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 double photon_nom_x=42.52;
92 double radian=180.0/3.14;
102 double cl1_impact_angle=atan2(cl1Y,cl1X-photon_nom_x)*radian;
103 double cl2_impact_angle=atan2(cl2Y,cl2X-photon_nom_x)*radian;
104 if(cl1_impact_angle<0.)
105 cl1_impact_angle+=360.;
106 if(cl2_impact_angle<0.)
107 cl2_impact_angle+=360.;
109 return cl2_impact_angle-cl1_impact_angle;
111 return cl1_impact_angle-cl2_impact_angle;
118 bool foundele =
false;
119 bool foundpos =
false;
121 for (
auto trk : trks) {
122 if (ele_id == trk->getID()) {
126 if (pos_id == trk->getID()) {
131 return foundele * foundpos;
135 int trkID=(part->
getTrack()).getID();
136 for (
auto trk :trks){
137 if (trkID == trk->getID())
145 for (
auto part :parts){
150 if ( clusSeed== pClusSeed)
160 bool foundele =
false;
161 bool foundpos =
false;
163 for (
int ipart = 0; ipart < vtx->getParticles().GetEntries(); ++ipart) {
166 int pdg_id = ((
Particle*)vtx->getParticles().At(ipart))->getPDG();
167 if (
debug_) std::cout<<
"In Loop "<<pdg_id<<
" "<< ipart<<std::endl;
170 ele = ((
Particle*)vtx->getParticles().At(ipart));
172 if (
debug_) std::cout<<
"found ele "<< (int)foundele<<std::endl;
174 else if (pdg_id == -11) {
175 pos = (
Particle*)vtx->getParticles().At(ipart);
177 if (
debug_) std::cout<<
"found pos "<<(int)foundpos<<std::endl;
183 std::cout<<
"Vertex formed without ele/pos. Skip."<<std::endl;
186 if (
debug_) std::cout<<
"returning "<<(int) (foundele && foundpos) <<std::endl;
187 return foundele && foundpos;
194 bool foundele =
false;
195 bool foundpos =
false;
200 for (
int ipart = 0; ipart < vtx->getParticles().GetEntries(); ++ipart) {
203 int pdg_id = ((
Particle*)vtx->getParticles().At(ipart))->getPDG();
204 if (
debug_) std::cout<<
"In Loop "<<pdg_id<<
" "<< ipart<<std::endl;
207 eleTmp = ((
Particle*)vtx->getParticles().At(ipart));
209 if (
debug_) std::cout<<
"found ele "<< (int)foundele<<std::endl;
211 else if (pdg_id == -11) {
212 posTmp = (
Particle*)vtx->getParticles().At(ipart);
214 if (
debug_) std::cout<<
"found pos "<<(int)foundpos<<std::endl;
219 if (!eleTmp || !posTmp) {
220 std::cout<<
"Vertex formed without ele/pos. Skip."<<std::endl;
227 for (
auto part :parts){
229 if (eleEne == part->getMomentum().at(2)) {
233 if (posEne == part->getMomentum().at(2)) {
240 return foundele && foundpos && matchpos &&matchele;
250 (*rotSvt_sym)(0,1) = 0.;
253 (*rotSvt_sym)(1,0) = 0.;
254 (*rotSvt_sym)(1,1) = 1.;
255 (*rotSvt_sym)(1,2) = 0.;
258 (*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
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()