Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TruthConversionEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TruthConversionEval.h
1 
10 #ifndef TRUTHCONVERSIONEVAL_H__
11 #define TRUTHCONVERSIONEVAL_H__
12 
13 #include <fun4all/SubsysReco.h>
14 #include <calobase/RawClusterContainer.h>
15 #include <g4main/PHG4Particle.h>
17 #include <TLorentzVector.h>
18 #include <queue>
19 
20 class PHCompositeNode;
22 class PHG4VtxPoint;
23 class SvtxTrackEval;
24 class SvtxTrackMap;
25 class SvtxVertex;
26 class SvtxHitMap;
27 class SvtxHit;
28 class SvtxClusterMap;
29 class SvtxCluster;
32 class SVReco;
33 class VtxRegressor;
34 class Conversion;
35 class TTree;
36 class TFile;
37 
39 {
40 
41  public:
50  TruthConversionEval(const std::string &name,unsigned int runnumber,
51  int particleEmbed, int pythiaEmbed,bool makeTTree,std::string TMVAName,std::string TMVAPath);
59  int End(PHCompositeNode*);
61  const RawClusterContainer* getClusters()const;
62 
63  private:
64  //@return ownsership
65  inline TLorentzVector tracktoTLV(SvtxTrack* track){
66  TLorentzVector r;
67  r.SetPtEtaPhiM(track->get_pt(),track->get_eta(),track->get_phi(),.0005109989461);//assume electron
68  return r;
69  }
70  //@return ownsership
71  inline TLorentzVector particletoTLV(PHG4Particle* particle){
72  return TLorentzVector(particle->get_px(),particle->get_py(),particle->get_pz(),particle->get_e());
73  }
74  bool doNodePointers(PHCompositeNode* topNode);
79  void numUnique(std::map<int,Conversion>* map,SvtxTrackEval* trackEval,RawClusterContainer* mainClusterContainer,std::vector<std::pair<SvtxTrack*,SvtxTrack*>>* tightBackground);
81  void processTrackBackground(std::vector<SvtxTrack*>*v,SvtxTrackEval*);
82  void recordConversion(Conversion *conversion,TLorentzVector *tlv_photon,TLorentzVector *tlv_electron, TLorentzVector *tlv_positron);
83 
84  int get_embed(PHG4Particle* particle, PHG4TruthInfoContainer* truthinfo) const;
85  float vtoR(PHG4VtxPoint* vtx)const;
86 
87  const static int s_kMAXParticles=200;
88  const unsigned int _kRunNumber;
89  const int _kParticleEmbed;
90  const int _kPythiaEmbed;
91  const bool _kMakeTTree;//< if false no TTrees are output
92  int _runNumber;
93  TFile *_f=NULL;
94  TTree *_signalCutTree=NULL;
95  TTree *_trackBackTree=NULL;
96  TTree *_pairBackTree=NULL;
97  TTree *_vtxBackTree=NULL;
98  TTree *_vtxingTree=NULL;
99  TTree *_observTree=NULL;
100  RawClusterContainer *_mainClusterContainer; //< clusters from the node
104  SvtxHitMap *_hitMap;
108 
135  float _b_track_pT;
138  double _b_approach ;
140  float _b_vtx_phi ;
141  float _b_vtx_eta ;
142  float _b_vtx_x ;
143  float _b_vtx_y ;
144  float _b_vtx_z ;
145  float _b_tvtx_eta ;
146  float _b_tvtx_x ;
147  float _b_tvtx_y ;
148  float _b_tvtx_z ;
150  float _b_tvtx_phi ;
153  float _b_vtx_chi2;
154  float _b_photon_m;
160  //bb stands for background branch
167  double _bb_approach ;
175  int _bb_pid;
176  int _b_nMatched=0;
178  std::vector<float> _b_truth_pT;
179  std::vector<float> _b_reco_pT;
180  std::vector<float> _b_alltrack_pT;
181  std::vector<float> _b_allphoton_pT;
186  //TODO check TPC radius
187  const static int s_kTPCRADIUS=21; //in cm there is a way to get this from the simulation I should implement?
189  float _kRAPIDITYACCEPT=1; //<acceptance rapidity currently hard coded to |1|
190  float _kTightPtMin=2.5; //< pt cut for making tight background
191  float _kTightDetaMax=.0082;//< deta cut for making tight background
192 };
193 
194 
195 
196 #endif // __TRUTHCONVERSIONEVAL_H__
197 
198 
199