13 #include <TLorentzVector.h>
31 #define FCAL_Z_OFFSET 640.0-65.0 // I don't know what this value is ???
33 #define PI_ZERO_MASS 0.13497
41 dE_over_E_vs_E =
new TH2D(
"dE_over_E_vs_E",
"Smeared-unsmeared energy diff for single FCAL blocks", 50, 0.0, 1.0, 50, -0.1, 0.1);
60 vector<const DFCALGeometry*> fcalGeomVect;
61 vector<const DFCALHit*> hits;
62 vector<const DFCALHit*> truthhits;
63 loop->Get(fcalGeomVect);
65 loop->Get(truthhits,
"TRUTH");
68 if(fcalGeomVect.size()<1)
return OBJECT_NOT_AVAILABLE;
72 map<int,const DFCALHit*> hit_map;
73 for(
unsigned int i=0; i<hits.size(); i++){
77 hit_map[channel] = hit;
81 japp->RootFillLock(
this);
85 for(
unsigned int i=0; i<truthhits.size(); i++){
86 const DFCALHit *truthhit = truthhits[i];
87 map<int,const DFCALHit*>::iterator iter = hit_map.find(fcalGeom.
channel(truthhit->
row, truthhit->
column));
88 if(iter==hit_map.end())
continue;
91 double deltaE = hit->
E - truthhit->
E;
92 dE_over_E_vs_E->Fill(truthhit->
E, deltaE/truthhit->
E);
95 japp->RootFillUnLock(
this);
jerror_t fini(void)
Called after last event of last event source has been processed.
jerror_t evnt(JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
jerror_t init(void)
Called once at program start.
int channel(int row, int column) const
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t brun(JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.