Skip to content

Commit b441640

Browse files
cortesepalibuild
andauthored
ZDC Fixes on reconstruction for p-p 23zd runs (#11631)
* Fix override of default thresholds * Possibility to disable extended search * Remove debug print * Extended search defaults to false * Please consider the following formatting changes (#74) * Configuration to enable storage of events with in bunch pile-up (EvE) * Please consider the following formatting changes (#75) * Better printout * Better printout * Update intercalibration * Please consider the following formatting changes (#76) * Revert "Please consider the following formatting changes (#76)" (#77) This reverts commit a941a88. * Bug fix * Please consider the following formatting changes (#78) * Update intercalibration * Update intercalibration * Fix missing reset in baseline calibration * Fixes in TDC calibration * Please consider the following formatting changes (#79) * Fixes in Noise calibration * Please consider the following formatting changes (#80) * Reduce printout * Tune verbosity * Cancel comment * Change comment * Fix file name --------- Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 891ba6c commit b441640

40 files changed

Lines changed: 597 additions & 243 deletions

Detectors/ZDC/calib/include/ZDCCalib/BaselineCalibEPN.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ class BaselineCalibEPN
3939
void setSaveDebugHistos() { mSaveDebugHistos = true; }
4040
void setDontSaveDebugHistos() { mSaveDebugHistos = false; }
4141
void setVerbosity(int val) { mVerbosity = val; }
42-
BaselineCalibData mData;
42+
BaselineCalibData mData; // Data to be transmitted to aggregator
43+
BaselineCalibData mDataSum; // Debug histograms to be saved on EPN node
4344
BaselineCalibData& getData() { return mData; }
45+
BaselineCalibData& getDataSum() { return mDataSum; }
4446

4547
private:
4648
bool mInitDone = false;

Detectors/ZDC/calib/include/ZDCCalib/CalibParamZDC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace o2
2727
namespace zdc
2828
{
2929
struct CalibParamZDC : public o2::conf::ConfigurableParamHelper<CalibParamZDC> {
30-
bool debugOutput = true; // Debug output
30+
bool debugOutput = false; // Debug output
3131
bool rootOutput = true; // Output histograms to EOS
3232
std::string outputDir = "./"; // ROOT files output directory
3333
std::string metaFileDir = "/dev/null"; // Metafile output directory

Detectors/ZDC/calib/include/ZDCCalib/InterCalib.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class InterCalib
4343
static constexpr int HidZNC = 2;
4444
static constexpr int HidZPC = 3;
4545
static constexpr int HidZEM = 4;
46+
static constexpr int HidZNI = 5;
47+
static constexpr int HidZPI = 6;
4648
static constexpr int NH = InterCalibData::NH;
4749
static constexpr int NPAR = InterCalibData::NPAR;
4850
void clear(int ih = -1);
@@ -79,10 +81,11 @@ class InterCalib
7981
void setVerbosity(int v) { mVerbosity = v; }
8082
int getVerbosity() const { return mVerbosity; }
8183

82-
static constexpr const char* mHUncN[2 * NH] = {"hZNAS", "hZPAS", "hZNCS", "hZPCS", "hZEM2", "hZNAC", "hZPAC", "hZNCC", "hZPCC", "hZEM1"};
83-
static constexpr const char* mHUncT[2 * NH] = {"ZNA sum", "ZPA sum", "ZNC sum", "ZPC sum", "ZEM2", "ZNA TC", "ZPA TC", "ZNC TC", "ZPC TC", "ZEM1"};
84-
static constexpr const char* mCUncN[NH] = {"cZNA", "cZPA", "cZNC", "cZPC", "cZEM"};
85-
static constexpr const char* mCUncT[NH] = {"ZNA;TC;SUM", "ZPA;TC;SUM", "ZNC;TC;SUM", "ZPC;TC;SUM", "ZEM;ZEM1;ZEM2"};
84+
// Histograms for intercalibration of side C vs A are duplicate -> No title
85+
static constexpr const char* mHUncN[2 * NH] = {"hZNAS", "hZPAS", "hZNCS", "hZPCS", "hZEM2", "", "", "hZNAC", "hZPAC", "hZNCC", "hZPCC", "hZEM1", "", ""};
86+
static constexpr const char* mHUncT[2 * NH] = {"ZNA sum", "ZPA sum", "ZNC sum", "ZPC sum", "ZEM2", "", "", "ZNA TC", "ZPA TC", "ZNC TC", "ZPC TC", "ZEM1", "", ""};
87+
static constexpr const char* mCUncN[NH] = {"cZNA", "cZPA", "cZNC", "cZPC", "cZEM", "cZNI", "cZPI"};
88+
static constexpr const char* mCUncT[NH] = {"ZNA;TC;SUM", "ZPA;TC;SUM", "ZNC;TC;SUM", "ZPC;TC;SUM", "ZEM;ZEM1;ZEM2", "ZN;ZNAC;ZNCC", "ZP;ZPAC;ZPCC"};
8689

8790
private:
8891
std::array<o2::dataformats::FlatHisto1D<float>*, 2 * NH> mHUnc{};

Detectors/ZDC/calib/include/ZDCCalib/InterCalibConfig.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ namespace o2
2727
namespace zdc
2828
{
2929
struct InterCalibConfig {
30-
static constexpr int NH = 5; /// ZNA, ZPA, ZNC, ZPC, ZEM
31-
bool enabled[NH] = {true, true, true, true, true};
32-
double cutLow[NH] = {-std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity()};
33-
double cutHigh[NH] = {std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity()};
30+
static constexpr int NH = 7; /// ZNA, ZPA, ZNC, ZPC, ZEM, ZNI, ZPI
31+
bool enabled[NH] = {true, true, true, true, true, true, true};
32+
double cutLow[NH] = {-std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity()};
33+
double cutHigh[NH] = {std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity()};
3434
int nb1[NH] = {0}; /// 1D histogram: number of bins
3535
double amin1[NH] = {0}; /// minimum
3636
double amax1[NH] = {0}; /// maximum
3737
int nb2[NH] = {0}; /// 2D histogram: number of bins
3838
double amin2[NH] = {0}; /// minimum
3939
double amax2[NH] = {0}; /// maximum
40-
double l_bnd[NH] = {0.1, 0.1, 0.1, 0.1, 0.1};
41-
double u_bnd[NH] = {10., 10., 10., 10., 10.};
42-
double l_bnd_o[NH] = {-20., -20., -20., -20., -20.};
43-
double u_bnd_o[NH] = {20., 20., 20., 20., 20.};
44-
double step_o[NH] = {0., 0., 0., 0., 0.};
45-
double min_e[NH] = {0., 0., 0., 0., 0.};
40+
double l_bnd[NH] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1};
41+
double u_bnd[NH] = {10., 10., 10., 10., 10., 10., 10.};
42+
double l_bnd_o[NH] = {-20., -20., -20., -20., -20., -20., -20.};
43+
double u_bnd_o[NH] = {20., 20., 20., 20., 20., 20., 20.};
44+
double step_o[NH] = {0., 0., 0., 0., 0., 0., 0.};
45+
double min_e[NH] = {0., 0., 0., 0., 0., 0., 0.};
4646
std::string desc = "";
4747

4848
void print() const;
@@ -64,13 +64,15 @@ struct InterCalibConfig {
6464
void setBinning1D(int ih, int nb, double amin, double amax);
6565
void setBinning2D(int ih, int nb, double amin, double amax);
6666
void setDescription(std::string d) { desc = d; }
67-
void enable(bool c0, bool c1, bool c2, bool c3, bool c4)
67+
void enable(bool c0, bool c1, bool c2, bool c3, bool c4, bool c5, bool c6)
6868
{
6969
enabled[0] = c0;
7070
enabled[1] = c1;
7171
enabled[2] = c2;
7272
enabled[3] = c3;
7373
enabled[4] = c4;
74+
enabled[5] = c5;
75+
enabled[6] = c6;
7476
}
7577
ClassDefNV(InterCalibConfig, 3);
7678
};

Detectors/ZDC/calib/include/ZDCCalib/InterCalibData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ namespace zdc
2727

2828
struct InterCalibData {
2929
static constexpr int NPAR = 6; /// Dimension of matrix (1 + 4 coefficients + offset)
30-
static constexpr int NH = 5; /// ZNA, ZPA, ZNC, ZPC, ZEM
30+
static constexpr int NH = 7; /// ZNA, ZPA, ZNC, ZPC, ZEM, ZNI, ZPI
3131
double mSum[NH][NPAR][NPAR] = {0}; /// Cumulated sums
3232
uint64_t mCTimeBeg = 0; /// Time of processed time frame
3333
uint64_t mCTimeEnd = 0; /// Time of processed time frame
34-
static constexpr const char* DN[NH] = {"ZNA", "ZPA", "ZNC", "ZPC", "ZEM"};
34+
static constexpr const char* DN[NH] = {"ZNA", "ZPA", "ZNC", "ZPC", "ZEM", "ZNI", "ZPI"};
3535
InterCalibData& operator+=(const InterCalibData& other);
3636
int getEntries(int ih) const;
3737
void print() const;

Detectors/ZDC/calib/include/ZDCCalib/InterCalibEPN.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class InterCalibEPN
4040
static constexpr int HidZNC = 2;
4141
static constexpr int HidZPC = 3;
4242
static constexpr int HidZEM = 4;
43+
static constexpr int HidZNI = 5;
44+
static constexpr int HidZPI = 6;
4345
static constexpr int NH = InterCalibData::NH;
4446
static constexpr int NPAR = InterCalibData::NPAR;
4547
void clear(int ih = -1);

Detectors/ZDC/calib/include/ZDCCalib/InterCalibSpec.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ class InterCalibSpec : public o2::framework::Task
5555
bool mInitialized = false; // Connect once to CCDB during initialization
5656
InterCalib mWorker; // Intercalibration object
5757
TStopwatch mTimer;
58-
long mRunStartTime = 0; /// start time of the run (ms)
59-
std::string mOutputDir; /// where to write calibration digits
60-
std::string mHistoFileName; /// file name of output calib digits
58+
long mRunStartTime = 0; /// start time of the run (ms)
59+
o2::framework::DataAllocator* mOutput = nullptr; /// Pointer to output object
60+
std::unique_ptr<o2::dataformats::FileMetaData> mHistoFileMetaData = nullptr; /// Pointer to metadata file
61+
std::string mOutputDir; /// where to write calibration digits
62+
std::string mHistoFileName; /// file name of output calib digits
6163
std::string mLHCPeriod;
6264
int mRunNumber = -1;
6365
};

Detectors/ZDC/calib/include/ZDCCalib/NoiseCalib.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class NoiseCalib
3737
void clear();
3838
// int process(const o2::zdc::NoiseCalibSummaryData& data);
3939
int process(const o2::zdc::NoiseCalibSummaryData* data);
40-
void add(int ih, o2::dataformats::FlatHisto1D<double>& h1);
40+
void add(int ih, int iarr, o2::dataformats::FlatHisto1D<double>& h1);
4141
int endOfRun();
4242
int saveDebugHistos(const std::string fn = "ZDCNoiseCalib.root");
4343
void setSaveDebugHistos() { mSaveDebugHistos = true; }
@@ -50,7 +50,9 @@ class NoiseCalib
5050

5151
NoiseCalibData& getData() { return mData; }
5252
NoiseParam& getParam() { return mParam; }
53-
std::array<o2::dataformats::FlatHisto1D<double>*, NChannels> mH{};
53+
54+
static constexpr int NHA = 3;
55+
std::array<std::array<o2::dataformats::FlatHisto1D<double>*, NChannels>, NHA> mH{};
5456

5557
private:
5658
NoiseCalibData mData;

Detectors/ZDC/calib/include/ZDCCalib/NoiseCalibData.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,18 @@ struct NoiseCalibData {
119119
}
120120
}
121121

122+
static constexpr int NHA = 3;
123+
122124
uint64_t getEntries(int is) const;
123125
uint32_t getMaxBin(int is) const;
124126
int getStat(int is, uint64_t& en, double& mean, double& var) const;
125127
void print() const;
126128
void clear();
127129
void setCreationTime(uint64_t ctime);
130+
void mergeCreationTime(uint64_t ctime);
128131
void setN(int n);
129132
NoiseCalibSummaryData& getSummary();
130-
int saveDebugHistos(const std::string fn);
133+
int saveDebugHistos(const std::string fn, bool is_epn = false);
131134
ClassDefNV(NoiseCalibData, 1);
132135
};
133136

Detectors/ZDC/calib/include/ZDCCalib/NoiseCalibEPN.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,19 @@ class NoiseCalibEPN
3535
void setModuleConfig(const ModuleConfig* moduleConfig) { mModuleConfig = moduleConfig; };
3636
const ModuleConfig* getModuleConfig() { return mModuleConfig; };
3737

38-
void clear(int ih = -1);
38+
void clear();
3939
int process(const gsl::span<const o2::zdc::OrbitData>& orbitdata, const gsl::span<const o2::zdc::BCData>& bcdata, const gsl::span<const o2::zdc::ChannelData>& chdata);
4040
int endOfRun();
4141
int saveDebugHistos(const std::string fn = "ZDCNoiseCalibEPN.root");
4242
void setSaveDebugHistos() { mSaveDebugHistos = true; }
4343
void setDontSaveDebugHistos() { mSaveDebugHistos = false; }
4444
void setVerbosity(int val) { mVerbosity = val; }
45-
NoiseCalibData mData;
45+
NoiseCalibData mData; // Data to compute RMS of noise
46+
NoiseCalibData mDataSum; // Data to compute RMS of noise (cumulated)
4647
NoiseCalibData& getData() { return mData; }
47-
std::array<o2::dataformats::FlatHisto1D<double>*, NChannels> mH{};
48-
std::array<o2::dataformats::FlatHisto1D<double>*, NChannels> mHS{};
49-
std::array<o2::dataformats::FlatHisto1D<double>*, NChannels> mHD{};
48+
NoiseCalibData& getDataSum() { return mDataSum; }
49+
std::array<std::array<o2::dataformats::FlatHisto1D<double>*, NChannels>, NoiseCalibData::NHA> mH{};
50+
std::array<std::array<o2::dataformats::FlatHisto1D<double>*, NChannels>, NoiseCalibData::NHA> mHSum{};
5051

5152
private:
5253
bool mInitDone = false;

0 commit comments

Comments
 (0)