31 std::vector<std::string> modules;
43 std::ostringstream
os;
58 std::map<std::string, unsigned int> roses = { {
"AUX", 0}, {
"LBA", 1}, {
"LBC", 2}, {
"EBA", 3}, {
"EBC", 4} };
59 for (
const std::string& maskedModuleChannels :
m_masked) {
61 std::string
module = maskedModuleChannels.substr(0, 5);
65 <<
" => skip because of bad format: " << maskedModuleChannels);
69 unsigned int drawer = std::stoi(
module.substr(3, 2)) - 1;
72 <<
" => skip because of bad format: " << maskedModuleChannels);
79 std::string
gain = maskedModuleChannels.substr(5,7);
80 unsigned int adc = std::stoi(
gain);
83 ATH_MSG_WARNING(
"There no such gain: " <<
gain <<
" => skip because of bad format: " << maskedModuleChannels);
87 std::stringstream
channels(maskedModuleChannels.substr(7));
94 <<
" => skip because of bad format: " << maskedModuleChannels);
121 std::vector<unsigned int> maxTower{10, 10, 16, 16};
123 for (
unsigned int i = 0;
i < xyCells.size(); ++
i) {
124 for (
const std::vector<std::vector<double>>& xy : xyCells[
i].
get()) {
125 if (xy.size() != maxTower[
i]) {
126 std::string
properties = ((
i % 2 == 0) ?
"xCell" :
"yCell");
127 properties += (
i < 2) ?
"LongBarrelSample[A,BC,D]" :
"ExtendedBarrelSample[A,BC,D]";
129 return StatusCode::FAILURE;
135 const CaloCell_ID* caloID =
nullptr;
138 unsigned int minCellTower = 1;
139 unsigned int maxCellTower = 9;
141 std::vector<std::vector<int>> lbCellsD{{}, {0, 2}, {2, 4}, {2, 4}, {1, 4, 6}, {4, 6}, {4, 6}, {6}, {6}};
142 for (
unsigned int cellTower = minCellTower; cellTower < maxCellTower; ++cellTower) {
144 for (
unsigned int cellModule = 0; cellModule < 2; ++cellModule) {
145 for (
unsigned int cellSample = 0; cellSample < 2; ++cellSample) {
146 for (
unsigned int tower = cellTower - 1; tower < cellTower + 2; ++tower) {
148 cells.push_back(caloID->calo_cell_hash(cell_id));
152 const std::vector<int>& towersD = lbCellsD[cellTower];
153 for (
int towerD : towersD) {
156 cells.push_back(caloID->calo_cell_hash(cell_id));
161 static const std::vector<std::vector<std::vector<int>>> ebCellsNearTower{{{}},
162 {{11, 12}, {9, 10, 11, 12}, {8, 10}},
163 {{11, 12}, {9, 10, 11, 12}, {8, 10}},
164 {{12, 13}, {11, 12}, {10, 12}},
165 {{12, 13, 14}, {11, 12, 13}, {10, 12}},
166 {{13, 14}, {12, 13}, {12}},
167 {{14, 15}, {13, 14}, {12}},
168 {{14, 15}, {13, 14}, {12}},
170 for (
unsigned int cellTower = minCellTower; cellTower < maxCellTower; ++cellTower) {
172 const std::vector<std::vector<int>>& ebCells = ebCellsNearTower[cellTower];
173 for (
unsigned int cellSample = 0; cellSample < 3; ++cellSample) {
174 const std::vector<int>& ebCellsInSample = ebCells[cellSample];
175 for (
int tower : ebCellsInSample) {
178 cells.push_back(caloID->calo_cell_hash(cell_id));
183 for (
unsigned int cellTower = minCellTower; cellTower < maxCellTower; ++cellTower) {
185 ATH_MSG_INFO(
"The are " <<
cells.size() <<
" Tile cells near the tower " << cellTower <<
" in LBC02: ");
191 return StatusCode::SUCCESS;
203 if (caloCellContainer->
empty())
return StatusCode::SUCCESS;
205 const TileCell* cellWithMaxEnergy =
nullptr;
207 double totalEnergy(0.0);
208 bool onlyLBC04(
true);
209 int nCellsOverThreshold(0);
211 double totalEnergyLBA01 = 0.;
212 double totalEnergyLBA02 = 0.;
213 double totalEnergyLBC01 = 0.;
214 double totalEnergyLBC02 = 0.;
215 double totalEnergyEBC03 = 0.;
220 if (!tile_cell)
continue;
224 IdentifierHash hash1 = caloDDE->
onl1();
225 IdentifierHash hash2 = caloDDE->
onl2();
234 && (!cellWithMaxEnergy || cellWithMaxEnergy->
energy() < tile_cell->
energy())) {
235 cellWithMaxEnergy = tile_cell;
239 double energy_pC(0.0);
252 std::string moduleName2 =
"";
260 if (onlyLBC04 &&
chan1 > 0 && drawerIdx1 != 87) onlyLBC04 =
false;
298 energy_pC =
energy * 0.001;
299 totalEnergy += energy_pC;
303 if (
module == 0) totalEnergyLBA01 += energy_pC;
304 else if (
module == 1) totalEnergyLBA02 += energy_pC;
306 if (
module == 0) totalEnergyLBC01 += energy_pC;
307 else if (
module == 1) totalEnergyLBC02 += energy_pC;
311 totalEnergyEBC03 += energy_pC;
317 ++nCellsOverThreshold;
352 if (cellWithMaxEnergy && !onlyLBC04) {
356 fill(
"TileTBHotCellA_LBC02", monTower);
358 if ((tower > 0) && (tower < 9)) {
360 double sumClong = 0.0;
361 double sumCtot = 0.0;
365 caloCellContainer->findCellVector(cellsHashes,
cells);
371 double sumCellEnergyAlpha = 0.;
379 double avgCellEnergyAlpha = sumCellEnergyAlpha /
nCells;
392 double Ctot = std::sqrt(sumCtot /
nCells) / sumCellEnergyAlpha;
397 fill(
"TileTBCtot", monCtot);
398 fill(
"TileTBClong", monClong);
399 fill(
"TileTBCtotVsClong", monClong, monCtot);
408 fill(
"TileTBTotalEventEnergy", monEnergy);
411 fill(
"TileTBCellsNumberVsTotalEnergy", monCellsOvThr, monEnergy);
413 std::vector<int>
side{0,0,1,1,1};
416 std::vector<int>
module{0,1,0,1,2};
419 std::vector<double> moduleEnergy{totalEnergyLBA01, totalEnergyLBA02,
420 totalEnergyLBC01, totalEnergyLBC02,
424 fill(
"TileTBHitMap", monSide, monModule, monModEnergy);
430 return StatusCode::SUCCESS;