|
ATLAS Offline Software
|
Tool to retrieve dynamic pedestal values from a text file.
More...
#include <L1DynamicPedestalProviderTxt.h>
|
| 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 |
|
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.
◆ StoreGateSvc_t
◆ L1DynamicPedestalProviderTxt()
LVL1::L1DynamicPedestalProviderTxt::L1DynamicPedestalProviderTxt |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~L1DynamicPedestalProviderTxt()
LVL1::L1DynamicPedestalProviderTxt::~L1DynamicPedestalProviderTxt |
( |
| ) |
|
|
virtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ distanceFromHeadOfTrain()
std::pair< bool, int > LVL1::L1DynamicPedestalProviderTxt::distanceFromHeadOfTrain |
( |
int |
bcid | ) |
const |
|
private |
Definition at line 179 of file L1DynamicPedestalProviderTxt.cxx.
186 return {bcData->gapBeforeTrain(
bcid) > 250, bcData->distanceFromFront(
bcid,
BC)};
188 if(bcData->gapAfterBunch(
bcid,
BC) == 0) {
190 return {bcData->gapBeforeTrain(
head) > 250, -1};
191 }
else if(bcData->gapBeforeBunch(
bcid,
BC) == 0) {
193 return {bcData->gapBeforeTrain(
tail) > 250,
194 bcData->distanceFromFront(
tail,
BC) + 1};
◆ 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.
223 if(iBCID < 0 || (
unsigned)iBCID >= MAX_BCID)
return pedestal;
229 bool longGap = bcidInfo.first;
230 int bcid = bcidInfo.second + 1;
232 if(
bcid < 0)
return pedestal;
241 }
else if(
layer == 1) {
244 ATH_MSG_ERROR(
"Wrong layer index. Give 0 for Em, 1 for Had.");
249 if (dynamic_pedestal < 0) dynamic_pedestal = 0;
251 return dynamic_pedestal;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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.
93 if(fileNameEMShort.empty()) {
95 return StatusCode::FAILURE;
97 ATH_MSG_VERBOSE(
"::initialize: resolved input file: " << fileNameEMShort);
101 }
catch (
const ParseException&
e) {
102 ATH_MSG_FATAL(
"Could not parse input file: " << fileNameEMShort <<
"; error: " <<
e.what());
103 return StatusCode::FAILURE;
107 if(fileNameEMLong.empty()) {
109 return StatusCode::FAILURE;
111 ATH_MSG_VERBOSE(
"::initialize: resolved input file: " << fileNameEMLong);
115 }
catch (
const ParseException&
e) {
116 ATH_MSG_FATAL(
"Could not parse input file: " << fileNameEMLong <<
"; error: " <<
e.what());
117 return StatusCode::FAILURE;
122 if(fileNameHADShort.empty()) {
124 return StatusCode::FAILURE;
126 ATH_MSG_VERBOSE(
"::initialize: resolved input file: " << fileNameHADShort);
130 }
catch (
const ParseException&
e) {
131 ATH_MSG_FATAL(
"Could not parse input file: " << fileNameHADShort <<
"; error: " <<
e.what());
132 return StatusCode::FAILURE;
136 if(fileNameHADLong.empty()) {
138 return StatusCode::FAILURE;
140 ATH_MSG_VERBOSE(
"::initialize: resolved input file: " << fileNameHADLong);
144 }
catch (
const ParseException&
e) {
145 ATH_MSG_FATAL(
"Could not parse input file: " << fileNameHADLong <<
"; error: " <<
e.what());
146 return StatusCode::FAILURE;
149 return StatusCode::SUCCESS;
◆ inputHandles()
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 |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
298 using std::istream_iterator;
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;
308 if(L[0] ==
'#')
continue;
310 std::istringstream
S(L);
313 if(ctx.P == Context::Element) {
318 throw ParseException(
"got '" + C +
"' expected 'element'.");
320 throw ParseException(
"element number (" +
std::to_string(ctx.E) +
") out-of-range.");
322 ctx.P = Context::Poly;
323 }
else if(ctx.P == Context::Poly) {
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));
330 ctx.P = Context::Exp;
331 }
else if(ctx.P == Context::Exp) {
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));
341 std::vector<float>
P;
343 std::copy(istream_iterator<float>(
S), istream_iterator<float>(), back_inserter(
P));
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]);
353 throw ParseException(
"BCID '" +
std::to_string(B) +
"' didn't appear in 'poly' or 'exp' for element '" +
357 if(++ctx.N == (ctx.poly.size() + ctx.exp.size())) {
360 throw ParseException(
"Not all BCIDs filled");
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!");
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_bcDataKey
◆ m_detStore
◆ m_emParameterizations
std::array<std::vector<std::vector<std::unique_ptr<ParamFunc> > >, 2> LVL1::L1DynamicPedestalProviderTxt::m_emParameterizations |
|
private |
◆ m_evtStore
◆ m_hadParameterizations
std::array<std::vector<std::vector<std::unique_ptr<ParamFunc> > >, 2> LVL1::L1DynamicPedestalProviderTxt::m_hadParameterizations |
|
private |
◆ m_inputFileEMLong
std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileEMLong |
|
private |
◆ m_inputFileEMShort
std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileEMShort |
|
private |
◆ m_inputFileHADLong
std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileHADLong |
|
private |
◆ m_inputFileHADShort
std::string LVL1::L1DynamicPedestalProviderTxt::m_inputFileHADShort |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ s_nBCIDPerTrain
const unsigned LVL1::L1DynamicPedestalProviderTxt::s_nBCIDPerTrain = 74 |
|
staticprivate |
◆ s_nElements
const unsigned LVL1::L1DynamicPedestalProviderTxt::s_nElements = 33 |
|
staticprivate |
The documentation for this class was generated from the following files:
static const unsigned s_nBCIDPerTrain
static const unsigned s_nElements
std::string m_inputFileEMShort
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
std::string tail(std::string s, const std::string &pattern)
tail of a string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_hadParameterizations
float round(const float toRound, const unsigned int decimals)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
virtual void setOwner(IDataHandleHolder *o)=0
std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_emParameterizations
std::pair< bool, int > distanceFromHeadOfTrain(int bcid) const
std::string m_inputFileEMLong
@ BunchCrossings
Distance in units of 25 nanoseconds.
@ MiddleEmpty
An empty BCID in the middle of a train.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void parseInputFile(const std::string &fileName, std::vector< std::vector< std::unique_ptr< ParamFunc >>> ¶ms)
std::string head(std::string s, const std::string &pattern)
head of a string
std::string to_string(const DetectorType &type)
StatusCode initialize(bool used=true)
setEventNumber setTimeStamp bcid
std::string m_inputFileHADShort
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
std::string m_inputFileHADLong