-
Notifications
You must be signed in to change notification settings - Fork 5
/
TStarJetPicoEventCuts.cxx
716 lines (642 loc) · 20.3 KB
/
TStarJetPicoEventCuts.cxx
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
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
#include "TStarJetPicoEventCuts.h"
#include "TStarJetPicoEvent.h"
#include "TStarJetPicoEventHeader.h"
#include "TStarJetPicoDefinitions.h"
#include "TMath.h"
#include "TChain.h"
/////////////////////////////////////////////////////////////////////////
// //
// TStarJetPicoEventCuts //
// //
// Default cuts implemented. //
// Lots of virtual functions... so overload in derived classes and //
// pass to TStarJetPicoReader via TStarJetPicoReader::SetEventCuts //
// TStarJetPicoReader calls IsEventOK. //
// //
/////////////////////////////////////////////////////////////////////////
ClassImp(TStarJetPicoEventCuts)
TStarJetPicoEventCuts::TStarJetPicoEventCuts()
: TObject()
, fTrigSel("All")
, fVzCut(50.)
, fVzDiffCut(6.)
, fRefMultCutMin(0)
, fRefMultCutMax(99999)
, fRefCentCutMin(0)
, fRefCentCutMax(8)
, fBbceCutMin(0)
, fBbceCutMax(99999)
, fPVRankingCut(-10.)
, fFlagPVRankingCut(kFALSE) //reasonable value of PV Ranking Cut depends on PV finder & dataset used -> off by default!
, fMaxEventPt ( 99999 )
, fMaxEventEt ( 99999 )
, fMinEventEt( -1 ) // software HT trigger
, fUseRawForMinEventEtCut( true )
{
__DEBUG(2, "Creating event cuts with default values.");
}
TStarJetPicoEventCuts::TStarJetPicoEventCuts(const TStarJetPicoEventCuts &t)
: TObject(t)
, fTrigSel(t.fTrigSel)
, fVzCut(t.fVzCut)
, fVzDiffCut(t.fVzDiffCut)
, fRefMultCutMin(t.fRefMultCutMin)
, fRefMultCutMax(t.fRefMultCutMax)
, fRefCentCutMin(t.fRefCentCutMin)
, fRefCentCutMax(t.fRefCentCutMax)
, fBbceCutMin(t.fBbceCutMin)
, fBbceCutMax(t.fBbceCutMax)
, fPVRankingCut(t.fPVRankingCut)
, fFlagPVRankingCut(t.fFlagPVRankingCut)
, fMaxEventPt( t.fMaxEventPt )
, fMaxEventEt( t.fMaxEventEt )
, fMinEventEt( t.fMinEventEt )
, fUseRawForMinEventEtCut( t.fUseRawForMinEventEtCut )
{
__DEBUG(2, "Copy event cuts.");
}
Bool_t TStarJetPicoEventCuts::IsTriggerIdOK(Int_t mTrigId)
{
// ORDER IS IMPORTANT!
// Scanning a string here, so check and completely evaluate things like
// Contains("HT3") before Contains("HT")
__DEBUG(2, Form("mTrigId = %d TrigSel = %s", mTrigId, fTrigSel.Data()));
// nick: moving the more specific pAu trigger strings first, so that there is no opportunity
// for name collisions when trying to find a substring like "mb", etc
// Isaac: pAu year 2015, triggersel options: pAu2015_vpdmb,pAu2015_bbcmb,pAu2015_ht2,pAu2015_jp2
// see: https://www.star.bnl.gov/protected/common/common2015/trigger2015/lumipAu200GeV/lum_pertriggerid_pAu2015_200GeV.txt
if (fTrigSel.Contains("pAu2015_vpdmb")) { //VPDMB-30
if (mTrigId==500904) {
__DEBUG(2, "pAu2015_vpdmb trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("pAu2015_bbcmb")) { //BBCMB
if (mTrigId==500008 || mTrigId==500018) {
__DEBUG(2, "pAu2015_bbcmb trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("pAu2015_ht2")) { //BHT2*BBCMB
if (mTrigId==500205 || mTrigId==500215) {
__DEBUG(2, "pAu2015_ht2 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("pAu2015_jp2")) { //JP2
if (mTrigId==500401 || mTrigId==500411) {
__DEBUG(2, "pAu2015_jp2 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
// -------------------- Run 14 HT2 || HT3
if (fTrigSel.Contains("HT2") && fTrigSel.Contains("HT3") && !fTrigSel.Contains("pp")){
if ( mTrigId==450203 || mTrigId==450213 ||
mTrigId==450202 || mTrigId==450212
) { // HT3 OR HT3
__DEBUG(2, "HT3 || HT2, Trigger for Au+Au run 14 ok");
return kTRUE;
} else {
__DEBUG(2, "HT3 || HT2, Trigger for Au+Au run 14 ok");
return kFALSE;
}
}
// -------------------- Run 14 HT3
if (fTrigSel.Contains("HT3") && !fTrigSel.Contains("pp")){
if ( mTrigId==450203 || mTrigId==450213 ) { // HT3
__DEBUG(2, "HT3, Trigger for Au+Au run 14 ok");
return kTRUE;
} else {
__DEBUG(2, "HT3, Trigger for Au+Au run 14 NOT ok");
return kFALSE;
}
}
// -------------------- Run 14 HT2
if (fTrigSel.Contains("HT2") && !fTrigSel.Contains("pp")){
if ( mTrigId==450202 || mTrigId==450212 ) { // HT2*VPDMB-30
__DEBUG(2, "HT2, Trigger for Au+Au run 14 ok");
return kTRUE;
} else {
__DEBUG(2, "HT2, Trigger for Au+Au run 14 NOT ok");
return kFALSE;
}
}
if (fTrigSel.Contains("VPDMB30") && !fTrigSel.Contains("pp")){
if ( mTrigId==450010 || mTrigId==450020 ) { // VPDMB-30
__DEBUG(2, "VPDMB-30, Trigger for Au+Au run 14 ok");
return kTRUE;
} else {
__DEBUG(2, "VPDMB-30, Trigger for Au+Au run 14 NOT ok");
return kFALSE;
}
}
if (fTrigSel.Contains("VPDMB5") && !fTrigSel.Contains("pp")){
if ( mTrigId==450008 || mTrigId==450018 ) { // VPDMB-5
__DEBUG(2, "VPDMB-5, Trigger for Au+Au run 14 ok");
return kTRUE;
} else {
__DEBUG(2, "VPDMB-5, Trigger for Au+Au run 14 NOT ok");
return kFALSE;
}
}
if (fTrigSel.Contains("MBMON") && !fTrigSel.Contains("pp")){
if ( mTrigId==450008 || mTrigId==450018 ) { // MBMON
__DEBUG(2, "MBMON, Trigger for Au+Au run 14 ok");
return kTRUE;
} else {
__DEBUG(2, "MBMON, Trigger for Au+Au run 14 NOT ok");
return kFALSE;
}
}
if (fTrigSel.Contains("pp"))
{
// include different pp triggers, MB,HT and JP ...
if (fTrigSel.Contains("ppHT"))
{
if (mTrigId==117211 || mTrigId==117212 ||
mTrigId==127212 || mTrigId==127213 ||
mTrigId==137213)
{
__DEBUG(2, "HT Trigger p+p events selected");
return kTRUE;
}
else if (mTrigId==240530 || mTrigId==240540 || mTrigId==240550 || mTrigId==240560 ||
mTrigId==240570)
{
__DEBUG(2, "HT Trigger p+p events run 9 selected");
return kTRUE;
}
else if (mTrigId==370541 || mTrigId==370542 || mTrigId==370351 ) // BHT0*BBCMB*TOF0, BHT0*BBCMB*TOF0, MTD*BHT3
{
__DEBUG(2, "HT Trigger p+p events run 12 selected");
return kTRUE;
}
else
{
__DEBUG(2, "Reject ppHT trigger.");
return kFALSE;
}
}
else if (fTrigSel.Contains("ppJP"))
{
if (fTrigSel.Contains("ppJP2")) { // test
if (mTrigId==370621) // JP2 // test
{ // test
__DEBUG(2, "JP2 Trigger p+p events run 12 selected"); // test
return kTRUE; // test
} // test
else return kFALSE; // test
} // test
else if (mTrigId==117221 || mTrigId==127221 ||
mTrigId==137221 || mTrigId==137222)
{
__DEBUG(2,"JP Trigger p+p events selected");
return kTRUE;
}
else if (mTrigId==240410 || mTrigId==240411 || mTrigId==240650 || mTrigId==240651 ||
mTrigId==240652)
{
__DEBUG(2, "JP Trigger p+p events run 9 selected");
return kTRUE;
}
else if (mTrigId==370601 || mTrigId==370611 || mTrigId==370621) // JP0, JP1, JP2
{
__DEBUG(2, "JP Trigger p+p events run 12 selected");
return kTRUE;
}
else
return kFALSE;
}
else if (fTrigSel.Contains("ppMB"))
{
if (mTrigId==370011)
{
__DEBUG(2,"MB Trigger p+p events run 12 selected");
return kTRUE;
}
else
return kFALSE;
}
else if (fTrigSel.Contains("ppHM"))
{
if (mTrigId==370341)
{
__DEBUG(2,"High-multiplicity Trigger p+p events run 12 selected");
return kTRUE;
}
}
else
{
__DEBUG(2, "Reject pp trigger.");
return kFALSE;
}
} //pp selection
if (fTrigSel.Contains("HT") && !fTrigSel.Contains("pp"))
{
if (mTrigId==200620 || mTrigId==200621 || mTrigId==200211 ||
mTrigId==200212 || mTrigId==200220 || mTrigId==200221 ||
mTrigId==200222)
{
__DEBUG(2, "HT trigger for Au+Au ok.");
return kTRUE;
}
else if (mTrigId==260504 || mTrigId==260514 || mTrigId==260524)
{
__DEBUG(2, "HT Trigger for Au+Au run 10 ok");
return kTRUE;
}
else if (mTrigId==350512 || mTrigId==350502 || // NPE15
mTrigId==350513 || mTrigId==350503 || // NPE18
mTrigId==350514 || mTrigId==350504 ) // NPE25
{
__DEBUG(2, "HT Trigger for Au+Au run 11 ok");
return kTRUE;
}
else if (mTrigId==450201 || mTrigId==450211 || // HT1*VPDMB-30
mTrigId==450202 || mTrigId==450212 || // HT2*VPDMB-30
mTrigId==450203 || mTrigId==450213 ) // HT3*VPDMB-30
{
__DEBUG(2, "HT1, HT2, HT3, Trigger for Au+Au run 14 ok");
return kTRUE;
}
else
{
__DEBUG(2, "Reject HT trigger for Au+Au.");
return kFALSE;
}
} // auau HT
if (fTrigSel.Contains("MB") && !fTrigSel.Contains("pp"))
{
if (mTrigId==200001 || mTrigId==200003 || mTrigId==200013)
{
__DEBUG(2, "Accept MB trigger for Au+Au.");
return kTRUE;
}
else if (mTrigId==200001 || mTrigId==200003 || mTrigId==200013)
{
__DEBUG(2, "Accept MB trigger for Au+Au run 11.");
return kTRUE;
}
else if ( mTrigId==450010 || mTrigId==450020 || // VPDMB-30
mTrigId==450008 || mTrigId==450018 || // VPDMB-5
mTrigId==450008 || mTrigId==450018 // MBMON
) {
__DEBUG(2, "Accept VPDMB-30 || VPDMB-5 || MBMON for Au+Au run 14.");
return kTRUE;
} else {
__DEBUG(2, "Reject MB trigger for Au+Au.");
return kFALSE;
}
} // auau mb
if (fTrigSel.Contains("wide") && !fTrigSel.Contains("pp"))
{
if (mTrigId==320000 || mTrigId==320001 || mTrigId==320011 || mTrigId==320021)
{
__DEBUG(1, "Accept MB trigger for Au+Au.");
return kTRUE;
}
else
{
__DEBUG(2, "Reject MB trigger for Au+Au.");
return kFALSE;
}
} // auau mb, wide vz cut
// dAu year 2008, triggersel options: dAu_mb,dAu_ht_all,dAu_ht0,dAu_ht1,dAu_ht2,dAu_ht4
if (fTrigSel.Contains("dAu_mb")) {
if (mTrigId==210020) {
__DEBUG(2, "dAu_mb trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("dAu_ht_all")) {
if (mTrigId==210500 || mTrigId==210501 || mTrigId==210510 || mTrigId==210511 || mTrigId==210520 || mTrigId==210521 || mTrigId==210541) {
__DEBUG(2, "dAu_ht_all trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("dAu_ht0")) {
if (mTrigId==210500 || mTrigId==210501) {
__DEBUG(2, "dAu_ht0 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("dAu_ht1")) {
if (mTrigId==210510 || mTrigId==210511) {
__DEBUG(2, "dAu_ht1 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("dAu_ht2")) {
if (mTrigId==210520 || mTrigId==210521) {
__DEBUG(2, "dAu_ht2 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("dAu_ht4")) {
if (mTrigId==210541) {
__DEBUG(2, "dAu_ht4 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
// p+p year8 trigger selection: y8p+p_ht0,y8p+p_ht1,y8p+p_ht2,y8p+p_mb
if (fTrigSel.Contains("y8p+p_ht0")) {
if (mTrigId==220500) {
__DEBUG(2, "y8p+p_ht0 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("y8p+p_ht1")) {
if (mTrigId==220510) {
__DEBUG(2, "y8p+p_ht1 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("y8p+p_ht2")) {
if (mTrigId==220520) {
__DEBUG(2, "y8p+p_ht2 trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("y8p+p_mb")) {
if (mTrigId==220000) {
__DEBUG(2, "y8p+p_mb trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
if (fTrigSel.Contains("y4mb")) {
if (mTrigId==15007) {
__DEBUG(2, "y4mb trigger ok.");
return kTRUE;
} else {
return kFALSE;
}
}
__WARNING(Form("Unrecognized trigger selection! %s", fTrigSel.Data()));
return kFALSE;
}
Bool_t TStarJetPicoEventCuts::IsTriggerIdOK(TStarJetPicoEvent *mEv)
{
Bool_t retval = kFALSE;
if (fTrigSel.Contains("All") || fTrigSel.Contains("all") )
{
__DEBUG(2, "All events taken, no Trigger selection");
return kTRUE;
}
for (Int_t id = 0; id < mEv->GetHeader()->GetNOfTriggerIds(); id++)
{
Int_t TrigId = mEv->GetHeader()->GetTriggerId(id);
if ( IsTriggerIdOK(TrigId) == kTRUE )
{
retval = kTRUE;
break;
}
}
if ( !retval ) __DEBUG(1, Form("Reject. No suitable trigger.") );
return retval;
}
Bool_t TStarJetPicoEventCuts::IsVertexZDiffOK(TStarJetPicoEvent *mEv)
{
Float_t Vz =mEv->GetHeader()->GetPrimaryVertexZ();
Float_t VpdVz =mEv->GetHeader()->GetVpdVz();
if(TMath::Abs(Vz-VpdVz)<fVzDiffCut)
{
__DEBUG(1,Form("Accept. %f<%f",TMath::Abs(Vz-VpdVz),fVzDiffCut));
return kTRUE;
}
__DEBUG(1,Form("Reject. %f<%f",TMath::Abs(Vz-VpdVz),fVzDiffCut));
return kFALSE;
}
Int_t TStarJetPicoEventCuts::GetReferenceMultiplicity(TStarJetPicoEvent *mEv)
{
__ERROR ( "Deprecated, don't use");
throw (-1);
Int_t RefMult = mEv->GetHeader()->GetReferenceMultiplicity();
if ((fTrigSel.Contains("HT") || fTrigSel.Contains("MB")) &&
(!fTrigSel.Contains("pp")) )
{
__DEBUG(1, Form("Switching to GRefMult cut for AuAu data. Trigger is %s",
fTrigSel.Data()));
RefMult = mEv->GetHeader()->GetGReferenceMultiplicity();
}
return RefMult;
}
Bool_t TStarJetPicoEventCuts::IsRefMultOK(TStarJetPicoEvent *mEv )
{
// KK: Simplified
Double_t RefMult = mEv->GetHeader()->GetProperReferenceMultiplicity();
// Int_t RefMult = mEv->GetHeader()->GetReferenceMultiplicity();
// Int_t run = mEv->GetHeader()->GetRunId();
// if(run < 11002120 || run > 11147025)//exclude Run 10 AuAu all energies
// if ((fTrigSel.Contains("HT") || fTrigSel.Contains("MB")) &&
// (!fTrigSel.Contains("pp")) )
// {
// __DEBUG(1, Form("Switching to GRefMult cut for AuAu data. Trigger is %s",
// fTrigSel.Data()));
// RefMult = mEv->GetHeader()->GetGReferenceMultiplicity();
// }
// TString triggerSel = fTrigSel;
// triggerSel.ToUpper();
// //nick elsey: overriding this for run 11: using CorRefMult if its present
// if ( ( ( (run-run%1000000)/1000000 ) == 12 ) && fInputTree->FindLeaf("fEventHeader.fCorRefMult") ) {
// if ( triggerSel.Contains("HT") || triggerSel.Contains("MB") || triggerSel.Contains("ALL") ) {
// RefMult = mEv->GetHeader()->GetCorrectedReferenceMultiplicity();
// __DEBUG(1, Form("Switching to CorRefMult cut for y11 data. Trigger is %s",
// triggerSel.Data()));
// }
// }
if (( RefMult > fRefMultCutMin) &&
( RefMult < fRefMultCutMax) )
{
__DEBUG(1, Form("Accept. %d < %.1f < %d",
fRefMultCutMin, RefMult, fRefMultCutMax));
return kTRUE;
}
__DEBUG(1, Form("Reject. %d < %.1f < %d",
fRefMultCutMin, RefMult, fRefMultCutMax));
return kFALSE;
}
Bool_t TStarJetPicoEventCuts::IsRefCentOK(TStarJetPicoEvent *mEv, TChain *fInputTree)
{
if (fRefCentCutMin == 0 && fRefCentCutMax == 8) {
__DEBUG(1, Form("No Reference Centrality selected. "));
return kTRUE;
}
if ( !fInputTree->FindLeaf("fEventHeader.fRefCent") ) {
__ERROR("Reference centrality cut defined, but the leaf wasn't found. ")
return kFALSE;
}
Int_t refCent = mEv->GetHeader()->GetReferenceCentrality();
if ( (refCent >= fRefCentCutMin) && (refCent <= fRefCentCutMax) ) {
__DEBUG(1, Form("Accept. %d < %d < %d",
fRefCentCutMin, refCent, fRefCentCutMax));
return kTRUE;
}
__DEBUG(1, Form("Reject. %d < %d < %d",
fRefCentCutMin, refCent, fRefCentCutMax));
return kFALSE;
}
Bool_t TStarJetPicoEventCuts::IsVertexZOK(TStarJetPicoEvent *mEv)
{
Float_t Vz = mEv->GetHeader()->GetPrimaryVertexZ();
if ( TMath::Abs(Vz) < fVzCut )
{
__DEBUG(1, Form("Accept. %f < %f", TMath::Abs(Vz), fVzCut));
return kTRUE;
}
__DEBUG(1, Form("Reject. %f < %f", TMath::Abs(Vz), fVzCut));
return kFALSE;
}
Bool_t TStarJetPicoEventCuts::IsPVRankingOK(TStarJetPicoEvent *mEv)
{
Float_t ranking = mEv->GetHeader()->GetPrimaryVertexRanking();
if (ranking>fPVRankingCut){
__DEBUG(1, Form("Accept. %f > %f",ranking,fPVRankingCut));
return kTRUE;
}
__DEBUG(1, Form("Reject. ! %f > %f",ranking,fPVRankingCut));
return kFALSE;
}
Bool_t TStarJetPicoEventCuts::IsBbceOK(TStarJetPicoEvent *mEv)
{
Int_t Bbce = mEv->GetHeader()->GetBbcAdcSumEast();
if (( Bbce > fBbceCutMin) &&
( Bbce < fBbceCutMax) )
{
__DEBUG(1, Form("Accept. %d < %d < %d",
fBbceCutMin, Bbce, fBbceCutMax));
return kTRUE;
}
__DEBUG(1, Form("Reject. ! %d < %d < %d",
fBbceCutMin, Bbce, fBbceCutMax));
return kFALSE;
}
Bool_t TStarJetPicoEventCuts::IsScalersOK(TStarJetPicoEvent *mEv)
{
Bool_t retval=kTRUE;
//taken from StRoot/StMuAnalysisMaker/StMuScalerCutter.cxx, version 1.1
Int_t run = mEv->GetHeader()->GetRunId();
Float_t zdce = mEv->GetHeader()->GetZdcEastRate();
Float_t zdcw = mEv->GetHeader()->GetZdcWestRate();
Float_t zdcx = mEv->GetHeader()->GetZdcCoincidenceRate();
Float_t bbcw = mEv->GetHeader()->GetBbcWestRate();
Float_t bbcx = mEv->GetHeader()->GetBbcCoincidenceRate();
Float_t bbcbb = mEv->GetHeader()->GetBbcBlueBackgroundRate();
// zdcx check
if (zdcx/bbcx > 0.42 || zdcx/zdcw > 0.35) retval=kFALSE;
// zdce check
if (run > 8361110 && run < 8363032) {
if (zdce/bbcx > 2.9 ||
zdce/zdcw > 1.8) retval=kFALSE;
} else {
if (zdce/bbcx > 1.9 ||
zdce/zdcw > 1.8) retval=kFALSE;
}
// bbcbb check (for 1-second scalers)
Double_t R1 = 1.4923e-3*TMath::Power(zdcw,-2.57818)*TMath::Power(bbcw,3.6488);
Double_t R2 = bbcbb/R1;
if ( ( R2 > 0.2 && R2 < 0.72 ) ||
( R2 > 1.4 && R2 < 4.6 ) ) retval=kFALSE;
if (retval==kTRUE) {
__DEBUG(1, Form("Accept. Corrupt scalers cut ok."));
return kTRUE;
}
__DEBUG(1, Form("Reject. Corrupt scalers cut NOT ok."));
return kFALSE;
}
Bool_t TStarJetPicoEventCuts::CheckEvent(TStarJetPicoEvent *mEv, TChain *fInputTree)
{
return IsEventOK(mEv, fInputTree);
}
Bool_t TStarJetPicoEventCuts::IsEventOK(TStarJetPicoEvent *mEv, TChain *fInputTree)
{
Bool_t retval;
retval = (IsRefMultOK(mEv) && IsRefCentOK(mEv, fInputTree) && IsVertexZOK(mEv) && IsTriggerIdOK(mEv) && (fFlagPVRankingCut==kFALSE || IsPVRankingOK(mEv)) );
//cuts for dAu2008
Int_t run = mEv->GetHeader()->GetRunId();
if (run > 8313000 && run < 9029000) { // Run 8 dAu cuts
if (IsBbceOK(mEv)==kFALSE)
retval = kFALSE;
if (IsScalersOK(mEv)==kFALSE)
retval = kFALSE;
}
//extra vzVPD-vzTPC cut for Run9 & 10, pp and AuAu
// and Run 15 pAu
if((run > 10085112 && run < 11147025) || (run >= 16125024 && run <= 16159024)){
if(IsVertexZDiffOK(mEv)==kFALSE)
retval = kFALSE;
}
return retval;
}
Bool_t TStarJetPicoEventCuts::IsHighestPtOK( Float_t mPt )
{
if ( mPt>fMaxEventPt ) {
__DEBUG(1,Form("Reject. %f>%f",mPt,fMaxEventPt));
return kFALSE;
}
__DEBUG(6,Form("Accept. %f<%f",mPt,fMaxEventPt));
return kTRUE;
}
Bool_t TStarJetPicoEventCuts::IsHighestEtOK( Float_t mEt )
{
if ( mEt>fMaxEventEt ) {
__DEBUG(1,Form("Reject. %f>%f",mEt,fMaxEventEt));
return kFALSE;
}
__DEBUG(6,Form("Accept. %f<%f",mEt,fMaxEventEt));
return kTRUE;
}
Bool_t TStarJetPicoEventCuts::IsHighTowerOk( Float_t mEt )
{
if ( fMinEventEt > 0 && mEt<fMinEventEt ) {
__DEBUG(1,Form("Reject. High tower %f<%f",mEt,fMinEventEt));
return kFALSE;
}
__DEBUG(6,Form("Accept. High tower %f>%f",mEt,fMinEventEt));
return kTRUE;
}
Bool_t TStarJetPicoEventCuts::SetReferenceCentralityCut(Int_t min, Int_t max)
{
if (min > max) {
__ERROR("Reference centrality minimum set greater than maximum. Using Defaults.");
return kFALSE;
}
if (min < 0) {
__ERROR("Reference centrality minimum set less than zero. Using Defaults");
return kFALSE;
}
if (max > 8) {
__ERROR("Reference centrality minimum set greater than eight. Using Defaults.");
return kFALSE;
}
fRefCentCutMax = max;
fRefCentCutMin = min;
return kTRUE;
}