17 TString infile =
"phi2170_phipipi.root"
29 TFile *
f = TFile::Open(infile);
31 if (!
f ||
f->IsZombie()) {
32 cout <<
"Cannot open " << infile << endl;
36 TTree *tree = (TTree*)
f->Get(
"data");
39 cout <<
"Tree \"data\" not found." << endl;
47 TClonesArray *particles =
nullptr;
48 tree->SetBranchAddress(
"Particles", &particles);
63 Double_t mKKmax = 1.08;
65 if (infile.Contains(
"KKpipi"))
68 Double_t mpipimin = 0.2;
69 if (infile.Contains(
"phif0"))
72 TH1D *h_mKK =
new TH1D(
74 "K^{+}K^{-} invariant mass;M(K^{+}K^{-}) [GeV/c^{2}];Events",
77 TH1D *h_mpipi =
new TH1D(
79 "#pi^{+}#pi^{-} invariant mass;M(#pi^{+}#pi^{-}) [GeV/c^{2}];Events",
82 TH1D *h_mKKpipi =
new TH1D(
84 "K^{+}K^{-}#pi^{+}#pi^{-} invariant mass;M(K^{+}K^{-}#pi^{+}#pi^{-}) [GeV/c^{2}];Events",
91 Long64_t
nev = tree->GetEntries();
93 cout <<
"Reading " <<
nev <<
" events..." << endl;
95 for (Long64_t iev = 0; iev <
nev; iev++) {
99 if (!particles)
continue;
101 TLorentzVector
kp,
km, pip,
pim;
108 Int_t np = particles->GetEntriesFast();
114 for (Int_t i = 0; i < np; i++) {
118 if (
p->ID() == pidKp) {
122 else if (
p->ID() == pidKm) {
126 else if (
p->ID() == pidPip) {
130 else if (
p->ID() == pidPim) {
140 if (hasKp && hasKm) {
142 h_mKK->Fill((
kp +
km).M());
144 if (hasPip && hasPim) {
146 h_mpipi->Fill((pip +
pim).M());
148 h_mKKpipi->Fill((
kp +
km + pip +
pim).M());
170 TString outfile = infile;
171 outfile.ReplaceAll(
".root",
"_inspect.pdf");
175 cout <<
"==========================================" << endl;
176 cout <<
"phi(2170) inspection" << endl;
177 cout <<
"==========================================" << endl;
178 cout <<
"Input file : " << infile << endl;
179 cout <<
"Events : " << tree->GetEntries() << endl;
180 cout <<
"==========================================" << endl;
184 cout <<
"Inspection finished." << endl;
185 cout <<
"Plots saved to " << outfile << endl;
PDistributionManager * makeDistributionManager()
PStaticData * makeStaticData()
Bool_t Exec(const char *command)
int GetParticleID(const char *id, int warn=1)
void inspect_phi2170(TString infile="phi2170_phipipi.root")