Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ struct TOFFEEtriggerConfig {

//_____________________________________________________________________________

struct TOFFEEmapHVConfig {

unsigned int mHVstat[Geo::NPLATES]; // 1 bit per strip status inside 5 modules
TOFFEEmapHVConfig() = default;

ClassDefNV(TOFFEEmapHVConfig, 1);
};

//_____________________________________________________________________________

struct TOFFEElightConfig {

static constexpr int NCHANNELS = 172800;
Expand All @@ -61,11 +71,13 @@ struct TOFFEElightConfig {
// std::array<TOFFEEchannelConfig, NCHANNELS> mChannelConfig;
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
TOFFEEtriggerConfig mTriggerConfig[NTRIGGERMAPS];
TOFFEEmapHVConfig mHVConfig[Geo::NSECTORS];
TOFFEElightConfig() = default;
const TOFFEEchannelConfig* getChannelConfig(int icrate, int itrm, int ichain, int itdc, int ich) const;
const TOFFEEtriggerConfig* getTriggerConfig(int idx) const { return idx < NTRIGGERMAPS ? &mTriggerConfig[idx] : nullptr; }

ClassDefNV(TOFFEElightConfig, 1);
const TOFFEEmapHVConfig* getHVConfig(int isector) const { return (isector < Geo::NSECTORS) ? &mHVConfig[isector] : nullptr; }
unsigned int getHVConfig(int isector, int iplate) const { return (isector < Geo::NSECTORS && iplate < Geo::NPLATES) ? mHVConfig[isector].mHVstat[iplate] : 0; }
ClassDefNV(TOFFEElightConfig, 2);
};

} // namespace tof
Expand Down
1 change: 1 addition & 0 deletions Detectors/TOF/calibration/src/TOFCalibrationLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#pragma link C++ struct TOFFEEchannelConfig + ;
#pragma link C++ struct TOFFEEtriggerConfig + ;
#pragma link C++ struct TOFFEEmapHVConfig + ;
#pragma link C++ struct TOFFEElightConfig + ;
#pragma link C++ struct TOFFEElightReader + ;

Expand Down
22 changes: 22 additions & 0 deletions Detectors/TOF/calibration/src/TOFFEElightReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,28 @@ int TOFFEElightReader::parseFEElightConfig(bool verbose)
}
}

const int istripInPlate[Geo::NSECTORS] = {Geo::NSTRIPC, Geo::NSTRIPB, Geo::NSTRIPA, Geo::NSTRIPB, Geo::NSTRIPC};
const int channelInSector = Geo::NPADS * Geo::NSTRIPXSECTOR;
for (int isector = 0; isector < Geo::NSECTORS; isector++) {
int nstripInPrevPlates = 0;
for (int iplate = 0; iplate < Geo::NPLATES; iplate++) {
unsigned int mask = mFEElightConfig->getHVConfig(isector, iplate);
for (int istrip = 0; istrip < istripInPlate[iplate]; istrip++) {
bool isActive = mask & 1; // check first bit/current_strip
mask /= 2; // move to the next bit/strip

if (!isActive) { // switch off all channels in this strip
int index0 = isector * channelInSector + (nstripInPrevPlates + istrip) * Geo::NPADS;
int indexF = index0 + Geo::NPADS;
for (int index = index0; index < indexF; index++) {
mFEElightInfo.mChannelEnabled[index] = 0;
}
}
}
nstripInPrevPlates += istripInPlate[iplate];
}
}

const TOFFEEtriggerConfig* triggerConfig = nullptr;
for (Int_t iddl = 0; iddl < TOFFEElightConfig::NTRIGGERMAPS; iddl++) {
triggerConfig = mFEElightConfig->getTriggerConfig(iddl);
Expand Down