28 std::vector<std::string> modules;
30 int ros = fragID >> 8;
31 int drawer = fragID & 0x3F;
36 std::ostringstream os;
40 unsigned int ros = fragID >> 8;
41 unsigned int drawer = fragID & 0xFF;
43 os <<
" " << module <<
"/0x" << std::hex << fragID << std::dec;
52 std::map<std::string, unsigned int> roses = { {
"AUX", 0}, {
"LBA", 1}, {
"LBC", 2}, {
"EBA", 3}, {
"EBC", 4} };
53 for (
const std::string& maskedModuleChannels :
m_masked) {
55 std::string module = maskedModuleChannels.substr(0, 5);
56 std::string partition =
module.substr(0, 3);
57 if (roses.count(partition) != 1) {
58 ATH_MSG_WARNING(
"There no such partition: " << partition <<
" in module: " << module
59 <<
" => skip because of bad format: " << maskedModuleChannels);
63 unsigned int drawer = std::stoi(module.substr(3, 2)) - 1;
65 ATH_MSG_WARNING(
"There no such drawer: " << drawer + 1 <<
" in module: " << module
66 <<
" => skip because of bad format: " << maskedModuleChannels);
70 unsigned int ros = roses.at(partition);
73 std::string gain = maskedModuleChannels.substr(5,7);
74 unsigned int adc = std::stoi(gain);
77 ATH_MSG_WARNING(
"There no such gain: " << gain <<
" => skip because of bad format: " << maskedModuleChannels);
81 std::stringstream channels(maskedModuleChannels.substr(7));
83 while (std::getline(channels, channel,
',')) {
84 if (!channel.empty()) {
85 unsigned int chan = std::stoi(channel);
87 ATH_MSG_WARNING(
"There no such channel: " << chan <<
" in channels: " << channels.str()
88 <<
" => skip because of bad format: " << maskedModuleChannels);
116 std::vector<std::string> beamChambers{
"BC1",
"BC2"};
123 return StatusCode::SUCCESS;
139 std::vector<std::reference_wrapper<int>> mu{muTag, muHalo, muVeto};
157 double totalMuonWallEnergy = 0;
162 ATH_MSG_VERBOSE(
"TileRawDataContainer of TileRawDataCollection of TileBeamElem size = " << beamElemContainer->size());
167 int frag = beamElemCollection->identify();
168 ATH_MSG_VERBOSE(
"TileRawDataCollection of TileBeamElem Id = 0x" << MSG::hex << frag << MSG::dec
169 <<
" size = " << beamElemCollection->size());
171 for (
const TileBeamElem* beamElement : *beamElemCollection) {
176 std::vector<uint32_t> digits = beamElement->get_digits();
178 int nDigits = digits.size();
180 if ( nDigits <= 0 ) {
182 <<
") for channel " << channel
183 <<
" in frag 0x"<< MSG::hex << frag << MSG::dec
187 int amplitude = digits[0];
190 <<
" in frag 0x" << MSG::hex << frag << MSG::dec
192 <<
" with amp=" << amplitude);
198 if(channel >= 0 && channel < 8) {
199 muonWall[channel] = amplitude;
201 totalMuonWallEnergy += amplitude;
211 if(channel >= 0 && channel < 6) {
213 muonWall[8 + channel] = amplitude;
215 totalMuonWallEnergy += amplitude;
229 tof[channel] = amplitude;
243 if ((channel > 11) && (channel < 16) && (
run > 2211136)) {
244 tof[channel] = amplitude;
246 }
else if (channel < 16) {
248 if (btdcHitsN[channel] == 0) {
249 btdc[channel] = amplitude;
250 ++(btdcHitsN[channel]);
253 btdc[channel] = amplitude;
260 if (channel >= 0 && channel < 8) {
262 sCounter[channel] = amplitude;
263 }
else if (channel < 5) {
264 cherenkov[channel - 3] = amplitude;
266 mu[channel - 5] = amplitude;
278 if (channel >= 0 && channel < 16) {
280 sCounter[channel] = amplitude;
281 }
else if (channel == 2) {
285 muonWall[10] = amplitude;
287 totalMuonWallEnergy += amplitude;
290 sCounter[2] = amplitude;
292 }
else if (channel < 6) {
293 cherenkov[channel - 3] = amplitude;
295 muonWall[channel - 6] = amplitude;
297 totalMuonWallEnergy += amplitude;
308 if (channel >= 0 && channel < 16) {
310 sCounter[channel] = amplitude;
311 }
else if (channel < 6) {
312 cherenkov[channel - 3] = amplitude;
327 muonWall[channel] = amplitude;
329 totalMuonWallEnergy += amplitude;
331 }
else if (channel > 31) {
338 if (
run > 2310000 && channel < 16) {
340 scaler[channel] = amplitude;
342 scaler12 = amplitude;
354 fill(
"TileTBTotalMuonEnergy", monTotalMuonEnergy);
356 std::vector<int> counterToTOF{14,15,13};
357 for (
int counter = 0; counter <
N_TOF; ++counter) {
362 for (
unsigned int pairIdx = 0; pairIdx <
m_tofPairs.size(); ++pairIdx) {
363 const std::pair<int, int>& tofPair =
m_tofPairs[pairIdx];
364 int tof1 = tof[counterToTOF[tofPair.first - 1]];
365 int tof2 = tof[counterToTOF[tofPair.second - 1]];
366 if (tof1 != 0 && tof2 != 0) {
372 for (
int counter = 0; counter <
N_S_COUNTER; ++counter) {
377 for (
int counter = 0; counter <
N_CHERENKOV; ++counter) {
384 fill(
"CherCompare", monCherenkovAmplitude1, monCherenkovAmplitude2);
386 for (
int tofCounter = 0; tofCounter <
N_TOF; ++tofCounter) {
388 for (
int cherenkovCounter = 0; cherenkovCounter <
N_CHERENKOV; ++cherenkovCounter) {
396 for (
int counter = 0; counter <
N_SCALER; ++counter) {
401 fill(
"Scaler12", monCounts12);
409 for (
int row = 0; row < 2; ++row) {
410 for (
int column = 0; column < 4; ++column) {
414 fill(
"PMTHitMap", monColumn, monRow, monAmplitude);
458 fill(
"ImpactProfile", xImp, yImp);
466 if (!caloCellContainer->empty()) {
468 double cellEnergy = 0;
469 double totalEnergy(0.0);
471 for (
const CaloCell* cell : *caloCellContainer) {
472 if (
m_tileID->is_tile(cell->ID())) {
474 if (!tile_cell)
continue;
483 int gain1 = tile_cell->
gain1();
489 int channel1 =
m_tileHWID->channel(channelId1);
494 if (gain1 >= 0 && !((
m_maskedChannels[drawerIdx1][channel1] >> gain1) & 1U)) {
495 energy = cell->energy();
500 int gain2 = tile_cell->
gain2();
506 int channel2 =
m_tileHWID->channel(channelId2);
510 if (gain1 < 0 || ((
m_maskedChannels[drawerIdx1][channel1] >> gain1) & 1U)) {
511 if (gain2 >= 0 && !((
m_maskedChannels[drawerIdx2][channel2] >> gain2) & 1U)) {
512 energy = tile_cell->
ene2() * 2;
514 }
else if (gain2 >= 0 && ((
m_maskedChannels[drawerIdx2][channel2] >> gain2) & 1U)) {
515 if (gain1 >= 0 && !((
m_maskedChannels[drawerIdx1][channel1] >> gain1) & 1U)) {
516 energy = tile_cell->
ene1() * 2;
519 energy = cell->energy();
524 double energy_pC = energy * 0.001;
525 totalEnergy += energy_pC;
527 if (energy_pC > cellEnergy) {
528 cellEnergy = energy_pC;
536 for (
int counter = 0; counter <
N_CHERENKOV; ++counter) {
541 fill(
"CellEnergyImpactX", xImp, monCellEnergy);
542 fill(
"CellEnergyImpactY", yImp, monCellEnergy);
543 fill(
"TotalEnergyImpactX", xImp, monTotalEnergy);
544 fill(
"TotalEnergyImpactY", yImp, monTotalEnergy);
547 fill(
"ScinCalEnergy", monAmplitudeS1, monTotalEnergy);
551 fill(
"TileTBBeamMonExecuteTime", timer);
553 return StatusCode::SUCCESS;