Skip to content
Snippets Groups Projects
Commit f5971c39 authored by FU Chengdong's avatar FU Chengdong
Browse files

first import for silicon tracking

parent 5e60fa5c
No related branches found
No related tags found
No related merge requests found
Showing
with 10581 additions and 1980 deletions
gaudi_subdir(SiliconTracking v0r0)
find_package(GEAR REQUIRED)
find_package(GSL REQUIRED )
find_package(LCIO REQUIRED )
find_package(EDM4HEP REQUIRED )
gaudi_depends_on_subdirs(
Service/GearSvc
Service/EventSeeder
Service/TrackSystemSvc
Utilities/DataHelper
)
set(SiliconTracking_srcs src/*.cpp)
# Modules
gaudi_add_module(SiliconTracking ${SiliconTracking_srcs}
INCLUDE_DIRS GaudiKernel FWCore gear ${GSLx_INCLUDE_DIRS} ${LCIOx_INCLUDE_DIRS}
LINK_LIBRARIES TrackSystemSvcLib DataHelperLib GaudiKernel FWCore $ENV{GEAR}/lib/libgearsurf.so ${GSL_LIBRARIES} ${LCIO_LIBRARIES}
)
gaudi_subdir(SiliconTracking v0r0)
find_package(GEAR REQUIRED)
find_package(GSL REQUIRED )
find_package(LCIO REQUIRED )
find_package(EDM4HEP REQUIRED )
gaudi_depends_on_subdirs(
Service/GearSvc
Service/EventSeeder
Service/TrackSystemSvc
Utilities/DataHelper
)
set(SiliconTracking_srcs src/*.cpp)
# Modules
gaudi_add_module(SiliconTracking ${SiliconTracking_srcs}
INCLUDE_DIRS GaudiKernel FWCore gear ${GSLx_INCLUDE_DIRS} ${LCIOx_INCLUDE_DIRS}
LINK_LIBRARIES TrackSystemSvcLib DataHelper GaudiKernel FWCore $ENV{GEAR}/lib/libgearsurf.so ${GSL_LIBRARIES} ${LCIO_LIBRARIES}
)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
gaudi_subdir(DataHelper v0r0)
#find_package(CLHEP REQUIRED)
#find_package(GEAR REQUIRED)
#find_package(GSL REQUIRED )
#find_package(LCIO REQUIRED )
#find_package(podio REQUIRED )
#find_package(K4FWCore REQUIRED)
find_package(EDM4HEP REQUIRED)
gaudi_depends_on_subdirs()
set(DataHelper_srcs src/*.cc)
gaudi_install_headers(DataHelper)
#gaudi_add_library(DataHelperLib ${DataHelperLib_srcs}
# PUBLIC_HEADERS DataHelper
# LINK_LIBRARIES EDM4HEP::edm4hep EDM4HEP::edm4hepDict
#)
# Modules
gaudi_add_module(DataHelper ${DataHelper_srcs}
INCLUDE_DIRS K4FWCore GaudiKernel GaudiAlgLib CLHEP gear ${GSL_INCLUDE_DIRS} ${LCIO_INCLUDE_DIRS}
LINK_LIBRARIES K4FWCore GaudiKernel GaudiAlgLib CLHEP $ENV{GEAR}/lib/libgearsurf.so ${GSL_LIBRARIES} ${LCIO_LIBRARIES} EDM4HEP::edm4hep EDM4HEP::edm4hepDict
)
#include "CaloHitExtended.h"
#include <math.h>
CaloHitExtended::CaloHitExtended(const edm4hep::CalorimeterHit& calhit, int type)
:_calohit(calhit){
_type = type;
_index = 0;
_calohitTo = NULL;
_calohitFrom = NULL;
}
CaloHitExtended::~CaloHitExtended(){
}
CalorimeterHit* CaloHitExtended::getCalorimeterHit() {
return &_calohit;
}
CaloHitExtended* CaloHitExtended::getCaloHitTo() {
return _calohitTo;
}
CaloHitExtended* CaloHitExtended::getCaloHitFrom() {
return _calohitFrom;
}
ClusterExtended* CaloHitExtended::getClusterExtended() {
return _clusterAR;
}
int CaloHitExtended::getIndex() {
return _index;
}
int CaloHitExtended::getType() {
return _type;
}
const float* CaloHitExtended::getDirVec() {
return _dirVec;
}
float CaloHitExtended::getYresTo() {
return _yresTo;
}
float CaloHitExtended::getYresFrom() {
return _yresFrom;
}
float CaloHitExtended::getGenericDistance() {
return _genericDistance;
}
//void CaloHitExtended::setCalorimeterHit(CalorimeterHit* calhit) {
// _calohit = calhit;
//}
void CaloHitExtended::setCaloHitTo(CaloHitExtended* calhitto) {
_calohitTo = calhitto;
}
void CaloHitExtended::setCaloHitFrom(CaloHitExtended* calhitfrom) {
_calohitFrom = calhitfrom;
}
void CaloHitExtended::setClusterExtended(ClusterExtended* cluster) {
_clusterAR = cluster;
}
void CaloHitExtended::setIndex(int index) {
_index = index;
}
void CaloHitExtended::setType(int type) {
_type = type;
}
void CaloHitExtended::setDirVec(float* dirVec) {
float modulus(0.);
for (int i(0); i < 3; ++i) {
modulus += dirVec[i]*dirVec[i];
}
modulus = sqrt(modulus);
if (modulus <= 0.) {
_dirVec[0] = 0.;
_dirVec[1] = 0.;
_dirVec[2] = 1.;
}
else {
_dirVec[0] = dirVec[0] / modulus;
_dirVec[1] = dirVec[1] / modulus;
_dirVec[2] = dirVec[2] / modulus;
}
}
void CaloHitExtended::setYresTo(float yresto) {
_yresTo = yresto;
}
void CaloHitExtended::setYresFrom(float yresfrom) {
_yresFrom = yresfrom;
}
void CaloHitExtended::setGenericDistance(float genericDistance) {
_genericDistance = genericDistance;
}
void CaloHitExtended::setDistanceToCalo(float caloDistance) {
_caloDistance = caloDistance;
}
float CaloHitExtended::getDistanceToCalo() {
return _caloDistance;
}
void CaloHitExtended::setDistanceToNearestHit(float distanceToNearest) {
_distanceToNearestHit = distanceToNearest;
}
float CaloHitExtended::getDistanceToNearestHit() {
return _distanceToNearestHit;
}
#ifndef CaloHitExtended_H
#define CaloHitExtended_H 1
//#include "lcio.h"
//#include "EVENT/LCIO.h"
#include "edm4hep/CalorimeterHit.h"
#include "ClusterExtended.h"
using namespace edm4hep ;
class ClusterExtended;
/**
* Class extending native LCIO class CalorimeterHit. <br>
* Class CaloHitExtended is used in TrackwiseClustering <br>
* and Wolf processors. <br>
* @author A. Raspereza (DESY)<br>
* @version $Id: CaloHitExtended.h,v 1.4 2006-02-22 14:53:27 owendt Exp $<br>
*/
class CaloHitExtended {
public:
CaloHitExtended(CalorimeterHit* calhit, int type);
~CaloHitExtended();
CalorimeterHit * getCalorimeterHit();
CaloHitExtended * getCaloHitTo();
CaloHitExtended * getCaloHitFrom();
ClusterExtended * getClusterExtended();
int getIndex();
int getType();
const float* getDirVec();
float getYresTo();
float getYresFrom();
float getGenericDistance();
void setCalorimeterHit(CalorimeterHit* calhit);
void setCaloHitTo(CaloHitExtended* calhitto);
void setCaloHitFrom(CaloHitExtended* calohitfrom);
void setClusterExtended(ClusterExtended* cluster);
void setIndex(int index);
void setType(int type);
void setDirVec(float* dirVec);
void setYresTo(float yresto);
void setYresFrom(float yresfrom);
void setGenericDistance(float genericDistance);
void setDistanceToCalo(float distanceToCalo);
float getDistanceToCalo();
void setDistanceToNearestHit(float distanceToNearest);
float getDistanceToNearestHit();
private:
CalorimeterHit * _calohit;
CaloHitExtended * _calohitTo;
CaloHitExtended * _calohitFrom;
ClusterExtended * _clusterAR;
int _index;
int _type;
float _dirVec[3];
float _yresTo;
float _yresFrom;
float _genericDistance;
float _caloDistance;
float _distanceToNearestHit;
};
#endif
#include "CaloHitExtended.h"
#include "TrackExtended.h"
#include "ClusterExtended.h"
#include <math.h>
ClusterExtended::ClusterExtended() {
_hitVector.clear();
_trackVector.clear();
_direction[0] = 0.;
_direction[1] = 0.;
_direction[2] = 0.;
_startingPoint[0] = 0.;
_startingPoint[1] = 0.;
_startingPoint[2] = 0.;
}
ClusterExtended::ClusterExtended( Cluster * cluster ) {
_hitVector.clear();
_trackVector.clear();
_direction[0] = 0.;
_direction[1] = 0.;
_direction[2] = 0.;
_startingPoint[0] = 0.;
_startingPoint[1] = 0.;
_startingPoint[2] = 0.;
_cluster = cluster;
}
ClusterExtended::ClusterExtended(CaloHitExtended * calohit) {
_hitVector.clear();
_hitVector.push_back(calohit);
_trackVector.clear();
float rad(0);
_startingPoint[0] = calohit->getCalorimeterHit()->getPosition().x;
_startingPoint[1] = calohit->getCalorimeterHit()->getPosition().y;
_startingPoint[2] = calohit->getCalorimeterHit()->getPosition().z;
for (int i(0); i < 3; ++i) {
rad += _startingPoint[i]*_startingPoint[i];
}
rad = sqrt(rad);
_direction[0] = _startingPoint[0]/rad;
_direction[1] = _startingPoint[1]/rad;
_direction[2] = _startingPoint[2]/rad;
}
ClusterExtended::ClusterExtended(TrackExtended * track) {
_hitVector.clear();
_trackVector.clear();
_trackVector.push_back(track);
for (int i(0); i < 3; ++i) {
_startingPoint[i] = track->getSeedPosition()[i];
_direction[i] = track->getSeedDirection()[i];
}
}
ClusterExtended::~ClusterExtended() {
_hitVector.clear();
_trackVector.clear();
}
CaloHitExtendedVec& ClusterExtended::getCaloHitExtendedVec() {
return _hitVector;
}
TrackExtendedVec& ClusterExtended::getTrackExtendedVec() {
return _trackVector;
}
const float* ClusterExtended::getStartingPoint() {
return _startingPoint;
}
const float* ClusterExtended::getDirection() {
return _direction;
}
void ClusterExtended::setStartingPoint(float* sPoint) {
_startingPoint[0] = sPoint[0];
_startingPoint[1] = sPoint[1];
_startingPoint[2] = sPoint[2];
}
void ClusterExtended::setDirection(float* direct) {
_direction[0] = direct[0];
_direction[1] = direct[1];
_direction[2] = direct[2];
}
void ClusterExtended::addCaloHitExtended(CaloHitExtended* calohit) {
_hitVector.push_back(calohit);
}
void ClusterExtended::addTrackExtended(TrackExtended * track) {
_trackVector.push_back(track);
}
void ClusterExtended::Clear() {
_hitVector.clear();
_trackVector.clear();
}
void ClusterExtended::setType( int type ) {
_type = type;
}
int ClusterExtended::getType() {
return _type;
}
void ClusterExtended::setCluster(Cluster * cluster) {
_cluster = cluster;
}
Cluster * ClusterExtended::getCluster() {
return _cluster;
}
void ClusterExtended::setAxis(float * axis) {
_axis[0] = axis[0];
_axis[1] = axis[1];
_axis[2] = axis[2];
}
float * ClusterExtended::getAxis() {
return _axis;
}
void ClusterExtended::setEccentricity( float eccentricity) {
_eccentricity = eccentricity;
}
float ClusterExtended::getEccentricity() {
return _eccentricity;
}
void ClusterExtended::setHelix(HelixClass helix) {
_helix = helix;
int nHits = int(_hitVector.size());
float timeMax = -1.0e+20;
float timeMin = 1.0e+20;
for (int ihit=0;ihit<nHits;++ihit) {
float pos[3];
for (int i=0;i<3;++i)
pos[i]=_hitVector[ihit]->getCalorimeterHit()->getPosition()[i];
float distance[3];
float time = _helix.getDistanceToPoint(pos,distance);
if (time > timeMax) {
timeMax = time;
_upEdge[0] = pos[0];
_upEdge[1] = pos[1];
_upEdge[2] = pos[2];
}
if (time < timeMin) {
timeMin = time;
_lowEdge[0] = pos[0];
_lowEdge[1] = pos[1];
_lowEdge[2] = pos[2];
}
}
}
HelixClass & ClusterExtended::getHelix() {
return _helix;
}
void ClusterExtended::setHelixChi2R(float helixChi2) {
_helixChi2R = helixChi2;
}
float ClusterExtended::getHelixChi2R() {
return _helixChi2R;
}
void ClusterExtended::setHelixChi2Z(float helixChi2) {
_helixChi2Z = helixChi2;
}
float ClusterExtended::getHelixChi2Z() {
return _helixChi2Z;
}
void ClusterExtended::setPosition(float * position) {
_position[0] = position[0];
_position[1] = position[1];
_position[2] = position[2];
}
float * ClusterExtended::getPosition() {
return _position;
}
void ClusterExtended::setUpEdge(float * upEdge) {
_upEdge[0] = upEdge[0];
_upEdge[1] = upEdge[1];
_upEdge[2] = upEdge[2];
}
void ClusterExtended::setLowEdge(float * lowEdge) {
_lowEdge[0] = lowEdge[0];
_lowEdge[1] = lowEdge[1];
_lowEdge[2] = lowEdge[2];
}
float * ClusterExtended::getUpEdge() {
return _upEdge;
}
float * ClusterExtended::getLowEdge() {
return _lowEdge;
}
#ifndef ClusterExtended_H
#define ClusterExtended_H 1
#include "CaloHitExtended.h"
#include "TrackExtended.h"
#include "plcio/Cluster.h"
#include "HelixClass.h"
using namespace plcio;
//class TrackExtended;
//typedef std::vector<TrackExtended*> TrackExtendedVec;
//class CaloHitExtended;
//typedef std::vector<CaloHitExtended*> CaloHitExtendedVec;
//class ClusterExtended;
//typedef std::vector<ClusterExtended*> ClusterExtendedVec;
/**
* Class extending native LCIO class Cluster. <br>
* Class ClusterExtended is used in TrackwiseClustering <br>
* and Wolf processors. <br>
* @author A. Raspereza (DESY)<br>
* @version $Id: ClusterExtended.h,v 1.4 2006-02-22 14:41:41 owendt Exp $<br>
*/
class ClusterExtended {
public:
ClusterExtended();
ClusterExtended( Cluster * cluster );
ClusterExtended(CaloHitExtended * calohit);
ClusterExtended(TrackExtended * track);
~ClusterExtended();
CaloHitExtendedVec & getCaloHitExtendedVec();
TrackExtendedVec & getTrackExtendedVec();
const float* getStartingPoint();
const float* getDirection();
void setStartingPoint(float* sPoint);
void setDirection(float* direct);
void addCaloHitExtended(CaloHitExtended * calohit);
void addTrackExtended(TrackExtended * track);
void setType( int type );
int getType();
void Clear();
void setCluster(Cluster * cluster);
Cluster * getCluster();
void setAxis(float * axis);
float * getAxis();
void setEccentricity( float eccentricity);
float getEccentricity();
void setHelix(HelixClass helix);
HelixClass & getHelix();
void setHelixChi2R(float helixChi2);
float getHelixChi2R();
void setHelixChi2Z(float helixChi2);
float getHelixChi2Z();
void setPosition(float * position);
float * getPosition();
void setLowEdge(float * lowEdge);
float * getLowEdge();
void setUpEdge(float * upEdge);
float * getUpEdge();
private:
TrackExtendedVec _trackVector;
CaloHitExtendedVec _hitVector;
float _startingPoint[3];
float _direction[3];
int _type;
Cluster * _cluster;
float _axis[3];
float _position[3];
float _eccentricity;
HelixClass _helix;
float _helixChi2R;
float _helixChi2Z;
float _lowEdge[3];
float _upEdge[3];
};
typedef std::vector<ClusterExtended*> ClusterExtendedVec;
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment