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

#include <LArRampBuilder.h>

Inheritance diagram for LArRampBuilder:
Collaboration diagram for LArRampBuilder:

Public Types

typedef std::map< uint32_t, LArCalibTriggerAccumulatorACCRAMP
 

Public Member Functions

 ~LArRampBuilder ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
virtual StatusCode stop ()
 
StatusCode finalize ()
 
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
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

enum  recoType { PARABOLA, SHAPE, OF }
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void chooseRecoMode ()
 
StatusCode rampfit (unsigned deg, const std::vector< LArRawRamp::RAMPPOINT_t > &data, std::vector< float > &rampCoeffs, std::vector< int > &vSat, const HWIdentifier chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
 
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< LArOnOffIdMappingm_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
 
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKeySC {this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
 
std::unique_ptr< LArConditionsContainer< ACCRAMP > > m_ramps
 
PublicToolHandle< LArParabolaPeakRecoToolm_peakParabolaTool {this,"LArParabolaPeakRecoTool","LArParabolaPeakRecoTool"}
 
PublicToolHandle< LArShapePeakRecoToolm_peakShapeTool {this,"LArShapePeakRecoTool","LArShapePeakRecoTool"}
 
ToolHandle< LArOFPeakRecoToolm_peakOFTool {this,"PeakOFTool","LArOFPeakRecoTool"}
 
unsigned m_event_counter =0
 
int m_delay =-1
 
int m_ipassShape =0
 
std::vector< std::vector< std::vector< std::vector< double > > > > m_CaliWaves
 
std::vector< std::vector< std::vector< unsigned int > > > m_CaliDACs
 
std::vector< std::vector< int > > m_IndexDAC0
 
std::vector< std::vector< int > > m_IndexHighestDAC
 
std::vector< float > m_thePedestal
 
recoType m_recoType {OF}
 
Gaudi::Property< std::vector< std::string > > m_keylist {this, "KeyList",{},"List if input SG keys"}
 
Gaudi::Property< std::string > m_keyoutput {this,"KeyOutput","LArRamp","SG Key of output object"}
 
IntegerProperty m_degree {this,"Polynom",1,"Degree of ramp-polynom"}
 
IntegerProperty m_maxADC {this,"RampRange",0,"Ignore ADC values higher than this (0: do nothing)"}
 
BooleanProperty m_dac0sub {this,"SubtractDac0",true,"Take first DAC value as pedestal"}
 
UnsignedIntegerProperty m_DAC0 {this,"DAC0",0,"DAC value considered DAC0"}
 
BooleanProperty m_saveRawRamp {this,"StoreRawRamp",false,"Save raw ramp obj in SG"}
 
BooleanProperty m_saveRecRamp {this,"StoreRecRamp",true,"Save reconstructed ramp obj in SG"}
 
BooleanProperty m_satSlope {this,"doSatSlope",true,"Ignore points subject to saturation"}
 
UnsignedIntegerProperty m_minDAC {this,"minDAC",0,"Ignore DAC values smaller that this"}
 
StringProperty m_recoTypeProp {this,"RecoType","OF","One of 'Parabola', 'Shape' or 'OF'"}
 
IntegerProperty m_deadChannelCut {this,"DeadChannelCut",1300,"Complain about channels with max-ADC below this value"}
 
BooleanProperty m_correctBias {this,"correctBias",false,"For Parabola method: Correction yes/no"}
 
BooleanProperty m_withIntercept {this,"WithIntercept",true,"False: Force fit to go through 0/0"}
 
FloatProperty m_delayShift {this,"DelayShift",23}
 
Gaudi::Property< bool > m_doBadChannelMask {this,"IgnoreBadChannels",true,"Don't complain about known bad channels"}
 
LArBadChannelMask m_bcMask
 
SG::ReadCondHandleKey< LArBadChannelContm_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}
 
Gaudi::Property< std::vector< std::string > > m_problemsToMask {this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}
 
Gaudi::Property< std::string > m_groupingType {this,"GroupingType","ExtendedFeedThrough","Grouping of the output conditions-container"}
 
Gaudi::Property< std::string > m_hec_key {this,"HECKey","","SG Key of injection-resistor obj used for HEC Ramps"}
 
const LArOnlineID_Basem_onlineHelper =nullptr
 
const LArEM_Base_IDm_emId =nullptr
 
Gaudi::Property< bool > m_isSC {this,"isSC",false,"Processing SC data yes/no"}
 
Gaudi::Property< bool > m_ishec {this,"isHEC",false,"Processing HEC data yes/no"}
 
Gaudi::Property< bool > m_iterate {this,"Iterate",false,"Iterative OF peak reco"}
 
uint16_t m_fatalFebErrorPattern =0xffff
 
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 61 of file LArRampBuilder.h.

Member Typedef Documentation

◆ ACCRAMP

Definition at line 74 of file LArRampBuilder.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ recoType

Enumerator
PARABOLA 
SHAPE 
OF 

Definition at line 112 of file LArRampBuilder.h.

112 {PARABOLA,SHAPE,OF};

Constructor & Destructor Documentation

◆ ~LArRampBuilder()

LArRampBuilder::~LArRampBuilder ( )
inline

Definition at line 66 of file LArRampBuilder.h.

66 {};

Member Function Documentation

◆ AthAlgorithm()

AthAlgorithm::AthAlgorithm

Constructor with parameters:

Definition at line 51 of file AthAlgorithm.cxx.

25  :
27 {
28  // Set up to run AthAlgorithmDHUpdate in sysInitialize before
29  // merging dependency lists. This extends the output dependency
30  // list with any symlinks implied by inheritance relations.
31  m_updateDataHandles =
32  std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
34  std::move (m_updateDataHandles));
35 }

◆ chooseRecoMode()

void LArRampBuilder::chooseRecoMode ( )
private

Definition at line 71 of file LArRampBuilder.cxx.

71  {
72 
73  // choose reconstructiom mode
74  if ( m_recoTypeProp == std::string("Parabola") ) {
76  StatusCode sc=m_peakParabolaTool.retrieve();
77  if (sc!=StatusCode::SUCCESS) {
78  ATH_MSG_ERROR( "Can't get LArParabolaPeakRecoTool" );
79  return;
80  }
81  ATH_MSG_DEBUG("LArParabolaPeakRecoTool retrieved with success!");
82 
83  if(m_correctBias){
84  // if using parabola, get offlineID helper to obtain the layer (needed for correction)
85  const CaloCell_ID* idHelper = nullptr;
86  if ( detStore()->retrieve (idHelper, "CaloCell_ID").isSuccess() ) {
87  m_emId = idHelper->em_idHelper();
88  }
89  if (!m_emId) {
90  ATH_MSG_ERROR( "Could not access lar EM ID helper" );
91  return ;
92  }
93 
94  }
95  m_peakShapeTool.disable();
96  m_peakOFTool.disable();
97  // Shape reconstruction
98  } else if (m_recoTypeProp == std::string("Shape") ) {
100  ATH_MSG_INFO( "ShapePeakReco mode is ON ! ");
101  if (m_peakShapeTool.retrieve().isFailure()) {
102  ATH_MSG_ERROR( "Can't get LArShapePeakRecoTool");
103  return;
104  }
105  ATH_MSG_DEBUG("LArShapePeakRecoTool retrieved with success!");
106  m_peakParabolaTool.disable();
107  m_peakOFTool.disable();
108  // OFC recontruction
109  } else if ( m_recoTypeProp == std::string("OF") ) {
110  m_recoType=OF;
111  if (m_peakOFTool.retrieve().isFailure()) {
112  ATH_MSG_ERROR( "Can't get LArOFPeakRecoTool");
113  return;
114  }
115  ATH_MSG_DEBUG("LArOFPeakRecoTool retrieved with success!");
116  m_peakShapeTool.disable();
117  m_peakParabolaTool.disable();
118  }
119 }

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

Definition at line 122 of file LArRampBuilder.cxx.

123 {
124 
125  StatusCode sc;
126  if ( m_event_counter < 100 || m_event_counter%100==0 )
127  ATH_MSG_INFO( "Processing event " << m_event_counter);
128  ++m_event_counter;
129 
130  if (m_keylist.size()==0) {
131  ATH_MSG_ERROR( "Key list is empty! No containers to process!");
132  return StatusCode::FAILURE;
133  }
134 
135  const LArFebErrorSummary* febErrSum=nullptr;
136  if (evtStore()->contains<LArFebErrorSummary>("LArFebErrorSummary")) {
137  sc=evtStore()->retrieve(febErrSum);
138  if (sc.isFailure()) {
139  ATH_MSG_ERROR( "Failed to retrieve FebErrorSummary object!");
140  return sc;
141  }
142  }
143  else
144  if (m_event_counter==1)
145  ATH_MSG_WARNING("No FebErrorSummaryObject found! Feb errors not checked!");
146 
147  const LArOnOffIdMapping* cabling(nullptr);
148  if( m_isSC ){
150  cabling = {*cablingHdl};
151  if(!cabling) {
152  ATH_MSG_ERROR("Do not have mapping object " << m_cablingKeySC.key());
153  return StatusCode::FAILURE;
154  }
155  }else{
157  cabling = {*cablingHdl};
158  if(!cabling) {
159  ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key());
160  return StatusCode::FAILURE;
161  }
162  }
163 
164 
165  std::vector<std::string>::const_iterator key_it=m_keylist.begin();
166  std::vector<std::string>::const_iterator key_it_e=m_keylist.end();
167 
168  const LArAccumulatedCalibDigitContainer* larAccumulatedCalibDigitContainer = nullptr;
169 
170 
171  // if using Shape Reco method, retrieve caliWaveContainer (only once !)
172  // FT remove the bitwise &&->&
173  if ( m_recoType == SHAPE && m_ipassShape==0) {
174 
175  m_ipassShape = 1;
176 
177  // keep only 8 samples of wave - dont need all samples for pseudo-OF reco
178  std::vector<double> tempWave;
179  int NSamplesKeep = 8;
180  tempWave.resize(24*NSamplesKeep);
181 
182  m_CaliWaves.resize(3);
183  m_CaliDACs.resize(3);
184  m_IndexDAC0.resize(3);
185  m_IndexHighestDAC.resize(3);
186 
187  // retrieve cali wave container
188 
189  const LArCaliWaveContainer* caliWaveContainer = nullptr;
190  ATH_MSG_WARNING("Will retrieve LArCaliWaveContainer ");
191  sc= detStore()->retrieve(caliWaveContainer,"CaliWave");
192  if (sc.isFailure()) {
193  ATH_MSG_WARNING("Cannot read LArCaliWaveContainer from StoreGate for key 'CaliWave' ! ");
194  return StatusCode::FAILURE;
195  }
196  ATH_MSG_DEBUG("Succefully retrieved LArCaliWaveContainer from StoreGate!");
197  for (;key_it!=key_it_e;++key_it) { //Loop over all containers that are to be processed (e.g. different gains)
198 
199  // first, set reference DAC (dirty hardcoding for now...)
201  if(*key_it == "HIGH") {
202  gainref=CaloGain::LARHIGHGAIN;
203  }else if(*key_it == "MEDIUM") {
204  gainref=CaloGain::LARMEDIUMGAIN;
205  }else if(*key_it == "LOW") {
206  gainref=CaloGain::LARLOWGAIN;
207  }
208 
209  m_CaliWaves[gainref].resize(m_onlineHelper->channelHashMax());
210  m_CaliDACs[gainref].resize(m_onlineHelper->channelHashMax());
211  m_IndexDAC0[gainref].resize(m_onlineHelper->channelHashMax());
212  m_IndexHighestDAC[gainref].resize(m_onlineHelper->channelHashMax());
213 
214  // Set gain from key value
216  if ((*key_it) == "MEDIUM") gain = CaloGain::LARMEDIUMGAIN;
217  else if ((*key_it) == "LOW") gain = CaloGain::LARLOWGAIN;
218 
219  // extract from all the waves the ones we are interested in (a given DAC value)
220  // and order them by hash ID in a vector
222  const_iterator itVec = caliWaveContainer->begin(gain);
223  const_iterator itVec_e = caliWaveContainer->end(gain);
224 
225  for (; itVec != itVec_e; ++itVec) {
226 
227  for (const LArCaliWave& larCaliWave : *itVec) { //Loop over all cells
228  unsigned int DAC = larCaliWave.getDAC();
229  IdentifierHash chidwave_hash = m_onlineHelper->channel_Hash(itVec.channelId());
230 
231  bool IsBad = false;
232  for(int i=0;i<24*NSamplesKeep;i++){
233  tempWave[i] = larCaliWave.getSample(i);
234  if(tempWave[i]<-500) { // check that this wave is not corrupted
235  IsBad = true;
236  break;
237  }
238  }
239 
240  if(IsBad) continue; // if corrupted wave, skip it;
241 
242  m_CaliWaves[gainref][chidwave_hash].push_back(tempWave);
243  m_CaliDACs[gainref][chidwave_hash].push_back(DAC);
244 
245  // remember index of highest DAC value for this cell (i.e. non-saturating)
246  if(DAC > m_CaliDACs[gainref][chidwave_hash][m_IndexHighestDAC[gainref][chidwave_hash]]) m_IndexHighestDAC[gainref][chidwave_hash]=m_CaliDACs[gainref][chidwave_hash].size()-1;
247 
248  // remember which index corresponds to DAC0
249  if(m_dac0sub && DAC == m_DAC0) {
250  m_IndexDAC0[gainref][chidwave_hash] = m_CaliDACs[gainref][chidwave_hash].size()-1;
251  ATH_MSG_DEBUG("Cell " << chidwave_hash << ": DAC0 is at index = " << m_IndexDAC0[gainref][chidwave_hash]);
252  }
253  } // loop over dac values
254  } // loop over cells
255  } // Loop over gains
256 
257  sc= detStore()->remove(caliWaveContainer);
258  if (sc.isFailure()) {
259  ATH_MSG_WARNING("Cannot remove LArCaliWaveContainer from StoreGate ! ");
260  return StatusCode::FAILURE;
261  }
262  ATH_MSG_DEBUG("Successfully removed LArCaliWaveContainer from StoreGate ");
263 
264  } // m_ipassShape
265 
266 
267 
268 
269  // now start to deal with digits
270  int foundkey = 0;
271  for (;key_it!=key_it_e;++key_it) { //Loop over all containers that are to be processed (e.g. different gains)
272 
273  sc= evtStore()->retrieve(larAccumulatedCalibDigitContainer,*key_it);
274  if (sc.isFailure()) {
275  ATH_MSG_WARNING("Cannot read LArAccumulatedCalibDigitContainer from StoreGate! key=" << *key_it);
276  if ( (std::next(key_it) == key_it_e) && foundkey==0 ){
277  ATH_MSG_ERROR("None of the provided LArAccumulatedDigitContainer keys could be read");
278  return StatusCode::FAILURE;
279  }else{
280  continue;
281  }
282  }
283  ++foundkey;
284  HWIdentifier lastFailedFEB(0);
285 
286  if(larAccumulatedCalibDigitContainer->empty()) {
287  ATH_MSG_DEBUG("LArAccumulatedCalibDigitContainer with key=" << *key_it << " is empty ");
288  } else {
289  ATH_MSG_DEBUG("LArAccumulatedCalibDigitContainer with key=" << *key_it << " has size " << larAccumulatedCalibDigitContainer->size());
290  }
291 
292  for (const LArAccumulatedCalibDigit* digit : *larAccumulatedCalibDigitContainer) { //Loop over all cells
293 
294  if (!(digit->isPulsed())){ //Check if cell is pulsed
295  continue; //Cell not pulsed -> ignore
296  }
297 
298  HWIdentifier chid=digit->hardwareID();
299  HWIdentifier febid=m_onlineHelper->feb_Id(chid);
300  if (febErrSum) {
301  const uint16_t febErrs=febErrSum->feb_error(febid);
302  if (febErrs & m_fatalFebErrorPattern) {
303  if (febid!=lastFailedFEB) {
304  lastFailedFEB=febid;
305  ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid)
306  << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored.");
307  }
308  continue;
309  }
310  }
311 
312 
313  if (m_delay==-1) { //First (pulsed) cell to be processed:
314  m_delay=digit->delay();
315  }
316  else
317  if (m_delay!=digit->delay()) {
318  ATH_MSG_ERROR( "Delay does not match! Found " << digit->delay() << " expected: " << m_delay);
319  continue; //Ignore this cell
320  }
321 
322  CaloGain::CaloGain gain=digit->gain();
323  if (gain<0 || gain>CaloGain::LARNGAIN)
324  {ATH_MSG_ERROR( "Found not-matching gain number ("<< (int)gain <<")");
325  return StatusCode::FAILURE;
326  }
327 
328  // if using bias-corrected Parabola tool or OFC Tool, get the pedestal
329  if ( (m_recoType == PARABOLA && m_correctBias ) || m_recoType == OF) {
330 
331  //GU, try to get only once the pedestal per channel...
332  IdentifierHash chid_hash = m_onlineHelper->channel_Hash(chid);
333  if (m_thePedestal[chid_hash] < 0) {
334 
335  //Pointer to conditions data objects
336  const ILArPedestal* larPedestal=nullptr;
337  sc=detStore()->retrieve(larPedestal);
338  if (sc.isFailure()) {
339  ATH_MSG_FATAL( "No pedestals found in database. Aborting executiong." );
340  return sc;
341  }
342 
343  if (larPedestal) {
344  float DBpedestal = larPedestal->pedestal(chid,gain);
345  if (DBpedestal >= (1.0+LArElecCalib::ERRORCODE) ) {
346  m_thePedestal[chid_hash]=DBpedestal;
347  } else {
348  ATH_MSG_WARNING("No pedestal value found for cell hash ID = "
349  << chid_hash << " " << m_onlineHelper->channel_name(chid)
350  << ". Skipping channel."
351  );
352  continue;
353  }
354  } else {
355  ATH_MSG_WARNING("No pedestal value found for cell hash ID = "
356  << chid_hash << " " << m_onlineHelper->channel_name(chid)
357  << ". Skipping channel."
358  );
359  continue;
360  }
361 
362  ATH_MSG_DEBUG(" channel,pedestal " << m_onlineHelper->channel_name(chid) << " "
363  << m_thePedestal[chid_hash]);
364 
365  } // m_ipassPedestal
366  }
367 
368  LArCalibTriggerAccumulator& accpoints=(m_ramps->get(chid,gain))[digit->DAC()];
369  LArCalibTriggerAccumulator::ERRTYPE ec=accpoints.add(digit->sampleSum(),digit->sample2Sum(),digit->nTriggers());
371  ATH_MSG_ERROR( "Failed to accumulate sub-steps: Inconsistent number of ADC samples");
372  }
374  ATH_MSG_ERROR( "Failed to accumulate sub-steps: Numeric Overflow");
375  }
376  }//End loop over all cells
377  } //End loop over all containers
378 
379  return StatusCode::SUCCESS;
380 }

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

Definition at line 72 of file LArRampBuilder.h.

72 {return StatusCode::SUCCESS;}

◆ initialize()

StatusCode LArRampBuilder::initialize ( )

Definition at line 19 of file LArRampBuilder.cxx.

20 {
21  StatusCode sc;
22  if ( m_isSC ) {
23  ATH_MSG_DEBUG("==== LArRampBuilder - looking at SuperCells ====");
25  sc = detStore()->retrieve(ll, "LArOnline_SuperCellID");
26  if (sc.isFailure()) {
27  msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg;
28  return StatusCode::FAILURE;
29  }
30  else {
32  ATH_MSG_DEBUG("Found the LArOnlineID helper");
33  }
34 
35  } else { // m_isSC
36  const LArOnlineID* ll;
37  sc = detStore()->retrieve(ll, "LArOnlineID");
38  if (sc.isFailure()) {
39  msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg;
40  return StatusCode::FAILURE;
41  }
42  else {
44  ATH_MSG_DEBUG(" Found the LArOnlineID helper. ");
45  }
46 
47  }
48 
51 
53  if(m_isSC) m_bcMask.setSC();
55 
56  //Intermediate ramp object (DAC/ADC pairs)
57  m_ramps=std::make_unique<LArConditionsContainer<ACCRAMP> >();
58  ATH_CHECK(m_ramps->setGroupingType(m_groupingType,msg()));
59  ATH_CHECK(m_ramps->initialize());
60 
61  chooseRecoMode() ;
63 
64  unsigned int online_id_max = m_onlineHelper->channelHashMax() ;
65  m_thePedestal.resize(online_id_max,-1);
66 
67  return StatusCode::SUCCESS;
68 }

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

◆ rampfit()

StatusCode LArRampBuilder::rampfit ( unsigned  deg,
const std::vector< LArRawRamp::RAMPPOINT_t > &  data,
std::vector< float > &  rampCoeffs,
std::vector< int > &  vSat,
const HWIdentifier  chid,
const LArOnOffIdMapping cabling,
const LArBadChannelCont bcCont 
)
private

Definition at line 755 of file LArRampBuilder.cxx.

758  {
759  unsigned linRange=data.size();
760  if (linRange<2) {
761  bool isgood=true;
762  if(m_doBadChannelMask && m_bcMask.cellShouldBeMasked(bcCont,chid)) isgood=false;
763  if (cabling->isOnlineConnected(chid) && isgood ) {
764  ATH_MSG_ERROR( "Not enough datapoints (" << linRange << ") to fit a polynom!" );
765  return StatusCode::FAILURE;
766  }
767  else {
768  ATH_MSG_DEBUG("Not enough datapoints (" << linRange << ") to fit a polynom for a disconnected or known bad channel!" );
769  return StatusCode::FAILURE;
770  }
771  }
772  int satpoint = -1;
773  if (m_satSlope) {
774 
775  float thisslope = 0., meanslope = 0.;
776  std::vector<float> accslope;
777  accslope.push_back(0);
778  for (unsigned int DACIndex=1;DACIndex<linRange;DACIndex++){
779  thisslope = (data[DACIndex].ADC - data[DACIndex-1].ADC)/(data[DACIndex].DAC - data[DACIndex-1].DAC);
780 
781  float scut;
782  if(m_onlineHelper->isHECchannel(chid) && DACIndex < 5) {
783  scut = meanslope/4.;
784  } else { scut = meanslope/10.;}
785  if ( (satpoint == -1) && ((meanslope-thisslope) > scut) ) {
786  satpoint = DACIndex;
787  if (satpoint <= 4) {
788  ATH_MSG_DEBUG("Only "<<satpoint<<" points to fit, chid: "<<std::hex<<chid.get_identifier32().get_compact()<<std::dec);
789  ATH_MSG_DEBUG(meanslope<<" "<<thisslope<<" | "<<data[DACIndex-1].ADC<<" "<<data[DACIndex].ADC);
790  }
791  } // saturation was reached
792 
793  meanslope = ( thisslope + (DACIndex-1)*(accslope[DACIndex-1]) )/DACIndex;
794  accslope.push_back(meanslope);
795 
796  }
797 
798  if (satpoint != -1) { linRange = satpoint; } // if a saturation was found, linRange becomes the saturation index
799 
800  }
801  vSat.push_back(satpoint);
802 
803  if (!m_withIntercept) {
804  deg--;
805  }
806  bool isgood=true;
807  if(m_doBadChannelMask && m_bcMask.cellShouldBeMasked(bcCont,chid)) isgood=false;
808  if (deg>linRange) {
809  if (cabling->isOnlineConnected(chid) && isgood )
810  ATH_MSG_ERROR( "Not enough datapoints before saturation (" << linRange << ") to fit a polynom of degree " << deg << "chid: "<<std::hex<<chid.get_identifier32().get_compact()<<std::dec);
811  else
812  ATH_MSG_DEBUG("Not enough datapoints before saturation (" << linRange << ") to fit a polynom of degree " << deg << "chid: "<<std::hex<<chid.get_identifier32().get_compact()<<std::dec
813  << " (channel disconnected or known to be bad)");
814 
815  return StatusCode::FAILURE;
816  }
817 
818  if (data[linRange-1].DAC>0 && data[linRange-1].ADC<m_deadChannelCut && data[linRange-1].ADC!=-999.) {
819  ATH_MSG_ERROR( "DAC= " << data[linRange-1].DAC << " yields ADC= " << data[linRange-1].ADC
820  << ". Dead channel?" );
821  return StatusCode::FAILURE;
822  }
823 
824  int begin = 0;
825  if(data[0].DAC == m_DAC0) begin = 1; // starts at 1 to skip DAC=0
826 
827  Eigen::MatrixXd alpha(deg,deg);
828  Eigen::VectorXd beta(deg);
829  float sigma2 = 1.;
830  for (unsigned k=0;k<deg;k++)
831  for (unsigned j=0;j<=k;j++)
832  {
833  alpha(k,j)=0;
834  for (unsigned i=begin;i<linRange;i++)
835  {
836  // we are not storing any error on the reconstructed
837  // peaks, but we can simply use the error on the sample
838  // means (RMS/sqrt(NTriggers)) to account for any
839  // potential variation on the number of accumulated
840  // triggers. BTW, this would be proportional to the ADC
841  // uncertainly but used as *DAC* uncertainty: in the limit
842  // in which the ramp is linear this is still correct, and
843  // anyway better than nothing. -- M.D. 13/7/2009
844  sigma2 = 1.;
845  if ( data[i].NTriggers ) {
846  //float sigma2 = (data[i].RMS[0]*data[i].RMS[0])/data[i].NTriggers;
847  sigma2 = 100./data[i].NTriggers;
848  }
849  // just use trigger number, assume RMS is constant for
850  // all DAC points (same noise). The 100. scale factor is
851  // there to guarantee the same results with respect to
852  // previous fits withour errors (having usually 100
853  // triggers), because of potential numerical
854  // differences when inverting the fit matrix even if
855  // errors are all the same.
856  if (m_withIntercept) {
857  alpha(k,j)+=(std::pow(data[i].ADC,(int)k)*std::pow(data[i].ADC,(int)j))/sigma2;
858  } else {
859  alpha(k,j)+=(std::pow(data[i].ADC,(int)k+1)*std::pow(data[i].ADC,(int)j+1))/sigma2;
860  }
861  alpha(j,k)=alpha(k,j); //Use symmetry
862  }
863  }
864 
865  for (unsigned k=0;k<deg;k++)
866  {
867  beta[k]=0;
868  for (unsigned i=begin;i<linRange;i++) {
869  sigma2 = 1.;
870  if ( data[i].NTriggers ) {
871  sigma2 = 100./data[i].NTriggers;
872  }
873  if (m_withIntercept) {
874  beta[k]+=(data[i].DAC*pow(data[i].ADC,(int)k))/sigma2;
875  } else {
876  beta[k]+=(data[i].DAC*pow(data[i].ADC,(int)k+1))/sigma2;
877  }
878  }
879  }
880 
881  //HepVector comp=solve(alpha,beta);
882  const Eigen::VectorXd comp=alpha.colPivHouseholderQr().solve(beta);
883 
884  //Fill RampDB object
885  if (!m_withIntercept)
886  rampCoeffs.push_back(0);
887 
888  for (int l=0;l<comp.size() ;l++)
889  rampCoeffs.push_back(comp[l]);
890 
891 #ifdef LARRAMPBUILDER_DEBUGOUTPUT
892  // ****************************************
893  // Output for Dugging:
894  for (unsigned i=1;i<data.size();i++)
895  std::cout << data[i].DAC << " " << data[i].ADC << " " << std::endl;
896  std::cout << "LinRange= " << linRange << " satpoint= " << satpoint<<std::endl;
897  for (unsigned k=0;k<deg;k++) {
898  std::cout<<"Beta "<<k<<" "<<beta[k]<<std::endl;
899  for (unsigned j=0;j<=k;j++) {
900  std::cout<<"Alpha "<<j<<" "<<alpha(k,j)<<std::endl;
901  }
902  }
903 
904  //Calculate error:
905  double sigma=0;
906  for (unsigned k=0;k<linRange;k++) //Run over all data points
907  {double DACcalc=comp[0];
908  for (int i=1;i<comp.size();i++) //Apply polynom
909  DACcalc+=comp[i]*pow(data[k].ADC,i);
910  sigma+=(DACcalc-data[k].DAC)*(DACcalc-data[k].DAC);
911  }
912  sigma=sqrt(sigma);
913  if (linRange>1)
914  sigma=sigma/(linRange-1);
915 
916  std::cout << "Components: ";
917  for (int i=0;i<comp.size();i++)
918  std::cout << comp[i] << " ";
919  std::cout << "sigma=" << sigma << std::endl;
920 #undef LARRAMPBUILDER_DEBUGOUTPUT
921 #endif
922 
923  return StatusCode::SUCCESS;
924 }

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

Definition at line 383 of file LArRampBuilder.cxx.

384 {
385  ATH_MSG_INFO( "in stop.");
386 
387  //retrieve BadChannel info:
388  const LArBadChannelCont* bcCont=nullptr;
389  if (m_doBadChannelMask) {
391  bcCont=(*bcContHdl);
392  }
393 
394  StatusCode sc;
395  //Create transient ramp object (to be filled later) (one object for all gains)
396  std::unique_ptr<LArRampComplete> larRampComplete;
397  if (m_saveRecRamp){
398  larRampComplete=std::make_unique<LArRampComplete>();
399  ATH_CHECK(larRampComplete->setGroupingType(m_groupingType,msg()));
400  ATH_CHECK(larRampComplete->initialize());
401  }
402 
403  const LArOnOffIdMapping* cabling(nullptr);
404  if( m_isSC ){
405  ATH_MSG_INFO("setting up SC cabling");
407  cabling = {*cablingHdl};
408  if(!cabling) {
409  ATH_MSG_ERROR("Do not have mapping object " << m_cablingKeySC.key());
410  return StatusCode::FAILURE;
411  }
412  }else{
413  ATH_MSG_INFO("setting up calo cabling");
415  cabling = {*cablingHdl};
416  if(!cabling) {
417  ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key());
418  return StatusCode::FAILURE;
419  }
420  }
421 
422 
423  const ILArRinj* rinj=nullptr;
424  if(m_ishec) {
426  }
427 
428  int containerCounter=0;
429 
430  int NRamp=0;
431 
432  for (unsigned k=0;k<(int)CaloGain::LARNGAIN;k++) {
436  if (cell_it==cell_it_e) {
437  ATH_MSG_INFO( "No ramp points found for gain " << gain);
438  continue; //No data for this gain
439  }
440  //Create transient object for raw ramp (one container per gain)
441  std::unique_ptr<LArRawRampContainer> larRawRampContainer;
442  if (m_saveRawRamp) {
443  larRawRampContainer=std::make_unique<LArRawRampContainer>();
444  }
445 
446  //Inner loop goes over the cells.
447  for (;cell_it!=cell_it_e;cell_it++){
448 
449  const HWIdentifier chid = cell_it.channelId();
450 
451  ACCRAMP::const_iterator dac_it=cell_it->begin();
452  ACCRAMP::const_iterator dac_it_e=cell_it->end();
453  auto rawramp=std::make_unique<LArRawRamp>(chid,gain);
454 
455  std::vector<float> peak;
456  float adcpeak, timepeak;
457  std::vector<float> adc0v;
458  bool isADCsat = false;
459 
460 
461 
462 
463  for (;dac_it!=dac_it_e;++dac_it) {
464 
465  LArRawRamp::RAMPPOINT_t ramppoint;
466 
467  adcpeak = -999.;
468  timepeak = -999.;
469  // prepare samples
470  float MaxADC = 0;
471  int iMaxADC = 0;
472  // if DAC0, fill adc0v vector
473  if(m_dac0sub && dac_it->first== m_DAC0){
474  // check that DAC0 is the first DAC of list
475 
476  if(dac_it!=cell_it->begin())
477  ATH_MSG_ERROR( "DAC0 is not the first DAC ? This might be a problem... " );
478  adc0v = dac_it->second.mean();
479  ramppoint.Samples = adc0v;
480  ramppoint.RMS = dac_it->second.RMS();
481  ramppoint.NTriggers = dac_it->second.nTriggers();
482  }else{// if not DAC0, substract DAC0 to current DAC
483  const size_t nS=dac_it->second.nsamples();
484  adc0v.resize(nS,0.0);
485  ramppoint.Samples.resize(nS);
486  ramppoint.RMS.resize(nS);
487  ramppoint.NTriggers = dac_it->second.nTriggers();
488  for(size_t k=0;k<nS;++k){
489  ramppoint.Samples[k]=dac_it->second.mean(k) - adc0v[k];
490  ramppoint.RMS[k]=dac_it->second.RMS(k);
491  // find sample max and its index
492  if(ramppoint.Samples[k]>MaxADC){
493  MaxADC = ramppoint.Samples[k];
494  iMaxADC = k;
495  }
496  }
497  }
498 
499  // reconstruct
500  if ( m_recoType == OF) {
501  if (!m_dac0sub) {
502  IdentifierHash chid_hash = m_onlineHelper->channel_Hash(chid);
503  for (size_t k=0;k<ramppoint.Samples.size();++k) {
504  ramppoint.Samples[k] = ramppoint.Samples[k] - m_thePedestal[chid_hash];
505  }
506  }
507 
508  //The following lines have been moved here from LArOFPeakReco tool:
509  float delay=m_delay;
510  unsigned kMax = max_element(ramppoint.Samples.begin(),ramppoint.Samples.end()) - ramppoint.Samples.begin() ;
511  unsigned kLow, kUp;
512  //unsigned nIter=0;
513  if(!m_iterate) { // No iteration, original code
514  if ( kMax < 2 || kMax+2 >= ramppoint.Samples.size() ) {
515  // probably wrong max for small signal = noise artifact
516  kMax=2;
517  bool isgood=true;
518  if(m_doBadChannelMask && m_bcMask.cellShouldBeMasked(bcCont,chid)) isgood=false;
519  if (cabling->isOnlineConnected(chid) && isgood) {
520  ATH_MSG_WARNING( "Not enough samples around the maximum! Use kMax=2 ("
521  << m_onlineHelper->channel_name(chid) <<", DAC=" << dac_it->first
522  << ", Amp[2]=" << ramppoint.Samples[2] << " )" );
523  if (msgLvl(MSG::VERBOSE)) {
524  msg(MSG::VERBOSE) << " Samples: ";
525  for (unsigned k=0;k<ramppoint.Samples.size();k++)
526  msg() << ramppoint.Samples[k] << " ";
527  msg() << endmsg;
528  }//end if verbose message
529  }//end if bad or disconnected channel
530  }//end if kmax out-of-range
531 
532  // convention delay=0 OFC use samp 0-1-2-3-4
533  // delay=24 OFC use samp 1-2-3-4-5
534  // => if kmax=2 : choose OFC with delay + delayShift
535  // if kmax=3 : choose OFC with delay+ delayShift+24
536  // if kmax=4 : stick to kmax=3
537  //GU temporary hardcoded number. To move to jobOptions
538 
539  if (kMax==4) kMax=3;
540  if (kMax==3) delay += (m_delayShift+24);
541  if (kMax==2) delay += m_delayShift;
542  ATH_MSG_VERBOSE("kMax " << kMax << " delay " << delay);
543  delay=(delay-0.5)*(25./24.);
544  //Call OF peak reco tool with no iteration and peak-sample forced to kMax
545  kLow = kUp = kMax;
546  } else { // code with iteration
547  kLow = kMax - 2;
548  kUp = kMax + 2;
549  delay = 0.;
550  //nIter = 10;
551  }
552  const LArOFPeakRecoTool::Result results=m_peakOFTool->peak(ramppoint.Samples,chid,gain,delay,0,kMax,kLow,kUp);
553  if (results.getValid()) {
554  adcpeak = results.getAmplitude();
555  timepeak = results.getTau();
556  }
557  else
558  ATH_MSG_ERROR( "LArOFPeak reco tool returns invalid result.");
559 
560 
561  } else if ( m_recoType == SHAPE) {
562 
563  IdentifierHash chid_hash = m_onlineHelper->channel_Hash(chid);
564 
565  // reconstruct for non-DAC0 values and non-saturating waves
566  if(dac_it->first!= m_DAC0 && dac_it->first <= m_CaliDACs[gain][chid_hash][m_IndexHighestDAC[gain][chid_hash]]){
567 
568  // find appropriate wave
569  unsigned int GoodIndex = 9999;
570  for(unsigned int i=0;i<m_CaliDACs[gain][chid_hash].size();i++){
571  if(dac_it->first == m_CaliDACs[gain][chid_hash][i]) GoodIndex=i;
572  }
573  if(GoodIndex == 9999) {
574  ATH_MSG_WARNING("No wave found for cell = " << chid_hash << ", DAC = " << dac_it->first);
575  float min = 9999999;
576  for(unsigned int i=0;i<m_CaliDACs[gain][chid_hash].size();i++){
577  int dacdiff = dac_it->first - m_CaliDACs[gain][chid_hash][i];
578  if(abs(dacdiff)<min)
579  {
580  min=abs(dacdiff);
581  GoodIndex=i;
582  }
583  }
584  ATH_MSG_WARNING("Replace with DAC = " << m_CaliDACs[gain][chid_hash][GoodIndex]);
585  }
586  // substract DAC0 wave
587  for(unsigned int k=0;k<m_CaliWaves[gain][chid_hash][GoodIndex].size();k++){
588  m_CaliWaves[gain][chid_hash][GoodIndex][k] -= m_CaliWaves[gain][chid_hash][m_IndexDAC0[gain][chid_hash]][k];
589  }
590 
591  // apply reconstruction
592  if(!m_CaliWaves[gain][chid_hash][GoodIndex].empty()){
593  peak=m_peakShapeTool->peak(ramppoint.Samples,m_CaliWaves[gain][chid_hash][GoodIndex]);
594  ATH_MSG_DEBUG("cell chid=" << chid.get_compact() << ",peak= " << peak[0]);
595  }else{
596  ATH_MSG_ERROR( "No wave for this cell chid=" << chid.get_compact() << ",hash= " << chid_hash);
597  peak.push_back(-999);
598  peak.push_back(-999);
599  }
600 
601  if(peak.size()>1){
602  adcpeak = peak[0];
603  timepeak = peak[1];
604  }
605  }
606  } else if ( m_recoType == PARABOLA ) {
607 
608  if(m_correctBias){
609 
610  IdentifierHash chid_hash = m_onlineHelper->channel_Hash(chid);
611 
612  // get layer for correction
613  Identifier id=cabling->cnvToIdentifier(chid);
614  int layer=m_emId->sampling(id);
615  peak=m_peakParabolaTool->peak(ramppoint.Samples,layer,m_thePedestal[chid_hash]);
616 
617  }else{
618  // call peak reco without layer --> no bias correction
619  peak=m_peakParabolaTool->peak(ramppoint.Samples);
620  }
621  adcpeak = peak[0];
622  timepeak = peak[1];
623 
624 
625  } else {
626  ATH_MSG_ERROR( "Both OF and Parabola reconstruction modes not available!" ) ;
627  return StatusCode::FAILURE ;
628  }
629 
630  ramppoint.ADC = adcpeak;
631  ramppoint.DAC = dac_it->first;
632 
633  if(m_ishec && m_onlineHelper->isHECchannel(chid)) {
634  if(rinj) {
635  const float rinjval = rinj->Rinj(chid);
636  if(rinjval < 4) ramppoint.DAC /= 2;
637  }
638  }
639 
640  ramppoint.iMaxSample = iMaxADC;
641  ramppoint.TimeMax = timepeak;
642 
643 
644  // only add to rawramp non saturing points (using rawdata information)
645 
646  if( (dac_it->first>= m_minDAC) && ramppoint.ADC > -998
647  && ((m_maxADC <= 0) || (MaxADC < m_maxADC)) ) {
648  rawramp->add(ramppoint);
649  }
650  else if ((m_maxADC > 0)&&(MaxADC >= m_maxADC)) {
651  isADCsat = true; // if ADC saturated at least once, it should be notified
652  if(ramppoint.DAC < 200){
653  ATH_MSG_DEBUG("Saturated low DAC: "<<m_onlineHelper->channel_name(chid)<<" at DAC "<<dac_it->first<<" ADC "<< MaxADC);
654  } else {
655  ATH_MSG_DEBUG("Saturated: "<<m_onlineHelper->channel_name(chid)<<" at DAC "<<dac_it->first<<" ADC "<< MaxADC);
656  }
657  }else{
658  ATH_MSG_DEBUG("Fail ramp selection: "<<chid<<" "<<dac_it->first<<" "<<m_minDAC<<" "<<ramppoint.ADC<<" "<<MaxADC<<" "<<m_maxADC);
659  }
660  }
661 
662  //Build ramp object..........
663  if (larRampComplete) {
664  std::vector<LArRawRamp::RAMPPOINT_t>& data=rawramp->theRamp();
665  sort(data.begin(),data.end()); //Sort vector of raw data (necessary to cut off nonlinar high ADC-values)
666  std::vector<float> rampCoeffs;
667  std::vector<int> vSat;
668  StatusCode sc=rampfit(m_degree+1,data,rampCoeffs,vSat,chid,cabling,bcCont);
669  if (sc!=StatusCode::SUCCESS){
670  if (!cabling->isOnlineConnected(chid))
671  ATH_MSG_DEBUG("Failed to produce ramp for disconnected channel " << m_onlineHelper->channel_name(chid));
672  else if (m_doBadChannelMask && m_bcMask.cellShouldBeMasked(bcCont,chid))
673  ATH_MSG_INFO( "Failed to produce ramp for known bad channel " << m_onlineHelper->channel_name(chid));
674  else
675  ATH_MSG_ERROR( "Failed to produce ramp for channel " << m_onlineHelper->channel_name(chid));
676  }
677  else{
678  if(rampCoeffs[1]<0)
679  ATH_MSG_ERROR( "Negative 1rst order coef for ramp = " << rampCoeffs[1] << " for channel "
680  << m_onlineHelper->channel_name(chid) );
681 
682  if (vSat[0] != -1) { rawramp->setsat(vSat[0]); } // if a saturation point was found in rampfit, record it
683  else {
684  if (isADCsat) { rawramp->setsat(data.size()-1); } // if no saturation point was found, and ADC saturation happened, record the last ramp point
685  if (!isADCsat) { rawramp->setsat(data.size()); } // if no saturation point was found, and ADC saturation did not happen, record the ramp size
686  }
687 
688  //Produce transient object
689  larRampComplete->set(chid,(int)gain,rampCoeffs);
690  NRamp++;
691  }// end else (rampfitting suceeded)
692  }// end if (build ramp object)
693  //Save raw ramp for this cell, if requested by jobOpts
694  if (larRawRampContainer){
695  larRawRampContainer->push_back(std::move(rawramp));
696  }
697  }//end loop cells
698 
699  if (larRawRampContainer) {
700  std::string key;
701  switch (gain) {
703  key="HIGH";
704  break;
706  key="MEDIUM";
707  break;
709  key="LOW";
710  break;
711  default:
712  key="UNKNOWN";
713  break;
714  }
715  key = m_keyoutput + key;
716  ATH_MSG_INFO( "Recording LArRawRampContainer for gain " << (int)gain << " key=" << key);
717  sc=detStore()->record(std::move(larRawRampContainer),key);
718  if (sc.isFailure()) {
719  ATH_MSG_ERROR( "Failed to record LArRawRamp object");
720  }
721  }// end if larRawRampContainer
722  ++containerCounter;
723  }//end loop over containers
724 
725  if (containerCounter==0) {
726  ATH_MSG_WARNING("No Ramps have been produced. No data found.");
727  return StatusCode::FAILURE;
728  }
729 
730  if (larRampComplete){ //Save the transient Ramp object.
731 
732  ATH_MSG_INFO( " Summary : Number of cells with a ramp value computed : " << NRamp );
733  ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 ");
734  ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 ");
735  ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 ");
736  ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 ");
737  ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 ");
738 
739 
740  sc=detStore()->record(std::move(larRampComplete),m_keyoutput);
741  if (sc.isFailure()) {
742  ATH_MSG_ERROR( "Failed to record LArRampComplete object");
743  }
745  if (sc.isFailure()) {
746  ATH_MSG_ERROR( "Failed to symlink LArRawRamp object");
747  }
748  }
749  m_ramps.reset();//Not needed any more. Free memory.
750  ATH_MSG_INFO( "LArRampBuilder has finished.");
751  return StatusCode::SUCCESS;
752 }// end finalize-method.

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

SG::ReadCondHandleKey<LArBadChannelCont> LArRampBuilder::m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}
private

Definition at line 136 of file LArRampBuilder.h.

◆ m_bcMask

LArBadChannelMask LArRampBuilder::m_bcMask
private

Definition at line 135 of file LArRampBuilder.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArRampBuilder::m_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
private

Definition at line 78 of file LArRampBuilder.h.

◆ m_cablingKeySC

SG::ReadCondHandleKey<LArOnOffIdMapping> LArRampBuilder::m_cablingKeySC {this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
private

Definition at line 79 of file LArRampBuilder.h.

◆ m_CaliDACs

std::vector< std::vector< std::vector< unsigned int > > > LArRampBuilder::m_CaliDACs
private

Definition at line 103 of file LArRampBuilder.h.

◆ m_CaliWaves

std::vector< std::vector< std::vector< std::vector<double> > > > LArRampBuilder::m_CaliWaves
private

Definition at line 101 of file LArRampBuilder.h.

◆ m_correctBias

BooleanProperty LArRampBuilder::m_correctBias {this,"correctBias",false,"For Parabola method: Correction yes/no"}
private

Definition at line 130 of file LArRampBuilder.h.

◆ m_DAC0

UnsignedIntegerProperty LArRampBuilder::m_DAC0 {this,"DAC0",0,"DAC value considered DAC0"}
private

Definition at line 123 of file LArRampBuilder.h.

◆ m_dac0sub

BooleanProperty LArRampBuilder::m_dac0sub {this,"SubtractDac0",true,"Take first DAC value as pedestal"}
private

Definition at line 122 of file LArRampBuilder.h.

◆ m_deadChannelCut

IntegerProperty LArRampBuilder::m_deadChannelCut {this,"DeadChannelCut",1300,"Complain about channels with max-ADC below this value"}
private

Definition at line 129 of file LArRampBuilder.h.

◆ m_degree

IntegerProperty LArRampBuilder::m_degree {this,"Polynom",1,"Degree of ramp-polynom"}
private

Definition at line 120 of file LArRampBuilder.h.

◆ m_delay

int LArRampBuilder::m_delay =-1
private

Definition at line 98 of file LArRampBuilder.h.

◆ m_delayShift

FloatProperty LArRampBuilder::m_delayShift {this,"DelayShift",23}
private

Definition at line 132 of file LArRampBuilder.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_doBadChannelMask

Gaudi::Property<bool> LArRampBuilder::m_doBadChannelMask {this,"IgnoreBadChannels",true,"Don't complain about known bad channels"}
private

Definition at line 134 of file LArRampBuilder.h.

◆ m_emId

const LArEM_Base_ID* LArRampBuilder::m_emId =nullptr
private

Definition at line 142 of file LArRampBuilder.h.

◆ m_event_counter

unsigned LArRampBuilder::m_event_counter =0
private

Definition at line 97 of file LArRampBuilder.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 LArRampBuilder::m_fatalFebErrorPattern =0xffff
private

Definition at line 148 of file LArRampBuilder.h.

◆ m_groupingType

Gaudi::Property<std::string> LArRampBuilder::m_groupingType {this,"GroupingType","ExtendedFeedThrough","Grouping of the output conditions-container"}
private

Definition at line 138 of file LArRampBuilder.h.

◆ m_hec_key

Gaudi::Property<std::string> LArRampBuilder::m_hec_key {this,"HECKey","","SG Key of injection-resistor obj used for HEC Ramps"}
private

Definition at line 139 of file LArRampBuilder.h.

◆ m_IndexDAC0

std::vector< std::vector< int> > LArRampBuilder::m_IndexDAC0
private

Definition at line 105 of file LArRampBuilder.h.

◆ m_IndexHighestDAC

std::vector< std::vector< int> > LArRampBuilder::m_IndexHighestDAC
private

Definition at line 106 of file LArRampBuilder.h.

◆ m_ipassShape

int LArRampBuilder::m_ipassShape =0
private

Definition at line 99 of file LArRampBuilder.h.

◆ m_ishec

Gaudi::Property<bool> LArRampBuilder::m_ishec {this,"isHEC",false,"Processing HEC data yes/no"}
private

Definition at line 145 of file LArRampBuilder.h.

◆ m_isSC

Gaudi::Property<bool> LArRampBuilder::m_isSC {this,"isSC",false,"Processing SC data yes/no"}
private

Definition at line 144 of file LArRampBuilder.h.

◆ m_iterate

Gaudi::Property<bool> LArRampBuilder::m_iterate {this,"Iterate",false,"Iterative OF peak reco"}
private

Definition at line 146 of file LArRampBuilder.h.

◆ m_keylist

Gaudi::Property<std::vector<std::string> > LArRampBuilder::m_keylist {this, "KeyList",{},"List if input SG keys"}
private

Definition at line 117 of file LArRampBuilder.h.

◆ m_keyoutput

Gaudi::Property<std::string> LArRampBuilder::m_keyoutput {this,"KeyOutput","LArRamp","SG Key of output object"}
private

Definition at line 118 of file LArRampBuilder.h.

◆ m_maxADC

IntegerProperty LArRampBuilder::m_maxADC {this,"RampRange",0,"Ignore ADC values higher than this (0: do nothing)"}
private

Definition at line 121 of file LArRampBuilder.h.

◆ m_minDAC

UnsignedIntegerProperty LArRampBuilder::m_minDAC {this,"minDAC",0,"Ignore DAC values smaller that this"}
private

Definition at line 127 of file LArRampBuilder.h.

◆ m_onlineHelper

const LArOnlineID_Base* LArRampBuilder::m_onlineHelper =nullptr
private

Definition at line 141 of file LArRampBuilder.h.

◆ m_peakOFTool

ToolHandle<LArOFPeakRecoTool> LArRampBuilder::m_peakOFTool {this,"PeakOFTool","LArOFPeakRecoTool"}
private

Definition at line 95 of file LArRampBuilder.h.

◆ m_peakParabolaTool

PublicToolHandle<LArParabolaPeakRecoTool> LArRampBuilder::m_peakParabolaTool {this,"LArParabolaPeakRecoTool","LArParabolaPeakRecoTool"}
private

Definition at line 93 of file LArRampBuilder.h.

◆ m_peakShapeTool

PublicToolHandle<LArShapePeakRecoTool> LArRampBuilder::m_peakShapeTool {this,"LArShapePeakRecoTool","LArShapePeakRecoTool"}
private

Definition at line 94 of file LArRampBuilder.h.

◆ m_problemsToMask

Gaudi::Property<std::vector<std::string> > LArRampBuilder::m_problemsToMask {this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}
private

Definition at line 137 of file LArRampBuilder.h.

◆ m_ramps

std::unique_ptr<LArConditionsContainer<ACCRAMP> > LArRampBuilder::m_ramps
private

Definition at line 90 of file LArRampBuilder.h.

◆ m_recoType

recoType LArRampBuilder::m_recoType {OF}
private

Definition at line 113 of file LArRampBuilder.h.

◆ m_recoTypeProp

StringProperty LArRampBuilder::m_recoTypeProp {this,"RecoType","OF","One of 'Parabola', 'Shape' or 'OF'"}
private

Definition at line 128 of file LArRampBuilder.h.

◆ m_satSlope

BooleanProperty LArRampBuilder::m_satSlope {this,"doSatSlope",true,"Ignore points subject to saturation"}
private

Definition at line 126 of file LArRampBuilder.h.

◆ m_saveRawRamp

BooleanProperty LArRampBuilder::m_saveRawRamp {this,"StoreRawRamp",false,"Save raw ramp obj in SG"}
private

Definition at line 124 of file LArRampBuilder.h.

◆ m_saveRecRamp

BooleanProperty LArRampBuilder::m_saveRecRamp {this,"StoreRecRamp",true,"Save reconstructed ramp obj in SG"}
private

Definition at line 125 of file LArRampBuilder.h.

◆ m_thePedestal

std::vector<float> LArRampBuilder::m_thePedestal
private

Definition at line 108 of file LArRampBuilder.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.

◆ m_withIntercept

BooleanProperty LArRampBuilder::m_withIntercept {this,"WithIntercept",true,"False: Force fit to go through 0/0"}
private

Definition at line 131 of file LArRampBuilder.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArRampBuilder::m_deadChannelCut
IntegerProperty m_deadChannelCut
Definition: LArRampBuilder.h:129
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:24
ILArPedestal::pedestal
virtual float pedestal(const HWIdentifier &id, int gain) const =0
LArAccumulatedCalibDigit
Data class for calibration ADC samples preprocessed by the DSP.
Definition: LArAccumulatedCalibDigit.h:42
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LArRampBuilder::m_dac0sub
BooleanProperty m_dac0sub
Definition: LArRampBuilder.h:122
LArRampBuilder::m_recoType
recoType m_recoType
Definition: LArRampBuilder.h:113
LArRampBuilder::m_thePedestal
std::vector< float > m_thePedestal
Definition: LArRampBuilder.h:108
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1636
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
LArRampBuilder::m_isSC
Gaudi::Property< bool > m_isSC
Definition: LArRampBuilder.h:144
MonDataType::ADC
@ ADC
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LArRampBuilder::m_keylist
Gaudi::Property< std::vector< std::string > > m_keylist
Definition: LArRampBuilder.h:117
LArRampBuilder::m_peakOFTool
ToolHandle< LArOFPeakRecoTool > m_peakOFTool
Definition: LArRampBuilder.h:95
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
LArRampBuilder::m_withIntercept
BooleanProperty m_withIntercept
Definition: LArRampBuilder.h:131
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArRampBuilder::m_maxADC
IntegerProperty m_maxADC
Definition: LArRampBuilder.h:121
LArCalibTriggerAccumulator::add
ERRTYPE add(const std::vector< short > &digits)
accumulated individual set of digits.
Definition: LArCalibTriggerAccumulator.cxx:17
LArRampBuilder::m_saveRecRamp
BooleanProperty m_saveRecRamp
Definition: LArRampBuilder.h:125
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArRampBuilder::m_CaliWaves
std::vector< std::vector< std::vector< std::vector< double > > > > m_CaliWaves
Definition: LArRampBuilder.h:101
ILArPedestal
Definition: ILArPedestal.h:12
LArRampBuilder::m_peakParabolaTool
PublicToolHandle< LArParabolaPeakRecoTool > m_peakParabolaTool
Definition: LArRampBuilder.h:93
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArRampBuilder::rampfit
StatusCode rampfit(unsigned deg, const std::vector< LArRawRamp::RAMPPOINT_t > &data, std::vector< float > &rampCoeffs, std::vector< int > &vSat, const HWIdentifier chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Definition: LArRampBuilder.cxx:755
LArConditionsContainerDB::iteratorT
Declaration of const iterator.
Definition: LArConditionsContainerDB.h:72
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
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
LArRampBuilder::m_groupingType
Gaudi::Property< std::string > m_groupingType
Definition: LArRampBuilder.h:138
LArBadChannelMask::buildBitMask
StatusCode buildBitMask(const std::vector< std::string > &problemsToMask, MsgStream &msg)
Definition: LArBadChannelMask.cxx:10
deg
#define deg
Definition: SbPolyhedron.cxx:17
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
LArRampBuilder::m_emId
const LArEM_Base_ID * m_emId
Definition: LArRampBuilder.h:142
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
LArRampBuilder::m_keyoutput
Gaudi::Property< std::string > m_keyoutput
Definition: LArRampBuilder.h:118
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
ILArRinj::Rinj
virtual const float & Rinj(const HWIdentifier &id) const =0
LArFebErrorSummary::error_to_string
static std::string error_to_string(uint16_t error)
interpret the error in string
Definition: LArFebErrorSummary.cxx:58
LArRampBuilder::m_cablingKeySC
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
Definition: LArRampBuilder.h:79
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArRawRamp::RAMPPOINT_t::NTriggers
uint16_t NTriggers
Definition: LArRawRamp.h:38
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
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
LArRampBuilder::m_recoTypeProp
StringProperty m_recoTypeProp
Definition: LArRampBuilder.h:128
HWIdentifier
Definition: HWIdentifier.h:13
LArBadChannelMask::cellShouldBeMasked
bool cellShouldBeMasked(const LArBadChannelCont *bcCont, const HWIdentifier &hardwareId) const
Definition: LArBadChannelMask.h:42
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
LArRampBuilder::m_iterate
Gaudi::Property< bool > m_iterate
Definition: LArRampBuilder.h:146
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
LArRampBuilder::m_onlineHelper
const LArOnlineID_Base * m_onlineHelper
Definition: LArRampBuilder.h:141
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArCaliWaveContainer
Liquid Argon Cumulative Wave Container.
Definition: LArCaliWaveContainer.h:33
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
LArRampBuilder::m_IndexHighestDAC
std::vector< std::vector< int > > m_IndexHighestDAC
Definition: LArRampBuilder.h:106
LArRawRamp::RAMPPOINT_t
Definition: LArRawRamp.h:30
LArFebErrorSummary::feb_error
uint16_t feb_error(HWIdentifier febid) const
get error for feb
Definition: LArFebErrorSummary.cxx:20
LArConditionsContainer
Definition: LArAutoCorrSym.h:14
LArRampBuilder::m_degree
IntegerProperty m_degree
Definition: LArRampBuilder.h:120
LArCalibTriggerAccumulator
Helper class to accumulate calibration triggers.
Definition: LArCalibTriggerAccumulator.h:30
LArRampBuilder::m_peakShapeTool
PublicToolHandle< LArShapePeakRecoTool > m_peakShapeTool
Definition: LArRampBuilder.h:94
LArRawRamp::RAMPPOINT_t::TimeMax
float TimeMax
Definition: LArRawRamp.h:35
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
ILArRinj
Definition: ILArRinj.h:12
LArCaliWave
Definition: LArCaliWave.h:44
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
LArRampBuilder::m_delay
int m_delay
Definition: LArRampBuilder.h:98
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
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
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArRampBuilder::OF
@ OF
Definition: LArRampBuilder.h:112
LArOnlineID_Base::isHECchannel
virtual bool isHECchannel(const HWIdentifier id) const =0
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArRawRamp::RAMPPOINT_t::ADC
RAMPDATA_t ADC
Definition: LArRawRamp.h:32
LArRampBuilder::m_satSlope
BooleanProperty m_satSlope
Definition: LArRampBuilder.h:126
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LArRampBuilder::m_doBadChannelMask
Gaudi::Property< bool > m_doBadChannelMask
Definition: LArRampBuilder.h:134
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
LArRampBuilder::m_fatalFebErrorPattern
uint16_t m_fatalFebErrorPattern
Definition: LArRampBuilder.h:148
LArRampBuilder::chooseRecoMode
void chooseRecoMode()
Definition: LArRampBuilder.cxx:71
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArRampBuilder::m_delayShift
FloatProperty m_delayShift
Definition: LArRampBuilder.h:132
delay
double delay(std::size_t d)
Definition: JetTrigTimerTest.cxx:14
LArRampBuilder::SHAPE
@ SHAPE
Definition: LArRampBuilder.h:112
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
LArRampComplete::set
virtual void set(const HWIdentifier &CellID, int gain, const std::vector< float > &vRamp)
Definition: LArRampComplete.h:58
LArRampBuilder::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: LArRampBuilder.h:136
LArRampBuilder::m_minDAC
UnsignedIntegerProperty m_minDAC
Definition: LArRampBuilder.h:127
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
min
#define min(a, b)
Definition: cfImp.cxx:40
LArCalibTriggerAccumulator::NumericOverflow
@ NumericOverflow
Definition: LArCalibTriggerAccumulator.h:49
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
LArRampBuilder::m_hec_key
Gaudi::Property< std::string > m_hec_key
Definition: LArRampBuilder.h:139
LArRampBuilder::m_ishec
Gaudi::Property< bool > m_ishec
Definition: LArRampBuilder.h:145
LArBadChannelMask::setSC
void setSC()
Definition: LArBadChannelMask.h:29
LArRawRamp::RAMPPOINT_t::DAC
uint32_t DAC
Definition: LArRawRamp.h:33
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
LArRampBuilder::m_bcMask
LArBadChannelMask m_bcMask
Definition: LArRampBuilder.h:135
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1901
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
LArRampBuilder::m_event_counter
unsigned m_event_counter
Definition: LArRampBuilder.h:97
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArOnlineID
Definition: LArOnlineID.h:20
python.ami.results
def results
Definition: ami.py:386
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArRampBuilder::m_ipassShape
int m_ipassShape
Definition: LArRampBuilder.h:99
LArOnline_SuperCellID
Definition: LArOnline_SuperCellID.h:20
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
LArRampBuilder::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArRampBuilder.h:78
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
LArRawRamp::RAMPPOINT_t::RMS
std::vector< float > RMS
Definition: LArRawRamp.h:37
LArRampBuilder::m_ramps
std::unique_ptr< LArConditionsContainer< ACCRAMP > > m_ramps
Definition: LArRampBuilder.h:90
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
LArFebErrorSummary
Holds information from the FEB Error Summary.
Definition: LArFebErrorSummary.h:23
LArRawRamp::RAMPPOINT_t::Samples
std::vector< float > Samples
Definition: LArRawRamp.h:36
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
LArRampBuilder::m_IndexDAC0
std::vector< std::vector< int > > m_IndexDAC0
Definition: LArRampBuilder.h:105
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
LArRampBuilder::m_saveRawRamp
BooleanProperty m_saveRawRamp
Definition: LArRampBuilder.h:124
LArRampBuilder::m_CaliDACs
std::vector< std::vector< std::vector< unsigned int > > > m_CaliDACs
Definition: LArRampBuilder.h:103
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
LArRampBuilder::m_correctBias
BooleanProperty m_correctBias
Definition: LArRampBuilder.h:130
LArElecCalib::ERRORCODE
@ ERRORCODE
Definition: LArCalibErrorCode.h:17
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
LArCalibTriggerAccumulator::ERRTYPE
ERRTYPE
Definition: LArCalibTriggerAccumulator.h:46
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
IdentifierHash
Definition: IdentifierHash.h:38
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
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
LArAccumulatedCalibDigitContainer
Container class for LArAccumulatedCalibDigit.
Definition: LArAccumulatedCalibDigitContainer.h:25
LArRampBuilder::m_DAC0
UnsignedIntegerProperty m_DAC0
Definition: LArRampBuilder.h:123
LArCalibTriggerAccumulator::WrongNSamples
@ WrongNSamples
Definition: LArCalibTriggerAccumulator.h:48
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
LArRampBuilder::PARABOLA
@ PARABOLA
Definition: LArRampBuilder.h:112
LArRawRamp::RAMPPOINT_t::iMaxSample
float iMaxSample
Definition: LArRawRamp.h:34
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
LArRampBuilder::m_problemsToMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Definition: LArRampBuilder.h:137
fitman.k
k
Definition: fitman.py:528
LArOFIterResults
Definition: LArOFIterResults.h:15
DiTauMassTools::TauTypes::ll
@ ll
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:49
ServiceHandle< ICondSvc >
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37