5 std::string h_name =
"";
7 if (hist.key() ==
"pos_pxpy_hh")
9 for (
int pxz = hist.value().at(
"lowPxz");
10 pxz < hist.value().at(
"highPxz");
11 pxz += (int) hist.value().at(
"stepPxz"))
13 h_name =
m_name +
"_pos_pxpy_" + std::to_string(pxz) +
"_hh";
15 hist.value().at(
"binsX"), hist.value().at(
"minX"),
16 hist.value().at(
"maxX"), hist.value().at(
"ytitle"),
17 hist.value().at(
"binsY"), hist.value().at(
"minY"),
18 hist.value().at(
"maxY"));
21 if (hist.key() ==
"ele_pxpy_hh")
23 for (
int pxz = hist.value().at(
"lowPxz");
24 pxz < hist.value().at(
"highPxz");
25 pxz += (int) hist.value().at(
"stepPxz"))
27 h_name =
m_name +
"_ele_pxpy_" + std::to_string(pxz) +
"_hh";
29 hist.value().at(
"binsX"), hist.value().at(
"minX"),
30 hist.value().at(
"maxX"), hist.value().at(
"ytitle"),
31 hist.value().at(
"binsY"), hist.value().at(
"minY"),
32 hist.value().at(
"maxY"));
39 if(mcParts ==
nullptr)
40 std::cout <<
"MCPARTS IS NULL" << std::endl;
41 int nParts = mcParts->size();
47 double minMuonE = -99.9;
52 for (
int i = 0; i < nParts; i++)
61 double massMeV = 1000.0*part->
getMass();
64 TLorentzVector part4P(partP.at(0), partP.at(1), partP.at(2), energy);
65 part4P.RotateY(-0.0305);
66 double momentum = part4P.P();
104 if (energy < minMuonE || minMuonE < 0.0)
110 bool partOfInt =
false;
112 if (analysis ==
"simps"){
113 if (fabs(pdg) == 11 && momPdg == 625)
116 if ((momPdg == 623 || momPdg == 622) && (fabs(pdg) == 11))
120 if (partOfInt ==
true)
122 double PperpB = 1000.0*sqrt( (part4P.Px()*part4P.Px()) + (part4P.Pz()*part4P.Pz()) );
123 int Pxz = int(floor(PperpB));
129 Fill2DHisto(
"ele_pxpy_" + std::to_string(Pxz) +
"_hh", part4P.Px(), part4P.Py(), weight);
133 Fill1DHisto(
"truthRadElecPt_h", part4P.Pt(), weight);
134 Fill1DHisto(
"truthRadElecPz_h", part4P.Pz(), weight);
141 Fill2DHisto(
"pos_pxpy_" + std::to_string(Pxz) +
"_hh", part4P.Px(), part4P.Py(), weight);
145 Fill1DHisto(
"truthRadPosPt_h", part4P.Pt(), weight);
146 Fill1DHisto(
"truthRadPosPz_h", part4P.Pz(), weight);
152 if (analysis ==
"beam") {
169 Fill1DHisto(
"truthGammaELow_h", energy*1000.0, weight);
174 Fill1DHisto(
"MCpartsEnergyLow_h", energy*1000.0, weight);
190 int nHits = mcTrkrHits->size();
192 for (
int i=0; i < nHits; i++)
202 int nHits = mcEcalHits->size();
204 for (
int i=0; i < nHits; i++)
212 double px=mcpart->getMomentum().at(0);
213 double py=mcpart->getMomentum().at(1);
214 double pz=mcpart->getMomentum().at(2);
216 double p=sqrt(px*px+py*py+pz*pz);
239 double E1=sqrt(px1*px1+py1*py1+pz1*pz1);
240 double E2=sqrt(px2*px2+py2*py2+pz2*pz2);
242 double pxTot=px1+px2;
243 double pyTot=py1+py2;
244 double pzTot=pz1+pz2;
245 double pTotSq=pxTot*pxTot+pyTot*pyTot+pzTot*pzTot;
248 double mass=sqrt(Etot*Etot-pTotSq);
256 double thetaX=pxTot/sqrt(pTotSq);
257 double thetaY=pyTot/sqrt(pTotSq);
void Fill2DHisto(const std::string &histoName, float valuex, float valuey, float weight=1.)
description
std::map< std::string, TH2F * > histos2d
description
TH2F * plot2D(std::string name, std::string xtitle, int nbinsX, float xmin, float xmax, std::string ytitle, int nbinsY, float ymin, float ymax)
description
void Fill1DHisto(const std::string &histoName, float value, float weight=1.)
description
json _h_configs
description
std::string m_name
description
void FillMCParticles(std::vector< MCParticle * > *mcParts, std::string analysis, float weight=1.)
description
void FillMCParticleHistos(MCParticle *mcpart, std::string label, double weight)
void FillMCPairHistos(MCParticle *ele, MCParticle *pos, std::string label, double weight)
void FillMCTrackerHits(std::vector< MCTrackerHit * > *mcTrkrHits, float weight=1.)
description
void FillMCEcalHits(std::vector< MCEcalHit * > *mcEcalHits, float weight=1.)
description
virtual void Define2DHistos()
description
std::vector< double > getMomentum() const
std::vector< double > getVertexPosition() const