6#include "GaudiKernel/Service.h"
7#include "Gaudi/Property.h"
21#include <CLHEP/Units/SystemOfUnits.h>
26 ,
const std::string& name,
const IInterface* parent)
31 declareInterface<ICaloCellMakerTool>(
this );
56 return StatusCode::SUCCESS;
65 int ros = 0, drw = 0,
index = -1;
68 std::stringstream dris;
75 std::stringstream dris;
77 dris >> ros >> drw >>
index;
82 std::stringstream dris;
84 dris >> ros >> drw >>
index;
89 std::stringstream dris;
91 dris >> ros >> drw >>
index;
96 std::stringstream dris;
98 dris >> ros >> drw >>
index;
102 return StatusCode::SUCCESS;
109 int begin = 0, end = 0;
111 if (component ==
"drawer") {
114 }
else if (component ==
"mb") {
115 begin = (4 -
index) * 12;
117 }
else if (component ==
"dig") {
118 begin = (8 -
index) * 6;
120 }
else if (component ==
"dmu") {
128 if (ros < 1 || ros > 4) {
129 ATH_MSG_WARNING(
" wrong selection of ros = " << ros <<
" in TileCellMaskingTool::killer ");
130 }
else if (drw < 0 || drw > 63) {
131 ATH_MSG_WARNING(
" wrong selection of drawer = " << drw <<
" in TileCellMaskingTool::killer ");
132 }
else if (begin < 0 || end > 48) {
134 <<
" = " <<
index <<
" in TileCellMaskingTool::killer ");
136 msg(MSG::INFO) <<
" killing ros " << ros <<
" drawer " << drw;
137 if (component !=
"drawer") {
143 for (
int channel = begin; channel < end; ++channel) {
148 <<
" hash " << hash );
156 const EventContext& )
const
158 int n_cells = 0, n_masked_1 = 0, n_masked_2 = 0, n_masked_12 = 0;
159 double ene_before = 0.0, ene_after = 0.0;
164 for (
size_t iCell = firstCell; iCell <= lastCell; ++iCell) {
166 CaloCell* aCell = (*theCont)[iCell];
173 ene_before += aCell->
energy();
183 int gain1 = pCell->
gain1();
184 int gain2 = pCell->
gain2();
192 if (
msgLvl(MSG::VERBOSE)) {
193 msg(MSG::VERBOSE) <<
" second channel is OFF"
194 <<
", hash2: " << hash2
195 <<
" before " << pCell->
ene1()
196 <<
" + " << pCell->
ene2()
197 <<
" = " << pCell->
energy();
201 float ene1 = pCell->
ene1();
202 pCell->
setEnergy(ene1, ene1, gain1, gain1);
206 if (
msgLvl(MSG::VERBOSE)) {
207 msg(MSG::VERBOSE) <<
" after " << pCell -> ene1()
208 <<
" + " << pCell -> ene2()
209 <<
" = " << pCell -> energy() <<
endmsg;
218 if (
msgLvl(MSG::VERBOSE)) {
219 msg(MSG::VERBOSE) <<
" channel in GAP is OFF"
220 <<
", hash1: " << hash1
221 <<
" before " << pCell->
ene1()
222 <<
" + " << pCell->
ene2()
223 <<
" = " << pCell->
energy();
236 if (
msgLvl(MSG::VERBOSE)) {
237 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
238 <<
" + " << pCell->
ene2()
246 if (
msgLvl(MSG::VERBOSE)) {
247 msg(MSG::VERBOSE) <<
" first channel is OFF"
248 <<
", hash1: " << hash1
249 <<
" before " << pCell->
ene1()
250 <<
" + " << pCell->
ene2()
251 <<
" = " << pCell->
energy();
255 float ene2 = pCell->
ene2();
256 pCell->
setEnergy(ene2, ene2, gain2, gain2);
261 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
262 <<
" + " << pCell->
ene2()
269 if (
msgLvl(MSG::VERBOSE)) {
270 msg(MSG::VERBOSE) <<
" both channels are OFF"
271 <<
", hash1: " << hash1
272 <<
", hash2: " << hash2
273 <<
" before " << pCell->
ene1()
274 <<
" + " << pCell->
ene2()
275 <<
" = " << pCell->
energy();
290 if (
msgLvl(MSG::VERBOSE)) {
291 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
292 <<
" + " << pCell->
ene2()
297 ene_after += aCell->
energy();
302 <<
" N masked gap/normal/half-masked: " << n_masked_1 <<
" " << n_masked_2 <<
" " << n_masked_12
303 <<
" Ene before/after/delta: " << ene_before <<
" " << ene_after <<
" " << ene_after-ene_before );
305 return StatusCode::SUCCESS;
312 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