ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1::L1DynamicPedestalProviderTxt Class Reference

Tool to retrieve dynamic pedestal values from a text file. More...

#include <L1DynamicPedestalProviderTxt.h>

Inheritance diagram for LVL1::L1DynamicPedestalProviderTxt:
Collaboration diagram for LVL1::L1DynamicPedestalProviderTxt:

Classes

class  ParamFunc
 

Public Member Functions

 L1DynamicPedestalProviderTxt (const std::string &, const std::string &, const IInterface *)
 constructor More...
 
virtual ~L1DynamicPedestalProviderTxt ()
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual int dynamicPedestal (int iEta, int layer, int pedestal, int iBCID, float mu) const override
 retrieve the bcidCorrection value 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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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

std::pair< bool, int > distanceFromHeadOfTrain (int bcid) const
 
void parseInputFile (const std::string &fileName, std::vector< std::vector< std::unique_ptr< ParamFunc >>> &params)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_emParameterizations
 
std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_hadParameterizations
 
SG::ReadCondHandleKey< BunchCrossingCondDatam_bcDataKey {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"}
 
std::string m_inputFileEMShort
 
std::string m_inputFileHADShort
 
std::string m_inputFileEMLong
 
std::string m_inputFileHADLong
 
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
 

Static Private Attributes

static const unsigned s_nElements = 33
 
static const unsigned s_nBCIDPerTrain = 74
 

Detailed Description

Tool to retrieve dynamic pedestal values from a text file.

This tool retrieves the dynamic pedestal value given the trigger tower location and the bcid and mu value of the event. The correction is parameterized as a function of eta, BCID and mu. To reduce the number of parameters necessary the eta dependence is parameterized in a so-called "second parameterization" for large parts of the detector. The parameters are read from a text file.

Definition at line 53 of file L1DynamicPedestalProviderTxt.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1DynamicPedestalProviderTxt()

LVL1::L1DynamicPedestalProviderTxt::L1DynamicPedestalProviderTxt ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

constructor

Definition at line 52 of file L1DynamicPedestalProviderTxt.cxx.

55  : AthAlgTool(t, n, p)
56 {
57  declareInterface<IL1DynamicPedestalProvider>(this);
58 
59  // fill the vectors with default values - didn't find a more clever way due to move-only unique_ptr
60  m_emParameterizations[0] = std::vector<std::vector<std::unique_ptr<ParamFunc>>>(s_nElements);
61  m_emParameterizations[1] = std::vector<std::vector<std::unique_ptr<ParamFunc>>>(s_nElements);
62  m_hadParameterizations[0] = std::vector<std::vector<std::unique_ptr<ParamFunc>>>(s_nElements);
63  m_hadParameterizations[1] = std::vector<std::vector<std::unique_ptr<ParamFunc>>>(s_nElements);
64  for(std::size_t i = 0; i < s_nElements; ++i) {
65  m_emParameterizations[0][i] = std::vector<std::unique_ptr<ParamFunc>>(s_nBCIDPerTrain);
66  m_emParameterizations[1][i] = std::vector<std::unique_ptr<ParamFunc>>(s_nBCIDPerTrain);
67  m_hadParameterizations[0][i] = std::vector<std::unique_ptr<ParamFunc>>(s_nBCIDPerTrain);
68  m_hadParameterizations[1][i] = std::vector<std::unique_ptr<ParamFunc>>(s_nBCIDPerTrain);
69  }
70 
71  // Input files containing the parameters for the electromagnetic and hadronic
72  // layer, respectively.
73  declareProperty("InputFileEM_ShortGap", m_inputFileEMShort);
74  declareProperty("InputFileHAD_ShortGap", m_inputFileHADShort);
75  declareProperty("InputFileEM_LongGap", m_inputFileEMLong);
76  declareProperty("InputFileHAD_LongGap", m_inputFileHADLong);
77 }

◆ ~L1DynamicPedestalProviderTxt()

LVL1::L1DynamicPedestalProviderTxt::~L1DynamicPedestalProviderTxt ( )
virtual

default destructor

Definition at line 80 of file L1DynamicPedestalProviderTxt.cxx.

81 {
82  // keep destructor in .cxx file since ~unique_ptr needs full type
83 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

◆ distanceFromHeadOfTrain()

std::pair< bool, int > LVL1::L1DynamicPedestalProviderTxt::distanceFromHeadOfTrain ( int  bcid) const
private

Definition at line 179 of file L1DynamicPedestalProviderTxt.cxx.

180 {
182 
184 
185  if(bcData->isFilled(bcid) || bcData->bcType(bcid) == BunchCrossingCondData::MiddleEmpty) {
186  return {bcData->gapBeforeTrain(bcid) > 250, bcData->distanceFromFront(bcid, BC)};
187  } else {
188  if(bcData->gapAfterBunch(bcid, BC) == 0) {
189  const bcid_t head = ((bcid + 1) == MAX_BCID ? 0 : bcid + 1); // wrap around
190  return {bcData->gapBeforeTrain(head) > 250, -1};
191  } else if(bcData->gapBeforeBunch(bcid, BC) == 0) {
192  const bcid_t tail = bcid ? bcid - 1 : MAX_BCID - 1; // wrap around
193  return {bcData->gapBeforeTrain(tail) > 250,
194  bcData->distanceFromFront(tail, BC) + 1};
195  } else {
196  return {false, -10};
197  }
198  }
199 }

◆ dynamicPedestal()

int LVL1::L1DynamicPedestalProviderTxt::dynamicPedestal ( int  iEta,
int  layer,
int  pedestal,
int  iBCID,
float  mu 
) const
overridevirtual

retrieve the bcidCorrection value

Implements LVL1::IL1DynamicPedestalProvider.

Definition at line 205 of file L1DynamicPedestalProviderTxt.cxx.

206 {
207  /*
208  * Uncomment this for debugging/printing the full bunch train pattern
209  *
210  static bool first=true;
211  if (first) {
212  SG::ReadCondHandle<BunchCrossingCondData> bcData(m_bcDataKey);
213  first = false;
214  std::vector<std::pair<bool, int16_t>> dist;
215  dist.assign(MAX_BCID, std::make_pair(false, -10));
216  for(bcid_t bcid = 0; bcid != MAX_BCID; ++bcid) {
217  dist[bcid] = distanceFromHeadOfTrain(bcid);
218  }
219  printPatternParsingInfo(msg(), *bcData.retrieve(), dist);
220  }
221  */
222 
223  if(iBCID < 0 || (unsigned)iBCID >= MAX_BCID) return pedestal;
224 
225  // Only one bunch train is parameterized. Thus the BCID needs to be mapped
226  // to the first train. The train starts at bcid = 1, thus the '+ 1'.
227  // Bunches without available parameterization will have a value of -9 and a value of 0 is returned.
228  auto bcidInfo = distanceFromHeadOfTrain(iBCID);
229  bool longGap = bcidInfo.first;
230  int bcid = bcidInfo.second + 1;
231 
232  if(bcid < 0) return pedestal;
233 
234  // The parameterization is done for the dynamic pedestal correction,
235  // i.e. correction = (dynamic_pedestal - pedestal).
236  // Since the return value is expected to be the dynamic_pedestal itself, the
237  // pedestal is added to the value obtained from the parameterization.
238  int correction = 0;
239  if(layer == 0) {
240  correction = std::round((*m_emParameterizations[longGap][iElement][bcid])(mu));
241  } else if(layer == 1) {
242  correction = std::round((*m_hadParameterizations[longGap][iElement][bcid])(mu));
243  } else {
244  ATH_MSG_ERROR("Wrong layer index. Give 0 for Em, 1 for Had.");
245  }
246 
247  // Hardware cannot calculate a dynamic pedestal < 0, but it is possible the parameterisation can
248  int dynamic_pedestal = correction + pedestal;
249  if (dynamic_pedestal < 0) dynamic_pedestal = 0;
250 
251  return dynamic_pedestal;
252 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

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

◆ initialize()

StatusCode LVL1::L1DynamicPedestalProviderTxt::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 87 of file L1DynamicPedestalProviderTxt.cxx.

88 {
90 
91  // parse parameterization for the electromagnetic layer
92  std::string fileNameEMShort = PathResolver::find_file(m_inputFileEMShort, "DATAPATH");
93  if(fileNameEMShort.empty()) {
94  ATH_MSG_FATAL("Could not resolve input file: " << m_inputFileEMShort);
95  return StatusCode::FAILURE;
96  }
97  ATH_MSG_VERBOSE("::initialize: resolved input file: " << fileNameEMShort);
98 
99  try {
100  parseInputFile(fileNameEMShort, m_emParameterizations[0]);
101  } catch (const ParseException& e) {
102  ATH_MSG_FATAL("Could not parse input file: " << fileNameEMShort << "; error: " << e.what());
103  return StatusCode::FAILURE;
104  }
105 
106  std::string fileNameEMLong = PathResolver::find_file(m_inputFileEMLong, "DATAPATH");
107  if(fileNameEMLong.empty()) {
108  ATH_MSG_FATAL("Could not resolve input file: " << m_inputFileEMLong);
109  return StatusCode::FAILURE;
110  }
111  ATH_MSG_VERBOSE("::initialize: resolved input file: " << fileNameEMLong);
112 
113  try {
114  parseInputFile(fileNameEMLong, m_emParameterizations[1]);
115  } catch (const ParseException& e) {
116  ATH_MSG_FATAL("Could not parse input file: " << fileNameEMLong << "; error: " << e.what());
117  return StatusCode::FAILURE;
118  }
119 
120  // parse parameterization for the hadronic layer
121  std::string fileNameHADShort = PathResolver::find_file(m_inputFileHADShort, "DATAPATH");
122  if(fileNameHADShort.empty()) {
123  ATH_MSG_FATAL("Could not resolve input file: " << m_inputFileHADShort);
124  return StatusCode::FAILURE;
125  }
126  ATH_MSG_VERBOSE("::initialize: resolved input file: " << fileNameHADShort);
127 
128  try {
129  parseInputFile(fileNameHADShort, m_hadParameterizations[0]);
130  } catch (const ParseException& e) {
131  ATH_MSG_FATAL("Could not parse input file: " << fileNameHADShort << "; error: " << e.what());
132  return StatusCode::FAILURE;
133  }
134 
135  std::string fileNameHADLong = PathResolver::find_file(m_inputFileHADLong, "DATAPATH");
136  if(fileNameHADLong.empty()) {
137  ATH_MSG_FATAL("Could not resolve input file: " << m_inputFileHADLong);
138  return StatusCode::FAILURE;
139  }
140  ATH_MSG_VERBOSE("::initialize: resolved input file: " << fileNameHADLong);
141 
142  try {
143  parseInputFile(fileNameHADLong, m_hadParameterizations[1]);
144  } catch (const ParseException& e) {
145  ATH_MSG_FATAL("Could not parse input file: " << fileNameHADLong << "; error: " << e.what());
146  return StatusCode::FAILURE;
147  }
148 
149  return StatusCode::SUCCESS;
150 }

◆ inputHandles()

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

◆ interfaceID()

const InterfaceID & LVL1::IL1DynamicPedestalProvider::interfaceID ( )
inlinestaticinherited

Definition at line 30 of file IL1DynamicPedestalProvider.h.

31 {
32  return IID_IL1DynamicPedestalProvider;
33 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

◆ parseInputFile()

void LVL1::L1DynamicPedestalProviderTxt::parseInputFile ( const std::string &  fileName,
std::vector< std::vector< std::unique_ptr< ParamFunc >>> &  params 
)
private

Definition at line 295 of file L1DynamicPedestalProviderTxt.cxx.

297 {
298  using std::istream_iterator;
299 
300  std::ifstream F(fileName);
301  Context ctx;
302 
303  // read file line-by-line
304  const std::set<char> whitespaces{'\t',' ','\n','\r'};
305  for(std::string L; std::getline(F, L); ) {
306  while ((!L.empty()) && whitespaces.count(L.back())) L.pop_back();
307  if(L.empty()) continue; // ignore empty lines
308  if(L[0] == '#') continue; // ignore comments
309 
310  std::istringstream S(L);
311 
312  // parsing
313  if(ctx.P == Context::Element) {
314  // start parsing a new element block
315  std::string C = "";
316  S >> C >> ctx.E;
317  if(C != "element")
318  throw ParseException("got '" + C + "' expected 'element'.");
319  if(ctx.E > s_nElements)
320  throw ParseException("element number (" + std::to_string(ctx.E) + ") out-of-range.");
321 
322  ctx.P = Context::Poly; // advance state
323  } else if(ctx.P == Context::Poly) {
324  // start parsing a poly line
325  std::string C = "";
326  S >> C;
327  if(C != "poly") throw ParseException("got '" + C + "' expected 'poly'.");
328  std::copy(istream_iterator<size_t>(S), istream_iterator<size_t>(), std::back_inserter(ctx.poly));
329 
330  ctx.P = Context::Exp; // advance state
331  } else if(ctx.P == Context::Exp) {
332  // start parsing a exp line
333  std::string C = "";
334  S >> C;
335  if(C != "exp") throw ParseException("got '" + C + "' expected 'exp'.");
336  std::copy(istream_iterator<size_t>(S), istream_iterator<size_t>(), std::back_inserter(ctx.exp));
337 
338  ctx.P = Context::BCID; // advance state
339  } else if(ctx.P == Context::BCID) {
340  size_t B;
341  std::vector<float> P;
342  S >> B; // bcid
343  std::copy(istream_iterator<float>(S), istream_iterator<float>(), back_inserter(P)); // parameters
344  if(P.size() != 3) {
345  throw ParseException("BCID=" + std::to_string(B) +
346  ": expected 3 parameters got " + std::to_string(P.size()));
347  }
348  if(std::binary_search(ctx.poly.begin(), ctx.poly.end(), B)) {
349  params[ctx.E][B] = make_unique<ParamFuncPol2>(P[0], P[1], P[2]);
350  } else if(std::binary_search(ctx.exp.begin(), ctx.exp.end(), B)) {
351  params[ctx.E][B] = make_unique<ParamFuncExp>(P[0], P[1], P[2]);
352  } else {
353  throw ParseException("BCID '" + std::to_string(B) + "' didn't appear in 'poly' or 'exp' for element '" +
354  std::to_string(ctx.E) + "'.");
355  }
356 
357  if(++ctx.N == (ctx.poly.size() + ctx.exp.size())) {
358  // all bcids exhausted block is finished
359  if(ctx.N != s_nBCIDPerTrain) {
360  throw ParseException("Not all BCIDs filled");
361  }
362 
363  ctx.reset();
364  }
365  }
366  }
367 
368  for(auto& V : params) {
369  if(std::find_if(V.begin(), V.end(), [](std::unique_ptr<ParamFunc>& p) { return p == nullptr; }) != V.end()) {
370  throw ParseException("Not all elements and bcids filled!");
371  }
372  }
373 }

◆ 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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_bcDataKey

SG::ReadCondHandleKey<BunchCrossingCondData> LVL1::L1DynamicPedestalProviderTxt::m_bcDataKey {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"}
private

Definition at line 79 of file L1DynamicPedestalProviderTxt.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_emParameterizations

std::array<std::vector<std::vector<std::unique_ptr<ParamFunc> > >, 2> LVL1::L1DynamicPedestalProviderTxt::m_emParameterizations
private

Definition at line 75 of file L1DynamicPedestalProviderTxt.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_hadParameterizations

std::array<std::vector<std::vector<std::unique_ptr<ParamFunc> > >, 2> LVL1::L1DynamicPedestalProviderTxt::m_hadParameterizations
private

Definition at line 76 of file L1DynamicPedestalProviderTxt.h.

◆ m_inputFileEMLong

std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileEMLong
private

Definition at line 84 of file L1DynamicPedestalProviderTxt.h.

◆ m_inputFileEMShort

std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileEMShort
private

Definition at line 82 of file L1DynamicPedestalProviderTxt.h.

◆ m_inputFileHADLong

std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileHADLong
private

Definition at line 85 of file L1DynamicPedestalProviderTxt.h.

◆ m_inputFileHADShort

std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileHADShort
private

Definition at line 83 of file L1DynamicPedestalProviderTxt.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ s_nBCIDPerTrain

const unsigned LVL1::L1DynamicPedestalProviderTxt::s_nBCIDPerTrain = 74
staticprivate

Definition at line 95 of file L1DynamicPedestalProviderTxt.h.

◆ s_nElements

const unsigned LVL1::L1DynamicPedestalProviderTxt::s_nElements = 33
staticprivate

Definition at line 94 of file L1DynamicPedestalProviderTxt.h.


The documentation for this class was generated from the following files:
LVL1::L1DynamicPedestalProviderTxt::s_nBCIDPerTrain
static const unsigned s_nBCIDPerTrain
Definition: L1DynamicPedestalProviderTxt.h:95
LVL1::L1DynamicPedestalProviderTxt::s_nElements
static const unsigned s_nElements
Definition: L1DynamicPedestalProviderTxt.h:94
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LVL1::L1DynamicPedestalProviderTxt::m_inputFileEMShort
std::string m_inputFileEMShort
Definition: L1DynamicPedestalProviderTxt.h:82
Run1::ROD::bcid_t
cool::Int16 bcid_t
Definition: openCoraCool.cxx:113
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
tail
std::string tail(std::string s, const std::string &pattern)
tail of a string
Definition: computils.cxx:300
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1::L1DynamicPedestalProviderTxt::m_hadParameterizations
std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_hadParameterizations
Definition: L1DynamicPedestalProviderTxt.h:76
DMTest::C
C_v1 C
Definition: C.h:26
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
LVL1::L1DynamicPedestalProviderTxt::m_emParameterizations
std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_emParameterizations
Definition: L1DynamicPedestalProviderTxt.h:70
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1::L1DynamicPedestalProviderTxt::distanceFromHeadOfTrain
std::pair< bool, int > distanceFromHeadOfTrain(int bcid) const
Definition: L1DynamicPedestalProviderTxt.cxx:179
LVL1::L1DynamicPedestalProviderTxt::m_inputFileEMLong
std::string m_inputFileEMLong
Definition: L1DynamicPedestalProviderTxt.h:84
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
BunchCrossingCondData::BunchCrossings
@ BunchCrossings
Distance in units of 25 nanoseconds.
Definition: BunchCrossingCondData.h:132
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
BunchCrossingCondData::MiddleEmpty
@ MiddleEmpty
An empty BCID in the middle of a train.
Definition: BunchCrossingCondData.h:104
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
LVL1::L1DynamicPedestalProviderTxt::parseInputFile
void parseInputFile(const std::string &fileName, std::vector< std::vector< std::unique_ptr< ParamFunc >>> &params)
Definition: L1DynamicPedestalProviderTxt.cxx:295
head
std::string head(std::string s, const std::string &pattern)
head of a string
Definition: computils.cxx:310
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
Muon::EnumDefs::BC
@ BC
Definition: MuonEnumDefs.h:13
LVL1::L1DynamicPedestalProviderTxt::m_inputFileHADShort
std::string m_inputFileHADShort
Definition: L1DynamicPedestalProviderTxt.h:83
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
F
#define F(x, y, z)
Definition: MD5.cxx:112
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
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
calibdata.copy
bool copy
Definition: calibdata.py:27
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LVL1::L1DynamicPedestalProviderTxt::m_bcDataKey
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
Definition: L1DynamicPedestalProviderTxt.h:80
fitman.k
k
Definition: fitman.py:528
LVL1::L1DynamicPedestalProviderTxt::m_inputFileHADLong
std::string m_inputFileHADLong
Definition: L1DynamicPedestalProviderTxt.h:85