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

#include <LArPedestalAutoCorrBuilder.h>

Inheritance diagram for LArPedestalAutoCorrBuilder:
Collaboration diagram for LArPedestalAutoCorrBuilder:

Public Member Functions

 LArPedestalAutoCorrBuilder (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~LArPedestalAutoCorrBuilder ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
virtual StatusCode stop ()
 
virtual 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 LArConditionsContainer< LArAccumulatedDigitACCU
 
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

const LArOnlineID_Basem_onlineHelper
 
std::vector< std::string > m_keylist
 
std::string m_groupingType
 
ACCU m_accu
 
unsigned m_event_counter
 
std::string m_pedContName
 
std::string m_acContName
 
bool m_doPedestal
 
bool m_doAutoCorr
 
uint16_t m_fatalFebErrorPattern
 
int m_normalize
 
int m_sample_min
 
int m_sample_max
 
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 LArPedestalAutoCorrBuilder.h.

Member Typedef Documentation

◆ ACCU

Definition at line 60 of file LArPedestalAutoCorrBuilder.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArPedestalAutoCorrBuilder()

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

Definition at line 29 of file LArPedestalAutoCorrBuilder.cxx.

30  : AthAlgorithm(name, pSvcLocator),
31  m_onlineHelper(nullptr),
32  m_event_counter(0),
34 {
35  declareProperty("KeyList", m_keylist);
36  declareProperty("PedestalKey", m_pedContName="LArPedestal");
37  declareProperty("normalize", m_normalize=1);
38  declareProperty("AutoCorrKey", m_acContName="LArAutoCorr");
39  declareProperty("GroupingType", m_groupingType="ExtendedFeedThrough");
40  declareProperty("doPedestal", m_doPedestal=true);
41  declareProperty("doAutoCorr", m_doAutoCorr=true);
42  declareProperty("sample_min", m_sample_min=-1);
43  declareProperty("sample_max", m_sample_max=-1);
44 }

◆ ~LArPedestalAutoCorrBuilder()

LArPedestalAutoCorrBuilder::~LArPedestalAutoCorrBuilder ( )
default

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

Definition at line 90 of file LArPedestalAutoCorrBuilder.cxx.

92 {
93 
94  StatusCode sc;
96  if (m_keylist.empty()) {
97  ATH_MSG_ERROR( "Key list is empty! No containers processed!" );
98  return StatusCode::FAILURE;
99  }
100 
101 
102  const LArFebErrorSummary* febErrSum=nullptr;
103  if (evtStore()->contains<LArFebErrorSummary>("LArFebErrorSummary")) {
104  sc=evtStore()->retrieve(febErrSum);
105  if (sc.isFailure()) {
106  ATH_MSG_ERROR( "Failed to retrieve FebErrorSummary object!" );
107  return sc;
108  }
109  }
110  else
111  if (m_event_counter==1)
112  ATH_MSG_WARNING( "No FebErrorSummaryObject found! Feb errors not checked!" );
113 
114 
115  const LArAccumulatedDigitContainer* container = nullptr;
116  //Outermost loop goes over all gains (different containers).
117  int foundkey = 0;
118 
119  for (const std::string& key : m_keylist) {
120  sc= evtStore()->retrieve(container,key);
121  if (sc.isFailure() || !container) {
122  ATH_MSG_DEBUG("Cannot read LArAccumulatedDigitContainer from StoreGate! key=" << key);
123  if ( ( (&key == &m_keylist.back()) ) && foundkey==0 ){
124  ATH_MSG_ERROR("None of the provided LArAccumulatedDigitContainer keys could be read");
125  return StatusCode::FAILURE;
126  }else{
127  continue;
128  }
129  }
130  foundkey+=1;
131 
132  // check that container is not empty
133  if(container->empty() ) {
134  ATH_MSG_DEBUG("LArAccumulatedDigitContainer (key=" << key << ") is empty ");
135  continue;
136  }else{
137  ATH_MSG_DEBUG("LArAccumulatedDigitContainer (key=" << key << ") has length " << container->size());
138  }
139 
140  HWIdentifier lastFailedFEB(0);
141  //Inner loop goes over the cells.
142  for (const LArAccumulatedDigit* dg : *container) { //Loop over all cells
143  if (dg->nTrigger()==0) continue; //Don't care about empty digits
144  const HWIdentifier chid=dg->hardwareID();
145  const HWIdentifier febid=m_onlineHelper->feb_Id(chid);
146  if (febErrSum) {
147  const uint16_t febErrs=febErrSum->feb_error(febid);
148  if (febErrs & m_fatalFebErrorPattern) {
149  if (febid!=lastFailedFEB) {
150  lastFailedFEB=febid;
151  ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid)
152  << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." );
153  }
154  continue;
155  } //end if fatal feb error
156  }//end if check feb error summary
157 
158  const CaloGain::CaloGain gain=dg->gain();
159 
160  LArAccumulatedDigit& accDg=m_accu.get(chid,gain);
161  if (!accDg.setAddSubStep(*dg))
162  ATH_MSG_ERROR( "Failed to accumulate sub-steps! Inconsistent number of ADC samples" );
163  } //end loop over input container
164  }//end loop over keys
165  return StatusCode::SUCCESS;
166 }

◆ 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()

virtual StatusCode LArPedestalAutoCorrBuilder::finalize ( )
inlinevirtual

Definition at line 49 of file LArPedestalAutoCorrBuilder.h.

49 {return StatusCode::SUCCESS;}

◆ initialize()

StatusCode LArPedestalAutoCorrBuilder::initialize ( )

Definition at line 49 of file LArPedestalAutoCorrBuilder.cxx.

50 {
51  if (m_groupingType == "SuperCells") {
52  ATH_MSG_INFO("Processing LAr SuperCells");
53  const LArOnline_SuperCellID* onlID;
54  ATH_CHECK(detStore()->retrieve(onlID,"LArOnline_SuperCellID"));
55  m_onlineHelper=onlID; // cast to base-class
56  }
57  else {
58  ATH_MSG_INFO("Processing regular LArCells");
59  const LArOnlineID* onlID;
60  ATH_CHECK(detStore()->retrieve(onlID, "LArOnlineID"));
61  m_onlineHelper=onlID; // cast to base-class
62  }
63 
64 
65 
66  if (!m_doPedestal && !m_doAutoCorr) {
67  ATH_MSG_ERROR( "Configuration Problem: Neither doPedstal nor doAutoCorr set!" );
68  return StatusCode::FAILURE;
69  }
70 
71  if (m_keylist.empty()) // Not key list given
72  {m_keylist.emplace_back("HIGH");
73  m_keylist.emplace_back("MEDIUM");
74  m_keylist.emplace_back("LOW");
75  m_keylist.emplace_back("FREE"); //For H6....
76  }
77 
78  //Container for internal accumulation
81  if (sc.isFailure()) {
82  ATH_MSG_ERROR( "Failed initialize LArConditionsContainer 'm_accu'" );
83  return sc;
84  }
85  return StatusCode::SUCCESS;
86 }

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

◆ stop()

StatusCode LArPedestalAutoCorrBuilder::stop ( )
virtual

Definition at line 170 of file LArPedestalAutoCorrBuilder.cxx.

170  {
171 
172  std::unique_ptr<LArAutoCorrComplete> larAutoCorrComplete;
173  std::unique_ptr<LArPedestalComplete> larPedestalComplete;
174 
175  if (m_doAutoCorr) {
176  //Book and initialize LArAutoCorrComplete object
177  ATH_MSG_INFO("Creating LArAutoCorrComplete");
178  larAutoCorrComplete = std::make_unique<LArAutoCorrComplete>();
179  ATH_CHECK( larAutoCorrComplete->setGroupingType(m_groupingType,msg()) );
180  ATH_CHECK( larAutoCorrComplete->initialize() );
181  }
182 
183  if (m_doPedestal) {
184  //Book and initialize LArPedestalComplete object
185  ATH_MSG_INFO("Creating LArAutoPedestalComplete");
186  larPedestalComplete = std::make_unique<LArPedestalComplete>();
187  ATH_CHECK( larPedestalComplete->setGroupingType(m_groupingType,msg()) );
188  ATH_CHECK( larPedestalComplete->initialize() );
189  }
190 
191  //For the log output further down
192  std::string objName;
193  if (m_doPedestal)
194  objName="pedestal";
195  if (m_doAutoCorr)
196  objName="autocorr";
197  if (m_doAutoCorr && m_doPedestal)
198  objName="pedestal & autocorr";
199 
200  int n_zero,n_min, n_max, n_cur;
201  n_zero=0; n_max=n_min=-1;
202  unsigned NCells=0;
203  std::vector<float> cov;
204  //Loop over gains
205  for (unsigned k=0;k<(int)CaloGain::LARNGAIN;k++) {
207  //Loop over cells
210 
211  if (cell_it==cell_it_e){
212  continue; //No data for this gain
213  }
214  for (;cell_it!=cell_it_e;cell_it++) {
215  const LArAccumulatedDigit& dg=*cell_it;
216  n_cur = dg.nTrigger();
217  if(n_cur==0) { n_zero++; continue; }
218 
219  HWIdentifier chid = cell_it.channelId();
220 
221  if(n_cur<n_min || n_min<0) n_min=n_cur;
222  if(n_cur>n_max || n_max<0) n_max=n_cur;
223 
224  // Fill the data class with pedestal and rms values
225  if (larPedestalComplete)
226  larPedestalComplete->set(chid,gain,dg.mean(m_sample_min, m_sample_max),dg.RMS(m_sample_min, m_sample_max));
227 
228  if (larAutoCorrComplete) {
229  dg.getCov(cov,m_normalize);
230  larAutoCorrComplete->set(chid,gain,cov);
231  }
232  NCells++;
233  }//end loop over all cells
234 
235  ATH_MSG_INFO( "Gain " << gain << " Number of cells with 0 events to compute "<<objName<< ": " << n_zero );
236  ATH_MSG_INFO( "Gain " << gain << " Minimum number of events*samples to compute " <<objName<<": "<< n_min );
237  ATH_MSG_INFO( "Gain " << gain << " Maximum number of events*samples to compute " <<objName<<": " <<n_max );
238  }// End loop over all containers
239 
240  ATH_MSG_INFO( " Summary : Number of cells with " <<objName<<" value computed : " << NCells );
241  ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " );
242  ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " );
243  ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " );
244  ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " );
245  ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " );
246 
247  if (larPedestalComplete) {
248  ATH_CHECK( detStore()->record(std::move(larPedestalComplete),m_pedContName) );
249  }
250 
251 
252  if (larAutoCorrComplete) {
253  ATH_CHECK( detStore()->record(std::move(larAutoCorrComplete),m_acContName) );
254  }
255 
256  return StatusCode::SUCCESS;
257 }

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

std::string LArPedestalAutoCorrBuilder::m_acContName
private

Definition at line 66 of file LArPedestalAutoCorrBuilder.h.

◆ m_accu

ACCU LArPedestalAutoCorrBuilder::m_accu
private

Definition at line 61 of file LArPedestalAutoCorrBuilder.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_doAutoCorr

bool LArPedestalAutoCorrBuilder::m_doAutoCorr
private

Definition at line 68 of file LArPedestalAutoCorrBuilder.h.

◆ m_doPedestal

bool LArPedestalAutoCorrBuilder::m_doPedestal
private

Definition at line 68 of file LArPedestalAutoCorrBuilder.h.

◆ m_event_counter

unsigned LArPedestalAutoCorrBuilder::m_event_counter
private

Definition at line 63 of file LArPedestalAutoCorrBuilder.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_fatalFebErrorPattern

uint16_t LArPedestalAutoCorrBuilder::m_fatalFebErrorPattern
private

Definition at line 70 of file LArPedestalAutoCorrBuilder.h.

◆ m_groupingType

std::string LArPedestalAutoCorrBuilder::m_groupingType
private

Definition at line 57 of file LArPedestalAutoCorrBuilder.h.

◆ m_keylist

std::vector<std::string> LArPedestalAutoCorrBuilder::m_keylist
private

Definition at line 54 of file LArPedestalAutoCorrBuilder.h.

◆ m_normalize

int LArPedestalAutoCorrBuilder::m_normalize
private

Definition at line 72 of file LArPedestalAutoCorrBuilder.h.

◆ m_onlineHelper

const LArOnlineID_Base* LArPedestalAutoCorrBuilder::m_onlineHelper
private

Definition at line 52 of file LArPedestalAutoCorrBuilder.h.

◆ m_pedContName

std::string LArPedestalAutoCorrBuilder::m_pedContName
private

Definition at line 65 of file LArPedestalAutoCorrBuilder.h.

◆ m_sample_max

int LArPedestalAutoCorrBuilder::m_sample_max
private

Definition at line 75 of file LArPedestalAutoCorrBuilder.h.

◆ m_sample_min

int LArPedestalAutoCorrBuilder::m_sample_min
private

Definition at line 74 of file LArPedestalAutoCorrBuilder.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
LArConditionsContainerBase::SuperCells
@ SuperCells
Definition: LArConditionsContainerBase.h:51
LArPedestalAutoCorrBuilder::m_sample_max
int m_sample_max
Definition: LArPedestalAutoCorrBuilder.h:75
checkCoolLatestUpdate.dg
dg
Definition: checkCoolLatestUpdate.py:9
LArPedestalAutoCorrBuilder::m_sample_min
int m_sample_min
Definition: LArPedestalAutoCorrBuilder.h:74
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LArAccumulatedDigitContainer
Container class for LArAccumulatedDigit.
Definition: LArAccumulatedDigitContainer.h:22
LArConditionsContainerBase::SingleGroup
@ SingleGroup
Definition: LArConditionsContainerBase.h:46
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArAccumulatedDigit::setAddSubStep
bool setAddSubStep(const CaloGain::CaloGain gain_value, const HWIdentifier chid, const std::vector< uint64_t > &sampleSum, const std::vector< uint64_t > &sampleSquare, const unsigned nTrigger)
Accumulate new values
Definition: LArAccumulatedDigit.cxx:113
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArPedestalAutoCorrBuilder::m_keylist
std::vector< std::string > m_keylist
Definition: LArPedestalAutoCorrBuilder.h:54
LArPedestalAutoCorrBuilder::m_groupingType
std::string m_groupingType
Definition: LArPedestalAutoCorrBuilder.h:57
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
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
LArFebErrorSummary::error_to_string
static std::string error_to_string(uint16_t error)
interpret the error in string
Definition: LArFebErrorSummary.cxx:58
LArAutoCorrComplete::set
void set(const HWIdentifier &CellID, int gain, const std::vector< float > &vAutoCorr)
Definition: LArAutoCorrComplete.cxx:13
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArPedestalAutoCorrBuilder::m_accu
ACCU m_accu
Definition: LArPedestalAutoCorrBuilder.h:61
HWIdentifier
Definition: HWIdentifier.h:13
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
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
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
LArFebErrorSummary::feb_error
uint16_t feb_error(HWIdentifier febid) const
get error for feb
Definition: LArFebErrorSummary.cxx:20
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
LArAccumulatedDigit
Data class for ADC samples and autocorr preprocessed by the DSP.
Definition: LArAccumulatedDigit.h:32
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
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
LArConditionsContainer::end
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
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
LArConditionsContainer::get
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
LArPedestalAutoCorrBuilder::m_onlineHelper
const LArOnlineID_Base * m_onlineHelper
Definition: LArPedestalAutoCorrBuilder.h:52
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArPedestalAutoCorrBuilder::m_acContName
std::string m_acContName
Definition: LArPedestalAutoCorrBuilder.h:66
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LArPedestalComplete::set
void set(const HWIdentifier &CellID, const int gain, const float vPedestal, const float vPedestalRMS)
Definition: LArPedestalComplete.cxx:19
LArConditionsContainer< LArAccumulatedDigit >::ConditionsMapIterator
ConditionsMap::iterator ConditionsMapIterator
Definition: LArConditionsContainer.h:87
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:1479
LArPedestalAutoCorrBuilder::m_doPedestal
bool m_doPedestal
Definition: LArPedestalAutoCorrBuilder.h:68
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
LArPedestalAutoCorrBuilder::m_event_counter
unsigned m_event_counter
Definition: LArPedestalAutoCorrBuilder.h:63
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LArPedestalAutoCorrBuilder::m_doAutoCorr
bool m_doAutoCorr
Definition: LArPedestalAutoCorrBuilder.h:68
LArOnlineID
Definition: LArOnlineID.h:20
LArOnline_SuperCellID
Definition: LArOnline_SuperCellID.h:20
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArPedestalAutoCorrBuilder::m_fatalFebErrorPattern
uint16_t m_fatalFebErrorPattern
Definition: LArPedestalAutoCorrBuilder.h:70
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
LArConditionsContainer::initialize
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArPedestalAutoCorrBuilder::m_pedContName
std::string m_pedContName
Definition: LArPedestalAutoCorrBuilder.h:65
LArFebErrorSummary
Holds information from the FEB Error Summary.
Definition: LArFebErrorSummary.h:23
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArConditionsContainer::begin
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LArPedestalAutoCorrBuilder::m_normalize
int m_normalize
Definition: LArPedestalAutoCorrBuilder.h:72
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
LArOnlineID_Base::channel_name
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
Definition: LArOnlineID_Base.cxx:219
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37