Skip to content

Commit a8e59b4

Browse files
committed
adding HV maps to TOF FEELIGHT
1 parent 8069cf6 commit a8e59b4

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

Detectors/TOF/calibration/include/TOFCalibration/TOFFEElightConfig.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ struct TOFFEEtriggerConfig {
4949

5050
//_____________________________________________________________________________
5151

52+
struct TOFFEEmapHVConfig {
53+
54+
unsigned int mHVstat[Geo::NPLATES]; // 1 bit per strip status inside 5 modules
55+
TOFFEEmapHVConfig() = default;
56+
57+
ClassDefNV(TOFFEEmapHVConfig, 1);
58+
};
59+
60+
//_____________________________________________________________________________
61+
5262
struct TOFFEElightConfig {
5363

5464
static constexpr int NCHANNELS = 172800;
@@ -61,11 +71,13 @@ struct TOFFEElightConfig {
6171
// std::array<TOFFEEchannelConfig, NCHANNELS> mChannelConfig;
6272
TOFFEEchannelConfig mChannelConfig[Geo::kNCrate][Geo::kNTRM - 2][Geo::kNChain][Geo::kNTdc][Geo::kNCh]; // in O2, the number of TRMs is 12, but in the FEE world it is 10
6373
TOFFEEtriggerConfig mTriggerConfig[NTRIGGERMAPS];
74+
TOFFEEmapHVConfig mHVConfig[Geo::NSECTORS];
6475
TOFFEElightConfig() = default;
6576
const TOFFEEchannelConfig* getChannelConfig(int icrate, int itrm, int ichain, int itdc, int ich) const;
6677
const TOFFEEtriggerConfig* getTriggerConfig(int idx) const { return idx < NTRIGGERMAPS ? &mTriggerConfig[idx] : nullptr; }
67-
68-
ClassDefNV(TOFFEElightConfig, 1);
78+
const TOFFEEmapHVConfig* getHVConfig(int isector) const { return (isector < Geo::NSECTORS) ? &mHVConfig[isector] : nullptr; }
79+
unsigned int getHVConfig(int isector, int iplate) const { return (isector < Geo::NSECTORS && iplate < Geo::NPLATES) ? mHVConfig[isector].mHVstat[iplate] : 0; }
80+
ClassDefNV(TOFFEElightConfig, 2);
6981
};
7082

7183
} // namespace tof

Detectors/TOF/calibration/src/TOFFEElightReader.cxx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,28 @@ int TOFFEElightReader::parseFEElightConfig(bool verbose)
9393
}
9494
}
9595

96+
const int istripInPlate[Geo::NSECTORS] = {Geo::NSTRIPC, Geo::NSTRIPB, Geo::NSTRIPA, Geo::NSTRIPB, Geo::NSTRIPC};
97+
const int channelInSector = Geo::NPADS * Geo::NSTRIPXSECTOR;
98+
for (int isector = 0; isector < Geo::NSECTORS; isector++) {
99+
int nstripInPrevPlates = 0;
100+
for (int iplate = 0; iplate < Geo::NPLATES; iplate++) {
101+
unsigned int mask = mFEElightConfig->getHVConfig(isector, iplate);
102+
for (int istrip = 0; istrip < istripInPlate[iplate]; istrip++) {
103+
bool isActive = mask & 1; // check first bit/current_strip
104+
mask /= 2; // move to the next bit/strip
105+
106+
if (!active) { // switch off all channels in this strip
107+
int index0 = isector * channelInSector + (nstripInPrevPlates + istrip) * Geo::NPADS;
108+
int indexF = index0 + Geo::NPADS;
109+
for (int index = index0; index < indexF; index++) {
110+
mFEElightInfo.mChannelEnabled[index] = 0;
111+
}
112+
}
113+
}
114+
nstripInPrevPlates += istripInPlate[iplate];
115+
}
116+
}
117+
96118
const TOFFEEtriggerConfig* triggerConfig = nullptr;
97119
for (Int_t iddl = 0; iddl < TOFFEElightConfig::NTRIGGERMAPS; iddl++) {
98120
triggerConfig = mFEElightConfig->getTriggerConfig(iddl);

0 commit comments

Comments
 (0)