Skip to content

Commit 37f001e

Browse files
victor-gonzalezVictor
andauthored
[PWGCF] DptDpt - Implementing linter recommendations (#11299)
Co-authored-by: Victor <victor@cern.ch>
1 parent 556fcbb commit 37f001e

File tree

6 files changed

+186
-166
lines changed

6 files changed

+186
-166
lines changed

PWGCF/TableProducer/dptDptFilter.cxx

Lines changed: 65 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ struct Multiplicity {
210210

211211
MultEst classestimator = kV0M;
212212

213+
static constexpr float kForMultiplicityPtLowLimit = 0.001f;
214+
static constexpr float kForMultiplicityPtHighLimit = 50.0f;
213215
float multiplicityClass = -1.0;
214216
float multiplicity = 0.0;
215217
bool inelgth0 = false;
@@ -277,16 +279,16 @@ struct Multiplicity {
277279
case kProton:
278280
/* not clear if we should use IsPhysicalPrimary here */
279281
/* TODO: adapt to FT0M Run 3 and other estimators */
280-
if (0.001 < p.pt() && p.pt() < 50.0) {
281-
if (p.eta() < 1.0 && -1.0 < p.eta()) {
282+
if (kForMultiplicityPtLowLimit < p.pt() && p.pt() < kForMultiplicityPtHighLimit) {
283+
if (p.eta() < 1.0f && -1.0f < p.eta()) {
282284
inelgth0 = true;
283285
}
284-
addTo(p, v0am, 2.8, 5.1);
285-
addTo(p, v0cm, -3.7, -1.7);
286-
addTo(p, cl1m, -1.4, 1.4);
287-
addTo(p, cl1EtaGapM, -1.4, -0.8);
288-
addTo(p, cl1EtaGapM, 0.8, 1.4);
289-
addTo(p, dNchdEta, -0.5, 0.5);
286+
addTo(p, v0am, 2.8f, 5.1f);
287+
addTo(p, v0cm, -3.7f, -1.7f);
288+
addTo(p, cl1m, -1.4f, 1.4f);
289+
addTo(p, cl1EtaGapM, -1.4f, -0.8f);
290+
addTo(p, cl1EtaGapM, 0.8f, 1.4f);
291+
addTo(p, dNchdEta, -0.5f, 0.5f);
290292
nPart++;
291293
}
292294
break;
@@ -359,13 +361,13 @@ struct Multiplicity {
359361

360362
struct DptDptFilter {
361363
struct : ConfigurableGroup {
362-
Configurable<std::string> cfgCCDBUrl{"input_ccdburl", "http://ccdb-test.cern.ch:8080", "The CCDB url for the input file"};
363-
Configurable<std::string> cfgCCDBPathName{"input_ccdbpath", "", "The CCDB path for the input file. Default \"\", i.e. don't load from CCDB"};
364-
Configurable<std::string> cfgCCDBDate{"input_ccdbdate", "20220307", "The CCDB date for the input file"};
365-
Configurable<std::string> cfgCCDBPeriod{"input_ccdbperiod", "LHC22o", "The CCDB dataset period for the input file"};
364+
Configurable<std::string> cfgCCDBUrl{"cfgCCDBUrl", "http://ccdb-test.cern.ch:8080", "The CCDB url for the input file"};
365+
Configurable<std::string> cfgCCDBPathName{"cfgCCDBPathName", "", "The CCDB path for the input file. Default \"\", i.e. don't load from CCDB"};
366+
Configurable<std::string> cfgCCDBDate{"cfgCCDBDate", "20220307", "The CCDB date for the input file"};
367+
Configurable<std::string> cfgCCDBPeriod{"cfgCCDBPeriod", "LHC22o", "The CCDB dataset period for the input file"};
366368
} cfginputfile;
367-
Configurable<bool> cfgFullDerivedData{"fullderiveddata", false, "Produce the full derived data for external storage. Default false"};
368-
Configurable<std::string> cfgCentMultEstimator{"centmultestimator", "V0M", "Centrality/multiplicity estimator detector: V0M,CL0,CL1,FV0A,FT0M,FT0A,FT0C,NTPV,NOCM: none. Default V0M"};
369+
Configurable<bool> cfgFullDerivedData{"cfgFullDerivedData", false, "Produce the full derived data for external storage. Default false"};
370+
Configurable<std::string> cfgCentMultEstimator{"cfgCentMultEstimator", "V0M", "Centrality/multiplicity estimator detector: V0M,CL0,CL1,FV0A,FT0M,FT0A,FT0C,NTPV,NOCM: none. Default V0M"};
369371

370372
struct : ConfigurableGroup {
371373
std::string prefix = "cfgEventSelection";
@@ -379,11 +381,11 @@ struct DptDptFilter {
379381
Configurable<float> cfgMaxOccupancy{"cfgMaxOccupancy", 1e6f, "Maximum allowed occupancy. Depends on the occupancy estimation"};
380382
} cfgOccupancySelection;
381383
} cfgEventSelection;
382-
Configurable<std::string> cfgSystem{"syst", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3, PbPbRun3. Default PbPb"};
383-
Configurable<std::string> cfgDataType{"datatype", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"};
384-
Configurable<std::string> cfgTriggSel{"triggsel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"};
385-
Configurable<std::string> cfgCentSpec{"centralities", "00-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80", "Centrality/multiplicity ranges in min-max separated by commas"};
386-
Configurable<float> cfgOverallMinP{"overallminp", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"};
384+
Configurable<std::string> cfgSystem{"cfgSystem", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3, PbPbRun3. Default PbPb"};
385+
Configurable<std::string> cfgDataType{"cfgDataType", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"};
386+
Configurable<std::string> cfgTriggSel{"cfgTriggSel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"};
387+
Configurable<std::string> cfgCentSpec{"cfgCentSpec", "00-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80", "Centrality/multiplicity ranges in min-max separated by commas"};
388+
Configurable<float> cfgOverallMinP{"cfgOverallMinP", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"};
387389
struct : ConfigurableGroup {
388390
std::string prefix = "cfgTpcExclusion";
389391
Configurable<int> method{"method", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"};
@@ -392,10 +394,10 @@ struct DptDptFilter {
392394
Configurable<std::string> negativeLowCut{"negativeLowCut", "pi/9.0 - (0.0892/x + 0.0251)", "The lower cut function for negative tracks"};
393395
Configurable<std::string> negativeUpCut{"negativeUpCut", "pi/9 - (0.0787/x - 0.0236)", "The upper cut function for negative tracks"};
394396
} cfgTpcExclusion;
395-
Configurable<o2::analysis::DptDptBinningCuts> cfgBinning{"binning",
397+
Configurable<o2::analysis::DptDptBinningCuts> cfgBinning{"cfgBinning",
396398
{28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5},
397399
"triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"};
398-
Configurable<bool> cfgTraceCollId0{"tracecollid0", false, "Trace particles in collisions id 0. Default false"};
400+
Configurable<bool> cfgTraceCollId0{"cfgTraceCollId0", false, "Trace particles in collisions id 0. Default false"};
399401

400402
OutputObj<TList> fOutput{"DptDptFilterCollisionsInfo", OutputObjHandlingPolicy::AnalysisObject};
401403

@@ -794,27 +796,27 @@ struct DptDptFilterTracks {
794796
std::string cfgCCDBDate{"20220307"};
795797
std::string cfgCCDBPeriod{"LHC22o"};
796798

797-
Configurable<bool> cfgOutDebugInfo{"outdebuginfo", false, "Out detailed debug information per track into a text file. Default false"};
798-
Configurable<bool> cfgFullDerivedData{"fullderiveddata", false, "Produce the full derived data for external storage. Default false"};
799-
Configurable<int> cfgTrackType{"trktype", 4, "Type of selected tracks: 0 = no selection;1 = Run2 global tracks FB96;3 = Run3 tracks;4 = Run3 tracks MM sel;5 = Run2 TPC only tracks;7 = Run 3 TPC only tracks;30-33 = any/two on 3 ITS,any/all in 7 ITS;40-43 same as 30-33 w tighter DCAxy;50-53 w tighter pT DCAz. Default 4"};
800-
Configurable<bool> cfgOnlyInOneSide{"onlyinoneside", false, "select tracks that don't cross the TPC central membrane. Default false"};
801-
Configurable<o2::analysis::CheckRangeCfg> cfgTraceDCAOutliers{"trackdcaoutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"};
802-
Configurable<float> cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"};
803-
Configurable<int> cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 No PID, 1 PID, 2 mcparticle, 3 mcparticle only primaries, 4 mcparticle only sec, 5 mcparicle only sec from decays, 6 mcparticle only sec from material. Default 0"};
804-
Configurable<o2::analysis::TrackSelectionTuneCfg> cfgTuneTrackSelection{"tunetracksel", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, tpcshcls-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,0.4,false,2.4,false,3.2,false}"};
805-
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgPionPIDSelection{"pipidsel",
799+
Configurable<bool> cfgOutDebugInfo{"cfgOutDebugInfo", false, "Out detailed debug information per track into a text file. Default false"};
800+
Configurable<bool> cfgFullDerivedData{"cfgFullDerivedData", false, "Produce the full derived data for external storage. Default false"};
801+
Configurable<int> cfgTrackType{"cfgTrackType", 4, "Type of selected tracks: 0 = no selection;1 = Run2 global tracks FB96;3 = Run3 tracks;4 = Run3 tracks MM sel;5 = Run2 TPC only tracks;7 = Run 3 TPC only tracks;30-33 = any/two on 3 ITS,any/all in 7 ITS;40-43 same as 30-33 w tighter DCAxy;50-53 w tighter pT DCAz. Default 4"};
802+
Configurable<bool> cfgOnlyInOneSide{"cfgOnlyInOneSide", false, "select tracks that don't cross the TPC central membrane. Default false"};
803+
Configurable<o2::analysis::CheckRangeCfg> cfgTraceDCAOutliers{"cfgTraceDCAOutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"};
804+
Configurable<float> cfgTraceOutOfSpeciesParticles{"cfgTraceOutOfSpeciesParticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"};
805+
Configurable<int> cfgRecoIdMethod{"cfgRecoIdMethod", 0, "Method for identifying reconstructed tracks: 0 No PID, 1 PID, 2 mcparticle, 3 mcparticle only primaries, 4 mcparticle only sec, 5 mcparicle only sec from decays, 6 mcparticle only sec from material. Default 0"};
806+
Configurable<o2::analysis::TrackSelectionTuneCfg> cfgTuneTrackSelection{"cfgTuneTrackSelection", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, tpcshcls-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,0.4,false,2.4,false,3.2,false}"};
807+
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgPionPIDSelection{"cfgPionPIDSelection",
806808
{},
807809
"PID criteria for pions"};
808-
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgKaonPIDSelection{"kapidsel",
810+
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgKaonPIDSelection{"cfgKaonPIDSelection",
809811
{},
810812
"PID criteria for kaons"};
811-
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgProtonPIDSelection{"prpidsel",
813+
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgProtonPIDSelection{"cfgProtonPIDSelection",
812814
{},
813815
"PID criteria for protons"};
814-
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgElectronPIDSelection{"elpidsel",
816+
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgElectronPIDSelection{"cfgElectronPIDSelection",
815817
{},
816818
"PID criteria for electrons"};
817-
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgMuonPIDSelection{"mupidsel",
819+
Configurable<o2::analysis::TrackSelectionPIDCfg> cfgMuonPIDSelection{"cfgMuonPIDSelection",
818820
{},
819821
"PID criteria for muons"};
820822

@@ -833,18 +835,18 @@ struct DptDptFilterTracks {
833835

834836
/* update with the configurable values */
835837
/* self configure the binning */
836-
getTaskOptionValue(initContext, "dpt-dpt-filter", "overallminp", overallminp, false);
837-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mZVtxbins", zvtxbins, false);
838-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mZVtxmin", zvtxlow, false);
839-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mZVtxmax", zvtxup, false);
840-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPTbins", ptbins, false);
841-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPTmin", ptlow, false);
842-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPTmax", ptup, false);
843-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtabins", etabins, false);
844-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtamin", etalow, false);
845-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtamax", etaup, false);
846-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPhibins", phibins, false);
847-
getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPhibinshift", phibinshift, false);
838+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgOverallMinP", overallminp, false);
839+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mZVtxbins", zvtxbins, false);
840+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mZVtxmin", zvtxlow, false);
841+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mZVtxmax", zvtxup, false);
842+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPTbins", ptbins, false);
843+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPTmin", ptlow, false);
844+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPTmax", ptup, false);
845+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mEtabins", etabins, false);
846+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mEtamin", etalow, false);
847+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mEtamax", etaup, false);
848+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPhibins", phibins, false);
849+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPhibinshift", phibinshift, false);
848850

849851
TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method
850852
std::string pLowCut;
@@ -861,10 +863,10 @@ struct DptDptFilterTracks {
861863
tpcExclude = static_cast<TpcExclusionMethod>(tmpTpcExclude);
862864
}
863865
/* self configure the CCDB access to the input file */
864-
getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdburl", cfgCCDBUrl, false);
865-
getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdbpath", cfgCCDBPathName, false);
866-
getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdbdate", cfgCCDBDate, false);
867-
getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdbperiod", cfgCCDBPeriod, false);
866+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgCCDBUrl", cfgCCDBUrl, false);
867+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgCCDBPathName", cfgCCDBPathName, false);
868+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgCCDBDate", cfgCCDBDate, false);
869+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgCCDBPeriod", cfgCCDBPeriod, false);
868870

869871
/* create the output list which will own the task histograms */
870872
TList* fOutputList = new TList();
@@ -892,9 +894,9 @@ struct DptDptFilterTracks {
892894
/* self configure system type and data type */
893895
/* if the system type is not known at this time, we have to put the initialization somewhere else */
894896
std::string tmpstr;
895-
getTaskOptionValue(initContext, "dpt-dpt-filter", "syst", tmpstr, false);
897+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgSystem", tmpstr, false);
896898
fSystem = getSystemType(tmpstr);
897-
getTaskOptionValue(initContext, "dpt-dpt-filter", "datatype", tmpstr, false);
899+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgDataType", tmpstr, false);
898900
fDataType = getDataType(tmpstr);
899901

900902
/* required ambiguous tracks checks? */
@@ -1536,8 +1538,14 @@ int8_t DptDptFilterTracks::selectTrack(TrackObject const& track)
15361538
template <StrongDebugging outdebug, typename CollisionObjects, typename TrackObject>
15371539
int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& collisions, TrackObject const& track)
15381540
{
1541+
enum AmbiguityTypes {
1542+
kNoAmbiguous = 0, /* no ambiguous track */
1543+
kOnePossibilitySame = 1, /* the track is present in the collision association table but has the same associated collision so the track is not ambiguous */
1544+
kOnePossibilityDifferent = 2, /* the track is present in the collision association table and has a diffetent collision associeted so the track is ambiguous */
1545+
kMoreThanOnePossibility = 3 /* the track is associated to more than one collision in the collision association table so the track is ambiguous */
1546+
};
15391547
bool ambiguoustrack = false;
1540-
int ambtracktype = 0; /* no ambiguous */
1548+
AmbiguityTypes ambtracktype = kNoAmbiguous;
15411549
std::vector<double> zvertexes{};
15421550
/* ambiguous tracks checks if required */
15431551
if constexpr (has_type_v<aod::track_association::CollisionIds, typename TrackObject::all_columns>) {
@@ -1547,17 +1555,17 @@ int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& col
15471555
/* ambiguous track! */
15481556
ambiguoustrack = true;
15491557
/* in principle we should not be here because the track is associated to two collisions at least */
1550-
ambtracktype = 2;
1558+
ambtracktype = kOnePossibilityDifferent;
15511559
zvertexes.push_back(collisions.iteratorAt(track.collisionId()).posZ());
15521560
zvertexes.push_back(collisions.iteratorAt(track.compatibleCollIds()[0]).posZ());
15531561
} else {
15541562
/* we consider the track as no ambiguous */
1555-
ambtracktype = 1;
1563+
ambtracktype = kOnePossibilitySame;
15561564
}
15571565
} else {
15581566
/* ambiguous track! */
15591567
ambiguoustrack = true;
1560-
ambtracktype = 3;
1568+
ambtracktype = kMoreThanOnePossibility;
15611569
/* the track is associated to more than one collision */
15621570
for (const auto& collIdx : track.compatibleCollIds()) {
15631571
zvertexes.push_back(collisions.iteratorAt(collIdx).posZ());
@@ -1572,7 +1580,7 @@ int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& col
15721580
fhAmbiguousTrackType->Fill(ambtracktype, multiplicityClass);
15731581
fhAmbiguousTrackPt->Fill(track.pt(), multiplicityClass);
15741582
fhAmbiguityDegree->Fill(zvertexes.size(), multiplicityClass);
1575-
if (ambtracktype == 2) {
1583+
if (ambtracktype == kOnePossibilityDifferent) {
15761584
fhCompatibleCollisionsZVtxRms->Fill(-computeRMS(zvertexes), multiplicityClass);
15771585
} else {
15781586
fhCompatibleCollisionsZVtxRms->Fill(computeRMS(zvertexes), multiplicityClass);

0 commit comments

Comments
 (0)