Skip to content

Commit 418ba8f

Browse files
authored
[EMCAL-524, EMCAL-530] Adjustable multiplicity ranges (#1926)
Mutliplicity ranges can now be configured via the task parameters for the cell task and the cluster task. Needed in order to optimise histogram binning for pp and PbPb runs which have very different ranges.
1 parent 6c6b34d commit 418ba8f

4 files changed

Lines changed: 154 additions & 61 deletions

File tree

Modules/EMCAL/include/EMCAL/CellTask.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,18 @@ class CellTask final : public TaskInterface
6565
bool mHasTimeVsCellID;
6666
bool mHasHistosCalib;
6767
bool mCalibrateEnergy;
68+
bool mIsHighMultiplicity;
6869

6970
double mAmpThresholdTimePhys = 0.15;
7071
double mAmpThresholdTimeCalib = 0.3;
7172
double mThresholdPHYS = 0.2;
7273
double mThresholdCAL = 0.5;
74+
75+
int mMultiplicityRange = 0;
76+
int mMultiplicityRangeDetector = 0;
77+
int mMultiplicityRangeThreshold = 0;
78+
int mMultiplicityRangeSM = 0;
79+
int mMultiplicityRangeSMThreshold = 0;
7380
};
7481
struct CellHistograms {
7582
o2::emcal::Geometry* mGeometry;
@@ -169,6 +176,9 @@ class CellTask final : public TaskInterface
169176
return mSubevents.size();
170177
};
171178
};
179+
void parseMultiplicityRanges();
180+
void initDefaultMultiplicityRanges();
181+
172182
std::vector<CombinedEvent> buildCombinedEvents(const std::unordered_map<header::DataHeader::SubSpecificationType, gsl::span<const o2::emcal::TriggerRecord>>& triggerrecords) const;
173183
TaskSettings mTaskSettings; ///< Settings of the task steered via task parameters
174184
Bool_t mIgnoreTriggerTypes = false; ///< Do not differenciate between trigger types, treat all triggers as phys. triggers

Modules/EMCAL/include/EMCAL/ClusterTask.h

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ class ClusterTask final : public TaskInterface
113113
void print(std::ostream& stream) const;
114114
};
115115

116+
/// \struct TaskParams
117+
/// \brief Other task parameters
118+
struct TaskParams {
119+
bool mInternalClusterizer = false; ///< Use run internal clusterizer, do not subscribe to external cluster collection
120+
bool mCalibrate = false; ///< Perform recalibration
121+
bool mFillInvMassMeson = false; ///< Fill invariant mass of meson candidates
122+
bool mFillControlHistograms = false; ///< Fill control histograms at cell level
123+
int mMultiplicityRange = 200; ///< Range for multiplicity histograms
124+
125+
/// \brief Print task parameters to output stream
126+
/// \param stream Stream used for printing
127+
void print(std::ostream& stream) const;
128+
};
129+
116130
/// \brief Constructor
117131
ClusterTask() = default;
118132
/// \brief Destructor
@@ -201,6 +215,9 @@ class ClusterTask final : public TaskInterface
201215
/// \brief Configure meson selection (cluster and pair cuts) for meson candidate histograms
202216
void configureMesonSelection();
203217

218+
/// \brief Configure task parameters
219+
void configureTaskParameters();
220+
204221
/// \brief Check for config value in taskParameter list
205222
/// \param key Key to check
206223
/// \return true if the key is found in the taskParameters, false otherwise
@@ -238,6 +255,7 @@ class ClusterTask final : public TaskInterface
238255
std::unique_ptr<o2::emcal::EventHandler<o2::emcal::Cell>> mEventHandler; ///< Event handler for event loop
239256
std::unique_ptr<o2::emcal::ClusterFactory<o2::emcal::Cell>> mClusterFactory; ///< Cluster factory for cluster kinematics
240257
std::unique_ptr<o2::emcal::Clusterizer<o2::emcal::Cell>> mClusterizer; ///< Internal clusterizer
258+
TaskParams mTaskParameters; ///< Task parameters (i.e. histogram ranges)
241259
ClusterizerParams mClusterizerSettings; ///< Settings for internal clusterizer
242260
InputBindings mTaskInputBindings; ///< Bindings for input containers
243261
MesonClusterSelection mMesonClusterCuts; ///< Cuts used in the meson selection
@@ -250,11 +268,6 @@ class ClusterTask final : public TaskInterface
250268
o2::emcal::TimeCalibrationParams* mTimeCalib = nullptr; ///< EMCAL time calib
251269
o2::emcal::GainCalibrationFactors* mEnergyCalib = nullptr; ///< EMCAL energy calib factors
252270

253-
bool mInternalClusterizer = false; ///< Use run internal clusterizer, do not subscribe to external cluster collection
254-
bool mCalibrate = false; ///< Perform recalibration
255-
bool mFillInvMassMeson = false; ///< Fill invariant mass of meson candidates
256-
bool mFillControlHistograms = false; ///< Fill control histograms at cell level
257-
258271
///////////////////////////////////////////////////////////////////////////////
259272
/// Control histograms input cells ///
260273
///////////////////////////////////////////////////////////////////////////////
@@ -331,6 +344,12 @@ std::ostream& operator<<(std::ostream& stream, const ClusterTask::MesonClusterSe
331344
/// \return Stream after printing the cuts
332345
std::ostream& operator<<(std::ostream& stream, const ClusterTask::MesonSelection& cuts);
333346

347+
/// \brief Output stream operator for task parameters in the ClusterTask
348+
/// \param stream Stream used for printing the task parameter object
349+
/// \param cuts Task parameters to be printed
350+
/// \return Stream after printing the parameters
351+
std::ostream& operator<<(std::ostream& stream, const ClusterTask::TaskParams& params);
352+
334353
} // namespace o2::quality_control_modules::emcal
335354

336355
#endif // QC_MODULE_EMC_EMCCLUSTERTASK_H

Modules/EMCAL/src/CellTask.cxx

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ void CellTask::initialize(o2::framework::InitContext& /*ctx*/)
113113
mTaskSettings.mHasTimeVsCellID = get_bool(getConfigValueLower("hasTimeVsCell")),
114114
mTaskSettings.mHasHistosCalib = get_bool(getConfigValueLower("hasHistCalib"));
115115
mTaskSettings.mCalibrateEnergy = get_bool(getConfigValue("calibrateEnergy"));
116+
mTaskSettings.mIsHighMultiplicity = get_bool(getConfigValue("highMultiplicity"));
116117
if (hasConfigValue("thresholdTimePhys")) {
117118
mTaskSettings.mAmpThresholdTimePhys = get_double(getConfigValue("thresholdTimePhys"));
118119
}
@@ -130,6 +131,7 @@ void CellTask::initialize(o2::framework::InitContext& /*ctx*/)
130131
ILOG(Info, Support) << "Amplitude cut time histograms (CalibTrigger) " << mTaskSettings.mAmpThresholdTimeCalib << ENDM;
131132
ILOG(Info, Support) << "Amplitude cut occupancy histograms (PhysTrigger) " << mTaskSettings.mThresholdPHYS << ENDM;
132133
ILOG(Info, Support) << "Amplitude cut occupancy histograms (CalibTrigger) " << mTaskSettings.mThresholdCAL << ENDM;
134+
ILOG(Info, Support) << "Multiplicity mode: " << (mTaskSettings.mIsHighMultiplicity ? "High multiplicity" : "Low multiplicity") << ENDM;
133135

134136
mIgnoreTriggerTypes = get_bool(getConfigValue("ignoreTriggers"));
135137

@@ -143,6 +145,9 @@ void CellTask::initialize(o2::framework::InitContext& /*ctx*/)
143145
ILOG(Debug, Support) << "Enabling calibrated histograms" << ENDM;
144146
}
145147

148+
parseMultiplicityRanges();
149+
initDefaultMultiplicityRanges();
150+
146151
// initialize geometry
147152
if (!mGeometry) {
148153
mGeometry = o2::emcal::Geometry::GetInstanceFromRunNumber(300000);
@@ -197,98 +202,98 @@ void CellTask::initialize(o2::framework::InitContext& /*ctx*/)
197202
mCellsMaxSM->GetYaxis()->SetTitle("counts");
198203
getObjectsManager()->startPublishing(mCellsMaxSM);
199204

200-
mCells_ev_sm = new TH2D("ncellsPerEventSupermodule", "# of Cells per Events vs supermodule ID", 100, 0, 100, 20, -0.5, 19.5);
205+
mCells_ev_sm = new TH2D("ncellsPerEventSupermodule", "# of Cells per Events vs supermodule ID", mTaskSettings.mMultiplicityRangeSM, 0, mTaskSettings.mMultiplicityRangeSM, 20, -0.5, 19.5);
201206
mCells_ev_sm->GetYaxis()->SetTitle("Supermodule");
202207
mCells_ev_sm->GetXaxis()->SetTitle("Cells/Event");
203208
mCells_ev_sm->SetStats(false);
204209
getObjectsManager()->startPublishing(mCells_ev_sm);
205210

206-
mCells_ev_smThr = new TH2D("ncellsPerEventSupermoduleWThr", "# of Cells per Events vs supermodule ID Threshold", 20, 0, 20, 20, -0.5, 19.5);
211+
mCells_ev_smThr = new TH2D("ncellsPerEventSupermoduleWThr", "# of Cells per Events vs supermodule ID Threshold", mTaskSettings.mMultiplicityRangeSMThreshold, 0, mTaskSettings.mMultiplicityRangeSMThreshold, 20, -0.5, 19.5);
207212
mCells_ev_smThr->GetYaxis()->SetTitle("Supermodule");
208213
mCells_ev_smThr->GetXaxis()->SetTitle("Cells/Event");
209214
mCells_ev_smThr->SetStats(false);
210215
getObjectsManager()->startPublishing(mCells_ev_smThr);
211216

212-
mCells_ev = new TH1D("ncellsPerEventTot", "# of Cells per event", 1000, 0, 1000);
217+
mCells_ev = new TH1D("ncellsPerEventTot", "# of Cells per event", mTaskSettings.mMultiplicityRange, 0, mTaskSettings.mMultiplicityRange);
213218
mCells_ev->GetXaxis()->SetTitle("Cells/Event");
214219
mCells_ev->GetYaxis()->SetTitle("Events");
215220
mCells_ev->SetStats(false);
216221
getObjectsManager()->startPublishing(mCells_ev);
217222

218-
mCells_ev_Thres = new TH1D("ncellPerEventTot_Thres", "# of Cells per event above threshold", 100, 0, 100);
223+
mCells_ev_Thres = new TH1D("ncellPerEventTot_Thres", "# of Cells per event above threshold", mTaskSettings.mMultiplicityRangeThreshold, 0, mTaskSettings.mMultiplicityRangeThreshold);
219224
mCells_ev_Thres->SetStats(false);
220225
mCells_ev_Thres->GetXaxis()->SetTitle("Cells/Event");
221226
mCells_ev_Thres->GetYaxis()->SetTitle("Events");
222227
getObjectsManager()->startPublishing(mCells_ev_Thres);
223228

224-
mCells_ev_EMCAL = new TH1D("ncellsPerEventEMCALTot", "# of Cells per events in EMCAL", 300, 0, 300);
229+
mCells_ev_EMCAL = new TH1D("ncellsPerEventEMCALTot", "# of Cells per events in EMCAL", mTaskSettings.mMultiplicityRangeDetector, 0, mTaskSettings.mMultiplicityRangeDetector);
225230
mCells_ev_EMCAL->GetXaxis()->SetTitle("Cells/Event");
226231
mCells_ev_EMCAL->GetYaxis()->SetTitle("Events");
227232
mCells_ev_EMCAL->SetStats(false);
228233
getObjectsManager()->startPublishing(mCells_ev_EMCAL);
229234

230-
mCells_ev_EMCAL_Thres = new TH1D("ncellPerEventEMCALTot_Thres", "# of Cells per event in EMCAL abvoe threshold", 100, 0, 100);
235+
mCells_ev_EMCAL_Thres = new TH1D("ncellPerEventEMCALTot_Thres", "# of Cells per event in EMCAL above threshold", mTaskSettings.mMultiplicityRangeThreshold, 0, mTaskSettings.mMultiplicityRangeThreshold);
231236
mCells_ev_EMCAL_Thres->GetXaxis()->SetTitle("Cells/Event");
232237
mCells_ev_EMCAL_Thres->GetYaxis()->SetTitle("Events");
233238
mCells_ev_EMCAL_Thres->SetStats(false);
234239
getObjectsManager()->startPublishing(mCells_ev_EMCAL_Thres);
235240

236-
mCells_ev_DCAL = new TH1D("ncellsPerEventDCALTot", "# of Cells per event in DCAL", 300, 0, 300);
241+
mCells_ev_DCAL = new TH1D("ncellsPerEventDCALTot", "# of Cells per event in DCAL", mTaskSettings.mMultiplicityRangeDetector, 0, mTaskSettings.mMultiplicityRangeDetector);
237242
mCells_ev_DCAL->GetXaxis()->SetTitle("Cells/Event");
238243
mCells_ev_DCAL->GetYaxis()->SetTitle("Events");
239244
mCells_ev_DCAL->SetStats(false);
240245
getObjectsManager()->startPublishing(mCells_ev_DCAL);
241246

242-
mCells_ev_DCAL_Thres = new TH1D("ncellPerEventDCALTot_Thres", "# of Cells per event in DCAL above threshold", 100, 0, 100);
247+
mCells_ev_DCAL_Thres = new TH1D("ncellPerEventDCALTot_Thres", "# of Cells per event in DCAL above threshold", mTaskSettings.mMultiplicityRangeThreshold, 0, mTaskSettings.mMultiplicityRangeThreshold);
243248
mCells_ev_DCAL_Thres->GetXaxis()->SetTitle("Cells/Event");
244249
mCells_ev_DCAL_Thres->GetYaxis()->SetTitle("Events");
245250
mCells_ev_DCAL_Thres->SetStats(false);
246251
getObjectsManager()->startPublishing(mCells_ev_DCAL_Thres);
247252

248253
if (mTaskSettings.mHasHistosCalib) {
249-
mCells_ev_sm_good = new TH2D("ncellsGoodPerEventSupermodule", "# of good Cells per Events vs supermodule ID", 100, 0, 100, 20, -0.5, 19.5);
254+
mCells_ev_sm_good = new TH2D("ncellsGoodPerEventSupermodule", "# of good Cells per Events vs supermodule ID", mTaskSettings.mMultiplicityRangeSM, 0, mTaskSettings.mMultiplicityRangeSM, 20, -0.5, 19.5);
250255
mCells_ev_sm_good->GetYaxis()->SetTitle("Supermodule");
251256
mCells_ev_sm_good->GetXaxis()->SetTitle("Good cells/Event");
252257
mCells_ev_sm_good->SetStats(false);
253258
getObjectsManager()->startPublishing(mCells_ev_sm_good);
254259

255-
mCells_ev_sm_bad = new TH2D("ncellsBadPerEventSupermodule", "# of bad Cells per Events vs supermodule ID", 100, 0, 100, 20, -0.5, 19.5);
260+
mCells_ev_sm_bad = new TH2D("ncellsBadPerEventSupermodule", "# of bad Cells per Events vs supermodule ID", mTaskSettings.mMultiplicityRangeSM, 0, mTaskSettings.mMultiplicityRangeSM, 20, -0.5, 19.5);
256261
mCells_ev_sm_bad->GetYaxis()->SetTitle("Supermodule");
257262
mCells_ev_sm_bad->GetXaxis()->SetTitle("Bad cells/Event");
258263
mCells_ev_sm_bad->SetStats(false);
259264
getObjectsManager()->startPublishing(mCells_ev_sm_bad);
260265

261-
mCells_ev_good = new TH1D("ncellsGoodPerEventTot", "# good of Cells per event", 1000, 0, 1000);
266+
mCells_ev_good = new TH1D("ncellsGoodPerEventTot", "# good of Cells per event", mTaskSettings.mMultiplicityRange, 0, mTaskSettings.mMultiplicityRange);
262267
mCells_ev_good->GetXaxis()->SetTitle("Good cells/Event");
263268
mCells_ev_good->GetYaxis()->SetTitle("Events");
264269
mCells_ev_good->SetStats(false);
265270
getObjectsManager()->startPublishing(mCells_ev_good);
266271

267-
mCells_ev_bad = new TH1D("ncellsBadPerEventTot", "# bad of Cells per event", 1000, 0, 1000);
272+
mCells_ev_bad = new TH1D("ncellsBadPerEventTot", "# bad of Cells per event", mTaskSettings.mMultiplicityRange, 0, mTaskSettings.mMultiplicityRange);
268273
mCells_ev_bad->GetXaxis()->SetTitle("Bad cells/Event");
269274
mCells_ev_bad->GetYaxis()->SetTitle("Events");
270275
mCells_ev_bad->SetStats(false);
271276
getObjectsManager()->startPublishing(mCells_ev_bad);
272277

273-
mCells_ev_EMCAL_good = new TH1D("ncellsGoodPerEventEMCALTot", "# of good Cells per events in EMCAL", 300, 0, 300);
278+
mCells_ev_EMCAL_good = new TH1D("ncellsGoodPerEventEMCALTot", "# of good Cells per events in EMCAL", mTaskSettings.mMultiplicityRangeDetector, 0, mTaskSettings.mMultiplicityRangeDetector);
274279
mCells_ev_EMCAL_good->GetXaxis()->SetTitle("Good cells/Event");
275280
mCells_ev_EMCAL_good->GetYaxis()->SetTitle("Events");
276281
mCells_ev_EMCAL_good->SetStats(false);
277282
getObjectsManager()->startPublishing(mCells_ev_EMCAL_good);
278283

279-
mCells_ev_EMCAL_bad = new TH1D("ncellsBadPerEventEMCALTot", "# of bad Cells per events in EMCAL", 300, 0, 300);
284+
mCells_ev_EMCAL_bad = new TH1D("ncellsBadPerEventEMCALTot", "# of bad Cells per events in EMCAL", mTaskSettings.mMultiplicityRangeDetector, 0, mTaskSettings.mMultiplicityRangeDetector);
280285
mCells_ev_EMCAL_bad->GetXaxis()->SetTitle("Bad cells/Event");
281286
mCells_ev_EMCAL_bad->GetYaxis()->SetTitle("Events");
282287
mCells_ev_EMCAL_bad->SetStats(false);
283288
getObjectsManager()->startPublishing(mCells_ev_EMCAL_bad);
284289

285-
mCells_ev_DCAL_good = new TH1D("ncellsGoodPerEventDCALTot", "# of good Cells per event in DCAL", 300, 0, 300);
290+
mCells_ev_DCAL_good = new TH1D("ncellsGoodPerEventDCALTot", "# of good Cells per event in DCAL", mTaskSettings.mMultiplicityRangeDetector, 0, mTaskSettings.mMultiplicityRangeDetector);
286291
mCells_ev_DCAL_good->GetXaxis()->SetTitle("Good cells/Event");
287292
mCells_ev_DCAL_good->GetYaxis()->SetTitle("Events");
288293
mCells_ev_DCAL_good->SetStats(false);
289294
getObjectsManager()->startPublishing(mCells_ev_DCAL_good);
290295

291-
mCells_ev_DCAL_bad = new TH1D("ncellsBaddPerEventDCALTot", "# of bad Cells per event in DCAL", 300, 0, 300);
296+
mCells_ev_DCAL_bad = new TH1D("ncellsBaddPerEventDCALTot", "# of bad Cells per event in DCAL", mTaskSettings.mMultiplicityRangeDetector, 0, mTaskSettings.mMultiplicityRangeDetector);
292297
mCells_ev_DCAL_bad->GetXaxis()->SetTitle("Badd cells/Event");
293298
mCells_ev_DCAL_bad->GetYaxis()->SetTitle("Events");
294299
mCells_ev_DCAL_bad->SetStats(false);
@@ -592,6 +597,44 @@ void CellTask::reset()
592597
resetOptional(mFracGoodCellsSM);
593598
}
594599

600+
void CellTask::initDefaultMultiplicityRanges()
601+
{
602+
if (!mTaskSettings.mMultiplicityRange) {
603+
mTaskSettings.mMultiplicityRange = mTaskSettings.mIsHighMultiplicity ? 10000 : 1000;
604+
}
605+
if (!mTaskSettings.mMultiplicityRangeDetector) {
606+
mTaskSettings.mMultiplicityRangeDetector = mTaskSettings.mIsHighMultiplicity ? 4000 : 300;
607+
}
608+
if (!mTaskSettings.mMultiplicityRangeThreshold) {
609+
mTaskSettings.mMultiplicityRangeThreshold = mTaskSettings.mIsHighMultiplicity ? 1000 : 100;
610+
}
611+
if (!mTaskSettings.mMultiplicityRangeSM) {
612+
mTaskSettings.mMultiplicityRangeSM = mTaskSettings.mIsHighMultiplicity ? 1000 : 100;
613+
}
614+
if (!mTaskSettings.mMultiplicityRangeSMThreshold) {
615+
mTaskSettings.mMultiplicityRangeSMThreshold = mTaskSettings.mIsHighMultiplicity ? 500 : 20;
616+
}
617+
}
618+
619+
void CellTask::parseMultiplicityRanges()
620+
{
621+
if (hasConfigValue("MultiplicityRange")) {
622+
mTaskSettings.mMultiplicityRange = std::stoi(getConfigValue("MultiplicityRange"));
623+
}
624+
if (hasConfigValue("MultiplicityRangeDetector")) {
625+
mTaskSettings.mMultiplicityRangeDetector = std::stoi(getConfigValue("MultiplicityRangeDetector"));
626+
}
627+
if (hasConfigValue("MultiplicityRangeThreshold")) {
628+
mTaskSettings.mMultiplicityRangeThreshold = std::stoi(getConfigValue("MultiplicityRangeThreshold"));
629+
}
630+
if (hasConfigValue("MultiplicityRangeSM")) {
631+
mTaskSettings.mMultiplicityRangeSM = std::stoi(getConfigValue("MultiplicityRangeSM"));
632+
}
633+
if (hasConfigValue("MultiplicityRangeSMThreshold")) {
634+
mTaskSettings.mMultiplicityRangeSMThreshold = std::stoi(getConfigValue("MultiplicityRangeSMThreshold"));
635+
}
636+
}
637+
595638
std::vector<CellTask::CombinedEvent> CellTask::buildCombinedEvents(const std::unordered_map<header::DataHeader::SubSpecificationType, gsl::span<const o2::emcal::TriggerRecord>>& triggerrecords) const
596639
{
597640
std::vector<CellTask::CombinedEvent> events;

0 commit comments

Comments
 (0)