6#include "GaudiKernel/Service.h"
7#include "Gaudi/Property.h"
22#include <CLHEP/Units/SystemOfUnits.h>
27 ,
const std::string& name,
const IInterface* parent)
32 declareInterface<ICaloCellMakerTool>(
this );
57 return StatusCode::SUCCESS;
66 int ros = 0, drw = 0,
index = -1;
69 std::stringstream dris;
76 std::stringstream dris;
78 dris >> ros >> drw >>
index;
83 std::stringstream dris;
85 dris >> ros >> drw >>
index;
90 std::stringstream dris;
92 dris >> ros >> drw >>
index;
97 std::stringstream dris;
99 dris >> ros >> drw >>
index;
103 return StatusCode::SUCCESS;
110 int begin = 0, end = 0;
112 if (component ==
"drawer") {
115 }
else if (component ==
"mb") {
116 begin = (4 -
index) * 12;
118 }
else if (component ==
"dig") {
119 begin = (8 -
index) * 6;
121 }
else if (component ==
"dmu") {
129 if (ros < 1 || ros > 4) {
130 ATH_MSG_WARNING(
" wrong selection of ros = " << ros <<
" in TileCellMaskingTool::killer ");
131 }
else if (drw < 0 || drw > 63) {
132 ATH_MSG_WARNING(
" wrong selection of drawer = " << drw <<
" in TileCellMaskingTool::killer ");
133 }
else if (begin < 0 || end > 48) {
135 <<
" = " <<
index <<
" in TileCellMaskingTool::killer ");
137 msg(MSG::INFO) <<
" killing ros " << ros <<
" drawer " << drw;
138 if (component !=
"drawer") {
144 for (
int channel = begin; channel < end; ++channel) {
149 <<
" hash " << hash );
157 const EventContext& )
const
159 int n_cells = 0, n_masked_1 = 0, n_masked_2 = 0, n_masked_12 = 0;
160 double ene_before = 0.0, ene_after = 0.0;
165 for (
size_t iCell = firstCell; iCell <= lastCell; ++iCell) {
167 CaloCell* aCell = (*theCont)[iCell];
174 ene_before += aCell->
energy();
184 int gain1 = pCell->
gain1();
185 int gain2 = pCell->
gain2();
193 if (
msgLvl(MSG::VERBOSE)) {
194 msg(MSG::VERBOSE) <<
" second channel is OFF"
195 <<
", hash2: " << hash2
196 <<
" before " << pCell->
ene1()
197 <<
" + " << pCell->
ene2()
198 <<
" = " << pCell->
energy();
202 float ene1 = pCell->
ene1();
203 pCell->
setEnergy(ene1, ene1, gain1, gain1);
207 if (
msgLvl(MSG::VERBOSE)) {
208 msg(MSG::VERBOSE) <<
" after " << pCell -> ene1()
209 <<
" + " << pCell -> ene2()
210 <<
" = " << pCell -> energy() <<
endmsg;
219 if (
msgLvl(MSG::VERBOSE)) {
220 msg(MSG::VERBOSE) <<
" channel in GAP is OFF"
221 <<
", hash1: " << hash1
222 <<
" before " << pCell->
ene1()
223 <<
" + " << pCell->
ene2()
224 <<
" = " << pCell->
energy();
237 if (
msgLvl(MSG::VERBOSE)) {
238 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
239 <<
" + " << pCell->
ene2()
247 if (
msgLvl(MSG::VERBOSE)) {
248 msg(MSG::VERBOSE) <<
" first channel is OFF"
249 <<
", hash1: " << hash1
250 <<
" before " << pCell->
ene1()
251 <<
" + " << pCell->
ene2()
252 <<
" = " << pCell->
energy();
256 float ene2 = pCell->
ene2();
257 pCell->
setEnergy(ene2, ene2, gain2, gain2);
262 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
263 <<
" + " << pCell->
ene2()
270 if (
msgLvl(MSG::VERBOSE)) {
271 msg(MSG::VERBOSE) <<
" both channels are OFF"
272 <<
", hash1: " << hash1
273 <<
", hash2: " << hash2
274 <<
" before " << pCell->
ene1()
275 <<
" + " << pCell->
ene2()
276 <<
" = " << pCell->
energy();
291 if (
msgLvl(MSG::VERBOSE)) {
292 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
293 <<
" + " << pCell->
ene2()
298 ene_after += aCell->
energy();
303 <<
" N masked gap/normal/half-masked: " << n_masked_1 <<
" " << n_masked_2 <<
" " << n_masked_12
304 <<
" Ene before/after/delta: " << ene_before <<
" " << ene_after <<
" " << ene_after-ene_before );
306 return StatusCode::SUCCESS;
313 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Container class for CaloCell.
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
int indexLastCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of last cell of given calorimeter (-2 if none) Note that it is normally more efficient to use i...
Data object for each calorimeter readout cell.
double energy() const
get energy (data member)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
This class groups all DetDescr information related to a CaloCell.
bool is_tile() const
cell belongs to Tile
IdentifierHash onl2() const
cell online identifier 2
IdentifierHash onl1() const
cell online identifier 1
This is a "hash" representation of an Identifier.
uint8_t qual1(void) const
get quality of first PMT (data member)
float time1(void) const
get time of first PMT
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero (final override of CaloCell method)
int gain2(void) const
get gain of second PMT
uint8_t qbit2(void) const
get quality bits of second PMT (data member)
int gain1(void) const
get gain of first PMT
uint8_t qual2(void) const
get quality of second PMT (data member)
void setQuality(unsigned char qual, unsigned char qbit, int pmt)
set quality value and quality bits for one PMT (TileCell specific overloads)
float ene1(void) const
get energy of first PMT
virtual void setTime(float t) override final
set cell time, reset timeDiff
float time2(void) const
get time of second PMT
uint8_t qbit1(void) const
get quality bits of first PMT (data member)
float ene2(void) const
get energy of second PMT