9 size_t i = filePath.rfind(sep, filePath.length());
10 std::string baseFile=
"";
12 if (i != std::string::npos) {
13 baseFile = filePath.substr(i+1, filePath.length() - i);
19 i = baseFile.find_last_of(
'.');
20 return baseFile.substr(0,i);
34 double x_edge_low = -262.74;
35 double x_edge_high = 347.7;
36 double y_edge_low = 33.54;
37 double y_edge_high = 75.18;
39 double x_gap_low = -106.66;
40 double x_gap_high = 42.17;
41 double y_gap_high = 47.18;
47 if( x>x_edge_low && x < x_edge_high && y > y_edge_low && y < y_edge_high)
48 if ( !(x > x_gap_low && x < x_gap_high && y > y_edge_low && y < y_gap_high) )
60 for (
int ihit=0; ihit<trk->
getHitLayers().size();++ihit) {
91 std::vector<int> layer_code = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
92 for (
int ihit=0; ihit<trk->
getHitLayers().size();ihit++) {
94 layer_code.at(layer) = 1;
100 double photon_nom_x=42.52;
101 double radian=180.0/3.14;
111 double cl1_impact_angle=atan2(cl1Y,cl1X-photon_nom_x)*radian;
112 double cl2_impact_angle=atan2(cl2Y,cl2X-photon_nom_x)*radian;
113 if(cl1_impact_angle<0.)
114 cl1_impact_angle+=360.;
115 if(cl2_impact_angle<0.)
116 cl2_impact_angle+=360.;
118 return cl2_impact_angle-cl1_impact_angle;
120 return cl1_impact_angle-cl2_impact_angle;
127 bool foundele =
false;
128 bool foundpos =
false;
130 for (
auto trk : trks) {
131 if (ele_id == trk->getID()) {
135 if (pos_id == trk->getID()) {
140 return foundele * foundpos;
145 for (
auto trk :trks){
146 if (trkID == trk->getID())
154 for (
auto part :parts){
159 if ( clusSeed== pClusSeed)
169 bool foundele =
false;
170 bool foundpos =
false;
172 for (
int ipart = 0; ipart < vtx->getParticles().GetEntries(); ++ipart) {
175 int pdg_id = ((
Particle*)vtx->getParticles().At(ipart))->getPDG();
176 if (
debug_) std::cout<<
"In Loop "<<pdg_id<<
" "<< ipart<<std::endl;
179 ele = ((
Particle*)vtx->getParticles().At(ipart));
181 if (
debug_) std::cout<<
"found ele "<< (int)foundele<<std::endl;
183 else if (pdg_id == -11) {
184 pos = (
Particle*)vtx->getParticles().At(ipart);
186 if (
debug_) std::cout<<
"found pos "<<(int)foundpos<<std::endl;
192 std::cout<<
"Vertex formed without ele/pos. Skip."<<std::endl;
195 if (
debug_) std::cout<<
"returning "<<(int) (foundele && foundpos) <<std::endl;
196 return foundele && foundpos;
203 bool foundele =
false;
204 bool foundpos =
false;
209 for (
int ipart = 0; ipart < vtx->getParticles().GetEntries(); ++ipart) {
212 int pdg_id = ((
Particle*)vtx->getParticles().At(ipart))->getPDG();
213 if (
debug_) std::cout<<
"In Loop "<<pdg_id<<
" "<< ipart<<std::endl;
216 eleTmp = ((
Particle*)vtx->getParticles().At(ipart));
218 if (
debug_) std::cout<<
"found ele "<< (int)foundele<<std::endl;
220 else if (pdg_id == -11) {
221 posTmp = (
Particle*)vtx->getParticles().At(ipart);
223 if (
debug_) std::cout<<
"found pos "<<(int)foundpos<<std::endl;
228 if (!eleTmp || !posTmp) {
229 std::cout<<
"Vertex formed without ele/pos. Skip."<<std::endl;
236 for (
auto part :parts){
238 if (eleEne == part->getMomentum().at(2)) {
242 if (posEne == part->getMomentum().at(2)) {
249 return foundele && foundpos && matchpos &&matchele;
259 (*rotSvt_sym)(0,1) = 0.;
262 (*rotSvt_sym)(1,0) = 0.;
263 (*rotSvt_sym)(1,1) = 1.;
264 (*rotSvt_sym)(1,2) = 0.;
267 (*rotSvt_sym)(1,1) = 0.;
Helper class for hipster analysis.
TRotation rotSvt
description
void InnermostLayerCheck(Track *trk, bool &foundL1, bool &foundL2)
Checks if a track has a 3d hit on innermost layer and second innermost layer.
TMatrixDSym * rotSvt_sym
description
std::vector< int > GetTrackHitLayers(Track *trk)
TVector3 rotationToSvtFrame(const TVector3 &v)
Rotate a vector from HPS to SVT Frame via TRotation.
Particle * GetParticleFromCluster(std::vector< Particle * > &parts, CalCluster *cluster)
bool MatchToGBLTracks(int ele_id, int pos_id, Track *&ele_trk, Track *&pos_trk, std::vector< Track * > &trks)
brief description
bool IsECalFiducial(CalCluster *clu)
const double SVT_ANGLE
Angle between SVT system and HPS coordinates.
TVector3 rotateToSvtFrame(TVector3 v)
Rotate a vector from HPS to SVT Frame (i.e. for position/momentum rotation).
bool GetParticlesFromVtxAndParticleList(std::vector< Particle * > &parts, Vertex *vtx, Particle *&ele, Particle *&pos)
double GetClusterCoplanarity(CalCluster *cl1, CalCluster *cl2)
static std::string getFileName(std::string filePath, bool withExtension)
bool GetParticlesFromVtx(Vertex *vtx, Particle *&ele, Particle *&pos)
Get the Particles From Vtx object.
Track * GetTrackFromParticle(std::vector< Track * > &trks, Particle *part)
TObject * getSeed() const
std::vector< double > getPosition() const
std::vector< double > getMomentum() const
bool isKalmanTrack() const
std::vector< int > getHitLayers()