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

#include <CalibHitIDCheck.h>

Inheritance diagram for CalibHitIDCheck:
Collaboration diagram for CalibHitIDCheck:

Public Member Functions

 CalibHitIDCheck (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~CalibHitIDCheck ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
void check (int)
 
void show_all ()
 
void check_all_cnts ()
 
void merge (Identifier)
 
void reset ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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 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
 

Public Attributes

bool m_Merge
 

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

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::string m_larDMHitContainer
 
std::string m_larActiveHitContainer
 
std::string m_larInactiveHitContainer
 
std::string m_tileActiveHitContainer
 
std::string m_tileInactiveHitContainer
 
std::string m_tiledmHitContainer
 
const CaloCalibrationHitContainerm_LArDMHitCnt
 
const CaloCalibrationHitContainerm_ActiveHitCnt
 
const CaloCalibrationHitContainerm_InactiveHitCnt
 
const CaloCalibrationHitContainerm_TileActiveHitCnt
 
const CaloCalibrationHitContainerm_TileInactiveHitCnt
 
const CaloCalibrationHitContainerm_TileDMHitCnt
 
bool m_Check
 
bool m_ShowAll
 
bool m_CheckAll
 
const AtlasDetectorIDm_id_helper
 
ID m_id_vec
 
DataObjIDColl m_extendedExtraObjects
 
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 28 of file CalibHitIDCheck.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CalibHitIDCheck()

CalibHitIDCheck::CalibHitIDCheck ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 33 of file CalibHitIDCheck.cxx.

34  :AthAlgorithm(name, pSvcLocator),
35  m_Merge(false),
36  m_LArDMHitCnt(nullptr),
37  m_ActiveHitCnt(nullptr),
38  m_InactiveHitCnt(nullptr),
39  m_TileActiveHitCnt(nullptr),
40  m_TileInactiveHitCnt(nullptr),
41  m_TileDMHitCnt(nullptr),
42  m_id_helper(nullptr)
43 {
44  declareProperty("InactiveCalibHitCnt", m_larInactiveHitContainer = "LArCalibrationHitInactive");
45  declareProperty("ActiveCalibHitCnt", m_larActiveHitContainer = "LArCalibrationHitActive");
46  declareProperty("LArDMCalibHitCnt", m_larDMHitContainer = "LArCalibrationHitDeadMaterial");
47  declareProperty("TileActiveHitCnt", m_tileActiveHitContainer = "TileCalibHitActiveCell");
48  declareProperty("TileInactiveHitCnt", m_tileInactiveHitContainer = "TileCalibHitInactiveCell");
49  declareProperty("TileDMCalibHitCnt", m_tiledmHitContainer = "TileCalibHitDeadMaterial");
50 
51  declareProperty("Check", m_Check = true);
52  declareProperty("ShowAll", m_ShowAll = false);
53  declareProperty("CheckAll", m_CheckAll = false);
54 
55 }

◆ ~CalibHitIDCheck()

CalibHitIDCheck::~CalibHitIDCheck ( )
virtualdefault

Member Function Documentation

◆ check()

void CalibHitIDCheck::check ( int  l_cnt)

Definition at line 135 of file CalibHitIDCheck.cxx.

135  {
136 
137  std::vector<Identifier> id_vec;
138  std::map<Identifier, int> id_map;
141 
142  bool no_invalid = true;
143  bool no_alien = true;
144 
145  //define appropriate iterator over the container
146  switch(l_cnt) {
147  case 0:
148 
149  if((m_InactiveHitCnt->Size()) != 0 )
150  {
151  ATH_MSG_INFO(" " );
152  ATH_MSG_INFO("*************************************************************" );
153  ATH_MSG_INFO("Investigate CalibHit IDs from LAr Inactive CalibHit Container" );
154  ATH_MSG_INFO("*************************************************************" );
155 
157  end = m_InactiveHitCnt->end();
158  }
159  else
160  {
161  return;
162  }
163  break;
164 
165 
166  case 1:
167 
168  if((m_ActiveHitCnt->Size()) != 0 )
169  {
170  ATH_MSG_INFO(" " );
171  ATH_MSG_INFO("***********************************************************" );
172  ATH_MSG_INFO("Investigate CalibHit IDs from LAr Active CalibHit Container" );
173  ATH_MSG_INFO("***********************************************************" );
174 
175  it = m_ActiveHitCnt->begin();
176  end = m_ActiveHitCnt->end();
177 
178  m_Merge=true;
179  }
180  else
181  {
182  return;
183  }
184  break;
185 
186 
187  case 2:
188 
189  if((m_TileInactiveHitCnt->Size()) != 0 )
190  {
191  ATH_MSG_INFO(" " );
192  ATH_MSG_INFO("**************************************************************" );
193  ATH_MSG_INFO("Investigate CalibHit IDs from Tile Inactive CalibHit container" );
194  ATH_MSG_INFO("**************************************************************" );
195 
198  }
199  else
200  {
201  return;
202  }
203  break;
204 
205 
206  case 3:
207 
208  if((m_TileActiveHitCnt->Size()) != 0 )
209  {
210  ATH_MSG_INFO(" " );
211  ATH_MSG_INFO("************************************************************" );
212  ATH_MSG_INFO("Investigate CalibHit IDs from Tile Active CalibHit container" );
213  ATH_MSG_INFO("************************************************************" );
214 
217 
218  m_Merge=true;
219  }
220  else
221  {
222  return;
223  }
224  break;
225 
226 
227  case 4:
228 
229  if((m_LArDMHitCnt->Size()) != 0 )
230  {
231  ATH_MSG_INFO(" " );
232  ATH_MSG_INFO("*******************************************************" );
233  ATH_MSG_INFO("Investigate CalibHit IDs from LAr DM CalibHit Container" );
234  ATH_MSG_INFO("*******************************************************" );
235 
236  it = m_LArDMHitCnt->begin();
237  end = m_LArDMHitCnt->end();
238  }
239  else
240  {
241  return;
242  }
243  break;
244 
245 
246  case 5:
247 
248  if((m_TileDMHitCnt->Size()) != 0 )
249  {
250  ATH_MSG_INFO(" " );
251  ATH_MSG_INFO("********************************************************" );
252  ATH_MSG_INFO("Investigate CalibHit IDs from Tile DM CalibHit Container" );
253  ATH_MSG_INFO("********************************************************" );
254 
255  it = m_TileDMHitCnt->begin();
256  end = m_TileDMHitCnt->end();
257  }
258  else
259  {
260  return;
261  }
262  break;
263 
264  default:
265  return;
266  }
267 
268 
269  //Now, iterate over the container to find
270  //not valid, 'alien' and repeated IDs
271  for(; it != end; ++it) {
272 
273  Identifier id=(*it)->cellID();
274 
275 
276  //Check ID whether is it valid or not
277  if(!id.is_valid()) {
278 
279  ATH_MSG_ERROR("Invalid Identifier of CalibHit is found! "
280  <<m_id_helper->show_to_string(id) );
281 
282  no_invalid=false;
283  }
284 
285 
286 
287  //Check for 'alien' IDs in the container
288  switch(l_cnt) {
289  case 0:
290  case 1:
291  if( !(m_id_helper->is_lar(id)) ) {
292  ATH_MSG_INFO("Found CalibHit with NO LAr ID "
293  <<m_id_helper->show_to_string(id) );
294  no_alien=false;
295  }
296  break;
297 
298  case 2:
299  case 3:
300  if( !(m_id_helper->is_tile(id)) ) {
301  ATH_MSG_INFO("Found CalibHit with NO Tile ID "
302  <<m_id_helper->show_to_string(id) );
303  no_alien=false;
304  }
305  break;
306 
307  case 4:
308  if( !(m_id_helper->is_lar_dm(id)) &&
309  //It's normal to find Tile DM ID
310  //recorded by Default Calculator
311  !(m_id_helper->is_tile_dm(id)) ) {
312  ATH_MSG_INFO("Found CalibHit with NO LAr DM ID "
313  <<m_id_helper->show_to_string(id) );
314  no_alien=false;
315  }
316  break;
317 
318  case 5:
319  if( !(m_id_helper->is_tile_dm(id)) ) {
320  ATH_MSG_INFO("Found CalibHit with NO Tile DM ID "
321  <<m_id_helper->show_to_string(id) );
322  no_alien=false;
323  }
324  break;
325 
326  }
327 
328 
329  bool no_rep = true;
330 
331  //Fill id_map with IDs, which are repeted more then once in the container
332  for (int iter=0; iter<static_cast<int>(id_vec.size()); iter++) {
333  if(id == id_vec[iter]) {
334 
335  if(id_map.find(id)==id_map.end()) {
336  id_map.insert(std::make_pair(id,2));
337  }
338  else {
339  map_it=id_map.find(id);
340  (map_it->second)++ ;
341  }
342 
343  no_rep = false;
344  break;
345  }
346  }
347 
348  if(no_rep) {
349  id_vec.push_back(id);
350 
351  //store id in the vector for all containers and
352  //don't forget merge Inactive & Active CalibHit IDs
353  if(m_Merge) merge(id);
354  else m_id_vec.push_back(id);
355  }
356  else {
357  //repeated ID should not be stored because
358  //its first pattern was already stored &
359  //should not be merged still the same reason
360  //as above.
361  }
362 
363  }//End of looping over the CalibHits inside the container
364 
365 
366  //reset merge flag anyway.
367  //It is needed 'true' only twice
368  m_Merge=false;
369 
370 
371  //tell if no invalid IDs were eppeared
372  if(no_invalid) {
373 
374  ATH_MSG_INFO("------------------------------------- " );
375  ATH_MSG_INFO("No invalid Identifiers has been found " );
376  ATH_MSG_INFO("------------------------------------- " );
377 
378  }
379 
380 
381  //tell if no 'alien' IDs were eppeared
382  if(no_alien) {
383 
384  ATH_MSG_INFO("------------------------------------------------------" );
385  ATH_MSG_INFO("No container not-respective Identifiers has been found" );
386  ATH_MSG_INFO("------------------------------------------------------" );
387 
388  }
389 
390 
391  //Print the result of looking for repeated IDs
392  if(!id_map.empty()) {
393 
394  ATH_MSG_INFO("----------------------------------------------- " );
395  ATH_MSG_INFO("Found repeated Identifiers | how many times " );
396  ATH_MSG_INFO("----------------------------------------------- " );
397 
398  for (const std::pair<const Identifier, int>& p : id_map) {
400  <<" "<< p.second );
401  }
402 
403  }
404  else {
405  ATH_MSG_INFO("----------------------------------------------- " );
406  ATH_MSG_INFO("No repeated CalibHit Identifiers has been found " );
407  ATH_MSG_INFO("----------------------------------------------- " );
408  }
409 
410 }

◆ check_all_cnts()

void CalibHitIDCheck::check_all_cnts ( )

Definition at line 480 of file CalibHitIDCheck.cxx.

480  {
481 
482  ATH_MSG_INFO("======================================================" );
483  ATH_MSG_INFO("Check for the CalibHits Identifiers has been repeated " );
484  ATH_MSG_INFO(" inside the different CalibHit containers " );
485  ATH_MSG_INFO("======================================================" );
486 
487 
488  bool no_rep=true;
489 
490  for (size_t i=0; i < m_id_vec.size(); i++) {
491 
492  ID::iterator it_end = std::remove (m_id_vec.begin()+i+1,
493  m_id_vec.end(),
494  m_id_vec[i]);
495  int same = m_id_vec.end() - it_end;
496  m_id_vec.erase (it_end, m_id_vec.end());
497 
498  if(same!=0) {
499  ATH_MSG_INFO("Identifier "
501  <<" is repeated "<<(same+1)<<" times"
502  <<" inside different containers " );
503 
504  no_rep=false;
505  }
506  } //end looping
507 
508 
509  if(no_rep) {
510  ATH_MSG_INFO("*** No repeated CalibHit Identifier "
511  <<"in the different containers was found ***" );
512  }
513 
514 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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; }

◆ execute()

StatusCode CalibHitIDCheck::execute ( )

Definition at line 73 of file CalibHitIDCheck.cxx.

74 {
81 
82  //We need merge only Inactive and Active
83  //LAr CalibHit Containers only once
84  m_Merge=false;
85 
86 
87  //check containers separately
88  if(m_Check) {
89  if(m_InactiveHitCnt) { check(0); }
90  if(m_ActiveHitCnt) { check(1); }
91  if(m_TileInactiveHitCnt){ check(2); }
92  if(m_TileActiveHitCnt) { check(3); }
93  if(m_LArDMHitCnt) { check(4); }
94  if(m_TileDMHitCnt) { check(5); }
95  }
96 
97 
98  //show all IDs from all containers
99  if(m_ShowAll) show_all();
100 
101 
102  //check all containers
104 
105 
106  //reset member 'm_id_vec'
107  reset();
108 
109 
110  ATH_MSG_DEBUG("execute() completed successfully" );
111  return StatusCode::SUCCESS;
112 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode CalibHitIDCheck::finalize ( )

Definition at line 118 of file CalibHitIDCheck.cxx.

119 {
120  ATH_MSG_INFO("finalize() successfully" );
121  return StatusCode::SUCCESS;
122 }

◆ initialize()

StatusCode CalibHitIDCheck::initialize ( )

Definition at line 62 of file CalibHitIDCheck.cxx.

63 {
65  ATH_MSG_INFO("initialisation completed" );
66  return StatusCode::SUCCESS;
67 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ merge()

void CalibHitIDCheck::merge ( Identifier  id)

Definition at line 418 of file CalibHitIDCheck.cxx.

418  {
419 
420  bool new_id = false;
421 
422  if(!m_id_vec.empty()) {
423 
424  for (int iter=0; iter != static_cast<int>(m_id_vec.size()); iter++) {
425  if(id == m_id_vec[iter]) {
426  new_id = false;
427  break;
428  }
429  else {
430  new_id = true;
431  }
432  }
433 
434  if(new_id) m_id_vec.push_back(id);
435  }
436  else {
437  //nothing to merge.
438  //push all IDs in the vector
439  m_id_vec.push_back(id) ;
440  }
441 
442 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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.

◆ 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< Algorithm > >::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< Algorithm > >::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  }

◆ reset()

void CalibHitIDCheck::reset ( )
inline

Definition at line 43 of file CalibHitIDCheck.h.

43 {m_id_vec.clear();}

◆ show_all()

void CalibHitIDCheck::show_all ( )

Definition at line 448 of file CalibHitIDCheck.cxx.

448  {
449 
450  ATH_MSG_INFO("=================================================" );
451  ATH_MSG_INFO("Show all CalibHits Identifiers for current events" );
452  ATH_MSG_INFO("=================================================" );
453 
454  for (int iter=0; iter != static_cast<int>(m_id_vec.size()); iter++) {
455 
457 
458  }
459 
460 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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_ActiveHitCnt

const CaloCalibrationHitContainer* CalibHitIDCheck::m_ActiveHitCnt
private

Definition at line 57 of file CalibHitIDCheck.h.

◆ m_Check

bool CalibHitIDCheck::m_Check
private

Definition at line 63 of file CalibHitIDCheck.h.

◆ m_CheckAll

bool CalibHitIDCheck::m_CheckAll
private

Definition at line 65 of file CalibHitIDCheck.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_id_helper

const AtlasDetectorID* CalibHitIDCheck::m_id_helper
private

Definition at line 67 of file CalibHitIDCheck.h.

◆ m_id_vec

ID CalibHitIDCheck::m_id_vec
private

Definition at line 69 of file CalibHitIDCheck.h.

◆ m_InactiveHitCnt

const CaloCalibrationHitContainer* CalibHitIDCheck::m_InactiveHitCnt
private

Definition at line 58 of file CalibHitIDCheck.h.

◆ m_larActiveHitContainer

std::string CalibHitIDCheck::m_larActiveHitContainer
private

Definition at line 50 of file CalibHitIDCheck.h.

◆ m_LArDMHitCnt

const CaloCalibrationHitContainer* CalibHitIDCheck::m_LArDMHitCnt
private

Definition at line 56 of file CalibHitIDCheck.h.

◆ m_larDMHitContainer

std::string CalibHitIDCheck::m_larDMHitContainer
private

Definition at line 49 of file CalibHitIDCheck.h.

◆ m_larInactiveHitContainer

std::string CalibHitIDCheck::m_larInactiveHitContainer
private

Definition at line 51 of file CalibHitIDCheck.h.

◆ m_Merge

bool CalibHitIDCheck::m_Merge

Definition at line 45 of file CalibHitIDCheck.h.

◆ m_ShowAll

bool CalibHitIDCheck::m_ShowAll
private

Definition at line 64 of file CalibHitIDCheck.h.

◆ m_TileActiveHitCnt

const CaloCalibrationHitContainer* CalibHitIDCheck::m_TileActiveHitCnt
private

Definition at line 59 of file CalibHitIDCheck.h.

◆ m_tileActiveHitContainer

std::string CalibHitIDCheck::m_tileActiveHitContainer
private

Definition at line 52 of file CalibHitIDCheck.h.

◆ m_TileDMHitCnt

const CaloCalibrationHitContainer* CalibHitIDCheck::m_TileDMHitCnt
private

Definition at line 61 of file CalibHitIDCheck.h.

◆ m_tiledmHitContainer

std::string CalibHitIDCheck::m_tiledmHitContainer
private

Definition at line 54 of file CalibHitIDCheck.h.

◆ m_TileInactiveHitCnt

const CaloCalibrationHitContainer* CalibHitIDCheck::m_TileInactiveHitCnt
private

Definition at line 60 of file CalibHitIDCheck.h.

◆ m_tileInactiveHitContainer

std::string CalibHitIDCheck::m_tileInactiveHitContainer
private

Definition at line 53 of file CalibHitIDCheck.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CalibHitIDCheck::m_CheckAll
bool m_CheckAll
Definition: CalibHitIDCheck.h:65
AtlasDetectorID::is_lar
bool is_lar(Identifier id) const
Definition: AtlasDetectorID.h:689
CalibHitIDCheck::m_id_vec
ID m_id_vec
Definition: CalibHitIDCheck.h:69
CalibHitIDCheck::merge
void merge(Identifier)
Definition: CalibHitIDCheck.cxx:418
CalibHitIDCheck::m_TileInactiveHitCnt
const CaloCalibrationHitContainer * m_TileInactiveHitCnt
Definition: CalibHitIDCheck.h:60
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CalibHitIDCheck::show_all
void show_all()
Definition: CalibHitIDCheck.cxx:448
CalibHitIDCheck::m_tileInactiveHitContainer
std::string m_tileInactiveHitContainer
Definition: CalibHitIDCheck.h:53
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.TrigEgammaFastCaloHypoTool.same
def same(val, tool)
Definition: TrigEgammaFastCaloHypoTool.py:12
CalibHitIDCheck::m_InactiveHitCnt
const CaloCalibrationHitContainer * m_InactiveHitCnt
Definition: CalibHitIDCheck.h:58
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
AthenaHitsVector< CaloCalibrationHit >::const_iterator
boost::transform_iterator< make_const, typename CONT::const_iterator > const_iterator
Definition: AthenaHitsVector.h:58
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CalibHitIDCheck::check_all_cnts
void check_all_cnts()
Definition: CalibHitIDCheck.cxx:480
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AtlasDetectorID::is_tile_dm
bool is_tile_dm(Identifier id) const
Definition: AtlasDetectorID.h:748
CalibHitIDCheck::m_ShowAll
bool m_ShowAll
Definition: CalibHitIDCheck.h:64
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CalibHitIDCheck::m_ActiveHitCnt
const CaloCalibrationHitContainer * m_ActiveHitCnt
Definition: CalibHitIDCheck.h:57
AtlasDetectorID::is_tile
bool is_tile(Identifier id) const
Definition: AtlasDetectorID.h:695
CalibHitIDCheck::m_LArDMHitCnt
const CaloCalibrationHitContainer * m_LArDMHitCnt
Definition: CalibHitIDCheck.h:56
CalibHitIDCheck::m_tileActiveHitContainer
std::string m_tileActiveHitContainer
Definition: CalibHitIDCheck.h:52
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CalibHitIDCheck::m_tiledmHitContainer
std::string m_tiledmHitContainer
Definition: CalibHitIDCheck.h:54
CalibHitIDCheck::check
void check(int)
Definition: CalibHitIDCheck.cxx:135
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CalibHitIDCheck::reset
void reset()
Definition: CalibHitIDCheck.h:43
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
AtlasDetectorID::is_lar_dm
bool is_lar_dm(Identifier id) const
LAr/Tile dead material:
Definition: AtlasDetectorID.h:736
h
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
AthenaHitsVector::Size
int Size() const
Definition: AthenaHitsVector.h:96
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CalibHitIDCheck::m_Merge
bool m_Merge
Definition: CalibHitIDCheck.h:45
CalibHitIDCheck::m_TileDMHitCnt
const CaloCalibrationHitContainer * m_TileDMHitCnt
Definition: CalibHitIDCheck.h:61
CalibHitIDCheck::m_Check
bool m_Check
Definition: CalibHitIDCheck.h:63
CalibHitIDCheck::m_id_helper
const AtlasDetectorID * m_id_helper
Definition: CalibHitIDCheck.h:67
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
CalibHitIDCheck::m_larActiveHitContainer
std::string m_larActiveHitContainer
Definition: CalibHitIDCheck.h:50
CalibHitIDCheck::m_TileActiveHitCnt
const CaloCalibrationHitContainer * m_TileActiveHitCnt
Definition: CalibHitIDCheck.h:59
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
AthenaHitsVector::end
const_iterator end() const
Definition: AthenaHitsVector.h:143
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
CalibHitIDCheck::m_larDMHitContainer
std::string m_larDMHitContainer
Definition: CalibHitIDCheck.h:49
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthenaHitsVector::begin
const_iterator begin() const
Definition: AthenaHitsVector.h:139
fitman.k
k
Definition: fitman.py:528
CalibHitIDCheck::m_larInactiveHitContainer
std::string m_larInactiveHitContainer
Definition: CalibHitIDCheck.h:51
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14