ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TileCellMaskingTool Class Reference

#include <TileCellMaskingTool.h>

Inheritance diagram for TileCellMaskingTool:
Collaboration diagram for TileCellMaskingTool:

Public Member Functions

 TileCellMaskingTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override
 
virtual StatusCode finalize () override
 
virtual bool channel_is_good (HWIdentifier &hwid)
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
 DeclareInterfaceID (ICaloCellMakerTool, 1, 0)
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode fillIncludedCellsMap ()
 
void killer (const std::string &component, int ros, int drw, int index)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::vector< std::string > m_rejectedTileDrawer
 
std::vector< std::string > m_rejectedTileMB
 
std::vector< std::string > m_rejectedTileDigitizer
 
std::vector< std::string > m_rejectedTileDMU
 
std::vector< std::string > m_rejectedTileChannels
 
float m_zeroEnergy
 
const TileIDm_tileID
 
const TileHWIDm_tileHWID
 
std::bitset< 65536 > m_includedCellsMap
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 25 of file TileCellMaskingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileCellMaskingTool()

TileCellMaskingTool::TileCellMaskingTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 25 of file TileCellMaskingTool.cxx.

28  , m_tileID(0)
29  , m_tileHWID(0)
30 {
31  declareInterface<ICaloCellMakerTool>( this );
32 
33  declareProperty("RejectedTileDrawer", m_rejectedTileDrawer) ;
34  declareProperty("RejectedTileMB", m_rejectedTileMB) ;
35  declareProperty("RejectedTileDigitizer", m_rejectedTileDigitizer) ;
36  declareProperty("RejectedTileDMU", m_rejectedTileDMU) ;
37  declareProperty("RejectedTileChannels", m_rejectedTileChannels) ;
38 
39  declareProperty("BadChannelZeroEnergy",m_zeroEnergy = 0.5 * MeV); // half a MeV in both PMTs i.e. one MeV in a cell
40 }

Member Function Documentation

◆ channel_is_good()

bool TileCellMaskingTool::channel_is_good ( HWIdentifier hwid)
virtual

Definition at line 317 of file TileCellMaskingTool.cxx.

317  {
318 
320 
321  return m_includedCellsMap.test(ChHash);
322 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ DeclareInterfaceID()

ICaloCellMakerTool::DeclareInterfaceID ( ICaloCellMakerTool  ,
,
 
)
inherited

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillIncludedCellsMap()

StatusCode TileCellMaskingTool::fillIncludedCellsMap ( )
private

Definition at line 61 of file TileCellMaskingTool.cxx.

61  {
62 
63  m_includedCellsMap.set();
64 
65  int ros = 0, drw = 0, index = -1;
66 
67  for (const std::string& dr : m_rejectedTileDrawer) {
68  std::stringstream dris;
69  dris << dr;
70  dris >> ros >> drw;
71  killer("drawer", ros, drw, index);
72  }
73 
74  for (const std::string& mb : m_rejectedTileMB) {
75  std::stringstream dris;
76  dris << mb;
77  dris >> ros >> drw >> index;
78  killer("mb", ros, drw, index);
79  }
80 
81  for (const std::string& dig : m_rejectedTileDigitizer) {
82  std::stringstream dris;
83  dris << dig;
84  dris >> ros >> drw >> index;
85  killer("dig", ros, drw, index);
86  }
87 
88  for (const std::string& dmu : m_rejectedTileDMU) {
89  std::stringstream dris;
90  dris << dmu;
91  dris >> ros >> drw >> index;
92  killer("dmu", ros, drw, index);
93  }
94 
95  for (const std::string& chan : m_rejectedTileChannels) {
96  std::stringstream dris;
97  dris << chan;
98  dris >> ros >> drw >> index;
99  killer("channel", ros, drw, index);
100  }
101 
102  return StatusCode::SUCCESS;
103 }

◆ finalize()

StatusCode TileCellMaskingTool::finalize ( )
overridevirtual

Definition at line 310 of file TileCellMaskingTool.cxx.

310  {
311 
312  return StatusCode::SUCCESS;
313 }

◆ initialize()

StatusCode TileCellMaskingTool::initialize ( )
overridevirtual

Definition at line 44 of file TileCellMaskingTool.cxx.

44  {
45 
46  ATH_MSG_DEBUG( " TileCellMaskingTool called " );
47 
48  CHECK( detStore() -> retrieve(m_tileID, "TileID") );
49  CHECK( detStore() -> retrieve(m_tileHWID, "TileHWID") );
50 
52  ATH_MSG_DEBUG( " Will exclude "
53  << m_includedCellsMap.size() - m_includedCellsMap.count()
54  << " channels " );
55 
56  return StatusCode::SUCCESS;
57 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ killer()

void TileCellMaskingTool::killer ( const std::string &  component,
int  ros,
int  drw,
int  index 
)
private

Definition at line 107 of file TileCellMaskingTool.cxx.

107  {
108 
109  int begin = 0, end = 0;
110 
111  if (component == "drawer") {
112  begin = 0;
113  end = 48;
114  } else if (component == "mb") {
115  begin = (4 - index) * 12;
116  end = begin + 12;
117  } else if (component == "dig") {
118  begin = (8 - index) * 6;
119  end = begin + 6;
120  } else if (component == "dmu") {
121  begin = index * 3;
122  end = begin + 3;
123  } else {
124  begin = index;
125  end = begin + 1;
126  }
127 
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) {
133  ATH_MSG_WARNING( " wrong selection of "<< component
134  << " = " << index << " in TileCellMaskingTool::killer ");
135  } else {
136  msg(MSG::INFO) << " killing ros " << ros << " drawer " << drw;
137  if (component != "drawer") {
138  msg(MSG::INFO) << component << " " << index << endmsg;
139  } else {
140  msg(MSG::INFO) << endmsg;
141  }
142 
143  for (int channel = begin; channel < end; ++channel) {
146  m_includedCellsMap.reset(hash);
147  ATH_MSG_DEBUG( "deleting channel " << m_tileHWID->to_string(chid,-1)
148  << " hash " << hash );
149  }
150  }
151 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ process()

StatusCode TileCellMaskingTool::process ( CaloCellContainer theCellContainer,
const EventContext &  ctx 
) const
overridevirtual

Implements ICaloCellMakerTool.

Definition at line 155 of file TileCellMaskingTool.cxx.

157 {
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;
160 
161  size_t firstCell = theCont->indexFirstCellCalo(CaloCell_ID::TILE);
162  size_t lastCell = theCont->indexLastCellCalo(CaloCell_ID::TILE);
163 
164  for (size_t iCell = firstCell; iCell <= lastCell; ++iCell) {
165 
166  CaloCell* aCell = (*theCont)[iCell];
167  const CaloDetDescrElement * caloDDE = aCell->caloDDE();
168 
169  if (caloDDE->is_tile()) { // check if cell belongs to TileCalorimeter
170 
171  if (msgLvl(MSG::DEBUG)) {
172  ++n_cells;
173  ene_before += aCell->energy();
174  }
175 
176  IdentifierHash hash1 = caloDDE->onl1();
177  IdentifierHash hash2 = caloDDE->onl2();
178 
179  bool bit1 = m_includedCellsMap.test(hash1); // true - good channel
180  bool bit2 = m_includedCellsMap.test(hash2); // false - channel should be masked
181 
182  TileCell* pCell = (TileCell*) aCell;
183  int gain1 = pCell->gain1();
184  int gain2 = pCell->gain2();
185 
186  if (bit1) { // first is good
187 
188  if (!bit2) { // second is bad
189 
190  if (msgLvl(MSG::DEBUG)) {
191  ++n_masked_12;
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();
198  }
199  }
200 
201  float ene1 = pCell->ene1();
202  pCell->setEnergy(ene1, ene1, gain1, gain1); // use energy/gain from first pmt for both pmts
203  pCell->setTime(pCell->time1()); // use time from first pmt as cell time
204  pCell->setQuality(pCell->qual1(), (pCell->qbit1() | TileCell::MASK_BADCH), 1); // change quality flag for second pmt
205 
206  if (msgLvl(MSG::VERBOSE)) {
207  msg(MSG::VERBOSE) << " after " << pCell -> ene1()
208  << " + " << pCell -> ene2()
209  << " = " << pCell -> energy() << endmsg;
210  }
211  }
212  } else { // first is bad
213 
214  if (hash2 == TileHWID::NOT_VALID_HASH) { // cells wih single PMT
215 
216  if (msgLvl(MSG::DEBUG)) {
217  ++n_masked_1;
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();
224  }
225  }
226 
227  if (gain1 == CaloGain::INVALIDGAIN) {
228  pCell->setEnergy(m_zeroEnergy, 0.0, TileID::LOWGAIN, CaloGain::INVALIDGAIN); // reset energy completely, indicate problem putting low gain
229  } else {
230  pCell->setEnergy(m_zeroEnergy, 0.0); // reset energy completely without changing gain
231  }
232  pCell->setTime(0.0); // reset time completely
233  pCell->setQuality(255, TileCell::MASK_BADCH, 0); // reset quality flag for first pmt
234  pCell->setQuality(0, TileCell::MASK_BADCH, 1); // reset quality flag for second pmt
235 
236  if (msgLvl(MSG::VERBOSE)) {
237  msg(MSG::VERBOSE) << " after " << pCell->ene1()
238  << " + " << pCell->ene2()
239  << " = " << pCell->energy() << endmsg;
240  }
241 
242  } else if (bit2) { // second is good
243 
244  if (msgLvl(MSG::DEBUG)) {
245  ++n_masked_12;
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();
252  }
253  }
254 
255  float ene2 = pCell->ene2();
256  pCell->setEnergy(ene2, ene2, gain2, gain2); // use energy/gain from second pmt for both pmts
257  pCell->setTime(pCell->time2()); // use time from second pmt as cell time
258  pCell->setQuality(pCell->qual2(), (pCell->qbit2() | TileCell::MASK_BADCH), 0); // change quality flag for first pmt
259 
260  if (msgLvl(MSG::VERBOSE))
261  msg(MSG::VERBOSE) << " after " << pCell->ene1()
262  << " + " << pCell->ene2()
263  << " = " << pCell->energy() << endmsg;
264 
265  } else { // second is bad
266 
267  if (msgLvl(MSG::DEBUG)) {
268  ++n_masked_2;
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();
276  }
277  }
278 
280  if (gain1 == CaloGain::INVALIDGAIN) gain1 = 0; // this is TileID::LOWGAIN; - commented out to make Coverity happy
281  if (gain2 == CaloGain::INVALIDGAIN) gain2 = 0; // this is TileID::LOWGAIN; - commented out to make Coverity happy
282  pCell->setEnergy(m_zeroEnergy, m_zeroEnergy, gain1, gain2); // reset energy completely, indicate problem putting low gain
283  } else {
284  pCell->setEnergy(m_zeroEnergy, m_zeroEnergy); // reset energy completely without changing gain
285  }
286  pCell->setTime(0.0); // reset time completely
287  pCell->setQuality(255, TileCell::MASK_BADCH, 0); // reset quality flag for first pmt
288  pCell->setQuality(255, TileCell::MASK_BADCH, 1); // reset quality flag for second pmt
289 
290  if (msgLvl(MSG::VERBOSE)) {
291  msg(MSG::VERBOSE) << " after " << pCell->ene1()
292  << " + " << pCell->ene2()
293  << " = " << pCell->energy() << endmsg;
294  }
295  }
296  }
297  ene_after += aCell->energy();
298  }
299  }
300 
301  ATH_MSG_DEBUG( " Ncells: " << n_cells
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 );
304 
305  return StatusCode::SUCCESS;
306 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_includedCellsMap

std::bitset<65536> TileCellMaskingTool::m_includedCellsMap
private

Definition at line 53 of file TileCellMaskingTool.h.

◆ m_rejectedTileChannels

std::vector<std::string> TileCellMaskingTool::m_rejectedTileChannels
private

Definition at line 47 of file TileCellMaskingTool.h.

◆ m_rejectedTileDigitizer

std::vector<std::string> TileCellMaskingTool::m_rejectedTileDigitizer
private

Definition at line 45 of file TileCellMaskingTool.h.

◆ m_rejectedTileDMU

std::vector<std::string> TileCellMaskingTool::m_rejectedTileDMU
private

Definition at line 46 of file TileCellMaskingTool.h.

◆ m_rejectedTileDrawer

std::vector<std::string> TileCellMaskingTool::m_rejectedTileDrawer
private

Definition at line 43 of file TileCellMaskingTool.h.

◆ m_rejectedTileMB

std::vector<std::string> TileCellMaskingTool::m_rejectedTileMB
private

Definition at line 44 of file TileCellMaskingTool.h.

◆ m_tileHWID

const TileHWID* TileCellMaskingTool::m_tileHWID
private

Definition at line 51 of file TileCellMaskingTool.h.

◆ m_tileID

const TileID* TileCellMaskingTool::m_tileID
private

Definition at line 50 of file TileCellMaskingTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_zeroEnergy

float TileCellMaskingTool::m_zeroEnergy
private

Definition at line 48 of file TileCellMaskingTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileCell
Definition: TileCell.h:57
CaloDetDescrElement::onl2
IdentifierHash onl2() const
cell online identifier 2
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:408
TileCell::time1
float time1(void) const
get time of first PMT
Definition: TileCell.h:198
TileCell::setTime
virtual void setTime(float t) override final
set cell time, reset timeDiff
Definition: TileCell.h:257
TileCellMaskingTool::killer
void killer(const std::string &component, int ros, int drw, int index)
Definition: TileCellMaskingTool.cxx:107
TileCellMaskingTool::m_zeroEnergy
float m_zeroEnergy
Definition: TileCellMaskingTool.h:48
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TileCell::time2
float time2(void) const
get time of second PMT
Definition: TileCell.h:200
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TileCell::ene1
float ene1(void) const
get energy of first PMT
Definition: TileCell.h:193
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
CaloTime_fillDB.gain2
gain2
Definition: CaloTime_fillDB.py:357
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TileCellMaskingTool::m_includedCellsMap
std::bitset< 65536 > m_includedCellsMap
Definition: TileCellMaskingTool.h:53
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TileCellMaskingTool::m_rejectedTileDigitizer
std::vector< std::string > m_rejectedTileDigitizer
Definition: TileCellMaskingTool.h:45
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HWIdentifier
Definition: HWIdentifier.h:13
TileCell::MASK_BADCH
@ MASK_BADCH
Definition: TileCell.h:63
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
TileCellMaskingTool::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileCellMaskingTool.h:51
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
CaloDetDescrElement::onl1
IdentifierHash onl1() const
cell online identifier 1
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:404
CaloGain::INVALIDGAIN
@ INVALIDGAIN
Definition: CaloGain.h:18
TileCell::qual2
uint8_t qual2(void) const
get quality of second PMT (data member)
Definition: TileCell.h:206
TileCellMaskingTool::m_rejectedTileMB
std::vector< std::string > m_rejectedTileMB
Definition: TileCellMaskingTool.h:44
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
TileHWID::get_channel_hash
virtual IdentifierHash get_channel_hash(const HWIdentifier &id) const
create hash id from compact Channel id
Definition: TileHWID.cxx:590
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Tile_Base_ID::LOWGAIN
@ LOWGAIN
Definition: Tile_Base_ID.h:57
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
TileCell::qbit1
uint8_t qbit1(void) const
get quality bits of first PMT (data member)
Definition: TileCell.h:209
TileHWID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition: TileHWID.h:314
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileCellMaskingTool::fillIncludedCellsMap
StatusCode fillIncludedCellsMap()
Definition: TileCellMaskingTool.cxx:61
TileCell::gain1
int gain1(void) const
get gain of first PMT
Definition: TileCell.cxx:182
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
CaloDetDescrElement::is_tile
bool is_tile() const
cell belongs to Tile
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
CaloTime_fillDB.gain1
gain1
Definition: CaloTime_fillDB.py:356
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TileCell::setQuality
void setQuality(unsigned char qual, unsigned char qbit, int pmt)
set quality value and quality bits for one PMT
Definition: TileCell.h:286
TileHWID::channel_id
HWIdentifier channel_id(int ros, int drawer, int channel) const
channel HWIdentifer
Definition: TileHWID.cxx:199
TileCellMaskingTool::m_tileID
const TileID * m_tileID
Definition: TileCellMaskingTool.h:50
TileCellMaskingTool::m_rejectedTileDMU
std::vector< std::string > m_rejectedTileDMU
Definition: TileCellMaskingTool.h:46
TileCell::setEnergy
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero
Definition: TileCell.cxx:123
TileCell::qbit2
uint8_t qbit2(void) const
get quality bits of second PMT (data member)
Definition: TileCell.h:212
TileCell::gain2
int gain2(void) const
get gain of second PMT
Definition: TileCell.cxx:189
TileCell::ene2
float ene2(void) const
get energy of second PMT
Definition: TileCell.h:195
DeMoScan.index
string index
Definition: DeMoScan.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TRT_PAI_physicsConstants::mb
const double mb
1mb to cm2
Definition: TRT_PAI_physicsConstants.h:15
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
TileCell::qual1
uint8_t qual1(void) const
get quality of first PMT (data member)
Definition: TileCell.h:203
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileHWID::to_string
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
Definition: TileHWID.cxx:50
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TileCellMaskingTool::m_rejectedTileDrawer
std::vector< std::string > m_rejectedTileDrawer
Definition: TileCellMaskingTool.h:43
fitman.k
k
Definition: fitman.py:528
TileCellMaskingTool::m_rejectedTileChannels
std::vector< std::string > m_rejectedTileChannels
Definition: TileCellMaskingTool.h:47