1818#include " PWGUD/Core/UDHelpers.h"
1919#include " PWGUD/DataModel/UDTables.h"
2020
21- #include " Common/DataModel/PIDResponse.h"
22-
2321#include " CommonConstants/PhysicsConstants.h"
2422#include " Framework/ASoA.h"
2523#include " Framework/ASoAHelpers.h"
@@ -76,13 +74,18 @@ struct ExclusiveRhoTo4Pi {
7674 HistogramRegistry histosKin{" Kinematics" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
7775 HistogramRegistry histos4piKin{" Four-Pion-Kinematics" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
7876 HistogramRegistry histosMCtruth{" MC-Truth" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
77+ // Debugging
78+ Configurable<bool > debugMode{" debugMode" , false , " Enable Debug Mode" };
7979 // Configurable Event parameters
8080 Configurable<int > ifUPC{" ifUPC" , 1 , " Enable UPC reconstruction only" };
8181 Configurable<float > vZCut{" vZCut" , 10 ., " Vertex Cut" };
8282 Configurable<float > fv0Cut{" fv0Cut" , 50 ., " FV0A threshold" };
8383 Configurable<float > ft0aCut{" ft0aCut" , 50 ., " FT0A threshold" };
8484 Configurable<float > ft0cCut{" ft0cCut" , 50 ., " FT0C threshold" };
85- Configurable<float > zdcCut{" zdcCut" , 0 ., " ZDC threshold" };
85+ Configurable<float > zdcCut{" zdcCut" , 1e6 , " ZDC threshold" };
86+ Configurable<float > zdcMaxAmp{" zdcMaxAmp" , 0 , " ZDC max amplitude to be 0n" };
87+ Configurable<float > zdcMaxTime{" zdcMaxTime" , 2 , " ZDC max time in ns" };
88+ Configurable<std::string> neutronClass{" neutronClass" , " XnXn" , " Neutron class for ZDCs" };
8689 Configurable<uint16_t > numPVContrib{" numPVContrib" , 4 , " Number of PV Contributors" };
8790 Configurable<int > sbpCut{" sbpCut" , 1 , " Sbp" };
8891 Configurable<int > itsROFbCut{" itsROFbCut" , 1 , " itsROFbCut" };
@@ -128,8 +131,7 @@ struct ExclusiveRhoTo4Pi {
128131 histosQA.add (" Events/selected/FT0A" , " T0A amplitude" , kTH1F , {{500 , 0.0 , 500.0 }});
129132 histosQA.add (" Events/selected/FT0C" , " T0C amplitude" , kTH1F , {{500 , 0.0 , 500.0 }});
130133 histosQA.add (" Events/selected/FV0A" , " V0A amplitude" , kTH1F , {{100 , 0.0 , 100 }});
131- histosQA.add (" Events/selected/ZDC_A" , " ZDC amplitude" , kTH1F , {{10000 , 0.0 , 10000 }});
132- histosQA.add (" Events/selected/ZDC_C" , " ZDC amplitude" , kTH1F , {{10000 , 0.0 , 10000 }});
134+ histosQA.add (" Events/selected/ZDC" , " ; ZDC A; ZDC C; time ZDC A [ns]; time ZDC C [ns]" , kTHnSparseF , {{200 , -10 , 1000 }, {200 , -10 , 1000 }, {400 , -10 , 50 }, {400 , -10 , 10 }});
133135 histosQA.add (" Events/selected/FDDA" , " FDD A signal; FDD A signal; Counts" , kTH1F , {{500 , 0.0 , 2000 }});
134136 histosQA.add (" Events/selected/FDDC" , " FDD C signal; FDD C signal; Counts" , kTH1F , {{500 , 0.0 , 2000 }});
135137 histosQA.add (" Events/selected/vertexX" , " Vertex X; Vertex X [cm]; Counts" , kTH1F , {{2000 , -0.05 , 0.05 }});
@@ -147,8 +149,7 @@ struct ExclusiveRhoTo4Pi {
147149 histosQA.add (" Events/4pion/FT0A" , " T0A amplitude" , kTH1F , {{500 , 0.0 , 500.0 }});
148150 histosQA.add (" Events/4pion/FT0C" , " T0C amplitude" , kTH1F , {{500 , 0.0 , 500.0 }});
149151 histosQA.add (" Events/4pion/FV0A" , " V0A amplitude" , kTH1F , {{100 , 0.0 , 100 }});
150- histosQA.add (" Events/4pion/ZDC_A" , " ZDC amplitude" , kTH1F , {{10000 , 0.0 , 10000 }});
151- histosQA.add (" Events/4pion/ZDC_C" , " ZDC amplitude" , kTH1F , {{10000 , 0.0 , 10000 }});
152+ histosQA.add (" Events/4pion/ZDC" , " ; ZDC A; ZDC C; time ZDC A; time ZDC C" , kTHnSparseF , {{200 , -10 , 1000 }, {200 , -10 , 1000 }, {400 , -10 , 50 }, {400 , -10 , 10 }});
152153 histosQA.add (" Events/4pion/FDDA" , " FDD A signal; FDD A signal; Counts" , kTH1F , {{500 , 0.0 , 2000 }});
153154 histosQA.add (" Events/4pion/FDDC" , " FDD C signal; FDD C signal; Counts" , kTH1F , {{500 , 0.0 , 2000 }});
154155 histosQA.add (" Events/4pion/vertexX" , " Vertex X; Vertex X [cm]; Counts" , kTH1F , {{2000 , -0.05 , 0.05 }});
@@ -257,12 +258,14 @@ struct ExclusiveRhoTo4Pi {
257258 histosMCtruth.add (" Four-pion" , " ;pT [GeV/c]; #eta; #varphi [rad];y; m_{4#pi} [GeV/c^{2}];Run Number" , kTHnSparseF , {pTAxis, etaAxis, phiAxis, rapidityAxis, invMassAxis, {113 , 0 , 113 }});
258259 // _______________________________________________________________________________________________________________________________________________
259260 setHistBinLabels ();
260- histosDataCounter.print ();
261- histosQA.print ();
262- histosPID.print ();
263- histosKin.print ();
264- histos4piKin.print ();
265- histosMCtruth.print ();
261+ if (debugMode) {
262+ histosDataCounter.print ();
263+ histosQA.print ();
264+ histosPID.print ();
265+ histosKin.print ();
266+ histos4piKin.print ();
267+ histosMCtruth.print ();
268+ }
266269 } // End of init function
267270
268271 // ---------------------------------------------------------------------------------------------------------------------------------------------
@@ -304,8 +307,7 @@ struct ExclusiveRhoTo4Pi {
304307 histosQA.fill (HIST (" Events/selected/FV0A" ), collision.totalFV0AmplitudeA ());
305308 histosQA.fill (HIST (" Events/selected/FT0A" ), collision.totalFT0AmplitudeA ());
306309 histosQA.fill (HIST (" Events/selected/FT0C" ), collision.totalFT0AmplitudeC ());
307- histosQA.fill (HIST (" Events/selected/ZDC_A" ), collision.energyCommonZNA ());
308- histosQA.fill (HIST (" Events/selected/ZDC_C" ), collision.energyCommonZNC ());
310+ histosQA.fill (HIST (" Events/selected/ZDC" ), collision.energyCommonZNA (), collision.energyCommonZNC (), collision.timeZNA (), collision.timeZNC ());
309311 histosQA.fill (HIST (" Events/selected/FDDA" ), collision.totalFDDAmplitudeA ());
310312 histosQA.fill (HIST (" Events/selected/FDDC" ), collision.totalFDDAmplitudeC ());
311313
@@ -440,8 +442,7 @@ struct ExclusiveRhoTo4Pi {
440442 histosQA.fill (HIST (" Events/4pion/FV0A" ), collision.totalFV0AmplitudeA ());
441443 histosQA.fill (HIST (" Events/4pion/FT0A" ), collision.totalFT0AmplitudeA ());
442444 histosQA.fill (HIST (" Events/4pion/FT0C" ), collision.totalFT0AmplitudeC ());
443- histosQA.fill (HIST (" Events/4pion/ZDC_A" ), collision.energyCommonZNA ());
444- histosQA.fill (HIST (" Events/4pion/ZDC_C" ), collision.energyCommonZNC ());
445+ histosQA.fill (HIST (" Events/4pion/ZDC" ), collision.energyCommonZNA (), collision.energyCommonZNC (), collision.timeZNA (), collision.timeZNC ());
445446 histosQA.fill (HIST (" Events/4pion/FDDA" ), collision.totalFDDAmplitudeA ());
446447 histosQA.fill (HIST (" Events/4pion/FDDC" ), collision.totalFDDAmplitudeC ());
447448
@@ -585,7 +586,7 @@ struct ExclusiveRhoTo4Pi {
585586 }
586587 histosDataCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 9 );
587588 // ZDC
588- if (collision. energyCommonZNA () > zdcCut || collision. energyCommonZNC () > zdcCut ) {
589+ if (! neutronClassSelection ( collision) ) {
589590 return ;
590591 }
591592 histosDataCounter.fill (HIST (" EventsCounts_vs_runNo" ), getRunNumberIndex (collision.runNumber ()), 10 );
@@ -746,8 +747,7 @@ struct ExclusiveRhoTo4Pi {
746747 histosQA.fill (HIST (" Events/selected/FV0A" ), collision.totalFV0AmplitudeA ());
747748 histosQA.fill (HIST (" Events/selected/FT0A" ), collision.totalFT0AmplitudeA ());
748749 histosQA.fill (HIST (" Events/selected/FT0C" ), collision.totalFT0AmplitudeC ());
749- histosQA.fill (HIST (" Events/selected/ZDC_A" ), collision.energyCommonZNA ());
750- histosQA.fill (HIST (" Events/selected/ZDC_C" ), collision.energyCommonZNC ());
750+ histosQA.fill (HIST (" Events/selected/ZDC" ), collision.energyCommonZNA (), collision.energyCommonZNC (), collision.timeZNA (), collision.timeZNC ());
751751 histosQA.fill (HIST (" Events/selected/FDDA" ), collision.totalFDDAmplitudeA ());
752752 histosQA.fill (HIST (" Events/selected/FDDC" ), collision.totalFDDAmplitudeC ());
753753
@@ -885,8 +885,7 @@ struct ExclusiveRhoTo4Pi {
885885 histosQA.fill (HIST (" Events/4pion/FV0A" ), collision.totalFV0AmplitudeA ());
886886 histosQA.fill (HIST (" Events/4pion/FT0A" ), collision.totalFT0AmplitudeA ());
887887 histosQA.fill (HIST (" Events/4pion/FT0C" ), collision.totalFT0AmplitudeC ());
888- histosQA.fill (HIST (" Events/4pion/ZDC_A" ), collision.energyCommonZNA ());
889- histosQA.fill (HIST (" Events/4pion/ZDC_C" ), collision.energyCommonZNC ());
888+ histosQA.fill (HIST (" Events/4pion/ZDC" ), collision.energyCommonZNA (), collision.energyCommonZNC (), collision.timeZNA (), collision.timeZNC ());
890889 histosQA.fill (HIST (" Events/4pion/FDDA" ), collision.totalFDDAmplitudeA ());
891890 histosQA.fill (HIST (" Events/4pion/FDDC" ), collision.totalFDDAmplitudeC ());
892891
@@ -1186,6 +1185,45 @@ struct ExclusiveRhoTo4Pi {
11861185 return cosThetaCS;
11871186 }
11881187
1188+ template <typename C>
1189+ bool neutronClassSelection (C const & coll)
1190+ {
1191+
1192+ bool aXn = coll.energyCommonZNA () > zdcMaxAmp && coll.timeZNA () < zdcMaxTime;
1193+ bool a0n = coll.energyCommonZNA () <= zdcMaxAmp;
1194+ bool cXn = coll.energyCommonZNC () > zdcMaxAmp && coll.timeZNC () < zdcMaxTime;
1195+ bool c0n = coll.energyCommonZNC () <= zdcMaxAmp;
1196+
1197+ if (this ->neutronClass .value == " XnXn" ) {
1198+ if (aXn && cXn) {
1199+ return true ;
1200+ } else {
1201+ return false ;
1202+ }
1203+ } else if (this ->neutronClass .value == " Xn0n" ) {
1204+ if (aXn && c0n) {
1205+ return true ;
1206+ } else {
1207+ return false ;
1208+ }
1209+ } else if (this ->neutronClass .value == " 0nXn" ) {
1210+ if (a0n && cXn) {
1211+ return true ;
1212+ } else {
1213+ return false ;
1214+ }
1215+ } else if (this ->neutronClass .value == " 0n0n" ) {
1216+ if (a0n && c0n) {
1217+ return true ;
1218+ } else {
1219+ return false ;
1220+ }
1221+ } else {
1222+ // "Any" class
1223+ return true ;
1224+ }
1225+ } // End of Neutron class selection function
1226+
11891227 template <typename T>
11901228 bool isSelectedTrack (T const & track,
11911229 float ptcut,
@@ -1309,7 +1347,7 @@ struct ExclusiveRhoTo4Pi {
13091347 " FT0A<=" + strFormat (fv0Cut),
13101348 " FT0C<=" + strFormat (ft0cCut),
13111349 " FV0A<=" + strFormat (ft0aCut),
1312- " ZDC " ,
1350+ " Neutron Class: " + neutronClass. value ,
13131351 " n PV Contrib = 4" ,
13141352 " V_{z} < " + strFormat (vZCut) + " cm" };
13151353 int numEventCuts = 13 ;
0 commit comments