ATLAS Offline Software
Loading...
Searching...
No Matches
L1DynamicPedestalProviderTxt.h
Go to the documentation of this file.
1
2/*
3 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4*/
5/*
6 * @file L1DynamicPedestalProviderTxt.h
7 * @author V. Scharf <vscharf@kip.uni-heidelberg.de>
8 * @date June 2014
9 * @brief Tool to retrieve dynamic pedestal values from a text file.
10 */
11
12#ifndef TRIGT1CALOTOOLS_L1DYNAMICPEDESTALPYTHON_H
13#define TRIGT1CALOTOOLS_L1DYNAMICPEDESTALPYTHON_H
14
16
18#include "GaudiKernel/ToolHandle.h"
21
22#include <array>
23#include <cstdint> // for guaranteed size-types
24#include <memory>
25#include <stdexcept>
26#include <string>
27#include <utility> // std::pair
28#include <vector>
29
30namespace LVL1
31{
35 class ParseException : public std::runtime_error
36 {
37 public:
38 ParseException(const std::string& what) : std::runtime_error(what)
39 {}
40 };
41
54 virtual public IL1DynamicPedestalProvider
55 {
56 public:
58 L1DynamicPedestalProviderTxt(const std::string&,const std::string&,const IInterface*);
59
62
64 virtual StatusCode initialize() override;
65
67 virtual int dynamicPedestal(int iEta, int layer, int pedestal, int iBCID, float mu) const override;
68
69 // forward declaration for a function that evaluates the correction as function of mu
70 class ParamFunc;
71 private:
72
73 // Stores the the correction for each eta-slice (the "outer" index of the vector) and bcid (the "inner" index).
74 // The first entry of the array is for trains after short gaps, the second for trains after long gaps.
75 std::array<std::vector<std::vector<std::unique_ptr<ParamFunc>>>, 2> m_emParameterizations;
76 std::array<std::vector<std::vector<std::unique_ptr<ParamFunc>>>, 2> m_hadParameterizations;
77
80 {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"};
81
82 std::string m_inputFileEMShort;
84 std::string m_inputFileEMLong;
85 std::string m_inputFileHADLong;
86
87 // maps the BCID (index) to the distance from the head of the train (after short or long gap)
88 // bool: long-gap train (true); short-gap train (false)
89 std::pair<bool, int> distanceFromHeadOfTrain(int bcid) const;
90
91 // parses the input file
92 void parseInputFile(const std::string& fileName, std::vector<std::vector<std::unique_ptr<ParamFunc>>>& params);
93
94 static const unsigned s_nElements = 33;
95 static const unsigned s_nBCIDPerTrain = 74; // actually 72 filled BCIDs + one before and one after
96 }; // end of class L1DynamicPedestalProviderTxt
97} // end of namespace
98
99#endif // TRIGT1CALOTOOLS_L1DYNAMICPEDESTALPYTHON_H
Replaces the BunchCrossing AlgTool used in run1/2.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
void parseInputFile(const std::string &fileName, std::vector< std::vector< std::unique_ptr< ParamFunc > > > &params)
virtual int dynamicPedestal(int iEta, int layer, int pedestal, int iBCID, float mu) const override
retrieve the bcidCorrection value
L1DynamicPedestalProviderTxt(const std::string &, const std::string &, const IInterface *)
constructor
virtual StatusCode initialize() override
standard Athena-Algorithm method
virtual ~L1DynamicPedestalProviderTxt()
default destructor
std::pair< bool, int > distanceFromHeadOfTrain(int bcid) const
std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_emParameterizations
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
std::array< std::vector< std::vector< std::unique_ptr< ParamFunc > > >, 2 > m_hadParameterizations
ParseException(const std::string &what)
STL class.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
STL namespace.