3030using namespace o2 ;
3131using namespace o2 ::framework;
3232
33- // using UDCollisionsFull = soa::Join<
34- // aod::UDCollisions,
35- // aod::UDCollisionsSels,
36- // aod::UDCollisionSelExtras>;
33+ using UDCollisionsFull = soa::Join<
34+ aod::UDCollisions,
35+ aod::UDCollisionsSels,
36+ aod::UDCollisionSelExtras>;
3737
38- using UDCollisionsFull = aod::UDCollisions;
38+ // using UDCollisionsFull = aod::UDCollisions;
3939
4040struct UpcTestFITBitMapping {
4141
@@ -45,7 +45,7 @@ struct UpcTestFITBitMapping {
4545 Configurable<int > maxEvents{" maxEvents" , -1 , " Process at most this many collisions (-1 = all)" };
4646 Configurable<int > debugPrintEvery{" debugPrintEvery" , 1000 , " Print every N events (-1 disables)" };
4747 Configurable<int > debugPrintFirst{" debugPrintFirst" , 10 , " Always print first N events" };
48- Configurable<bool > useRctFlag{" useRctFlag" , false , " use RCT flags for event selection" };
48+ Configurable<bool > useRctFlag{" useRctFlag" , true , " use RCT flags for event selection" };
4949 Configurable<int > cutRctFlag{" cutRctFlag" , 0 , " 0 = off, 1 = CBT, 2 = CBT+ZDC, 3 = CBThadron, 4 = CBThadron+ZDC" };
5050
5151 struct OffsetXYZ {
@@ -63,7 +63,7 @@ struct UpcTestFITBitMapping {
6363 HistogramRegistry registry{
6464 " registry" ,
6565 {
66- {" debug/hEventCounter" , " Event counter;step;events" , {HistType::kTH1F , {{6 , -0.5 , 5 .5 }}}},
66+ {" debug/hEventCounter" , " Event counter;step;events" , {HistType::kTH1F , {{10 , -0.5 , 9 .5 }}}},
6767 {" debug/hFitBitsSize" , " fitBits.size() per collision;fitBits.size();events" , {HistType::kTH1F , {{10 , -0.5 , 9.5 }}}},
6868 {" debug/hCollisionIndexMod" , " Collision index mod 100;collision.globalIndex() % 100;events" , {HistType::kTH1F , {{100 , -0.5 , 99.5 }}}},
6969
@@ -76,7 +76,7 @@ struct UpcTestFITBitMapping {
7676 {" map/hEtaPhiC" , " FT0C #eta vs #varphi;#eta;#varphi" , {HistType::kTH2F , {{8 , -3.5 , -2.0 }, {18 , 0.0 , 2 . * M_PI }}}},
7777
7878 {" mult/hPnFT0A" , " P(n): FT0A fired-channel multiplicity;N_{fired}^{FT0A};events" , {HistType::kTH1F , {{97 , -0.5 , 96.5 }}}},
79- {" mult/hPnFT0C" , " P(n): FT0C fired-channel multiplicity;N_{fired}^{FT0C};events" , {HistType::kTH1F , {{113 , -0.5 , 112 .5 }}}},
79+ {" mult/hPnFT0C" , " P(n): FT0C fired-channel multiplicity;N_{fired}^{FT0C};events" , {HistType::kTH1F , {{50 , -0.5 , 49 .5 }}}},
8080 {" mult/hPnFT0" , " P(n): FT0 fired-channel multiplicity;N_{fired}^{FT0};events" , {HistType::kTH1F , {{209 , -0.5 , 208.5 }}}},
8181 {" mult/hPnFV0A" , " P(n): FV0A fired-channel multiplicity;N_{fired}^{FV0A};events" , {HistType::kTH1F , {{49 , -0.5 , 48.5 }}}},
8282 {" mult/hPnFIT" , " P(n): FIT fired-channel multiplicity;N_{fired}^{FIT};events" , {HistType::kTH1F , {{257 , -0.5 , 256.5 }}}},
@@ -96,66 +96,66 @@ struct UpcTestFITBitMapping {
9696 return n;
9797 }
9898
99- // template <typename C>
100- // bool isGoodRctFlag(const C& collision)
101- // {
102- // switch (cutRctFlag) {
103- // case 1: // CBT
104- // return sgSelector.isCBTOk(collision);
105- // case 2: // CBT + ZDC
106- // return sgSelector.isCBTZdcOk(collision);
107- // case 3: // CBT hadron
108- // return sgSelector.isCBTHadronOk(collision);
109- // case 4: // CBT hadron + ZDC
110- // return sgSelector.isCBTHadronZdcOk(collision);
111- // default: // no RCT cut applied
112- // return true;
113- // }
114- // }
99+ template <typename C>
100+ bool isGoodRctFlag (const C& collision)
101+ {
102+ switch (cutRctFlag) {
103+ case 1 : // CBT
104+ return sgSelector.isCBTOk (collision);
105+ case 2 : // CBT + ZDC
106+ return sgSelector.isCBTZdcOk (collision);
107+ case 3 : // CBT hadron
108+ return sgSelector.isCBTHadronOk (collision);
109+ case 4 : // CBT hadron + ZDC
110+ return sgSelector.isCBTHadronZdcOk (collision);
111+ default : // no RCT cut applied
112+ return true ;
113+ }
114+ }
115115
116116
117- // template <typename C>
118- // bool collisionPassesCuts(const C& collision)
119- // {
120- // / * good vertex */
121- // if (!collision.vtxITSTPC()) {
122- // return false;
123- // }
124- // registry.fill(HIST("debug/hEventCounter"), 4.);
125-
126- // / * same bunch pile-up rejection */
127- // if (!collision.sbp()) {
128- // return false;
129- // }
130- // registry.fill(HIST("debug/hEventCounter"), 5.);
131-
132- // / * ITS ROF rejection */
133- // if (!collision.itsROFb()) {
134- // return false;
135- // }
136- // registry.fill(HIST("debug/hEventCounter"), 6.);
137-
138- // / * Timeframe border collision rejection */
139- // if (!collision.tfb()) {
140- // return false;
141- // }
142- // registry.fill(HIST("debug/hEventCounter"), 7.);
143-
144- // / * z-vertex cut */
145- // if (std::abs(collision.posZ()) > 10.0) {
146- // return false;
147- // }
148- // registry.fill(HIST("debug/hEventCounter"), 8.);
117+ template <typename C>
118+ bool collisionPassesCuts (const C& collision)
119+ {
120+ /* good vertex */
121+ if (!collision.vtxITSTPC ()) {
122+ return false ;
123+ }
124+ registry.fill (HIST (" debug/hEventCounter" ), 4 .);
125+
126+ /* same bunch pile-up rejection */
127+ if (!collision.sbp ()) {
128+ return false ;
129+ }
130+ registry.fill (HIST (" debug/hEventCounter" ), 5 .);
131+
132+ /* ITS ROF rejection */
133+ if (!collision.itsROFb ()) {
134+ return false ;
135+ }
136+ registry.fill (HIST (" debug/hEventCounter" ), 6 .);
137+
138+ /* Timeframe border collision rejection */
139+ if (!collision.tfb ()) {
140+ return false ;
141+ }
142+ registry.fill (HIST (" debug/hEventCounter" ), 7 .);
143+
144+ /* z-vertex cut */
145+ if (std::abs (collision.posZ ()) > 10.0 ) {
146+ return false ;
147+ }
148+ registry.fill (HIST (" debug/hEventCounter" ), 8 .);
149149
150- // / * RCT flag check*/
151- // if (useRctFlag) {
152- // if (!isGoodRctFlag(collision)) {
153- // return false;
154- // }
155- // registry.fill(HIST("debug/hEventCounter"), 9.); // passed RCT flag
156- // }
157- // return true;
158- // }
150+ /* RCT flag check*/
151+ if (useRctFlag) {
152+ if (!isGoodRctFlag (collision)) {
153+ return false ;
154+ }
155+ registry.fill (HIST (" debug/hEventCounter" ), 9 .); // passed RCT flag
156+ }
157+ return true ;
158+ }
159159
160160 void init (InitContext&)
161161 {
@@ -195,12 +195,11 @@ struct UpcTestFITBitMapping {
195195 }
196196
197197 /* Checking collision level cuts */
198- // if (!collisionPassesCuts(collision)) {
199- // return;
200- // }
198+ if (!collisionPassesCuts (collision)) {
199+ return ;
200+ }
201201
202202 /* Only one row per collision is expected. */
203- // auto const& row = *fitBits.begin();
204203 auto row = fitBits.begin ();
205204
206205 udhelpers::Bits256 w{};
0 commit comments