Skip to content

Commit bc92e67

Browse files
committed
fix efficiency & cuts
1 parent e664aba commit bc92e67

1 file changed

Lines changed: 9 additions & 78 deletions

File tree

PWGUD/Tasks/flowCorrelationsUpc.cxx

Lines changed: 9 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -153,28 +153,20 @@ struct FlowCorrelationsUpc {
153153
O2_DEFINE_CONFIGURABLE(cfgCutMerging, float, 0.02, "Merging cut on track merge")
154154
O2_DEFINE_CONFIGURABLE(cfgRadiusLow, float, 0.8, "Low radius for merging cut")
155155
O2_DEFINE_CONFIGURABLE(cfgRadiusHigh, float, 2.5, "High radius for merging cut")
156-
O2_DEFINE_CONFIGURABLE(cfgIsGoodItsLayers, bool, false, "whether choose itslayers")
157156
O2_DEFINE_CONFIGURABLE(cfgDcaxy, bool, true, "choose dcaxy")
158157
O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz")
159158
O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut")
160-
O2_DEFINE_CONFIGURABLE(cfgItsClusterSize, unsigned int, 5, "ITS cluster size")
161159
O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2")
162-
O2_DEFINE_CONFIGURABLE(cfgEvSelOccupancy, bool, true, "Occupancy cut")
160+
O2_DEFINE_CONFIGURABLE(cfgCutOccupancy, bool, true, "Occupancy cut")
163161
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 1000, "High cut on TPC occupancy")
164162
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy")
165163
O2_DEFINE_CONFIGURABLE(cfgCutTPCCrossedRows, float, 70.0f, "minimum number of crossed TPC Rows")
166164
O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 50.0f, "minimum number of found TPC clusters")
167165
O2_DEFINE_CONFIGURABLE(cfgCutITSclu, float, 5.0f, "minimum number of ITS clusters")
168-
O2_DEFINE_CONFIGURABLE(cfgCutTPCChi2NCl, int, 4, "max chi2 per TPC clusters")
169166
O2_DEFINE_CONFIGURABLE(cfgGlobalTrack, bool, true, "require TPC+ITS track")
170167
O2_DEFINE_CONFIGURABLE(cfgUseNchCorrected, bool, true, "use corrected Nch for X axis")
171-
O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, false, "Fill and output NUA weights")
172-
O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeightsRefPt, bool, false, "NUA weights are filled in ref pt bins")
173-
O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeightsRunbyRun, bool, false, "NUA weights are filled run-by-run")
174168
O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object")
175-
O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object")
176169
O2_DEFINE_CONFIGURABLE(cfgUseEventWeights, bool, false, "Use event weights for mixed event")
177-
O2_DEFINE_CONFIGURABLE(cfgLocalEfficiency, bool, false, "Use local efficiency object")
178170

179171
ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for histograms"};
180172
ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"};
@@ -203,25 +195,23 @@ struct FlowCorrelationsUpc {
203195
ConfigurableAxis axisNch{"axisNch", {300, 0, 300}, "N_{ch}"};
204196

205197
// Corrections
206-
TH1D* mEfficiency = nullptr;
198+
TH3D* mEfficiency = nullptr;
207199
GFWWeights* mAcceptance = nullptr;
208200
bool correctionsLoaded = false;
209201

210202
// make the filters and cuts.
211203
Filter trackFilter = (aod::udtrack::isPVContributor == true);
212-
Filter collisionFilter = ((aod::udcollision::gapSide == (uint8_t)1 || aod::udcollision::gapSide == (uint8_t)0) && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && (aod::flowcorrupc::truegapside == 1 || aod::flowcorrupc::truegapside == 0));
204+
Filter collisionFilter = ((aod::udcollision::gapSide == (uint8_t)1 || aod::udcollision::gapSide == (uint8_t)0) && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (!cfgCutOccupancy || (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh)) && (aod::flowcorrupc::truegapside == 1 || aod::flowcorrupc::truegapside == 0));
213205

214206
// Connect to ccdb
215207
Service<ccdb::BasicCCDBManager> ccdb;
216208
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
217209

218210
OutputObj<GFWWeights> fWeights{GFWWeights("weights")};
219-
OutputObj<GFWWeights> fWeightsMc{GFWWeights("weightsMC")};
220211

221212
TAxis* fPtAxis = nullptr;
222213
int lastRunNumber = -1;
223-
std::vector<int> runNumbers;
224-
std::map<int, std::shared_ptr<TH3>> th3sPerRun; // map of TH3 histograms for all runs
214+
std::vector<int> runNumbers; // map of TH3 histograms for all runs
225215
std::vector<float> efficiencyCache;
226216

227217
using UdTracks = soa::Filtered<soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>>;
@@ -248,9 +238,6 @@ struct FlowCorrelationsUpc {
248238
registry.add("pT", "pT", {HistType::kTH1D, {axisPtTrigger}});
249239
registry.add("Nch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}});
250240
registry.add("zVtx", "zVtx", {HistType::kTH1D, {axisVertex}});
251-
registry.add("Nch_vs_zVtx", "Nch vs zVtx", {HistType::kTH2D, {axisVertex, axisMultiplicity}});
252-
registry.add("Nch_same", "Nch same event", {HistType::kTH1D, {axisMultiplicity}});
253-
registry.add("Nch_mixed", "Nch mixed event", {HistType::kTH1D, {axisMultiplicity}});
254241
registry.add("EtaCorrected", "Eta corrected", {HistType::kTH1D, {axisEta}});
255242
registry.add("pTCorrected", "pT corrected", {HistType::kTH1D, {axisPtTrigger}});
256243

@@ -273,13 +260,6 @@ struct FlowCorrelationsUpc {
273260
double* ptBins = &(axis.binEdges)[0];
274261
fPtAxis = new TAxis(nPtBins, ptBins);
275262

276-
if (cfgOutputNUAWeights) {
277-
fWeights->setPtBins(nPtBins, ptBins);
278-
fWeights->init(true, false);
279-
fWeightsMc->setPtBins(nPtBins, ptBins);
280-
fWeightsMc->init(true, false);
281-
}
282-
283263
std::vector<AxisSpec> corrAxis = {{axisSample, "Sample"},
284264
{axisVertex, "z-vtx (cm)"},
285265
{axisIndependent, "Independent (N_{ch} corrected)"},
@@ -333,6 +313,9 @@ struct FlowCorrelationsUpc {
333313
if (track.pt() < cfgPtCutMin || track.pt() > cfgPtCutMax) {
334314
return false;
335315
}
316+
if (cfgGlobalTrack && !(track.hasITS() && track.hasTPC())) {
317+
return false;
318+
}
336319
// registry.fill(HIST("hTrackCount"), 1.5);
337320
if (cfgDcaz && !(std::fabs(track.dcaZ()) < cfgDcazCut)) {
338321
return false;
@@ -361,28 +344,13 @@ struct FlowCorrelationsUpc {
361344
return true;
362345
}
363346

364-
void createOutputObjectsForRun(int runNumber)
365-
{
366-
const AxisSpec axisPhi{60, 0.0, constants::math::TwoPI, "#varphi"};
367-
std::shared_ptr<TH3> histPhiEtaVtxz = registry.add<TH3>(Form("%d/hPhiEtaVtxz", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {axisPhi, {64, -1.8, 1.8}, {40, -10, 10}}});
368-
th3sPerRun.insert(std::make_pair(runNumber, histPhiEtaVtxz));
369-
}
370-
371347
void loadCorrections(uint64_t timestamp)
372348
{
373349
if (correctionsLoaded) {
374350
return;
375351
}
376-
if (cfgAcceptance.value.empty() == false) {
377-
mAcceptance = ccdb->getForTimeStamp<GFWWeights>(cfgAcceptance, timestamp);
378-
if (mAcceptance) {
379-
LOGF(info, "Loaded acceptance weights from %s (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance);
380-
} else {
381-
LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance);
382-
}
383-
}
384352
if (cfgEfficiency.value.empty() == false) {
385-
mEfficiency = ccdb->getForTimeStamp<TH1D>(cfgEfficiency, timestamp);
353+
mEfficiency = ccdb->getForTimeStamp<TH3D>(cfgEfficiency, timestamp);
386354
if (mEfficiency == nullptr) {
387355
LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgEfficiency.value.c_str());
388356
}
@@ -418,11 +386,7 @@ struct FlowCorrelationsUpc {
418386
if (eff == 0)
419387
return false;
420388
weight_nue = 1. / eff;
421-
422-
if (mAcceptance)
423-
weight_nua = mAcceptance->getNUA(phi, eta, vtxz);
424-
else
425-
weight_nua = 1;
389+
weight_nua = 1.; // Set to 1 as NUA weight is not being used
426390
return true;
427391
}
428392

@@ -449,20 +413,6 @@ struct FlowCorrelationsUpc {
449413
registry.fill(HIST("pT"), pt);
450414
registry.fill(HIST("EtaCorrected"), eta, weff);
451415
registry.fill(HIST("pTCorrected"), pt, weff);
452-
453-
if (cfgOutputNUAWeights) {
454-
if (cfgOutputNUAWeightsRefPt) {
455-
if (pt > cfgPtCutMin && pt < cfgPtCutMax) {
456-
fWeights->fill(phi, eta, vtxz, pt, 0., 0);
457-
if (cfgOutputNUAWeightsRunbyRun)
458-
th3sPerRun[runNumber]->Fill(phi, eta, vtxz);
459-
}
460-
} else {
461-
fWeights->fill(phi, eta, vtxz, pt, 0., 0);
462-
if (cfgOutputNUAWeightsRunbyRun)
463-
th3sPerRun[runNumber]->Fill(phi, eta, vtxz);
464-
}
465-
}
466416
}
467417
}
468418

@@ -528,12 +478,6 @@ struct FlowCorrelationsUpc {
528478
getEfficiencyCorrection(weff2, eta2, pt2, vtxz);
529479
}
530480

531-
if (mAcceptance) {
532-
wacc2 = mAcceptance->getNUA(phi2, eta2, vtxz);
533-
} else {
534-
wacc2 = 1;
535-
}
536-
537481
float deltaPhi = RecoDecay::constrainAngle(phi1 - phi2, -PIHalf);
538482
float deltaEta = eta1 - eta2;
539483

@@ -585,19 +529,6 @@ struct FlowCorrelationsUpc {
585529

586530
loadCorrections(runDuration.first);
587531

588-
if (cfgOutputNUAWeightsRunbyRun && currentRunNumber != lastRunNumber) {
589-
lastRunNumber = currentRunNumber;
590-
if (std::find(runNumbers.begin(), runNumbers.end(), currentRunNumber) == runNumbers.end()) {
591-
createOutputObjectsForRun(currentRunNumber);
592-
runNumbers.push_back(currentRunNumber);
593-
}
594-
595-
if (th3sPerRun.find(currentRunNumber) == th3sPerRun.end()) {
596-
LOGF(fatal, "RunNumber %d not found in th3sPerRun", currentRunNumber);
597-
return;
598-
}
599-
}
600-
601532
registry.fill(HIST("eventcont"), 3.5);
602533

603534
//-----------independent---------------

0 commit comments

Comments
 (0)