Skip to content

Commit eb0e592

Browse files
Internal codes for centrality/multiplicity estimators names (#4378)
Also - processpairs flag also added to filter task for easier configuration - filter task configuration params to output file - default the benchmark configuration (--)
1 parent bf6eeae commit eb0e592

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

Analysis/Tasks/PWGCF/dptdptcorrelations.cxx

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,24 @@ enum SystemType {
105105
knSystems ///< number of handled systems
106106
};
107107

108+
/// \enum CentMultEstimatorType
109+
/// \brief The detector used to estimate centrality/multiplicity
110+
enum CentMultEstimatorType {
111+
kV0M = 0, ///< V0M centrality/multiplicity estimator
112+
kV0A, ///< V0A centrality/multiplicity estimator
113+
kV0C, ///< V0C centrality/multiplicity estimator
114+
kCL0, ///< CL0 centrality/multiplicity estimator
115+
kCL1, ///< CL1 centrality/multiplicity estimator
116+
knCentMultEstimators ///< number of centrality/mutiplicity estimator
117+
};
118+
108119
namespace filteranalyistask
109120
{
110121
//============================================================================================
111122
// The DptDptCorrelationsFilterAnalysisTask output objects
112123
//============================================================================================
113124
SystemType fSystem = kNoSystem;
125+
CentMultEstimatorType fCentMultEstimator = kV0M;
114126
TH1F* fhCentMultB = nullptr;
115127
TH1F* fhCentMultA = nullptr;
116128
TH1F* fhVertexZB = nullptr;
@@ -179,17 +191,23 @@ SystemType getSystemType()
179191
return kPbPb;
180192
}
181193

182-
bool IsEvtSelected(aod::CollisionEvSelCent const& collision, const std::string estimator, float& centormult)
194+
bool IsEvtSelected(aod::CollisionEvSelCent const& collision, float& centormult)
183195
{
196+
using namespace filteranalyistask;
197+
184198
if (collision.alias()[kINT7]) {
185199
if (collision.sel7()) {
186200
/* TODO: vertex quality checks */
187201
if (zvtxlow < collision.posZ() and collision.posZ() < zvtxup) {
188-
if (estimator.compare("V0M") == 0) {
189-
if (collision.centV0M() < 100 and 0 < collision.centV0M()) {
190-
centormult = collision.centV0M();
191-
return true;
192-
}
202+
switch (fCentMultEstimator) {
203+
case kV0M:
204+
if (collision.centV0M() < 100 and 0 < collision.centV0M()) {
205+
centormult = collision.centV0M();
206+
return true;
207+
}
208+
break;
209+
default:
210+
break;
193211
}
194212
return false;
195213
}
@@ -267,8 +285,9 @@ using namespace dptdptcorrelations;
267285
struct DptDptCorrelationsFilterAnalysisTask {
268286

269287
Configurable<int> cfgTrackType{"trktype", 1, "Type of selected tracks: 0 = no selection, 1 = global tracks loose DCA, 2 = global SDD tracks"};
270-
Configurable<int> cfgTrackOneCharge{"trk1charge", 1, "Trakc one charge: 1 = positive, -1 = negative"};
288+
Configurable<int> cfgTrackOneCharge{"trk1charge", -1, "Trakc one charge: 1 = positive, -1 = negative"};
271289
Configurable<int> cfgTrackTwoCharge{"trk2charge", -1, "Trakc two charge: 1 = positive, -1 = negative"};
290+
Configurable<bool> cfgProcessPairs{"processpairs", true, "Process pairs: false = no, just singles, true = yes, process pairs"};
272291
Configurable<std::string> cfgCentMultEstimator{"centmultestimator", "V0M", "Centrality/multiplicity estimator detector: default V0M"};
273292

274293
Configurable<o2::analysis::DptDptBinningCuts> cfgBinning{"binning",
@@ -285,6 +304,7 @@ struct DptDptCorrelationsFilterAnalysisTask {
285304
using namespace filteranalyistask;
286305

287306
/* update with the configurable values */
307+
/* the binning */
288308
ptbins = cfgBinning->mPTbins;
289309
ptlow = cfgBinning->mPTmin;
290310
ptup = cfgBinning->mPTmax;
@@ -294,9 +314,16 @@ struct DptDptCorrelationsFilterAnalysisTask {
294314
zvtxbins = cfgBinning->mZVtxbins;
295315
zvtxlow = cfgBinning->mZVtxmin;
296316
zvtxup = cfgBinning->mZVtxmax;
317+
/* the track types and combinations */
297318
tracktype = cfgTrackType.value;
298319
trackonecharge = cfgTrackOneCharge.value;
299320
tracktwocharge = cfgTrackTwoCharge.value;
321+
/* the centrality/multiplicity estimation */
322+
if (cfgCentMultEstimator->compare("V0M") == 0) {
323+
fCentMultEstimator = kV0M;
324+
} else {
325+
LOGF(FATAL, "Centrality/Multiplicity estimator %s not supported yet", cfgCentMultEstimator->c_str());
326+
}
300327

301328
/* if the system type is not known at this time, we have to put the initalization somewhere else */
302329
fSystem = getSystemType();
@@ -306,6 +333,11 @@ struct DptDptCorrelationsFilterAnalysisTask {
306333
fOutputList->SetOwner(true);
307334
fOutput.setObject(fOutputList);
308335

336+
/* incorporate configuration parameters to the output */
337+
fOutputList->Add(new TParameter<Int_t>("TrackType", cfgTrackType, 'f'));
338+
fOutputList->Add(new TParameter<Int_t>("TrackOneCharge", cfgTrackOneCharge, 'f'));
339+
fOutputList->Add(new TParameter<Int_t>("TrackTwoCharge", cfgTrackTwoCharge, 'f'));
340+
309341
/* create the histograms */
310342
if (fSystem > kPbp) {
311343
fhCentMultB = new TH1F("CentralityB", "Centrality before cut; centrality (%)", 100, 0, 100);
@@ -364,7 +396,7 @@ struct DptDptCorrelationsFilterAnalysisTask {
364396
fhVertexZB->Fill(collision.posZ());
365397
int acceptedevent = DPTDPT_FALSE;
366398
float centormult = -100.0;
367-
if (IsEvtSelected(collision, cfgCentMultEstimator, centormult)) {
399+
if (IsEvtSelected(collision, centormult)) {
368400
acceptedevent = DPTDPT_TRUE;
369401
fhCentMultA->Fill(collision.centV0M());
370402
fhVertexZA->Fill(collision.posZ());

0 commit comments

Comments
 (0)