16 # include <TCollection.h>
22 # include <TBrowser.h>
41 const char*
fmt =
"%-10s | %5.3f | %5.2f | %5.2f | %5.2f %5.2f |";
100 head.ReplaceAll(
"%5.3f",
"%5s");
101 head.ReplaceAll(
"%5.2f",
"%5s");
103 lne.ReplaceAll(
"|",
"+");
104 lne.ReplaceAll(
"%5s",
"-----");
105 lne.ReplaceAll(
"%10s",
"----------");
106 lne.ReplaceAll(
" ",
"-");
107 Printf(head.Data(),
"Type",
"W",
"Ps",
"Ss",
"Cs",
"Cb");
112 for (ParticleList::const_iterator i =
particles.begin();
138 if (verb) printf(
"%-10s: %6.4f", w, ret);
139 for (ParticleList::const_iterator j =
particles.begin();
142 ret += (p->
w-1)*(p->
Get(i)/100);
143 if (verb) printf(
"+(%4.2f-1)*%6.4f", (p->
w), (p->
Get(i)/100));
145 if (verb) printf(
"=%6.4f\n", ret);
162 Printf(
"%-10s: (%5.3f*%6.4f+%5.3f*%6.4f+%5.3f*%6.4f)/"
163 "(%5.3f+%5.3f+%5.3f)=%6.4f",
164 "rM'",
fP, rPs,
fS, rSs,
fC, rCs,
fP,
fS,
fC, rMsim);
166 Printf(
"%-10s: %5.3f/(%5.3f+%5.3f+%5.3f)=%6.4f",
"beta",
fCs,
fPs,
fSs,
fCs);
167 Double_t rBetasim = (1-rCs/rMsim*beta)/(1-beta);
168 Printf(
"%-10s: (1-%6.4f/%6.4f*%6.4f)/(1-%6.4f)=%6.4f",
169 "rbeta'", rCs, rMsim, beta, beta);
171 Printf(
"%-10s: %6.4f/%6.4f=%6.4f",
"rk", rCs, rCb, rScale);
172 Double_t rBetarea = (1-rScale*beta)/(1-beta);
173 Printf(
"%-10s: (1-%6.4f*%6.4f)/(1-%6.4f)=%6.4f",
174 "rbeta", rScale, beta, beta);
175 Double_t rR = rPs * rBetarea / rBetasim / rMsim;
176 Printf(
"%-10s: %6.4f*%6.4f/%6.4f/%6.4f=%6.4f",
177 "rR", rPs, rBetarea, rBetasim, rMsim);
184 if (!o->IsA()->InheritsFrom(c)) {
185 ::Warning(
"ChkC",
"Object %s is not a %s but a %s",
186 o->GetName(), c->GetName(), o->ClassName());
194 ::Warning(
"ChkO",
"Object %s not found in %s", name, src->GetName());
203 ::Warning(
"GetO",
"No directory passed for %s", name);
212 ::Warning(
"GetO",
"No collection passed for %s", name);
215 TObject* o = d->FindObject(name);
228 return static_cast<TH1*
>(
GetO(d, name, TH1::Class()));
232 return static_cast<TH2*
>(
GetO(d, name, TH2::Class()));
236 return static_cast<THStack*
>(
GetO(d, name, THStack::Class()));
250 THStack* hp, THStack* hs, THStack* hc)
252 TH1* rps =
GetH1(hp->GetHists(),
"rowSig");
253 TH1* rss =
GetH1(hs->GetHists(),
"rowSig");
254 TH1* rcs =
GetH1(hc->GetHists(),
"rowSig");
255 TH1* rcb =
GetH1(hc->GetHists(),
"rowBg");
257 ret->
n = rps->GetXaxis()->GetBinLabel(bin);
259 ret->Ps = rps->GetBinContent(bin);
260 ret->Ss = rss->GetBinContent(bin);
261 ret->Cs = rcs->GetBinContent(bin);
262 ret->Cb = rcb->GetBinContent(bin);
275 TFile*
file = TFile::Open(fileName,
"READ");
277 TString sub = (mid ?
"mid" :
"fwd");
278 TString oth = (mid ?
"fwd" :
"mid");
287 TH1* ip =
GetH1(prim,
"totalIntegrals");
288 TH1* is =
GetH1(seco,
"totalIntegrals");
289 TH1* ic =
GetH1(comb,
"totalIntegrals");
290 TH1* op =
GetH1(opri,
"totalIntegrals");
291 TH1* os =
GetH1(osec,
"totalIntegrals");
292 TH1* oc =
GetH1(ocom,
"totalIntegrals");
293 THStack* hp =
GetHS(prim,
"rows");
294 THStack* hs =
GetHS(seco,
"rows");
295 THStack* hc =
GetHS(comb,
"rows");
296 Double_t tot = (ip->GetBinContent(1)+
297 is->GetBinContent(1)+
298 ic->GetBinContent(1)+
299 op->GetBinContent(1)+
300 os->GetBinContent(1)+
301 oc->GetBinContent(1));
305 fP = ip->GetBinContent(1)*100;
306 fS = is->GetBinContent(1)*100;
307 fC = ic->GetBinContent(1)*100;
308 fPs = ip->GetBinContent(2)*100;
309 fSs = is->GetBinContent(2)*100;
310 fCs = ic->GetBinContent(2)*100;
312 Create(1.52233, 1, hp, hs, hc);
313 Create(1.41178, 2, hp, hs, hc);
314 Create(2.75002, 3, hp, hs, hc);
315 Create(3.24110, 4, hp, hs, hc);
316 Create(2.75002, 5, hp, hs, hc);
319 TCanvas*
c =
new TCanvas(
"c",
"c");
321 c->cd(1); ip->Draw(
"hist text30");
322 c->cd(3); is->Draw(
"hist text30");
323 c->cd(5); ic->Draw(
"hist text30");
324 c->cd(2); hp->Draw(
"nostack");
325 c->cd(4); hs->Draw(
"nostack");
326 c->cd(6); hc->Draw(
"nostack");
331 Printf(
"R = %5.3f", r);
339 bin.Format(
"cent%03dd%02d_%03dd%02d",
342 Run(fileName, bin, mid);
360 c.
Run(file, c1, c2, mid);
THStack * GetHS(TCollection *d, const char *name)
TCollection * GetC(TDirectory *d, const char *name)
void Run(const char *fileName, Double_t c1=0, Double_t c2=0, Bool_t mid=true)
void BackOfTheEnvelope(const char *file, Double_t c1=0, Double_t c2=0, Bool_t mid=true)
TObject * GetO(TCollection *d, const char *name, TClass *cls) const
Double_t Get(Int_t i) const
Particle * Create(Double_t w, Int_t bin, THStack *hp, THStack *hs, THStack *hc)
Double_t Calc(Bool_t verb=true)
Double_t R(Int_t i, const char *w="", Bool_t verb=true) const
TObject * GetO(TDirectory *d, const char *name, TClass *cls) const
void AddParticle(Particle *p)
TCollection * GetC(TCollection *d, const char *name)
TObject * ChkO(TObject *src, TObject *o, const char *name) const
TFile * file
TList with histograms for a given trigger.
TH1 * GetH1(TCollection *d, const char *name)
TObject * ChkC(TObject *o, TClass *c) const
void Run(const char *fileName, const char *binName, Bool_t mid=true)
TH2 * GetH2(TCollection *d, const char *name)
std::vector< Particle * > ParticleList