-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOHltRateEff.cpp
More file actions
executable file
·644 lines (587 loc) · 19.9 KB
/
OHltRateEff.cpp
File metadata and controls
executable file
·644 lines (587 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// Program to calculate rates of trigger paths using variables of OHltTree class,
//
//Note: OHltTree class needs to be updated if any new variables become available
//in OpenHLT (HLTAnalyzer).
//
// Author: Vladimir Rekovic, Date: 2007/12/10
//
//
/////////////////////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <TString.h>
#include <TTree.h>
#include <TChain.h>
#include <TError.h>
#include "OHltTree.h"
#include "OHltMenu.h"
#include "OHltConfig.h"
#include "OHltRatePrinter.h"
#include "OHltEffPrinter.h"
using namespace std;
/* ********************************************** */
// Declarations
/* ********************************************** */
void fillProcesses(
OHltConfig *cfg,
vector<OHltTree*> &procs,
vector<TChain*> &chains,
OHltMenu *menu,
HLTDatasets &hltDatasets);
// int : returns number of negative weight events if needed (0 otherwise)
int calcRates(
OHltConfig *cfg,
OHltMenu *menu,
vector<OHltTree*> &procs,
vector<OHltRateCounter*> &rcs,
OHltRatePrinter* rprint,
HLTDatasets &hltDatasets);
void calcEff(
OHltConfig *cfg,
OHltMenu *menu,
vector<OHltTree*> &procs,
vector<OHltRateCounter*> &ecs,
OHltEffPrinter* eprint,
double &DenEff,
HLTDatasets &hltDatasets);
/* ********************************************** */
// Print out usage and example
/* ********************************************** */
inline void ShowUsage()
{
cout << " Usage: ./OHltRateEff <Config File>" << endl;
cout << "default: ./OHltRateEff hltmenu_1E31_2008Dec04.cfg" << endl;
}
/* ********************************************** */
// Main
/* ********************************************** */
int main(int argc, char *argv[])
{
gErrorIgnoreLevel = 5001;
int argIndex = 0;
if (argc > ++argIndex)
{
if (TString(argv[1])=="-h")
{
ShowUsage();
exit(0);
}
}
// Book menu
OHltMenu *omenu = new OHltMenu();
// Read & parse cfg file
OHltConfig *ocfg = new OHltConfig(argv[1],omenu);
/**
Create a HLTDatasets object to record primary datasets.
Make sure to register each sample with it as well!
*/
HLTDatasets hltDatasets(
omenu->GetTriggerNames(),
ocfg->dsList.Data(),
kFALSE,
"PrefixTest");
// Prepare process files
vector<TChain*> chains;
chains.clear();
vector<OHltTree*> procs;
procs.clear();
fillProcesses(ocfg, procs, chains, omenu, hltDatasets);
int nevts=0;
/* **** */
// Count rates
vector<OHltRateCounter*> rcs;
rcs.clear();
for (unsigned int i=0; i<procs.size(); i++)
{
nevts+=procs[i]->fChain->GetEntries();
rcs.push_back(new OHltRateCounter(omenu->GetTriggerSize(), omenu->GetL1TriggerSize()));
}
OHltRatePrinter* rprint = new OHltRatePrinter();
int TotalWeightedEvents=calcRates(ocfg, omenu, procs, rcs, rprint, hltDatasets);
/* **** */
// Get Seed prescales
omenu->SetMapL1SeedsOfStandardHLTPath(procs[0]->GetL1SeedsOfHLTPathMap());
rprint->printRatesASCII(ocfg, omenu);
//rprint->printCorrelationASCII();
if (ocfg->doPrintAll)
{
// rprint->printRatesTex(ocfg,omenu);
rprint->printRatesTwiki(ocfg, omenu);
// rprint->printPrescalesCfg(ocfg,omenu);
if (nevts > ocfg->nEntries && ocfg->nEntries > 0) nevts=ocfg->nEntries;
nevts=TotalWeightedEvents; //negative weight events are counted negatively
printf("nevents to TNamed = %d",nevts);
rprint->writeHistos(ocfg, omenu,nevts);
if(ocfg->nonlinearPileupFit != "none")
rprint->fitRatesForPileup(ocfg, omenu);
char sLumi[10], sEnergy[10];
snprintf(sEnergy, 10, "%1.0f", ocfg->cmsEnergy);
snprintf(sLumi, 10, "%1.1e", ocfg->iLumi);
TString hltTableFileName= TString("hlt_DS_Table_") + sEnergy + "TeV_"
+ sLumi + TString("_") + ocfg->versionTag;
// printf("About to call printHLTDatasets\n"); //RR
rprint->printHLTDatasets(ocfg,omenu,hltDatasets,hltTableFileName,3);
}
/* **** */
// Calculate Efficiencies
vector<OHltRateCounter*> ecs;
ecs.clear();
for (unsigned int i=0; i<procs.size(); i++)
{
ecs.push_back(new OHltRateCounter(omenu->GetTriggerSize(), omenu->GetL1TriggerSize()));
}
//RR debugging couts
// printf("About to call calcEff\n");
OHltEffPrinter* eprint = new OHltEffPrinter();
double DenEff=0;
calcEff(ocfg, omenu, procs, ecs, eprint, DenEff, hltDatasets);
// printf("calcEff just executed. About to call printEffASCII\n");
if (DenEff != 0)
eprint->printEffASCII(ocfg, omenu);
//
return 0;
}
/* ********************************************** */
// Prepare process files
/* ********************************************** */
void fillProcesses(
OHltConfig *cfg,
vector<OHltTree*> &procs,
vector<TChain*> &chains,
OHltMenu *menu,
HLTDatasets &hltDatasets)
{
for (unsigned int i=0; i<cfg->pnames.size(); i++)
{
chains.push_back(new TChain("HltTree"));
for (unsigned int j=0; j<cfg->pfnames.size(); j++)
{
//chains.back()->Add(cfg->ppaths[i]+cfg->pfnames[i]);
chains.back()->Add(cfg->ppaths[j]+cfg->pfnames[j]);
}
//chains[i]->Print();
procs.push_back(new OHltTree((TTree*)chains[i],menu));
hltDatasets.addSample(cfg->pnames[i], (cfg->pisPhysicsSample[i]==0
? RATE_SAMPLE
: PHYSICS_SAMPLE)); //SAK
}
}
/* ********************************************** */
// Do the actual rate count & rate conversion
/* ********************************************** */
int calcRates(
OHltConfig *cfg,
OHltMenu *menu,
vector<OHltTree*> &procs,
vector<OHltRateCounter*> &rcs,
OHltRatePrinter* rprint,
HLTDatasets &hltDatasets)
{
const int ntrig = (int)menu->GetTriggerSize();
const int nL1trig = (int)menu->GetL1TriggerSize();
vector< vector< double> > RatePerLS;
vector< vector< double > > CountPerLS;
vector< vector< int> > RefPrescalePerLS;
vector< vector< int> > RefL1PrescalePerLS;
vector<double> totalRatePerLS;
vector<double> totalCountPerLS;
vector<double> Count;
vector<double> Rate, pureRate, spureRate;
vector<double> RateErr, pureRateErr, spureRateErr;
vector< vector<double> > coMa;
vector<double> coDen;
vector<int> RefPrescale, RefL1Prescale;
vector<double> weightedPrescaleRefHLT;
vector<double> weightedPrescaleRefL1;
vector<double> InstLumiPerLS;
double DenEff=0.;
Int_t nbinpt = 50;
Double_t ptmin = 0.0;
Double_t ptmax = 20.0;
Int_t nbineta = 30;
Double_t etamin = -3.0;
Double_t etamax = 3.0;
TH1F *h1 = new TH1F("h1","pTnum",nbinpt,ptmin,ptmax);
TH1F *h2 = new TH1F("h2","pTden",nbinpt,ptmin,ptmax);
TH1F *h3 = new TH1F("h3","etanum",nbineta,etamin,etamax);
TH1F *h4 = new TH1F("h4","etaden",nbineta,etamin,etamax);
double fTwo=2.;
vector<double> ftmp;
for (int i=0; i<ntrig; i++)
{ // Init
// per lumisection
Rate.push_back(0.);
pureRate.push_back(0.);
spureRate.push_back(0.);
ftmp.push_back(0.);
RateErr.push_back(0.);
pureRateErr.push_back(0.);
spureRateErr.push_back(0.);
RefPrescale.push_back(1);
weightedPrescaleRefHLT.push_back(0.);
coDen.push_back(0.);
Count.push_back(0);
}
for (int i=0; i<nL1trig; i++)
{ // Init
RefL1Prescale.push_back(1);
weightedPrescaleRefL1.push_back(0.);
}
for (int j=0; j<ntrig; j++)
{
coMa.push_back(ftmp);
}
int TotalWeightedEvents=0;
for (unsigned int i=0; i<procs.size(); i++)
{
double chainEntries = (double)procs[i]->fChain->GetEntries();
procs[i]->Loop(
rcs[i],
cfg,
menu,
i,
DenEff,
h1,
h2,
h3,
h4,
hltDatasets[i]);
// take into account negative weight entries
chainEntries=DenEff;
TotalWeightedEvents+=chainEntries;
for (unsigned int iLS=0; iLS<rcs[0]->perLumiSectionCount.size(); iLS++)
{
RatePerLS.push_back(Rate);
totalRatePerLS.push_back(0.);
CountPerLS.push_back(Count);
totalCountPerLS.push_back(0);
RefPrescalePerLS.push_back(RefPrescale);
RefL1PrescalePerLS.push_back(RefL1Prescale);
InstLumiPerLS.push_back(0.);
}
double deno = (double)cfg->nEntries;
double scaleddeno = -1;
double scaleddenoPerLS = -1;
double prescaleSum = 0.0;
if (deno <= 0. || deno > chainEntries)
{
deno = chainEntries;
}
if (cfg->isRealData == 1 && cfg->lumiSectionLength > 0)
{
// Effective time = # of lumi sections * length of 1 lumi section / overall prescale factor of the PD being analyzed
double fact=cfg->lumiSectionLength/cfg->lumiScaleFactor;
scaleddeno = (double)((procs[i]->GetNLumiSections()) * (fact))
/ ((double)(cfg->prescaleNormalization));
//scaleddeno = (double)(1. * (fact)) / ((double)(cfg->prescaleNormalization));
scaleddenoPerLS = (double)((fact))
/ ((double)(cfg->prescaleNormalization));
cout << "N(Lumi Sections) = " << (procs[i]->GetNLumiSections())
<< endl;
hltDatasets[i].computeRate(scaleddeno); //SAK -- convert event counts into rates. FOR DATA ONLY
}
double mu = cfg->bunchCrossingTime*cfg->psigmas[i]*cfg->iLumi
*(double)cfg->maxFilledBunches /(double)cfg->nFilledBunches;
double collisionRate = ((double)cfg->nFilledBunches
/(double)cfg->maxFilledBunches)/cfg->bunchCrossingTime; // Hz
if (!(cfg->isRealData == 1 && cfg->lumiSectionLength > 0))
hltDatasets[i].computeRate(cfg->isCounts,collisionRate, mu); //SAK -- convert event counts into rates
for (unsigned int iLS=0; iLS<rcs[i]->perLumiSectionCount.size(); iLS++)
{
totalRatePerLS[iLS] += OHltRateCounter::eff(
(double)rcs[i]->perLumiSectionTotCount[iLS],
scaleddenoPerLS);
totalCountPerLS[iLS] += rcs[i]->perLumiSectionTotCount[iLS];
InstLumiPerLS[iLS] = (double)rcs[i]->perLumiSectionLumi[iLS];
}
for (int j=0; j<nL1trig; j++)
{
// per lumisection
prescaleSum = 0.0;
for (unsigned int iLS=0; iLS<rcs[i]->perLumiSectionCount.size(); iLS++)
{
RefL1PrescalePerLS[iLS][j]
= (double)rcs[i]->perLumiSectionRefL1Prescale[iLS][j];
prescaleSum += RefL1PrescalePerLS[iLS][j];
}
weightedPrescaleRefL1[j] = prescaleSum
/(rcs[i]->perLumiSectionCount.size());
}
for (int j=0; j<ntrig; j++)
{
// per lumisection
prescaleSum = 0.0;
for (unsigned int iLS=0; iLS<rcs[i]->perLumiSectionCount.size(); iLS++)
{
RatePerLS[iLS][j] += OHltRateCounter::eff(
(double)rcs[i]->perLumiSectionCount[iLS][j],
scaleddenoPerLS);
CountPerLS[iLS][j] += rcs[i]->perLumiSectionCount[iLS][j];
RefPrescalePerLS[iLS][j]
= (double)rcs[i]->perLumiSectionRefPrescale[iLS][j];
prescaleSum += RefPrescalePerLS[iLS][j];
}
weightedPrescaleRefHLT[j] = prescaleSum
/(rcs[i]->perLumiSectionCount.size());
if (cfg->isRealData == 1)
{
if (cfg->isCounts == 1) {
Rate[j] += (double)rcs[i]->iCount[j];
RateErr[j] += (double)rcs[i]->iCount[j];
Count[j] += rcs[i]->iCount[j];
spureRate[j] += (double)rcs[i]->sPureCount[j];
spureRateErr[j] += (double)rcs[i]->sPureCount[j];
pureRate[j] += (double)rcs[i]->pureCount[j];
pureRateErr[j] += (double)rcs[i]->pureCount[j];
}else{
Rate[j] += OHltRateCounter::eff(
(double)rcs[i]->iCount[j],
scaleddeno);
RateErr[j] += OHltRateCounter::errRate2(
(double)rcs[i]->iCount[j],
scaleddeno);
Count[j] += rcs[i]->iCount[j];
spureRate[j] += OHltRateCounter::eff(
(double)rcs[i]->sPureCount[j],
scaleddeno);
spureRateErr[j] += OHltRateCounter::errRate2(
(double)rcs[i]->sPureCount[j],
scaleddeno);
pureRate[j] += OHltRateCounter::eff(
(double)rcs[i]->pureCount[j],
scaleddeno);
pureRateErr[j] += OHltRateCounter::errRate2(
(double)rcs[i]->pureCount[j],
scaleddeno);
}
cout << "N(passing " << menu->GetTriggerName(j) << ") = "
<< (double)rcs[i]->iCount[j] << endl;
for (int k=0; k<ntrig; k++)
{
coMa[j][k] += ((double)rcs[i]->overlapCount[j][k]);
}
coDen[j] += ((double)rcs[i]->iCount[j]); // ovelap denominator
}
else // MC
{
if (cfg->isCounts == 1)
{
Rate[j] += (double)rcs[i]->iCount[j];
RateErr[j] += (double)rcs[i]->iCount[j];
Count[j] += rcs[i]->iCount[j];
spureRate[j] += (double)rcs[i]->sPureCount[j];
spureRateErr[j] += (double)rcs[i]->sPureCount[j];
pureRate[j] += (double)rcs[i]->pureCount[j];
pureRateErr[j] += (double)rcs[i]->pureCount[j];
cout << "N(passing " << menu->GetTriggerName(j) << ") = "
<< (double)rcs[i]->iCount[j] << endl;
}
else
{
Rate[j] += collisionRate*(1. - exp(-mu * OHltRateCounter::eff(
(double)rcs[i]->iCount[j],
deno)));
RateErr[j] += pow(collisionRate*mu * OHltRateCounter::effErr(
(double)rcs[i]->iCount[j],
deno), fTwo);
Count[j] += rcs[i]->iCount[j];
spureRate[j] += collisionRate*(1. - exp(-mu * OHltRateCounter::eff(
(double)rcs[i]->sPureCount[j],
deno)));
spureRateErr[j] += pow(collisionRate*mu * OHltRateCounter::effErr(
(double)rcs[i]->sPureCount[j],
deno), fTwo);
pureRate[j] += collisionRate*(1. - exp(-mu * OHltRateCounter::eff(
(double)rcs[i]->pureCount[j],
deno)));
pureRateErr[j] += pow(collisionRate*mu * OHltRateCounter::effErr(
(double)rcs[i]->pureCount[j],
deno), fTwo);
cout << "N(passing " << menu->GetTriggerName(j) << ") = "
<< (double)rcs[i]->iCount[j] << endl;
}
for (int k=0; k<ntrig; k++)
{
coMa[j][k] += ((double)rcs[i]->overlapCount[j][k])
* cfg->psigmas[i];
}
coDen[j] += ((double)rcs[i]->iCount[j] * cfg->psigmas[i]); // ovelap denominator
}
}
}
for (int i=0; i<ntrig; i++)
{
RateErr[i] = sqrt(RateErr[i]);
spureRateErr[i] = sqrt(spureRateErr[i]);
pureRateErr[i] = sqrt(pureRateErr[i]);
//cout<<menu->GetTriggerName(i)<<" "<<Rate[i]<<" +- "<<RateErr[i]<<endl;
for (int j=0; j<ntrig; j++)
{
coMa[i][j] = coMa[i][j]/coDen[i];
}
}
rprint->SetupAll(
Rate,
RateErr,
spureRate,
spureRateErr,
pureRate,
pureRateErr,
coMa,
RatePerLS,
rcs[0]->runID,
rcs[0]->lumiSection,
totalRatePerLS,
RefPrescalePerLS,
RefL1PrescalePerLS,
weightedPrescaleRefHLT,
weightedPrescaleRefL1,
CountPerLS,
totalCountPerLS,
InstLumiPerLS);
return TotalWeightedEvents;
}
void calcEff(
OHltConfig *cfg,
OHltMenu *menu,
vector<OHltTree*> &procs,
vector<OHltRateCounter*> &rcs,
OHltEffPrinter* eprint,
double &DenEff,
HLTDatasets &hltDatasets)
{
const int ntrig = (int)menu->GetTriggerSize();
vector<double> Rate, pureRate, spureRate;
vector<double> Eff, pureEff, spureEff;
vector<double> EffErr, pureEffErr, spureEffErr;
vector<double> Count;
vector< vector<double> > coMa;
vector<double> coDen;
// double DenEff=0.;
Int_t nbinpt = 50;
Double_t ptmin = 0.0;
Double_t ptmax = 20.0;
Int_t nbineta = 30;
Double_t etamin = -3.0;
Double_t etamax = 3.0;
vector<double> ftmp;
for (int i=0; i<ntrig; i++)
{ // Init
Eff.push_back(0.);
pureEff.push_back(0.);
spureEff.push_back(0.);
ftmp.push_back(0.);
EffErr.push_back(0.);
pureEffErr.push_back(0.);
spureEffErr.push_back(0.);
coDen.push_back(0.);
}
for (int j=0; j<ntrig; j++)
{
coMa.push_back(ftmp);
}
for (unsigned int i=0; i<procs.size(); i++)
{
// if(cfg->pnames[i]=="zee"||cfg->pnames[i]=="zmumu"){
if (cfg->pisPhysicsSample[i]!=0)
{
char filename[256];
snprintf(filename, 255, "MyEffHist_%d.root", i);
TFile* theFile = new TFile(filename, "RECREATE");
theFile->cd();
cout<< "Efficiency root file created: "<<filename <<endl;
TH1F *h1 = new TH1F("pTnum","pTnum",nbinpt,ptmin,ptmax);
TH1F *h2 = new TH1F("pTden","pTden",nbinpt,ptmin,ptmax);
TH1F *h3 = new TH1F("etanum","etanum",nbineta,etamin,etamax);
TH1F *h4 = new TH1F("etaden","etaden",nbineta,etamin,etamax);
TH1F *Eff_pt = new TH1F("eff_pt","eff_pt",nbinpt,ptmin,ptmax);
TH1F *Eff_eta = new TH1F("eff_eta","eff_eta",nbineta,etamin,etamax);
procs[i]->Loop(
rcs[i],
cfg,
menu,
i,
DenEff,
h1,
h2,
h3,
h4,
hltDatasets[i]);
for (int j=0; j<ntrig; j++)
{
Eff[j] += OHltRateCounter::eff((double)rcs[i]->iCount[j], DenEff);
EffErr[j] += OHltRateCounter::effErrb(
(double)rcs[i]->iCount[j],
DenEff);
//cout<<j<<" Counts: "<<rcs[i]->iCount[j]<<endl;
spureEff[j] += OHltRateCounter::eff(
(double)rcs[i]->sPureCount[j],
DenEff);
spureEffErr[j] += OHltRateCounter::effErrb(
(double)rcs[i]->sPureCount[j],
DenEff);
pureEff[j] += OHltRateCounter::eff(
(double)rcs[i]->pureCount[j],
DenEff);
pureEffErr[j] += OHltRateCounter::effErrb(
(double)rcs[i]->pureCount[j],
DenEff);
for (int k=0; k<ntrig; k++)
{
coMa[j][k] += ((double)rcs[i]->overlapCount[j][k])
* cfg->psigmas[i];
}
coDen[j] += ((double)rcs[i]->iCount[j] * cfg->psigmas[i]); // ovelap denominator
}
Eff_pt->Divide(h1, h2, 1., 1.);
Eff_eta->Divide(h3, h4, 1., 1.);
int nbins_pt=h1->GetNbinsX();
for (int i=1; i<=nbins_pt; i++)
{
double a = h1->GetBinContent(i);
double n = h2->GetBinContent(i);
if (n != 0.)
Eff_pt->SetBinError(i, sqrt( 1./n * a/n * ( 1. - a/n )) );
}
int nbins_eta=h3->GetNbinsX();
for (int i=1; i<=nbins_eta; i++)
{
double a = h3->GetBinContent(i);
double n = h4->GetBinContent(i);
if (n != 0.)
Eff_eta->SetBinError(i, sqrt( 1./n * a/n * ( 1. - a/n )) );
}
h1->Write();
h2->Write();
h3->Write();
h4->Write();
Eff_pt->Write();
Eff_eta->Write();
theFile->Close();
}
}
for (int i=0; i<ntrig; i++)
{
for (int j=0; j<ntrig; j++)
{
coMa[i][j] = coMa[i][j]/coDen[i];
}
}
if (DenEff!=0)
eprint->SetupAll(
Eff,
EffErr,
spureEff,
spureEffErr,
pureEff,
pureEffErr,
coMa,
DenEff);
}
////////////////////////////////////////////////////////////////////////////////////////////
// END
////////////////////////////////////////////////////////////////////////////////////////////