Skip to content

Commit 8fb97d1

Browse files
Dmitri Peresunkoshahor02
authored andcommitted
Add L1phase calibration
1 parent a4e8b64 commit 8fb97d1

File tree

4 files changed

+58
-17
lines changed

4 files changed

+58
-17
lines changed

Detectors/PHOS/calib/include/PHOSCalibWorkflow/ETCalibHistos.h

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,28 @@ class ETCalibHistos
3939
kTimeHGPerCell,
4040
kTimeLGPerCell,
4141
kTimeHGSlewing,
42-
kTimeLGSlewing };
42+
kTimeLGSlewing,
43+
kTimeDDL };
4344
static constexpr int nChannels = 14336 - 1793; // 4 full modules -1/2
4445
static constexpr int offset = 1793; // 1/2 full module
4546
// mgg histos
4647
static constexpr int nMass = 150.;
4748
static constexpr float massMax = 0.3;
4849
static constexpr float dm = massMax / nMass;
4950
// time histograms
50-
static constexpr int nTime = 200;
51-
static constexpr float timeMin = -100.e-9;
52-
static constexpr float timeMax = 100.e-9;
51+
static constexpr int nTime = 400;
52+
static constexpr float timeMin = -200.e-9;
53+
static constexpr float timeMax = 200.e-9;
5354
static constexpr float dt = (timeMax - timeMin) / nTime;
5455

5556
// pt
5657
static constexpr int npt = 200;
5758
static constexpr float ptMax = 20;
5859
static constexpr float dpt = ptMax / npt;
5960

61+
// L1 phase
62+
static constexpr int nDDL = 52; // 14 DDL * 4 BC
63+
6064
/// \brief Constructor
6165
ETCalibHistos() = default;
6266

@@ -89,6 +93,11 @@ class ETCalibHistos
8993
mTimeLGSlewing[i][j] += other->mTimeLGSlewing[i][j];
9094
}
9195
}
96+
for (int i = nDDL; --i;) {
97+
for (int j = nTime; --j;) {
98+
mTimeDDL[i][j] += other->mTimeDDL[i][j];
99+
}
100+
}
92101
}
93102

94103
void fill(int kind, float x, float y)
@@ -138,6 +147,12 @@ class ETCalibHistos
138147
}
139148
}
140149
}
150+
if (kind == kTimeDDL) {
151+
int j = int((y - timeMin) / dt);
152+
if (j >= 0 && j < nTime) {
153+
mTimeDDL[x][j]++;
154+
}
155+
}
141156
}
142157
void reset()
143158
{
@@ -149,6 +164,7 @@ class ETCalibHistos
149164
memset(&mTimeLGPerCell, 0, sizeof(mTimeLGPerCell));
150165
memset(&mTimeHGSlewing, 0, sizeof(mTimeHGSlewing));
151166
memset(&mTimeLGSlewing, 0, sizeof(mTimeLGSlewing));
167+
memset(&mTimeDDL, 0, sizeof(mTimeDDL));
152168
}
153169

154170
public:
@@ -160,8 +176,9 @@ class ETCalibHistos
160176
std::array<std::array<float, nTime>, nChannels> mTimeLGPerCell; ///< time per cell
161177
std::array<std::array<float, npt>, nTime> mTimeHGSlewing; ///< time vs pT
162178
std::array<std::array<float, npt>, nTime> mTimeLGSlewing; ///< time vs pT
179+
std::array<std::array<float, nDDL>, nTime> mTimeDDL; ///< time vs DDL
163180

164-
ClassDef(ETCalibHistos, 1);
181+
ClassDef(ETCalibHistos, 2);
165182
};
166183

167184
} // namespace phos

Detectors/PHOS/calib/include/PHOSCalibWorkflow/PHOSEnergyCalibrator.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ class PHOSEnergySlot
101101
uint32_t mEvBC = 0;
102102
uint32_t mEvOrbit = 0;
103103
uint32_t mEvent = 0;
104-
float mPtMin = 1.5; /// minimal pi0 pt to fill inv. mass histo
105-
float mEminHGTime = 1.5; /// minimal cell energy to fill HG time histo
106-
float mEminLGTime = 5.; /// minimal cell energy to fill LG time histo
107-
float mDigitEmin = 0.05; /// minimal energy of stored digits
104+
float mPtMin = 2.; /// minimal pi0 pt to fill inv. mass histo
105+
float mEminHGTime = 2.; /// minimal cell energy to fill HG time histo
106+
float mEminLGTime = 6.; /// minimal cell energy to fill LG time histo
107+
float mDigitEmin = 0.005; /// minimal energy of stored digits
108108
float mClusterEmin = 0.4; /// minimal energy of cluster which digits will be stored
109109
std::vector<uint32_t> mDigits; /// list of calibration digits
110110
};
@@ -141,9 +141,9 @@ class PHOSEnergyCalibrator final : public o2::calibration::TimeSlotCalibration<o
141141

142142
private:
143143
long mRunStartTime = 0; /// start time of the run (ns)
144-
float mPtMin = 1.5; /// minimal pi0 pt to fill inv. mass histo
144+
float mPtMin = 2.; /// minimal pi0 pt to fill inv. mass histo
145145
float mEminHGTime = 1.5; /// minimal cell energy to fill HG time histo
146-
float mEminLGTime = 5.; /// minimal cell energy to fill LG time histo
146+
float mEminLGTime = 5.5; /// minimal cell energy to fill LG time histo
147147
float mDigitEmin = 0.05; /// minimal energy of stored digits
148148
float mClusterEmin = 0.4; /// minimal energy of cluster which digits will be stored
149149
const CalibParams* mCalibParams = nullptr; /// Current calibration object

Detectors/PHOS/calib/src/PHOSEnergyCalibDevice.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void PHOSEnergyCalibDevice::stop()
139139
void PHOSEnergyCalibDevice::fillOutputTree()
140140
{
141141

142-
if (mOutputDigits.size() == 0) { // nothing to fill
142+
if (mOutputDigits.size() < 2) { // nothing to fill, need at least 2 cluster per event
143143
return;
144144
}
145145

Detectors/PHOS/calib/src/PHOSEnergyCalibrator.cxx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,26 @@ void PHOSEnergySlot::fill(const gsl::span<const Cluster>& clusters, const gsl::s
5959
h.mBC = tr.getBCData().bc;
6060
mDigits.push_back(h.mDataWord);
6161
mDigits.push_back(tr.getBCData().orbit);
62+
mEvBC = tr.getBCData().bc;
6263

6364
int firstCluInEvent = tr.getFirstEntry();
6465
int lastCluInEvent = firstCluInEvent + tr.getNumberOfObjects();
6566

67+
// event is good if a) 2 and more clusters; b) at least one cluster with E>1.5 GeV
68+
const float minCluE = 1.5;
69+
bool good = false;
70+
for (int i = firstCluInEvent; i < lastCluInEvent; i++) {
71+
const Cluster& clu = clusters[i];
72+
if (checkCluster(clu) && clu.getEnergy() > minCluE) {
73+
good = true;
74+
break;
75+
}
76+
}
77+
good &= (lastCluInEvent - firstCluInEvent > 1);
78+
if (!good) {
79+
continue;
80+
}
81+
6682
mBuffer->startNewEvent(); // mark stored clusters to be used for Mixing
6783
for (int i = firstCluInEvent; i < lastCluInEvent; i++) {
6884
const Cluster& clu = clusters[i];
@@ -75,9 +91,9 @@ void PHOSEnergySlot::fill(const gsl::span<const Cluster>& clusters, const gsl::s
7591
uint32_t lastCE = clu.getLastCluEl();
7692
for (uint32_t idig = firstCE; idig < lastCE; idig++) {
7793
const CluElement& ce = cluelements[idig];
78-
if (ce.energy < mDigitEmin) {
79-
continue;
80-
}
94+
// if (ce.energy < mDigitEmin) {
95+
// continue;
96+
// }
8197
short absId = ce.absId;
8298
// Fill cells from cluster for next iterations
8399
short adcCounts = ce.energy / mCalibParams->getGain(absId);
@@ -117,13 +133,21 @@ void PHOSEnergySlot::fillTimeMassHisto(const Cluster& clu, const gsl::span<const
117133
if (ce.isHG) {
118134
if (ce.energy > mEminHGTime) {
119135
mHistos->fill(ETCalibHistos::kTimeHGPerCell, absId, ce.time);
136+
char relid[3];
137+
Geometry::absToRelNumbering(absId, relid);
138+
int ddl = (relid[0] - 1) * 4 + (relid[1] - 1) / 16 - 2;
139+
mHistos->fill(ETCalibHistos::kTimeDDL, int(ddl * 4 + mEvBC % 4), ce.time);
140+
}
141+
if (mBadMap->isChannelGood(absId)) {
142+
mHistos->fill(ETCalibHistos::kTimeHGSlewing, ce.time, ce.energy);
120143
}
121-
mHistos->fill(ETCalibHistos::kTimeHGSlewing, ce.time, ce.energy);
122144
} else {
123145
if (ce.energy > mEminLGTime) {
124146
mHistos->fill(ETCalibHistos::kTimeLGPerCell, absId, ce.time);
125147
}
126-
mHistos->fill(ETCalibHistos::kTimeLGSlewing, ce.time, ce.energy);
148+
if (!mBadMap->isChannelGood(absId)) {
149+
mHistos->fill(ETCalibHistos::kTimeLGSlewing, ce.time, ce.energy);
150+
}
127151
}
128152
}
129153

0 commit comments

Comments
 (0)