|
@@ -4,45 +4,50 @@
|
|
|
|
|
|
ClassImp(qaUtility);
|
|
|
|
|
|
-qaUtility* qaUtility::fUtility = nullptr;;
|
|
|
+qaUtility *qaUtility::fUtility = nullptr;
|
|
|
+;
|
|
|
|
|
|
qaUtility::qaUtility() : Nevents(-1),
|
|
|
-debug(0),
|
|
|
-format("mctree"),
|
|
|
-Is_minbias(1),
|
|
|
-Is_refmult(1),
|
|
|
-Is_v1(1),
|
|
|
-Is_v2(1),
|
|
|
-Cut_minbias_Event_bmin(0.),
|
|
|
-Cut_minbias_Event_bmax(16.),
|
|
|
-Cut_minbias_Particle_ptmin(0.),
|
|
|
-Cut_minbias_Particle_ptmax(100.),
|
|
|
-Cut_minbias_Particle_etamin(-100.),
|
|
|
-Cut_minbias_Particle_etamax(100.),
|
|
|
-Cut_minbias_Particle_ymin(-100.),
|
|
|
-Cut_minbias_Particle_ymax(100.),
|
|
|
-Cut_refmult_Event_bmin(0.),
|
|
|
-Cut_refmult_Event_bmax(16.),
|
|
|
-Cut_refmult_Particle_ptmin(0.15),
|
|
|
-Cut_refmult_Particle_ptmax(3.),
|
|
|
-Cut_refmult_Particle_etamin(-0.5),
|
|
|
-Cut_refmult_Particle_etamax(0.5),
|
|
|
-Cut_v1_Event_bmin(0.),
|
|
|
-Cut_v1_Event_bmax(16.),
|
|
|
-Cut_v1_Particle_ptmin(1.0),
|
|
|
-Cut_v1_Particle_ptmax(1.5),
|
|
|
-Cut_v1_Particle_etamin(-100.),
|
|
|
-Cut_v1_Particle_etamax(100.),
|
|
|
-Cut_v1_Particle_ymin(-0.25),
|
|
|
-Cut_v1_Particle_ymax(-0.15),
|
|
|
-Cut_v2_Event_bmin(0.),
|
|
|
-Cut_v2_Event_bmax(16.),
|
|
|
-Cut_v2_Particle_ptmin(1.0),
|
|
|
-Cut_v2_Particle_ptmax(1.5),
|
|
|
-Cut_v2_Particle_etamin(-100.),
|
|
|
-Cut_v2_Particle_etamax(100.),
|
|
|
-Cut_v2_Particle_ymin(-0.05),
|
|
|
-Cut_v2_Particle_ymax(0.05)
|
|
|
+ debug(0),
|
|
|
+ format("mctree"),
|
|
|
+ Is_minbias(1),
|
|
|
+ Is_refmult(1),
|
|
|
+ Is_v1(1),
|
|
|
+ Is_v2(1),
|
|
|
+ Cut_minbias_Event_bmin(0.),
|
|
|
+ Cut_minbias_Event_bmax(16.),
|
|
|
+ Cut_minbias_Particle_ptmin(0.),
|
|
|
+ Cut_minbias_Particle_ptmax(100.),
|
|
|
+ Cut_minbias_Particle_etamin(-100.),
|
|
|
+ Cut_minbias_Particle_etamax(100.),
|
|
|
+ Cut_minbias_Particle_ymin(-100.),
|
|
|
+ Cut_minbias_Particle_ymax(100.),
|
|
|
+ Cut_refmult_Event_bmin(0.),
|
|
|
+ Cut_refmult_Event_bmax(16.),
|
|
|
+ Cut_refmult_Particle_ptmin(0.15),
|
|
|
+ Cut_refmult_Particle_ptmax(3.),
|
|
|
+ Cut_refmult_Particle_etamin(-0.5),
|
|
|
+ Cut_refmult_Particle_etamax(0.5),
|
|
|
+ Cut_v1_Event_bmin(0.),
|
|
|
+ Cut_v1_Event_bmax(16.),
|
|
|
+ sCut_v1_Event_bCent(""),
|
|
|
+ Cut_v1_Event_bCent({}),
|
|
|
+ Cut_v1_Particle_ptmin(1.0),
|
|
|
+ Cut_v1_Particle_ptmax(1.5),
|
|
|
+ Cut_v1_Particle_etamin(-100.),
|
|
|
+ Cut_v1_Particle_etamax(100.),
|
|
|
+ Cut_v1_Particle_ymin(-0.25),
|
|
|
+ Cut_v1_Particle_ymax(-0.15),
|
|
|
+ Cut_v2_Event_bmin(0.),
|
|
|
+ Cut_v2_Event_bmax(16.),
|
|
|
+ sCut_v2_Event_bCent(""),
|
|
|
+ Cut_v2_Event_bCent({}),
|
|
|
+ Cut_v2_Particle_ptmin(1.0),
|
|
|
+ Cut_v2_Particle_ptmax(1.5),
|
|
|
+ Cut_v2_Particle_etamin(-100.),
|
|
|
+ Cut_v2_Particle_etamax(100.),
|
|
|
+ Cut_v2_Particle_ymin(-0.05),
|
|
|
+ Cut_v2_Particle_ymax(0.05)
|
|
|
{
|
|
|
}
|
|
|
|
|
@@ -94,6 +99,7 @@ Bool_t qaUtility::ReadConfig(const TString &configFileName)
|
|
|
Is_v1 = env.GetValue("Is_v1", 0);
|
|
|
Cut_v1_Event_bmin = env.GetValue("Cut_v1_Event_bmin", 0.);
|
|
|
Cut_v1_Event_bmax = env.GetValue("Cut_v1_Event_bmax", 0.);
|
|
|
+ sCut_v1_Event_bCent = env.GetValue("Cut_v1_Event_bCent", "");
|
|
|
|
|
|
Cut_v1_Particle_ptmin = env.GetValue("Cut_v1_Particle_ptmin", 0.);
|
|
|
Cut_v1_Particle_ptmax = env.GetValue("Cut_v1_Particle_ptmax", 0.);
|
|
@@ -105,6 +111,7 @@ Bool_t qaUtility::ReadConfig(const TString &configFileName)
|
|
|
Is_v2 = env.GetValue("Is_v2", 0);
|
|
|
Cut_v2_Event_bmin = env.GetValue("Cut_v2_Event_bmin", 0.);
|
|
|
Cut_v2_Event_bmax = env.GetValue("Cut_v2_Event_bmax", 0.);
|
|
|
+ sCut_v2_Event_bCent = env.GetValue("Cut_v2_Event_bCent", "");
|
|
|
|
|
|
Cut_v2_Particle_ptmin = env.GetValue("Cut_v2_Particle_ptmin", 0.);
|
|
|
Cut_v2_Particle_ptmax = env.GetValue("Cut_v2_Particle_ptmax", 0.);
|
|
@@ -113,6 +120,8 @@ Bool_t qaUtility::ReadConfig(const TString &configFileName)
|
|
|
Cut_v2_Particle_ymin = env.GetValue("Cut_v2_Particle_ymin", 0.);
|
|
|
Cut_v2_Particle_ymax = env.GetValue("Cut_v2_Particle_ymax", 0.);
|
|
|
|
|
|
+ if (!initCentrality()) return false;
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -129,104 +138,206 @@ TChain *qaUtility::initChain(const TString &inputFileName, const char *chainName
|
|
|
return chain;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Event_minbias(qaEvent *const& event)
|
|
|
+std::vector<Float_t> qaUtility::ReadBvector(std::string _input)
|
|
|
+{
|
|
|
+ std::vector<Float_t> vB;
|
|
|
+
|
|
|
+ std::istringstream iss(_input);
|
|
|
+
|
|
|
+ std::copy(std::istream_iterator<Float_t>(iss),
|
|
|
+ std::istream_iterator<Float_t>(),
|
|
|
+ std::back_inserter(vB));
|
|
|
+
|
|
|
+ return vB;
|
|
|
+}
|
|
|
+
|
|
|
+Bool_t qaUtility::initCentrality()
|
|
|
{
|
|
|
- if (event->GetB() < Cut_minbias_Event_bmin) return false;
|
|
|
- if (event->GetB() > Cut_minbias_Event_bmax) return false;
|
|
|
+ Cut_v1_Event_bCent = ReadBvector(sCut_v1_Event_bCent);
|
|
|
+ Cut_v2_Event_bCent = ReadBvector(sCut_v2_Event_bCent);
|
|
|
|
|
|
+ if (Cut_v1_Event_bCent.size() == 0 ||
|
|
|
+ Cut_v2_Event_bCent.size() == 0)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Event_refmult(qaEvent *const& event)
|
|
|
+Bool_t qaUtility::Cut_Event_minbias(qaEvent *const &event)
|
|
|
{
|
|
|
- if (event->GetB() < Cut_refmult_Event_bmin) return false;
|
|
|
- if (event->GetB() > Cut_refmult_Event_bmax) return false;
|
|
|
+ if (event->GetB() < Cut_minbias_Event_bmin)
|
|
|
+ return false;
|
|
|
+ if (event->GetB() > Cut_minbias_Event_bmax)
|
|
|
+ return false;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Event_v1(qaEvent *const& event)
|
|
|
+Bool_t qaUtility::Cut_Event_refmult(qaEvent *const &event)
|
|
|
{
|
|
|
- if (event->GetB() < Cut_v1_Event_bmin) return false;
|
|
|
- if (event->GetB() > Cut_v1_Event_bmax) return false;
|
|
|
+ if (event->GetB() < Cut_refmult_Event_bmin)
|
|
|
+ return false;
|
|
|
+ if (event->GetB() > Cut_refmult_Event_bmax)
|
|
|
+ return false;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Event_v2(qaEvent *const& event)
|
|
|
+Bool_t qaUtility::Cut_Event_v1(qaEvent *const &event)
|
|
|
{
|
|
|
- if (event->GetB() < Cut_v2_Event_bmin) return false;
|
|
|
- if (event->GetB() > Cut_v2_Event_bmax) return false;
|
|
|
+ if (event->GetB() < Cut_v1_Event_bmin)
|
|
|
+ return false;
|
|
|
+ if (event->GetB() > Cut_v1_Event_bmax)
|
|
|
+ return false;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Particle_minbias(qaParticle *const& particle)
|
|
|
+Bool_t qaUtility::Cut_Event_v2(qaEvent *const &event)
|
|
|
{
|
|
|
- if (particle->GetPt() < Cut_minbias_Particle_ptmin) return false;
|
|
|
- if (particle->GetPt() > Cut_minbias_Particle_ptmax) return false;
|
|
|
- if (particle->GetEta() < Cut_minbias_Particle_etamin) return false;
|
|
|
- if (particle->GetEta() > Cut_minbias_Particle_etamax) return false;
|
|
|
+ if (event->GetB() < Cut_v2_Event_bmin)
|
|
|
+ return false;
|
|
|
+ if (event->GetB() > Cut_v2_Event_bmax)
|
|
|
+ return false;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Particle_refmult(qaParticle *const& particle)
|
|
|
+Bool_t qaUtility::Cut_Particle_minbias(qaParticle *const &particle)
|
|
|
{
|
|
|
- if (particle->GetPt() < Cut_refmult_Particle_ptmin) return false;
|
|
|
- if (particle->GetPt() > Cut_refmult_Particle_ptmax) return false;
|
|
|
- if (particle->GetEta() < Cut_refmult_Particle_etamin) return false;
|
|
|
- if (particle->GetEta() > Cut_refmult_Particle_etamax) return false;
|
|
|
-
|
|
|
+ if (particle->GetPt() < Cut_minbias_Particle_ptmin)
|
|
|
+ return false;
|
|
|
+ if (particle->GetPt() > Cut_minbias_Particle_ptmax)
|
|
|
+ return false;
|
|
|
+ if (particle->GetEta() < Cut_minbias_Particle_etamin)
|
|
|
+ return false;
|
|
|
+ if (particle->GetEta() > Cut_minbias_Particle_etamax)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+Bool_t qaUtility::Cut_Particle_refmult(qaParticle *const &particle)
|
|
|
+{
|
|
|
+ if (particle->GetPt() < Cut_refmult_Particle_ptmin)
|
|
|
+ return false;
|
|
|
+ if (particle->GetPt() > Cut_refmult_Particle_ptmax)
|
|
|
+ return false;
|
|
|
+ if (particle->GetEta() < Cut_refmult_Particle_etamin)
|
|
|
+ return false;
|
|
|
+ if (particle->GetEta() > Cut_refmult_Particle_etamax)
|
|
|
+ return false;
|
|
|
+
|
|
|
Double_t charge = GetCharge(particle->GetPdg());
|
|
|
- if (charge == error_code) return false;
|
|
|
- if (charge == 0) return false;
|
|
|
+ if (charge == error_code)
|
|
|
+ return false;
|
|
|
+ if (charge == 0)
|
|
|
+ return false;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Particle_v1(qaParticle *const& particle)
|
|
|
+Bool_t qaUtility::Cut_Particle_v1_pt(qaParticle *const &particle)
|
|
|
{
|
|
|
- if (particle->GetPt() < Cut_v1_Particle_ptmin) return false;
|
|
|
- if (particle->GetPt() > Cut_v1_Particle_ptmax) return false;
|
|
|
- if (particle->GetEta() < Cut_v1_Particle_etamin) return false;
|
|
|
- if (particle->GetEta() > Cut_v1_Particle_etamax) return false;
|
|
|
+ double y = 0.5 * TMath::Log( (particle->GetEnergy() + particle->GetPz())/(particle->GetEnergy() - particle->GetPz()) );
|
|
|
+ if (y < Cut_v1_Particle_ymin)
|
|
|
+ return false;
|
|
|
+ if (y > Cut_v1_Particle_ymax)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ Double_t charge = GetCharge(particle->GetPdg());
|
|
|
+ if (charge == error_code)
|
|
|
+ return false;
|
|
|
+ if (charge == 0)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+Bool_t qaUtility::Cut_Particle_v1_y(qaParticle *const &particle)
|
|
|
+{
|
|
|
+ if (particle->GetPt() < Cut_v1_Particle_ptmin)
|
|
|
+ return false;
|
|
|
+ if (particle->GetPt() > Cut_v1_Particle_ptmax)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ Double_t charge = GetCharge(particle->GetPdg());
|
|
|
+ if (charge == error_code)
|
|
|
+ return false;
|
|
|
+ if (charge == 0)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+Bool_t qaUtility::Cut_Particle_v2_pt(qaParticle *const &particle)
|
|
|
+{
|
|
|
+ double y = 0.5 * TMath::Log( (particle->GetEnergy() + particle->GetPz())/(particle->GetEnergy() - particle->GetPz()) );
|
|
|
+ if (y < Cut_v2_Particle_ymin)
|
|
|
+ return false;
|
|
|
+ if (y > Cut_v2_Particle_ymax)
|
|
|
+ return false;
|
|
|
|
|
|
Double_t charge = GetCharge(particle->GetPdg());
|
|
|
- if (charge == error_code) return false;
|
|
|
- if (charge == 0) return false;
|
|
|
+ if (charge == error_code)
|
|
|
+ return false;
|
|
|
+ if (charge == 0)
|
|
|
+ return false;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-Bool_t qaUtility::Cut_Particle_v2(qaParticle *const& particle)
|
|
|
+Bool_t qaUtility::Cut_Particle_v2_y(qaParticle *const &particle)
|
|
|
{
|
|
|
- if (particle->GetPt() < Cut_v2_Particle_ptmin) return false;
|
|
|
- if (particle->GetPt() > Cut_v2_Particle_ptmax) return false;
|
|
|
- if (particle->GetEta() < Cut_v2_Particle_etamin) return false;
|
|
|
- if (particle->GetEta() > Cut_v2_Particle_etamax) return false;
|
|
|
+ if (particle->GetPt() < Cut_v2_Particle_ptmin)
|
|
|
+ return false;
|
|
|
+ if (particle->GetPt() > Cut_v2_Particle_ptmax)
|
|
|
+ return false;
|
|
|
|
|
|
Double_t charge = GetCharge(particle->GetPdg());
|
|
|
- if (charge == error_code) return false;
|
|
|
- if (charge == 0) return false;
|
|
|
+ if (charge == error_code)
|
|
|
+ return false;
|
|
|
+ if (charge == 0)
|
|
|
+ return false;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
Double_t qaUtility::GetCharge(Int_t pdg)
|
|
|
{
|
|
|
- auto particle = (TParticlePDG*) TDatabasePDG::Instance()->GetParticle(pdg);
|
|
|
- if (!particle) return error_code;
|
|
|
- return particle->Charge()/3.;
|
|
|
+ auto particle = (TParticlePDG *)TDatabasePDG::Instance()->GetParticle(pdg);
|
|
|
+ if (!particle)
|
|
|
+ return error_code;
|
|
|
+ return particle->Charge() / 3.;
|
|
|
}
|
|
|
|
|
|
Int_t qaUtility::GetPdgId(Int_t pdg)
|
|
|
{
|
|
|
- if (pdg == vpdg.at(1)) return 1;
|
|
|
- if (pdg == vpdg.at(2)) return 2;
|
|
|
- if (pdg == vpdg.at(3)) return 3;
|
|
|
- if (pdg == vpdg.at(5)) return 5;
|
|
|
- if (pdg == vpdg.at(6)) return 6;
|
|
|
- if (pdg == vpdg.at(7)) return 7;
|
|
|
+ if (pdg == vpdg.at(1))
|
|
|
+ return 1;
|
|
|
+ if (pdg == vpdg.at(2))
|
|
|
+ return 2;
|
|
|
+ if (pdg == vpdg.at(3))
|
|
|
+ return 3;
|
|
|
+ if (pdg == vpdg.at(5))
|
|
|
+ return 5;
|
|
|
+ if (pdg == vpdg.at(6))
|
|
|
+ return 6;
|
|
|
+ if (pdg == vpdg.at(7))
|
|
|
+ return 7;
|
|
|
return -1;
|
|
|
}
|
|
|
+
|
|
|
+Int_t qaUtility::GetCentralityBin(Float_t b, std::vector<Float_t> vcent)
|
|
|
+{
|
|
|
+ if (vcent.size() == 0) return -1;
|
|
|
+
|
|
|
+ for (int i=0; i<(int)vcent.size()-1; i++)
|
|
|
+ {
|
|
|
+ if (b >= vcent.at(i) && b < vcent.at(i+1)) return i;
|
|
|
+ }
|
|
|
+
|
|
|
+ return -1;
|
|
|
+}
|