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

#include <LArAutoCorrExtrapolate.h>

Inheritance diagram for LArAutoCorrExtrapolate:
Collaboration diagram for LArAutoCorrExtrapolate:

Public Member Functions

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

SG::ReadCondHandleKey< LArBadFebContm_BFKey { this, "MissingFebsKey", "LArBadFeb", "SG Key of LArBadFebCont object"}
 
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
 
std::string m_keyoutput
 
std::string m_keyPedestal
 
std::string m_keyinput
 
std::string m_keyPedInput
 
std::string m_keyRamp
 
int m_Nsamples
 
const LArOnlineIDm_onlineId
 
bool m_useBad
 
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 30 of file LArAutoCorrExtrapolate.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

◆ LArAutoCorrExtrapolate()

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

Definition at line 31 of file LArAutoCorrExtrapolate.cxx.

32  : AthAlgorithm(name, pSvcLocator),
33  m_onlineId(nullptr)
34 {
35  m_useBad=true;
36  declareProperty("KeyOutput", m_keyoutput="LArAutoCorr");
37  declareProperty("keyPedestal", m_keyPedestal="Pedestal");
38  declareProperty("keyAutoInput", m_keyinput="LArAutoCorrElec");
39  declareProperty("keyPedInput", m_keyPedInput="PedestalElec");
40  declareProperty("keyRamp", m_keyRamp="LArRamp");
41  declareProperty("nSamples", m_Nsamples=5);
42 }

◆ ~LArAutoCorrExtrapolate()

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

Definition at line 64 of file LArAutoCorrExtrapolate.cxx.

65 {
66  return StatusCode::SUCCESS;
67 }

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

Definition at line 49 of file LArAutoCorrExtrapolate.h.

49 {return StatusCode::SUCCESS;}

◆ initialize()

StatusCode LArAutoCorrExtrapolate::initialize ( )

Definition at line 48 of file LArAutoCorrExtrapolate.cxx.

49 {
50  ATH_MSG_INFO ( ">>> Initialize" );
51 
52  if (m_BFKey.initialize().isFailure()) {
53  ATH_MSG_WARNING ( "No bad febs key" );
54  m_useBad=false;
55  }
56 
58 
59  return StatusCode::SUCCESS;
60 }

◆ 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 LArAutoCorrExtrapolate::stop ( )

Definition at line 71 of file LArAutoCorrExtrapolate.cxx.

72 {
73  ATH_MSG_INFO ( ">>> stop()" );
74 
75  ATH_CHECK( detStore()->retrieve(m_onlineId, "LArOnlineID") );
77  const LArOnOffIdMapping* cabling{*cablingHdl};
78  if(!cabling){
79  ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key() );
80  return StatusCode::FAILURE;
81  }
82 
83  LArAutoCorrComplete* larAutoCorrComplete = nullptr;
84  ATH_CHECK( detStore()->retrieve(larAutoCorrComplete,m_keyoutput) );
85  ATH_MSG_INFO ( " Got computed Autocorrelation from physics " );
86 
87  const LArAutoCorrComplete* larAutoCorrElec = nullptr;
88  ATH_CHECK( detStore()->retrieve(larAutoCorrElec,m_keyinput) );
89  ATH_MSG_INFO ( " Got electronics noise autocorrelation from database " );
90 
91  const LArPedestalComplete* larPedestalElec = nullptr;
92  ATH_CHECK( detStore()->retrieve(larPedestalElec,m_keyPedInput) );
93  ATH_MSG_INFO ( " Got pedestal from database " );
94 
95  const ILArRamp* larRamp = nullptr;
96  ATH_CHECK( detStore()->retrieve(larRamp,m_keyRamp) );
97  ATH_MSG_INFO ( " Got ramp from database " );
98 
100  const LArBadFebCont *bfCont {*readHandle};
101  if ( bfCont == nullptr) {
102  ATH_MSG_WARNING("Failed to retrieve BadFebCont with key "<<m_BFKey.key() );
103  m_useBad=false;
104  }
105 
106 // loop over channels
107  std::vector<HWIdentifier>::const_iterator it = m_onlineId->channel_begin();
108  std::vector<HWIdentifier>::const_iterator it_e = m_onlineId->channel_end();
109  for (;it!=it_e;++it) {
110  HWIdentifier hwid = (*it);
111 
112 // skip disconnected channels
113 
114  if (!(cabling->isOnlineConnected(hwid))) continue;
115 
116 // if HEC , correct low gain, otherwise correct Medium and Low
119  if (m_onlineId->isHECchannel(hwid)) {
122  }
124 
125  ATH_MSG_VERBOSE ( " hwid,gain0,gain1,gain2 " << m_onlineId->channel_name(hwid) << " " << gain0 << " " << gain1 << " " << gain2 );
126 
127 // get AutoCorr for highest gain, physics event
128  ILArAutoCorr::AutoCorrRef_t corr=larAutoCorrComplete->autoCorr(hwid,gain0);
129  ATH_MSG_VERBOSE ( " corr.size() " << corr.size() );
130 
131 // get electronics noise + autocorrelation from pedestal run for highest gain
132  float sigma0_elec;
133  if (larPedestalElec->pedestalRMS(hwid,gain0)>=(1.0+LArElecCalib::ERRORCODE))
134  sigma0_elec = larPedestalElec->pedestalRMS(hwid,gain0);
135  else {
136  ATH_MSG_WARNING ( " Cannot not find elec pedestal RMS " << m_onlineId->channel_name(hwid) );
137  continue;
138  }
139  ILArAutoCorr::AutoCorrRef_t corr0_elec = larAutoCorrElec->autoCorr(hwid,gain0);
140  ATH_MSG_VERBOSE ( " sigma0_elec " << sigma0_elec << " corr0_ele.size() " << corr0_elec.size() );
141  if (corr0_elec.size()==0) {
142  ATH_MSG_WARNING ( " cannot find elec autocorr " << m_onlineId->channel_name(hwid) );
143  continue;
144  }
145 
146  {
147  msg() << MSG::VERBOSE << " corr0_elec ";
148  unsigned int ii=0;
149  for (;ii<corr0_elec.size();ii++)
150  msg() << MSG::VERBOSE << corr0_elec[ii] << " ";
151  msg() << MSG::VERBOSE << endmsg;
152  }
153 
154  float sigma0_elec2 = sigma0_elec*sigma0_elec;
155 
156 // in case of some channels with missing data, try to recover using electronics autocorrelation only
157  std::vector<float> corr2;
158  bool recovered=false;
159  if (corr.size()==0) {
160  HWIdentifier febId = m_onlineId->feb_Id(hwid);
161  if (m_useBad && (!bfCont->status(febId).good()) ) {
162  ATH_MSG_DEBUG ( " Known missing Feb, no physics autocorr " << m_onlineId->channel_name(hwid) << "... use electronics from db " );
163  } else {
164  ATH_MSG_WARNING ( " No physics autocorr for channel " << m_onlineId->channel_name(hwid) << " .. use electronics from db" );
165  }
166  if (corr0_elec.size()==0) {
167  ATH_MSG_WARNING ( " No physics and no electronics autocorrelation available " << m_onlineId->channel_name(hwid) );
168  continue;
169  }
170  int n = m_Nsamples;
171  if (corr0_elec.size()<(unsigned int)(n-1)) n = corr0_elec.size()+1;
172  unsigned int size = n*(n+1)/2;
173  std::vector<float> corr2;
174  corr2.resize(size,0.);
175  unsigned k=0;
176  for (int i=0;i<n;i++) {
177  for (int j=i;j<n;j++,k++) {
178  if (i==j) corr2[k]=sigma0_elec2;
179  else corr2[k]=corr0_elec[j-i-1]*sigma0_elec2;
180  }
181  }
182  larAutoCorrComplete->set(hwid,gain0,corr2);
183  recovered=true;
184  }
185 
186 
187 // loop over gains to correct
188  for (int gain=gain1;gain<=gain2;gain++) {
189 
190 // for Presampler skip lowgain
191  if (m_onlineId->isEMBPS(hwid) && gain==CaloGain::LARLOWGAIN) continue;
192 
193  // get electronics noise autocorrelation
194  ILArAutoCorr::AutoCorrRef_t corr_elec = larAutoCorrElec->autoCorr(hwid,gain);
195  if (corr_elec.size()==0) {
196  ATH_MSG_WARNING ( " cannot find elec autocorr " << m_onlineId->channel_name(hwid) );
197  continue;
198  }
199  {
200  msg() << MSG::VERBOSE << " corr_elec ";
201  unsigned int ii=0;
202  for (;ii<corr_elec.size();ii++)
203  msg() << MSG::VERBOSE << corr_elec[ii] << " ";
204  msg() << MSG::VERBOSE << endmsg;
205  }
206 
207 
208  // get electronic noise in ADC counts
209  float sigma_elec;
210  if (larPedestalElec->pedestalRMS(hwid,gain) >= (1.0+LArElecCalib::ERRORCODE))
211  sigma_elec = larPedestalElec->pedestalRMS(hwid,gain);
212  else {
213  ATH_MSG_WARNING ( " cannot find elec noise RMS " << m_onlineId->channel_name(hwid) );
214  continue;
215  }
216  ATH_MSG_VERBOSE ( " sigma_elec " << sigma_elec << " corr_elec.size() " << corr_elec.size() );
217  float sigma_elec2 = sigma_elec*sigma_elec;
218 
219  // extrapolate to high gain using ramp
220  float ratio=0.1;
222  const ILArRamp::RampRef_t rampcoeff=larRamp->ADC2DAC(hwid, gain);
223  const ILArRamp::RampRef_t rampcoeff0=larRamp->ADC2DAC(hwid, gain0);
224  if (rampcoeff.size()>1 && rampcoeff0.size()>1) {
225  float ramp1 = rampcoeff[1];
226  float ramp0 = rampcoeff0[1];
227  if (ramp1>0.01 && ramp0>0.01 && ramp1<1e4 && ramp0<1e4) ratio = ramp0/ramp1;
228  }
229  //float ratio2=ratio*ratio;
230  ATH_MSG_VERBOSE ( " gain ratio " << ratio );
231 
232 // compute new autocorrelation
233 
234  std::vector<float> new_corr;
235  if (!recovered) new_corr.reserve(corr.size());
236  else new_corr.reserve(corr2.size());
237 
238  unsigned int k=0;
239  for (int i=0;i<m_Nsamples;i++) {
240  for (int j=i;j<m_Nsamples;j++,k++) {
241  float rij_0=0.;
242  if (!recovered) {
243  if (k<corr.size()) rij_0 = corr[k];
244  }
245  else {
246  if (k<corr2.size()) rij_0 = corr2[k];
247  }
248 
249  float corre0 = 0. ;
250  float corre = 0. ;
251  if (i==j) {
252  corre0=1.;
253  corre=1.;
254  }
255  else {
256  unsigned int index = j-i-1;
257  if (index<corr0_elec.size()) corre0=corr0_elec[index];
258  if (index<corr_elec.size()) corre=corr_elec[index];
259  }
260  float rij_tot = rij_0*ratio - sigma0_elec2*corre0*ratio + sigma_elec2*corre;
261  new_corr.push_back(rij_tot);
262  }
263  }
264 
265  {
266  msg() << MSG::VERBOSE << " old corr ";
267  if (corr.size()>=((unsigned int)(m_Nsamples*(m_Nsamples+1)/2))) {
268  unsigned k=0;
269  for (int i=0;i<m_Nsamples;i++) {
270  for (int j=i;j<m_Nsamples;j++,k++)
271  msg() << MSG::VERBOSE << corr[k] << " ";
272  msg() << MSG::VERBOSE << endmsg;
273  }
274  }
275  }
276  {
277  msg() << MSG::VERBOSE << " new corr ";
278  unsigned k=0;
279  for (int i=0;i<m_Nsamples;i++) {
280  for (int j=i;j<m_Nsamples;j++,k++)
281  msg() << MSG::VERBOSE << new_corr[k] << " ";
282  msg() << MSG::VERBOSE << endmsg;
283  }
284  }
285 
286 // save new extrapolation
287  larAutoCorrComplete->set(hwid,gain,new_corr);
288 
289 
290  } // loop over gains
291 
292  } // loop over channels
293 
294  return StatusCode::SUCCESS;
295 }

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

SG::ReadCondHandleKey<LArBadFebCont> LArAutoCorrExtrapolate::m_BFKey { this, "MissingFebsKey", "LArBadFeb", "SG Key of LArBadFebCont object"}
private

Definition at line 53 of file LArAutoCorrExtrapolate.h.

◆ m_cablingKey

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

Definition at line 54 of file LArAutoCorrExtrapolate.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_keyinput

std::string LArAutoCorrExtrapolate::m_keyinput
private

Definition at line 58 of file LArAutoCorrExtrapolate.h.

◆ m_keyoutput

std::string LArAutoCorrExtrapolate::m_keyoutput
private

Definition at line 56 of file LArAutoCorrExtrapolate.h.

◆ m_keyPedestal

std::string LArAutoCorrExtrapolate::m_keyPedestal
private

Definition at line 57 of file LArAutoCorrExtrapolate.h.

◆ m_keyPedInput

std::string LArAutoCorrExtrapolate::m_keyPedInput
private

Definition at line 59 of file LArAutoCorrExtrapolate.h.

◆ m_keyRamp

std::string LArAutoCorrExtrapolate::m_keyRamp
private

Definition at line 60 of file LArAutoCorrExtrapolate.h.

◆ m_Nsamples

int LArAutoCorrExtrapolate::m_Nsamples
private

Definition at line 62 of file LArAutoCorrExtrapolate.h.

◆ m_onlineId

const LArOnlineID* LArAutoCorrExtrapolate::m_onlineId
private

Definition at line 64 of file LArAutoCorrExtrapolate.h.

◆ m_useBad

bool LArAutoCorrExtrapolate::m_useBad
private

Definition at line 66 of file LArAutoCorrExtrapolate.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:
LArAutoCorrExtrapolate::m_Nsamples
int m_Nsamples
Definition: LArAutoCorrExtrapolate.h:62
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArAutoCorrExtrapolate::m_keyRamp
std::string m_keyRamp
Definition: LArAutoCorrExtrapolate.h:60
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArPedestalComplete
This class implements the ILArPedestal interface.
Definition: LArPedestalComplete.h:26
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
CaloTime_fillDB.gain2
gain2
Definition: CaloTime_fillDB.py:357
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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
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
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
HWIdentifier
Definition: HWIdentifier.h:13
LArOnlineID_Base::channel_end
id_iterator channel_end() const
Definition: LArOnlineID_Base.cxx:1931
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArAutoCorrExtrapolate::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArAutoCorrExtrapolate.h:54
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
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
LArAutoCorrComplete
This class implements the ILArAutoCorr interface.
Definition: LArAutoCorrComplete.h:26
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
LArAutoCorrExtrapolate::m_useBad
bool m_useBad
Definition: LArAutoCorrExtrapolate.h:66
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
LArAutoCorrExtrapolate::m_keyPedestal
std::string m_keyPedestal
Definition: LArAutoCorrExtrapolate.h:57
lumiFormat.i
int i
Definition: lumiFormat.py:92
PixelAthClusterMonAlgCfg.e4
e4
Definition: PixelAthClusterMonAlgCfg.py:317
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArAutoCorrExtrapolate::m_BFKey
SG::ReadCondHandleKey< LArBadFebCont > m_BFKey
Definition: LArAutoCorrExtrapolate.h:53
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ILArRamp
Definition: ILArRamp.h:12
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CaloTime_fillDB.gain0
gain0
Definition: CaloTime_fillDB.py:355
LArPedestalComplete::pedestalRMS
virtual float pedestalRMS(const HWIdentifier &CellID, int gain) const override
access to RMS of Pedestal index by Identifier, and gain setting
Definition: LArPedestalComplete.h:37
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
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
ILArRamp::ADC2DAC
virtual RampRef_t ADC2DAC(const HWIdentifier &id, int gain) const =0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
CaloTime_fillDB.gain1
gain1
Definition: CaloTime_fillDB.py:356
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
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
DeMoScan.index
string index
Definition: DeMoScan.py:362
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.compareTCTs.ratio
ratio
Definition: compareTCTs.py:295
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArOnlineID_Base::isEMBPS
bool isEMBPS(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1665
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArAutoCorrExtrapolate::m_keyinput
std::string m_keyinput
Definition: LArAutoCorrExtrapolate.h:58
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
LArElecCalib::ERRORCODE
@ ERRORCODE
Definition: LArCalibErrorCode.h:17
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LArAutoCorrExtrapolate::m_keyPedInput
std::string m_keyPedInput
Definition: LArAutoCorrExtrapolate.h:59
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
LArOnlineID::isHECchannel
bool isHECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:734
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
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:218
LArAutoCorrExtrapolate::m_keyoutput
std::string m_keyoutput
Definition: LArAutoCorrExtrapolate.h:56
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LArOnlineID_Base::channel_begin
id_iterator channel_begin() const
Returns an iterator pointing to a channel identifier collection.
Definition: LArOnlineID_Base.cxx:1926
LArAutoCorrComplete::autoCorr
virtual AutoCorrRef_t autoCorr(const HWIdentifier &CellID, int gain) const
Definition: LArAutoCorrComplete.cxx:29
fitman.k
k
Definition: fitman.py:528
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition: LArVectorProxy.h:38
ServiceHandle< ICondSvc >
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
LArAutoCorrExtrapolate::m_onlineId
const LArOnlineID * m_onlineId
Definition: LArAutoCorrExtrapolate.h:64