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

#include <LArCablingChecker.h>

Inheritance diagram for LArCablingChecker:
Collaboration diagram for LArCablingChecker:

Public Member Functions

 LArCablingChecker (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~LArCablingChecker ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
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
 

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

int m_count
 
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
 
SG::ReadCondHandleKey< LArBadChannelContm_BCKey {this, "BadChanKey", "LArBadChannel", "SG bad channels key"}
 
SG::ReadCondHandleKey< LArCalibLineMappingm_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
 
const LArOnlineIDm_onlineHelper
 
const LArEM_IDm_emId
 
std::ofstream m_outfile
 
std::string m_key
 
std::string m_outFileName
 
std::vector< bool > * m_errorcellsThisEvent
 
int m_errorCounterThisEvent
 
std::vector< bool > * m_errorcellsPreviousEvent
 
int m_errorCounterPreviousEvent
 
int m_numberOfEventsWithThisErrorState
 
LArOnlineID::size_type m_channelHashMax
 
bool m_PrintAllCellsAndEvents
 
bool m_PrintDisconnectedCells
 
int m_ADCThreshold
 
int m_DACHighGainThreshold
 
int m_DACMediumGainThreshold
 
int m_DACLowGainThreshold
 
bool m_printEventSummary
 
bool m_useBadChannelTool
 
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 20 of file LArCablingChecker.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

◆ LArCablingChecker()

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

Definition at line 14 of file LArCablingChecker.cxx.

15  : AthAlgorithm(name, pSvcLocator),
16  //m_chan(0),
17  m_onlineHelper(0),
18  m_emId(0),
25 {
26  m_count = 0;
27  declareProperty("DigitKey", m_key = "");
28  declareProperty("FileName", m_outFileName = "CablingSummary.txt");
29  //declareProperty("Pattern", m_vPattern);
30  declareProperty("ADCThreshold", m_ADCThreshold = 1250);
31  declareProperty("DACHighGainThreshold", m_DACHighGainThreshold = 100);
32  declareProperty("DACMediumGainThreshold", m_DACMediumGainThreshold = 1000);
33  declareProperty("DACLowGainThreshold", m_DACLowGainThreshold = 10000);
34  declareProperty("PrintAllCellsAndEvents", m_PrintAllCellsAndEvents = false);
35  declareProperty("PrintDisconnectedCells", m_PrintDisconnectedCells = true);
36  declareProperty("PrintEventSummary", m_printEventSummary = false);
37  declareProperty("UseBadChannelTool", m_useBadChannelTool = true);
38 }

◆ ~LArCablingChecker()

LArCablingChecker::~LArCablingChecker ( )

Definition at line 40 of file LArCablingChecker.cxx.

40  {
41  //empty
42 }

Member Function Documentation

◆ 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 LArCablingChecker::execute ( )

Definition at line 76 of file LArCablingChecker.cxx.

76  {
77  const EventContext& ctx = Gaudi::Hive::currentContext();
78  unsigned eventNb = ctx.eventID().event_number();
79 
80  ATH_MSG_INFO ( "======== executing event "<< eventNb << " ========" );
81  //m_outfile << "Checking Event " << eventNb << "..." << std::endl;
82 
83  //log << MSG::INFO << "Retrieving LArDigitContainer. Key= " << m_key << std::endl;
84  const LArDigitContainer* larDigitCont = nullptr;
85  ATH_CHECK( evtStore()->retrieve(larDigitCont, m_key) );
86 
87  //const LArCalibParams* calibParams;
88  const LArCalibParams* calibParams = nullptr;
89  ATH_CHECK( detStore()->retrieve(calibParams,"LArCalibParams") );
90 
92  const LArBadChannelCont *bcCont {*readHandle};
93  if(!bcCont) {
94  ATH_MSG_ERROR( "Do not have Bad chan container " << m_BCKey.key() );
95  return StatusCode::FAILURE;
96  }
97 
99  const LArOnOffIdMapping* cabling=*cablingHdl;
100  if(!cabling) {
101  ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping" );
102  return StatusCode::FAILURE;
103  }
104 
106  const LArCalibLineMapping *clCont {*clHdl};
107  if(!clCont) {
108  ATH_MSG_ERROR( "Do not have calib line mapping !!!" );
109  return StatusCode::FAILURE;
110  }
111 
112 
113  // Using vectors like this works because the hashes seem to be guaranteed to be collision-free.
114  delete m_errorcellsPreviousEvent; // OK to delete 0, Stroustrup 6.2.6
116  m_errorcellsThisEvent = new std::vector<bool>(m_channelHashMax); // All elements initialized to false, Stroustrup 16.3.4
117 
120 
121  int cellsCounter = 0;
122 
123  int inconsistencyCounter = 0;
124  int disconnectedCounter = 0;
125  int badChannelCounter = 0;
126 
127  bool signalPresent;
128  bool pulsed;
129  bool badChannel;
130  bool disconnected;
131 
132  // Put errors in ErrorList, to print if needed.
133  std::ostringstream ErrorList;
134 
135  // Loop on all cells (digits).
136  for (const LArDigit* digit : *larDigitCont) {
137  cellsCounter++;
138 
139  ErrorList.clear();
140 
141  // Get FEB info.
142  const HWIdentifier online_id = digit->hardwareID();
143  const HWIdentifier febid = m_onlineHelper->feb_Id(online_id);
144 
145  int chNb = m_onlineHelper->channel(online_id);
146 
147  // Check if channel is connected.
148  if (!cabling->isOnlineConnected(online_id)) {
149  disconnected = true;
150  disconnectedCounter++;
151  } else
152  disconnected = false;
153 
154  Identifier offline_id;
155 
156  // Get offline id.
157  bool noOffline_id = false;
158  try {
159  offline_id = cabling->cnvToIdentifier(online_id);
160  }
161  catch (const LArID_Exception&) {
162  noOffline_id = true;
163  }
164 
165  // Find out if signal over theshold is present.
166  // Set signalPresent.
167  const int max = *max_element(digit->samples().begin(), digit->samples().end());
168  if (max >= m_ADCThreshold)
169  signalPresent = true;
170  else
171  signalPresent = false;
172 
173  // Loop on calibchannels to see which, if any, that pulsed the cell.
174  // Set pulsed and DACvalue, and fill PulserList.
175  pulsed = false;
176  int DACvalue = -1;
177  std::ostringstream PulserList;
178  const std::vector<HWIdentifier>& calibChannelIDs=clCont->calibSlotLine(online_id);
179 
180  for (HWIdentifier hwid : calibChannelIDs) {
181  //m_outfile << hwid.get_compact() << " ";
182  bool isPulsed=calibParams->isPulsed(eventNb, hwid);
183  if (isPulsed) {
184  int DACvalue_temp = calibParams->DAC(eventNb, hwid);
185  if (DACvalue_temp > DACvalue)
186  DACvalue = DACvalue_temp;
187  pulsed = true;
188  const int slot = m_onlineHelper->slot(hwid);
189  const int line = m_onlineHelper->channel(hwid);
190  PulserList << std::hex << hwid.get_compact() << std::dec << " " << slot << " " << line << " ";
191  }
192  }
193  //m_outfile << std::endl;
194 
195  CaloGain::CaloGain gain = digit->gain();
196  bool DACOverThreshold;
197  switch (gain) {
198  case CaloGain::LARLOWGAIN :
199  DACOverThreshold = DACvalue >= m_DACLowGainThreshold;
200  break;
202  DACOverThreshold = DACvalue >= m_DACMediumGainThreshold;
203  break;
204  case CaloGain::LARHIGHGAIN :
205  DACOverThreshold = DACvalue >= m_DACHighGainThreshold;
206  break;
207  default:
208  DACOverThreshold = DACvalue >= m_DACHighGainThreshold;
209  }
210 
211  // Find out if we have a bad cell.
212  if (m_useBadChannelTool && !noOffline_id) {
213  if (bcCont->offlineStatus(offline_id).good()) {
214  badChannel = false;
215  } else {
216  badChannel = true;
217  badChannelCounter++;
218  }
219  } else {
220  badChannel = false;
221  }
222 
223  // Analyze and report.
224 
225  bool inconsistency = (signalPresent != pulsed) && DACOverThreshold;
226  if (inconsistency)
227  inconsistencyCounter++;
228 
229  bool errorInCell = inconsistency || badChannel;
230  if (errorInCell)
232 
233  std::ostringstream CellData;
234  CellData << "0x" << std::hex << std::setw(8) << febid.get_compact() << std::dec
235  << std::setw(5) << m_onlineHelper->feedthrough(febid)
236  << std::setw(5) << m_onlineHelper->slot(febid)
237  << std::setw(5) << chNb;
238 
239  CellData << std::setw(5);
240  if (noOffline_id)
241  CellData << "-";
242  else
243  CellData << m_emId->sampling(offline_id);
244 
245  CellData << std::setw(5);
246  if (noOffline_id)
247  CellData << "-";
248  else
249  CellData << m_emId->eta(offline_id);
250 
251  CellData << std::setw(5);
252  if (noOffline_id)
253  CellData << "-";
254  else
255  CellData << m_emId->phi(offline_id);
256 
257  CellData << std::setw(7) << max;
258  if (DACvalue >= 0) // Above have set DACvalue=-1 if got no DAC value.
259  CellData << std::setw(7) << DACvalue;
260  else
261  CellData << std::setw(7) << "-";
262 
263  if (disconnected) {
265  ErrorList << " D ";
266  ErrorList << CellData.str() << std::endl;
267  }
268  }
269  else {
270  // Set relevant bit in m_errorcellsThisEvent if error in this cell.
271  if (errorInCell)
272  (*m_errorcellsThisEvent)[m_onlineHelper->channel_Hash(online_id)] = true;
273 
274  if (errorInCell || m_PrintAllCellsAndEvents) {
275  if (inconsistency)
276  ErrorList << "I";
277  else
278  ErrorList << " ";
279  if (pulsed)
280  ErrorList << "P";
281  else
282  ErrorList << " ";
283  if (signalPresent)
284  ErrorList << "S";
285  else
286  ErrorList << " ";
287  if (badChannel)
288  ErrorList << "B ";
289  else
290  ErrorList << " ";
291 
292  ErrorList << CellData.str();
293 
294  if (pulsed)
295  ErrorList << " " << PulserList.str();
296 
297  ErrorList << std::endl;
298  }
299  }
300  } //End looping on all cells
301 
302  ErrorList << std::endl;
303 
304  if (m_printEventSummary) {
305  ErrorList << "Examined " << cellsCounter << " cells in event " << eventNb << ". Found:" << std::endl;
306  ErrorList << std::left << std::setw(25) << "Inconsistencies: "
307  << std::right << std::setw(4) << inconsistencyCounter << std::endl;
308  ErrorList << std::left << std::setw(25) << "Bad cells: "
309  << std::right << std::setw(4) << badChannelCounter << std::endl;
310  ErrorList << std::left << std::setw(25) << "Sum errors: "
311  << std::right << std::setw(4) << m_errorCounterThisEvent << std::endl;
312  ErrorList << std::left << std::setw(25) << "Disconnected cells: "
313  << std::right << std::setw(4) << disconnectedCounter << std::endl;
314  ErrorList << std::endl;
315  }
316 
318  // Compare m_errorcellsThisEvent to m_errorcellsPreviousEvent
319  if (*m_errorcellsThisEvent == *m_errorcellsPreviousEvent) { // Pray to God this is optimized.
320  // Same status as previous event, increase counter and go to next event.
322  }
323  else {
324  // A new status for this event. Print number of repeats for the previous one and print new state, if an error.
326  m_outfile << "Last error occurred in "
327  << m_numberOfEventsWithThisErrorState << " events." << std::endl << std::endl;
328 
329  if (m_errorCounterThisEvent != 0) {
330  m_outfile << "Error in event "<< std::setw(7) << eventNb
331  << " ==========================================================================" << std::endl;
332  m_outfile << "I=Inconsistency P=Pulsed S=Signal B=Bad D=Disconnected" << std::endl;
333  m_outfile << " "
334  << std::left << std::setw(10) << "FEB"
335  << std::right << std::setw(5) << "FT"
336  << std::setw(5) << "SL"
337  << std::setw(5) << "CH"
338  << std::setw(5) << "Smpl"
339  << std::setw(5) << "Eta"
340  << std::setw(5) << "Phi"
341  << std::setw(7) << "ADC"
342  << std::setw(7) << "DAC"
343  << " Pulsed by calibchannel slot line"
344  << std::endl;
345 
346  m_outfile << ErrorList.str();
347  }
348 
350  }
351  }
352  else { // m_PrintAllCellsAndEvents==true
353  m_outfile << "Status of event "<< std::setw(7) << eventNb
354  << " ==========================================================================" << std::endl;
355  m_outfile << "I=Inconsistency P=Pulsed S=Signal B=Bad D=Disconnected" << std::endl;
356  m_outfile << " "
357  << std::left << std::setw(10) << "FEB"
358  << std::right << std::setw(5) << "FT"
359  << std::setw(5) << "SL"
360  << std::setw(5) << "CH"
361  << std::setw(5) << "Smpl"
362  << std::setw(5) << "Eta"
363  << std::setw(5) << "Phi"
364  << std::setw(7) << "ADC"
365  << std::setw(7) << "DAC"
366  << " Pulsed by slot line"
367  << std::endl;
368 
369  m_outfile << ErrorList.str();
370  }
371 
372  return StatusCode::SUCCESS;
373 }

◆ 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 LArCablingChecker::finalize ( )

Definition at line 375 of file LArCablingChecker.cxx.

375  {
377  m_outfile << "Last error occurred in " << m_numberOfEventsWithThisErrorState << " events." << std::endl << std::endl;
378 
379  m_outfile.close();
380 
381  delete m_errorcellsThisEvent;
383 
384  return StatusCode::SUCCESS;
385 }

◆ initialize()

StatusCode LArCablingChecker::initialize ( )

Definition at line 44 of file LArCablingChecker.cxx.

44  {
45  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
48 
49  if (m_useBadChannelTool) {
50  ATH_CHECK( m_BCKey.initialize() );
51  }
52 
53  m_outfile.open(m_outFileName.c_str(), std::ios::out);
54  if (!m_outfile.is_open()) {
55  ATH_MSG_ERROR ( "Unable to open output file with name " << m_outFileName );
56  return StatusCode::FAILURE;
57  }
58 
59  const CaloCell_ID* idHelper = nullptr;
60  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
61  m_emId=idHelper->em_idHelper();
62 
64 
67  // Phony "previous" event so that the first event has something to compare to.
68  m_errorcellsThisEvent = new std::vector<bool>(m_channelHashMax);
71 
72  ATH_MSG_DEBUG ( "======== LArCablingChecker initialize successfully ========" );
73  return StatusCode::SUCCESS;
74 }

◆ 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.

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

◆ 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_ADCThreshold

int LArCablingChecker::m_ADCThreshold
private

Definition at line 57 of file LArCablingChecker.h.

◆ m_BCKey

SG::ReadCondHandleKey<LArBadChannelCont> LArCablingChecker::m_BCKey {this, "BadChanKey", "LArBadChannel", "SG bad channels key"}
private

Definition at line 36 of file LArCablingChecker.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArCablingChecker::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 35 of file LArCablingChecker.h.

◆ m_channelHashMax

LArOnlineID::size_type LArCablingChecker::m_channelHashMax
private

Definition at line 52 of file LArCablingChecker.h.

◆ m_CLKey

SG::ReadCondHandleKey<LArCalibLineMapping> LArCablingChecker::m_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
private

Definition at line 37 of file LArCablingChecker.h.

◆ m_count

int LArCablingChecker::m_count
private

Definition at line 33 of file LArCablingChecker.h.

◆ m_DACHighGainThreshold

int LArCablingChecker::m_DACHighGainThreshold
private

Definition at line 58 of file LArCablingChecker.h.

◆ m_DACLowGainThreshold

int LArCablingChecker::m_DACLowGainThreshold
private

Definition at line 60 of file LArCablingChecker.h.

◆ m_DACMediumGainThreshold

int LArCablingChecker::m_DACMediumGainThreshold
private

Definition at line 59 of file LArCablingChecker.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_emId

const LArEM_ID* LArCablingChecker::m_emId
private

Definition at line 40 of file LArCablingChecker.h.

◆ m_errorcellsPreviousEvent

std::vector<bool>* LArCablingChecker::m_errorcellsPreviousEvent
private

Definition at line 49 of file LArCablingChecker.h.

◆ m_errorcellsThisEvent

std::vector<bool>* LArCablingChecker::m_errorcellsThisEvent
private

Definition at line 47 of file LArCablingChecker.h.

◆ m_errorCounterPreviousEvent

int LArCablingChecker::m_errorCounterPreviousEvent
private

Definition at line 50 of file LArCablingChecker.h.

◆ m_errorCounterThisEvent

int LArCablingChecker::m_errorCounterThisEvent
private

Definition at line 48 of file LArCablingChecker.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_key

std::string LArCablingChecker::m_key
private

Definition at line 43 of file LArCablingChecker.h.

◆ m_numberOfEventsWithThisErrorState

int LArCablingChecker::m_numberOfEventsWithThisErrorState
private

Definition at line 51 of file LArCablingChecker.h.

◆ m_onlineHelper

const LArOnlineID* LArCablingChecker::m_onlineHelper
private

Definition at line 39 of file LArCablingChecker.h.

◆ m_outfile

std::ofstream LArCablingChecker::m_outfile
private

Definition at line 42 of file LArCablingChecker.h.

◆ m_outFileName

std::string LArCablingChecker::m_outFileName
private

Definition at line 44 of file LArCablingChecker.h.

◆ m_PrintAllCellsAndEvents

bool LArCablingChecker::m_PrintAllCellsAndEvents
private

Definition at line 55 of file LArCablingChecker.h.

◆ m_PrintDisconnectedCells

bool LArCablingChecker::m_PrintDisconnectedCells
private

Definition at line 56 of file LArCablingChecker.h.

◆ m_printEventSummary

bool LArCablingChecker::m_printEventSummary
private

Definition at line 61 of file LArCablingChecker.h.

◆ m_useBadChannelTool

bool LArCablingChecker::m_useBadChannelTool
private

Definition at line 62 of file LArCablingChecker.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
LArCablingChecker::m_emId
const LArEM_ID * m_emId
Definition: LArCablingChecker.h:40
LArEM_Base_ID::phi
int phi(const Identifier id) const
return phi according to :
checkFileSG.line
line
Definition: checkFileSG.py:75
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1636
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCell_ID::em_idHelper
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition: CaloCell_ID.h:63
LArCablingChecker::m_count
int m_count
Definition: LArCablingChecker.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArCalibLineMapping
Definition: LArCalibLineMapping.h:17
LArCablingChecker::m_CLKey
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey
Definition: LArCablingChecker.h:37
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
LArCalibParams
Definition: LArCalibParams.h:28
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
LArOnlineID_Base::slot
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
Definition: LArOnlineID_Base.cxx:1961
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
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
HWIdentifier
Definition: HWIdentifier.h:13
LArEM_Base_ID::eta
int eta(const Identifier id) const
return eta according to :
LArCablingChecker::m_PrintAllCellsAndEvents
bool m_PrintAllCellsAndEvents
Definition: LArCablingChecker.h:55
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
LArCablingChecker::m_DACMediumGainThreshold
int m_DACMediumGainThreshold
Definition: LArCablingChecker.h:59
LArCablingChecker::m_numberOfEventsWithThisErrorState
int m_numberOfEventsWithThisErrorState
Definition: LArCablingChecker.h:51
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
LArOnlineID_Base::channel
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
Definition: LArOnlineID_Base.cxx:1967
LArCablingChecker::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArCablingChecker.h:39
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
LArCablingChecker::m_BCKey
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
Definition: LArCablingChecker.h:36
LArCablingChecker::m_outFileName
std::string m_outFileName
Definition: LArCablingChecker.h:44
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
LArDigit
Liquid Argon digit base class.
Definition: LArDigit.h:25
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
LArCablingChecker::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArCablingChecker.h:35
LArCalibParams::isPulsed
bool isPulsed(const unsigned event, const HWIdentifier calibLineID) const
Definition: LArCalibParams.cxx:167
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LArCablingChecker::m_PrintDisconnectedCells
bool m_PrintDisconnectedCells
Definition: LArCablingChecker.h:56
LArCablingChecker::m_outfile
std::ofstream m_outfile
Definition: LArCablingChecker.h:42
LArCablingChecker::m_errorcellsThisEvent
std::vector< bool > * m_errorcellsThisEvent
Definition: LArCablingChecker.h:47
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1483
LArCablingChecker::m_key
std::string m_key
Definition: LArCablingChecker.h:43
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
LArCablingChecker::m_errorCounterThisEvent
int m_errorCounterThisEvent
Definition: LArCablingChecker.h:48
LArCalibParams::DAC
unsigned DAC(const unsigned event, const HWIdentifier calibLineID) const
Definition: LArCalibParams.cxx:147
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArCablingChecker::m_DACLowGainThreshold
int m_DACLowGainThreshold
Definition: LArCablingChecker.h:60
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1901
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
LArOnlineID_Base::feedthrough
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
Definition: LArOnlineID_Base.cxx:1948
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArCablingChecker::m_DACHighGainThreshold
int m_DACHighGainThreshold
Definition: LArCablingChecker.h:58
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
LArDigitContainer
Container class for LArDigit.
Definition: LArDigitContainer.h:24
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
LArCablingChecker::m_useBadChannelTool
bool m_useBadChannelTool
Definition: LArCablingChecker.h:62
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LArCablingChecker::m_channelHashMax
LArOnlineID::size_type m_channelHashMax
Definition: LArCablingChecker.h:52
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LArID_Exception
Exception class for LAr Identifiers.
Definition: LArID_Exception.h:20
LArCablingChecker::m_errorCounterPreviousEvent
int m_errorCounterPreviousEvent
Definition: LArCablingChecker.h:50
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
LArCablingChecker::m_printEventSummary
bool m_printEventSummary
Definition: LArCablingChecker.h:61
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
LArCablingChecker::m_ADCThreshold
int m_ADCThreshold
Definition: LArCablingChecker.h:57
LArCablingChecker::m_errorcellsPreviousEvent
std::vector< bool > * m_errorcellsPreviousEvent
Definition: LArCablingChecker.h:49