18 #include "CLHEP/Geometry/Vector3D.h"
40 m_sigmasAboveNoise(4.),
41 m_sigmasAboveNoiseCore(1.5) {
42 declareInterface<IMuidCaloEnergyMeas>(
this);
77 return StatusCode::SUCCESS;
85 return StatusCode::SUCCESS;
88 double phiHad)
const {
100 if (!noiseHdl.isValid()) {
110 std::unique_ptr<CaloMeas> caloMeas = std::make_unique<CaloMeas>();
123 <<
" Tile energy (GeV) :" << std::setw(8) << std::setprecision(3) << caloMeas->Tile_EnergyMeasured() /
Units::GeV
124 <<
" Material percent:" << std::setw(4) << std::setprecision(0) << 100. * caloMeas->Tile_SamplingFraction()
125 <<
" ISO :" << std::setw(8) << std::setprecision(3) << caloMeas->Tile_Isolation() /
Units::GeV <<
endmsg
126 <<
" LArHEC energy (GeV):" << std::setw(8) << std::setprecision(3) << caloMeas->LArHEC_EnergyMeasured() /
Units::GeV
127 <<
" Material percent:" << std::setw(4) << std::setprecision(0) << 100. * caloMeas->LArHEC_SamplingFraction()
128 <<
" ISO :" << std::setw(8) << std::setprecision(3) << caloMeas->LArHEC_Isolation() /
Units::GeV <<
endmsg
129 <<
" EM energy :" << std::setw(8) << std::setprecision(3) << caloMeas->LArEM_EnergyMeasured() /
Units::GeV
130 <<
" first compartment:" << std::setw(8) << std::setprecision(3)
131 << caloMeas->LArEM_FirstCompartmentEnergy() /
Units::GeV <<
" Material percent:" << std::setw(4)
132 << std::setprecision(0) << 100. * caloMeas->LArEM_SamplingFraction() <<
" ISO :" << std::setw(8)
133 << std::setprecision(3) << caloMeas->LArEM_Isolation() /
Units::GeV);
143 constexpr
double lowest_threshold = 4 * 50.;
151 const double cellEnergy =
cell->energy();
157 ATH_MSG_DEBUG(
" counted " <<
count <<
" cells over threshold out of a total of " << myList.ncells() <<
" cells");
175 const CaloNoise* noiseCDO,
double muEta,
double muPhi,
int isubcalo)
const {
200 double totalEnergy = 0.;
201 double leadingEnergy = 0.;
202 std::unique_ptr<CaloCellList> myList =
nullptr;
206 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
210 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
214 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
218 int countCoreCells = 0;
219 int countSelected = 0;
220 bool compartment[4] = {
false,
false,
false,
false};
221 double measuredSamplings = 0.;
223 if (myList && myList->
ncells()) {
228 for (
int coreSampling = 0; coreSampling != 4; ++coreSampling) {
230 double coreRadius = 0.;
234 if (
cell != lastCell && sampling != coreSampling)
continue;
240 if (sampling == coreSampling) {
241 if (!coreCell ||
radius < coreRadius) {
247 if (
cell != lastCell || !coreCell)
continue;
249 for (
const CaloCell* cell2 : *myList) {
251 if (sampling != coreSampling)
continue;
253 double cellEnergy = cell2->energy();
254 double noiseRms = noiseCDO->
getNoise(cell2->ID(), cell2->gain());
262 totalEnergy += cellEnergy;
263 compartment[coreSampling] =
true;
264 if (coreSampling < 2) leadingEnergy += cellEnergy;
266 if (cell2 == coreCell) {
280 std::string
info =
"";
281 std::string
type =
" Tile ";
287 if (cellSelected && cell2 == coreCell) {
288 info =
" selected core cell# ";
289 }
else if (cellSelected) {
290 info =
" selected cell# ";
291 }
else if (cell2 == coreCell) {
292 info =
" cell in core NOT selected";
297 <<
type <<
" Sampling: " << std::setw(1) << coreSampling <<
" Radius :" << std::setw(6)
298 << std::setprecision(0) << cell2->caloDDE()->r() <<
" Eta : " << std::setw(6)
299 << std::setprecision(2) << cell2->eta() <<
" Phi : " << std::setw(6) << std::setprecision(2)
300 << cell2->phi() <<
" Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
301 <<
" Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() <<
info);
302 }
else if (cellSelected) {
304 <<
type <<
" Sampling: " << std::setw(1) << coreSampling <<
" Radius :" << std::setw(6)
305 << std::setprecision(0) << cell2->caloDDE()->r() <<
" Eta : " << std::setw(6)
306 << std::setprecision(2) << cell2->eta() <<
" Phi : " << std::setw(6) << std::setprecision(2)
307 << cell2->phi() <<
" Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
308 <<
" Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() <<
info
312 <<
type <<
" Sampling: " << std::setw(1) << coreSampling <<
" Radius :" << std::setw(6)
313 << std::setprecision(0) << cell2->caloDDE()->r() <<
" Eta : " << std::setw(6)
314 << std::setprecision(2) << cell2->eta() <<
" Phi : " << std::setw(6) << std::setprecision(2)
315 << cell2->phi() <<
" Noise level : " << std::setw(6) << std::setprecision(0) << noiseRms
316 <<
" Energy : " << std::setw(7) << std::setprecision(0) << cell2->energy() <<
info);
324 std::string
info =
"";
325 std::string
type =
" Tile ";
332 ATH_MSG_DEBUG(
type <<
" at eta = " << muEta <<
" : selected " << countSelected <<
" from measured cone with "
333 << countCoreCells <<
" cells forming core");
336 for (
int i = 0;
i < 4; ++
i)
337 if (compartment[
i]) measuredSamplings +=
m_caloParamTool->caloCompartmentDepth(isubcalo,
i);
355 const CaloNoise* noiseCDO,
double muEta,
double muPhi,
int isubcalo)
const {
356 double totalEnergy = 0.;
361 std::unique_ptr<CaloCellList> myList;
365 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
369 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
373 myList = std::make_unique<CaloCellList>(detMgr,cellContainer, iCalo);
377 if (myList && myList->
ncells()) {
382 for (
int coreSampling = 0; coreSampling != 4; ++coreSampling) {
384 double coreRadius = 0.;
388 if (
cell != lastCell && sampling != coreSampling)
continue;
394 if (sampling == coreSampling) {
395 if (!coreCell ||
radius < coreRadius) {
401 if (
cell != lastCell || !coreCell)
continue;
403 for (
const CaloCell* cell2 : *myList) {
405 if (sampling != coreSampling)
continue;
407 double cellEnergy = cell2->energy();
408 double noiseRms = noiseCDO->
getNoise(cell2->ID(), cell2->gain());
413 if (cellSelected) totalEnergy += cellEnergy;
440 double tileTotalEnergy = 0.;
441 double tileTestEnergy = 0.;
454 double lowest_threshold = 0.;
456 double cellEnergy =
cell->energy();
463 <<
" Radius :" <<
cell->caloDDE()->r() <<
" Eta : " <<
cell->eta() <<
" Phi : " <<
cell->phi()
464 <<
" Noise Level : " << noise_rms);
466 tileTotalEnergy += cellEnergy;
468 tileTestEnergy += cellEnergy;
474 return tileTotalEnergy;
492 double larhecTotal = 0.;
505 constexpr
double lowest_threshold = 4. * 150.;
508 double cellEnergy =
cell->energy();
515 <<
" z :" <<
cell->caloDDE()->z() <<
" Eta : " <<
cell->eta() <<
" Phi : " <<
cell->phi()
516 <<
" Noise Level : " << noise_rms);
518 larhecTotal +=
cell->energy();
540 double emTotalEnergy = 0.;
555 double lowest_threshold = 4. * 50.;
558 double cellEnergy =
cell->energy();
566 <<
" Radius :" <<
cell->caloDDE()->r() <<
" z :" <<
cell->caloDDE()->z()
567 <<
" Eta : " <<
cell->eta() <<
" Phi : " <<
cell->phi() <<
" Noise Level : " << noise_rms);
569 emTotalEnergy +=
cell->energy();
575 return emTotalEnergy;