Skip to content

Commit 141bc48

Browse files
authored
Added missing Run2 event selection criteria + beam-gas checks (AliceO2Group#816)
* Added missing Run2 event selection criteria + beam-gas checks * ccdb-test to production ccdb * Fix warnings
1 parent 29f2867 commit 141bc48

5 files changed

Lines changed: 214 additions & 76 deletions

File tree

Common/CCDB/EventSelectionParams.cxx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ const char* selectionLabels[kNsel] = {
1818
"kIsBBV0C",
1919
"kIsBBFDA",
2020
"kIsBBFDC",
21+
"kIsBBT0A",
22+
"kIsBBT0C",
2123
"kNoBGV0A",
2224
"kNoBGV0C",
2325
"kNoBGFDA",
2426
"kNoBGFDC",
25-
"kIsBBT0A",
26-
"kIsBBT0C",
27+
"kNoBGT0A",
28+
"kNoBGT0C",
2729
"kIsBBZNA",
2830
"kIsBBZNC",
2931
"kIsBBZAC",
@@ -39,7 +41,11 @@ const char* selectionLabels[kNsel] = {
3941
"kNoPileupFromSPD",
4042
"kNoV0PFPileup",
4143
"kNoSPDClsVsTklBG",
42-
"kNoV0C012vsTklBG"};
44+
"kNoV0C012vsTklBG",
45+
"kNoInconsistentVtx",
46+
"kNoPileupInMultBins",
47+
"kNoPilupMV",
48+
"kNoPileupTPC"};
4349
}
4450

4551
EventSelectionParams::EventSelectionParams(int system)

Common/CCDB/EventSelectionParams.h

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,39 @@ namespace evsel
1919
{
2020
// Event selection criteria
2121
enum EventSelectionFlags {
22-
kIsBBV0A = 0, // cell-averaged time in V0A in beam-beam window
23-
kIsBBV0C, // cell-averaged time in V0C in beam-beam window (for Run 2 only)
24-
kIsBBFDA, // cell-averaged time in FDA (or AD in Run2) in beam-beam window
25-
kIsBBFDC, // cell-averaged time in FDC (or AD in Run2) in beam-beam window
26-
kNoBGV0A, // cell-averaged time in V0A in beam-gas window
27-
kNoBGV0C, // cell-averaged time in V0C in beam-gas window (for Run 2 only)
28-
kNoBGFDA, // cell-averaged time in FDA (AD in Run2) in beam-gas window
29-
kNoBGFDC, // cell-averaged time in FDC (AD in Run2) in beam-gas window
30-
kIsBBT0A, // cell-averaged time in T0A in beam-beam window
31-
kIsBBT0C, // cell-averaged time in T0C in beam-beam window
32-
kIsBBZNA, // time in common ZNA channel in beam-beam window
33-
kIsBBZNC, // time in common ZNC channel in beam-beam window
34-
kIsBBZAC, // time in ZNA and ZNC in beam-beam window - circular cut in ZNA-ZNC plane
35-
kNoBGZNA, // time in common ZNA channel is outside of beam-gas window
36-
kNoBGZNC, // time in common ZNC channel is outside of beam-gas window
37-
kNoV0MOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline VOM correlation
38-
kNoSPDOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline SPD correlation
39-
kNoV0Casymmetry, // no beam-gas according to correlation of V0C multiplicities in V0C3 and V0C012
40-
kIsGoodTimeRange, // good time range
41-
kNoIncompleteDAQ, // complete event according to DAQ flags
42-
kNoTPCLaserWarmUp, // no TPC laser warm-up event (used in Run 1)
43-
kNoTPCHVdip, // no TPC HV dip
44-
kNoPileupFromSPD, // no pileup according to SPD vertexer
45-
kNoV0PFPileup, // no out-of-bunch pileup according to V0 past-future info
46-
kNoSPDClsVsTklBG, // no beam-gas according to cluster-vs-tracklet correlation
47-
kNoV0C012vsTklBG, // no beam-gas according to V0C012-vs-tracklet correlation
48-
kNsel // counter
22+
kIsBBV0A = 0, // cell-averaged time in V0A in beam-beam window
23+
kIsBBV0C, // cell-averaged time in V0C in beam-beam window (for Run 2 only)
24+
kIsBBFDA, // cell-averaged time in FDA (or AD in Run2) in beam-beam window
25+
kIsBBFDC, // cell-averaged time in FDC (or AD in Run2) in beam-beam window
26+
kIsBBT0A, // cell-averaged time in T0A in beam-beam window
27+
kIsBBT0C, // cell-averaged time in T0C in beam-beam window
28+
kNoBGV0A, // cell-averaged time in V0A in beam-gas window
29+
kNoBGV0C, // cell-averaged time in V0C in beam-gas window (for Run 2 only)
30+
kNoBGFDA, // cell-averaged time in FDA (AD in Run2) in beam-gas window
31+
kNoBGFDC, // cell-averaged time in FDC (AD in Run2) in beam-gas window
32+
kNoBGT0A, // cell-averaged time in T0A in beam-gas window
33+
kNoBGT0C, // cell-averaged time in T0C in beam-gas window
34+
kIsBBZNA, // time in common ZNA channel in beam-beam window
35+
kIsBBZNC, // time in common ZNC channel in beam-beam window
36+
kIsBBZAC, // time in ZNA and ZNC in beam-beam window - circular cut in ZNA-ZNC plane
37+
kNoBGZNA, // time in common ZNA channel is outside of beam-gas window
38+
kNoBGZNC, // time in common ZNC channel is outside of beam-gas window
39+
kNoV0MOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline VOM correlation
40+
kNoSPDOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline SPD correlation
41+
kNoV0Casymmetry, // no beam-gas according to correlation of V0C multiplicities in V0C3 and V0C012
42+
kIsGoodTimeRange, // good time range
43+
kNoIncompleteDAQ, // complete event according to DAQ flags
44+
kNoTPCLaserWarmUp, // no TPC laser warm-up event (used in Run 1)
45+
kNoTPCHVdip, // no TPC HV dip
46+
kNoPileupFromSPD, // no pileup according to SPD vertexer
47+
kNoV0PFPileup, // no out-of-bunch pileup according to V0 past-future info
48+
kNoSPDClsVsTklBG, // no beam-gas according to cluster-vs-tracklet correlation
49+
kNoV0C012vsTklBG, // no beam-gas according to V0C012-vs-tracklet correlation
50+
kNoInconsistentVtx, // no inconsistency in SPD and Track vertices
51+
kNoPileupInMultBins, // no pileup according to multiplicity-differential pileup checks
52+
kNoPilupMV, // no pileup according to multi-vertexer
53+
kNoPileupTPC, // no pileup in TPC
54+
kNsel // counter
4955
};
5056

5157
extern const char* selectionLabels[kNsel];
@@ -106,11 +112,14 @@ class EventSelectionParams
106112
float fZNCBGlower = 5.0; // ns
107113
float fZNCBGupper = 100.0; // ns
108114

109-
// TODO rough cuts to be adjusted
110-
float fT0ABBlower = -2.0; // ns
111-
float fT0ABBupper = 2.0; // ns
112-
float fT0CBBlower = -2.0; // ns
113-
float fT0CBBupper = 2.0; // ns
115+
float fT0ABBlower = -1.0; // ns
116+
float fT0ABBupper = 1.0; // ns
117+
float fT0CBBlower = -1.0; // ns
118+
float fT0CBBupper = 1.0; // ns
119+
float fT0ABGlower = 32.7; // ns
120+
float fT0ABGupper = 32.8; // ns
121+
float fT0CBGlower = 32.7; // ns
122+
float fT0CBGupper = 32.8; // ns
114123

115124
// Default values from AliOADBTriggerAnalysis constructor
116125
float fSPDClsVsTklA = 65.f;

Common/CCDB/macros/upload_event_selection_params.C

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,29 @@ void upload_event_selection_params()
213213
ccdb.storeAsTFileAny(par[i], "EventSelection/EventSelectionParams", metadata, sor, eor);
214214
}
215215

216-
if (0) { // Default Run 3 object
216+
if (1) { // Default Run 3 object
217217
ULong64_t sorRun3 = 1543767116001;
218218
ULong64_t eorRun3 = 1893445200000;
219219
metadata["period"] = "Default Run 3";
220-
ccdb.storeAsTFileAny(par[0], "EventSelection/EventSelectionParams", metadata, sorRun3, eorRun3);
220+
n++;
221+
par[n] = new EventSelectionParams();
222+
par[n]->fV0ABBlower = -4.0; // ns
223+
par[n]->fV0ABBupper = +4.0; // ns
224+
par[n]->fV0ABGlower = 32.7; // ns
225+
par[n]->fV0ABGupper = 32.8; // ns
226+
par[n]->fFDABBlower = -4.0; // ns
227+
par[n]->fFDABBupper = +4.0; // ns
228+
par[n]->fFDABGlower = 32.7; // ns
229+
par[n]->fFDABGupper = 32.8; // ns
230+
par[n]->fFDCBBlower = -4.0; // ns
231+
par[n]->fFDCBBupper = +4.0; // ns
232+
par[n]->fFDCBGlower = 32.7; // ns
233+
par[n]->fFDCBGupper = 32.8; // ns
234+
par[n]->fT0ABBlower = -1.0; // ns
235+
par[n]->fT0ABBupper = +1.0; // ns
236+
par[n]->fT0CBBlower = -1.0; // ns
237+
par[n]->fT0CBBupper = +1.0; // ns
238+
239+
ccdb.storeAsTFileAny(par[n], "EventSelection/EventSelectionParams", metadata, sorRun3, eorRun3);
221240
}
222241
}

Common/TableProducer/eventSelection.cxx

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct BcSelectionTask {
3434

3535
void init(InitContext&)
3636
{
37+
// ccdb->setURL("http://ccdb-test.cern.ch:8080");
3738
ccdb->setURL("http://alice-ccdb.cern.ch");
3839
ccdb->setCaching(true);
3940
ccdb->setLocalObjectValidityChecking();
@@ -151,6 +152,10 @@ struct BcSelectionTask {
151152
selection[kNoTPCHVdip] = (eventCuts & 1 << aod::kIsTPCHVdip) == 0;
152153
selection[kNoPileupFromSPD] = (eventCuts & 1 << aod::kIsPileupFromSPD) == 0;
153154
selection[kNoV0PFPileup] = (eventCuts & 1 << aod::kIsV0PFPileup) == 0;
155+
selection[kNoInconsistentVtx] = (eventCuts & 1 << aod::kConsistencySPDandTrackVertices) > 0;
156+
selection[kNoPileupInMultBins] = (eventCuts & 1 << aod::kPileupInMultBins) == 0;
157+
selection[kNoPilupMV] = (eventCuts & 1 << aod::kPileUpMV) == 0;
158+
selection[kNoPileupTPC] = (eventCuts & 1 << aod::kTPCPileUp) == 0;
154159

155160
int32_t foundFT0 = bc.has_ft0() ? bc.ft0().globalIndex() : -1;
156161
int32_t foundFV0 = bc.has_fv0a() ? bc.fv0a().globalIndex() : -1;
@@ -171,8 +176,7 @@ struct BcSelectionTask {
171176
aod::FT0s const&,
172177
aod::FDDs const&)
173178
{
174-
175-
for (auto& bc : bcs) {
179+
for (auto bc : bcs) {
176180
EventSelectionParams* par = ccdb->getForTimeStamp<EventSelectionParams>("EventSelection/EventSelectionParams", bc.timestamp());
177181

178182
// TODO: fill fired aliases for run3
@@ -187,14 +191,44 @@ struct BcSelectionTask {
187191
float timeT0C = bc.has_ft0() ? bc.ft0().timeC() : -999.f;
188192
float timeFDA = bc.has_fdd() ? bc.fdd().timeA() : -999.f;
189193
float timeFDC = bc.has_fdd() ? bc.fdd().timeC() : -999.f;
194+
float timeV0ABG = -999.f;
195+
float timeT0ABG = -999.f;
196+
float timeT0CBG = -999.f;
197+
float timeFDABG = -999.f;
198+
float timeFDCBG = -999.f;
199+
200+
uint64_t globalBC = bc.globalBC();
201+
// move to previous bcs to check beam-gas in FT0, FV0 and FDD
202+
int64_t backwardMoveCount = 0;
203+
int64_t deltaBC = 6; // up to 6 bcs back
204+
while (bc.globalBC() + deltaBC >= globalBC) {
205+
if (bc == bcs.begin()) {
206+
break;
207+
}
208+
--bc;
209+
backwardMoveCount++;
210+
if (bc.globalBC() + 1 == globalBC) {
211+
timeV0ABG = bc.has_fv0a() ? bc.fv0a().time() : -999.f;
212+
timeT0ABG = bc.has_ft0() ? bc.ft0().timeA() : -999.f;
213+
timeT0CBG = bc.has_ft0() ? bc.ft0().timeC() : -999.f;
214+
}
215+
if (bc.globalBC() + 5 == globalBC) {
216+
timeFDABG = bc.has_fdd() ? bc.fdd().timeA() : -999.f;
217+
timeFDCBG = bc.has_fdd() ? bc.fdd().timeC() : -999.f;
218+
}
219+
}
220+
// move back to initial position
221+
bc.moveByIndex(backwardMoveCount);
190222

191223
// applying timing selections
192224
bool bbV0A = timeV0A > par->fV0ABBlower && timeV0A < par->fV0ABBupper;
193225
bool bbFDA = timeFDA > par->fFDABBlower && timeFDA < par->fFDABBupper;
194226
bool bbFDC = timeFDC > par->fFDCBBlower && timeFDC < par->fFDCBBupper;
195-
bool bgV0A = timeV0A > par->fV0ABGlower && timeV0A < par->fV0ABGupper;
196-
bool bgFDA = timeFDA > par->fFDABGlower && timeFDA < par->fFDABGupper;
197-
bool bgFDC = timeFDC > par->fFDCBGlower && timeFDC < par->fFDCBGupper;
227+
bool bgV0A = timeV0ABG > par->fV0ABGlower && timeV0ABG < par->fV0ABGupper;
228+
bool bgFDA = timeFDABG > par->fFDABGlower && timeFDABG < par->fFDABGupper;
229+
bool bgFDC = timeFDCBG > par->fFDCBGlower && timeFDCBG < par->fFDCBGupper;
230+
bool bgT0A = timeT0ABG > par->fT0ABGlower && timeT0ABG < par->fT0ABGupper;
231+
bool bgT0C = timeT0CBG > par->fT0CBGlower && timeT0CBG < par->fT0CBGupper;
198232
bool bbV0C = 0;
199233
bool bgV0C = 0;
200234

@@ -206,6 +240,8 @@ struct BcSelectionTask {
206240
selection[kNoBGV0A] = !bgV0A;
207241
selection[kNoBGFDA] = !bgFDA;
208242
selection[kNoBGFDC] = !bgFDC;
243+
selection[kNoBGT0A] = !bgT0A;
244+
selection[kNoBGT0C] = !bgT0C;
209245
selection[kIsBBT0A] = timeT0A > par->fT0ABBlower && timeT0A < par->fT0ABBupper;
210246
selection[kIsBBT0C] = timeT0C > par->fT0CBBlower && timeT0C < par->fT0CBBupper;
211247
selection[kIsBBZNA] = timeZNA > par->fZNABBlower && timeZNA < par->fZNABBupper;
@@ -254,6 +290,7 @@ struct EventSelectionTask {
254290

255291
void init(InitContext&)
256292
{
293+
//ccdb->setURL("http://ccdb-test.cern.ch:8080");
257294
ccdb->setURL("http://alice-ccdb.cern.ch");
258295
ccdb->setCaching(true);
259296
ccdb->setLocalObjectValidityChecking();

0 commit comments

Comments
 (0)