File indexing completed on 2025-08-03 08:15:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef TRUTHCONVERSIONEVAL_H__
0011 #define TRUTHCONVERSIONEVAL_H__
0012
0013 #include <fun4all/SubsysReco.h>
0014 #include <calobase/RawClusterContainer.h>
0015 #include <g4main/PHG4Particle.h>
0016 #include <trackbase_historic/SvtxTrack.h>
0017 #include <TLorentzVector.h>
0018 #include <queue>
0019
0020 class PHCompositeNode;
0021 class PHG4TruthInfoContainer;
0022 class PHG4VtxPoint;
0023 class SvtxTrackEval;
0024 class SvtxTrackMap;
0025 class SvtxVertex;
0026 class SvtxHitMap;
0027 class SvtxHit;
0028 class SvtxClusterMap;
0029 class SvtxCluster;
0030 class TrkrClusterContainer;
0031 class RawClusterContainer;
0032 class SVReco;
0033 class VtxRegressor;
0034 class Conversion;
0035 class TTree;
0036 class TFile;
0037
0038 class TruthConversionEval: public SubsysReco
0039 {
0040
0041 public:
0042
0043
0044
0045
0046
0047
0048
0049
0050 TruthConversionEval(const std::string &name,unsigned int runnumber,
0051 int particleEmbed, int pythiaEmbed,bool makeTTree,std::string TMVAName,std::string TMVAPath);
0052 ~TruthConversionEval();
0053 int InitRun(PHCompositeNode*);
0054
0055
0056
0057
0058 int process_event(PHCompositeNode*);
0059 int End(PHCompositeNode*);
0060
0061 const RawClusterContainer* getClusters()const;
0062
0063 private:
0064
0065 inline TLorentzVector tracktoTLV(SvtxTrack* track){
0066 TLorentzVector r;
0067 r.SetPtEtaPhiM(track->get_pt(),track->get_eta(),track->get_phi(),.0005109989461);
0068 return r;
0069 }
0070
0071 inline TLorentzVector particletoTLV(PHG4Particle* particle){
0072 return TLorentzVector(particle->get_px(),particle->get_py(),particle->get_pz(),particle->get_e());
0073 }
0074 bool doNodePointers(PHCompositeNode* topNode);
0075 SvtxVertex* get_primary_vertex(PHCompositeNode* topNode)const;
0076
0077
0078
0079 void numUnique(std::map<int,Conversion>* map,SvtxTrackEval* trackEval,RawClusterContainer* mainClusterContainer,std::vector<std::pair<SvtxTrack*,SvtxTrack*>>* tightBackground);
0080
0081 void processTrackBackground(std::vector<SvtxTrack*>*v,SvtxTrackEval*);
0082 void recordConversion(Conversion *conversion,TLorentzVector *tlv_photon,TLorentzVector *tlv_electron, TLorentzVector *tlv_positron);
0083
0084 int get_embed(PHG4Particle* particle, PHG4TruthInfoContainer* truthinfo) const;
0085 float vtoR(PHG4VtxPoint* vtx)const;
0086
0087 const static int s_kMAXParticles=200;
0088 const unsigned int _kRunNumber;
0089 const int _kParticleEmbed;
0090 const int _kPythiaEmbed;
0091 const bool _kMakeTTree;
0092 int _runNumber;
0093 TFile *_f=NULL;
0094 TTree *_signalCutTree=NULL;
0095 TTree *_trackBackTree=NULL;
0096 TTree *_pairBackTree=NULL;
0097 TTree *_vtxBackTree=NULL;
0098 TTree *_vtxingTree=NULL;
0099 TTree *_observTree=NULL;
0100 RawClusterContainer *_mainClusterContainer;
0101 PHG4TruthInfoContainer *_truthinfo;
0102 TrkrClusterContainer* _clusterMap;
0103 SvtxTrackMap* _allTracks;
0104 SvtxHitMap *_hitMap;
0105 std::string _foutname;
0106 SVReco *_vertexer=NULL;
0107 VtxRegressor *_regressor=NULL;
0108
0109
0110
0111
0112
0113
0114 float _b_refitdiffx;
0115 float _b_refitdiffy;
0116 float _b_refitdiffz;
0117 int _b_nCluster;
0118 int _bb_track1_pid;
0119 int _bb_track2_pid;
0120 int _bb_parent_pid;
0121 float _b_cluster_dphi ;
0122 float _b_cluster_deta;
0123 int _bb_nCluster;
0124 float _bb_cluster_dphi ;
0125 float _bb_cluster_deta;
0126 float _b_track1_pt;
0127 float _b_track1_eta;
0128 float _b_track1_phi;
0129 float _b_track2_pt;
0130 float _b_track2_eta;
0131 float _b_track2_phi;
0132 float _b_track_deta ;
0133 int _b_track_layer ;
0134 int _b_track_dlayer ;
0135 float _b_track_pT;
0136 float _b_track_dca;
0137 float _b_ttrack_pT;
0138 double _b_approach ;
0139 float _b_vtx_radius ;
0140 float _b_vtx_phi ;
0141 float _b_vtx_eta ;
0142 float _b_vtx_x ;
0143 float _b_vtx_y ;
0144 float _b_vtx_z ;
0145 float _b_tvtx_eta ;
0146 float _b_tvtx_x ;
0147 float _b_tvtx_y ;
0148 float _b_tvtx_z ;
0149 float _b_tvtx_radius ;
0150 float _b_tvtx_phi ;
0151 float _b_vtxTrackRZ_dist;
0152 float _b_vtxTrackRPhi_dist;
0153 float _b_vtx_chi2;
0154 float _b_photon_m;
0155 float _b_tphoton_m;
0156 float _b_tphoton_pT;
0157 float _b_photon_pT;
0158 float _b_cluster_prob;
0159 float _b_track_dphi;
0160
0161 float _bb_track_deta ;
0162 float _bb_vtx_radius ;
0163 float _bb_track_dca ;
0164 int _bb_track_layer ;
0165 int _bb_track_dlayer ;
0166 float _bb_track_pT;
0167 double _bb_approach ;
0168 float _bb_vtxTrackRZ_dist;
0169 float _bb_vtxTrackRPhi_dist;
0170 float _bb_vtx_chi2;
0171 float _bb_photon_m;
0172 float _bb_photon_pT;
0173 float _bb_cluster_prob;
0174 float _bb_track_dphi;
0175 int _bb_pid;
0176 int _b_nMatched=0;
0177 int _b_nUnmatched=0;
0178 std::vector<float> _b_truth_pT;
0179 std::vector<float> _b_reco_pT;
0180 std::vector<float> _b_alltrack_pT;
0181 std::vector<float> _b_allphoton_pT;
0182
0183
0184
0185 RawClusterContainer _conversionClusters;
0186
0187 const static int s_kTPCRADIUS=21;
0188
0189 float _kRAPIDITYACCEPT=1;
0190 float _kTightPtMin=2.5;
0191 float _kTightDetaMax=.0082;
0192 };
0193
0194
0195
0196 #endif
0197
0198
0199