ATLAS Offline Software
Loading...
Searching...
No Matches
CP::TElectronTestAlg Class Reference

#include <TElectronTestAlg.h>

Inheritance diagram for CP::TElectronTestAlg:
Collaboration diagram for CP::TElectronTestAlg:

Public Member Functions

 TElectronTestAlg (const std::string &n, ISvcLocator *l)
virtual StatusCode initialize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual::StatusCode finalize ()
 finalize this algorithm
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

enum  mode { All = 0 , Full = 1 , Total = 2 , Toys = 3 }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

bool m_doDetail {false}
bool m_doToys {false}
int m_numberCorr {0}
double m_lowestEt {0}
 Number of Correlated syst.
std::unique_ptr< Root::TElectronEfficiencyCorrectionToolm_pimpl = nullptr
 Lowest Et for the reccomendations.
SG::ReadHandleKey< xAOD::ElectronContainerm_electronContainer
 Input collection name.
Gaudi::Property< std::string > m_mapFile
 Label for the collection.
Gaudi::Property< std::string > m_recoKey
Gaudi::Property< std::string > m_idKey
Gaudi::Property< std::string > m_isoKey
Gaudi::Property< std::string > m_triggerKey
Gaudi::Property< intm_dataType
Gaudi::Property< intm_mode {this, "mode", All, "Mode (All/Full/Total/Toys"}
Gaudi::Property< intm_number_of_toys
Gaudi::Property< boolm_decorate {this, "doDecorate", true, "Do decorations"}
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_SF
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_TotalUp
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_TotalDown
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_uncorrUp
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_uncorrDown
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_HistIndex
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_HistBin
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_corrUp
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_corrDown
SG::WriteDecorHandleKey< xAOD::ElectronContainerm_toys
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 24 of file TElectronTestAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ mode

Enumerator
All 
Full 
Total 
Toys 

Definition at line 65 of file TElectronTestAlg.h.

Constructor & Destructor Documentation

◆ TElectronTestAlg()

CP::TElectronTestAlg::TElectronTestAlg ( const std::string & n,
ISvcLocator * l )
inline

Definition at line 27 of file TElectronTestAlg.h.

28 : EL::AnaReentrantAlgorithm(n, l) {}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TElectronTestAlg::execute ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 87 of file TElectronTestAlg.cxx.

87 {
88
89 //
90 unsigned int runNumber = 428648; // use a dummy default for testing
91
92 int dataType = m_dataType;
93 //
94 SG::ReadHandle<xAOD::ElectronContainer> electrons{m_electronContainer, ctx};
95
96 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, double>> SF;
97 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, double>> TotalUp;
98 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, double>>
99 TotalDown;
100 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, double>> uncorrUp;
101 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, double>>
102 uncorrDown;
103 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, int>> HistIndex;
104 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, int>> HistBin;
105 std::optional<
106 SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<double>>>
107 corrUp;
108 std::optional<
109 SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<double>>>
110 corrDown;
111 std::optional<
112 SG::WriteDecorHandle<xAOD::ElectronContainer, std::vector<double>>>
113 toys;
114
115 if (m_decorate) {
116 SF.emplace(m_SF, ctx);
117 TotalUp.emplace(m_TotalUp, ctx);
118 TotalDown.emplace(m_TotalDown, ctx);
119 if (m_doDetail) {
120 uncorrUp.emplace(m_uncorrUp, ctx);
121 uncorrDown.emplace(m_uncorrDown, ctx);
122 HistIndex.emplace(m_HistIndex, ctx);
123 HistBin.emplace(m_HistBin, ctx);
124 corrUp.emplace(m_corrUp, ctx);
125 corrDown.emplace(m_corrDown, ctx);
126 }
127 if (m_doToys) {
128 toys.emplace(m_toys, ctx);
129 }
130 }
131
132 for (const xAOD::Electron* el : *electrons) {
133
134 Root::TElectronEfficiencyCorrectionTool::Result result;
135
136 // In case we fail
137 if (std::abs(el->eta()) > 2.469 || el->pt() < 10000) {
138 // if we decorate we need to set everything to dummy
139 // avoid decorating partially the collection ...
140 if (m_decorate) {
141 SF.value()(*el) = result.SF;
142 TotalUp.value()(*el) = result.SF + result.Total;
143 TotalDown.value()(*el) = result.SF - result.Total;
144 if (m_doDetail) {
145 uncorrUp.value()(*el) = result.SF + result.UnCorr;
146 uncorrDown.value()(*el) = result.SF - result.UnCorr;
147 HistIndex.value()(*el) = result.histIndex;
148 HistBin.value()(*el) = result.histBinNum;
149 corrUp.value()(*el) = result.Corr;
150 corrDown.value()(*el) = result.Corr;
151 }
152 if (m_doToys) {
153 toys.value()(*el) = result.toys;
154 }
155 }
156 continue;
157 }
158
159 // Some logic for validity
160 double cluster_eta(-9999.9);
161 const xAOD::CaloCluster* cluster = el->caloCluster();
162 if (!cluster) {
163 ATH_MSG_ERROR("ERROR no cluster associated to the Electron \n");
164 return StatusCode::FAILURE;
165 }
166 // we need to use different variables for central and forward electrons
167 static const SG::AuxElement::ConstAccessor<uint16_t> accAuthor("author");
168 if (accAuthor.isAvailable(*el) &&
170 cluster_eta = cluster->eta();
171 } else {
172 cluster_eta = cluster->etaBE(2);
173 }
174
175 // use et from cluster because it is immutable under syst variations of
176 // electron energy scale
177 const double energy = cluster->e();
178 const double parEta = el->eta();
179 const double coshEta = std::cosh(parEta);
180 double et = (coshEta != 0.) ? energy / coshEta : 0.;
181 // allow for a 5% margin at the lowest pT bin boundary
182 if (et < m_lowestEt) {
183 et = et * 1.05;
184 }
185
186 // do the calculations
187 const int status = m_pimpl->calculate(
188 static_cast<PATCore::ParticleDataType::DataType>(dataType), runNumber,
189 cluster_eta, et, /* in MeV */
190 result, (m_mode == Total) /* do work only for Total*/);
191 if (!status) {
192 ATH_MSG_ERROR("Something went wrong in the calculation");
193 return StatusCode::FAILURE;
194 }
195
196 // print outs
197 ATH_MSG_INFO("--------------------------------------------");
198 ATH_MSG_INFO("Electron pt : " << el->pt() << " eta " << el->eta());
199 ATH_MSG_INFO("SF = " << result.SF << " +- " << result.Total);
200 if (m_doDetail) {
201 ATH_MSG_INFO("SF = " << result.SF << " +- " << result.UnCorr
202 << " stat only ");
203 ATH_MSG_INFO("At histo " << result.histIndex << " at bin "
204 << result.histBinNum);
205 ATH_MSG_INFO("Num correlated " << result.Corr.size());
206 for (double res : result.Corr) {
207 ATH_MSG_INFO("+- " << res);
208 }
209 }
210 if (m_doToys) {
211 ATH_MSG_INFO("Run " << result.toys.size() << " Toys ");
212 for (double res : result.toys) {
213 ATH_MSG_INFO("+- " << res);
214 }
215 }
216 if (m_decorate) {
217 SF.value()(*el) = result.SF;
218 TotalUp.value()(*el) = result.SF + result.Total;
219 TotalDown.value()(*el) = result.SF - result.Total;
220 if (m_doDetail) {
221 uncorrUp.value()(*el) = result.SF + result.UnCorr;
222 uncorrDown.value()(*el) = result.SF - result.UnCorr;
223 HistIndex.value()(*el) = result.histIndex;
224 HistBin.value()(*el) = result.histBinNum;
225 const size_t corrsize = result.Corr.size();
226 std::vector<double> up(corrsize, 0);
227 std::vector<double> down(corrsize, 0);
228 for (size_t i = 0; i < corrsize; ++i) {
229 up[i] = result.SF + result.Corr[i];
230 down[i] = result.SF - result.Corr[i];
231 }
232 corrUp.value()(*el) = std::move(up);
233 corrDown.value()(*el) = std::move(down);
234 }
235 if (m_doToys) {
236 toys.value()(*el) = std::move(result.toys);
237 }
238 }
239
240 } // end of loop over electrons
241 return StatusCode::SUCCESS;
242}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
std::pair< std::vector< unsigned int >, bool > res
Gaudi::Property< bool > m_decorate
Gaudi::Property< int > m_dataType
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContainer
Input collection name.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_toys
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_HistIndex
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_TotalUp
std::unique_ptr< Root::TElectronEfficiencyCorrectionTool > m_pimpl
Lowest Et for the reccomendations.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_corrDown
double m_lowestEt
Number of Correlated syst.
Gaudi::Property< int > m_mode
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_TotalDown
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_uncorrDown
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_HistBin
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_SF
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_uncorrUp
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_corrUp
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
const float SF[NF]
Cross sections for Fluor.
status
Definition merge.py:16
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
Definition EgammaDefs.h:30
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Electron_v1 Electron
Definition of the current "egamma version".

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode EL::AnaReentrantAlgorithm::finalize ( )
protectedinherited

finalize this algorithm

This gets called after event processing has finished. The last event may no longer be in memory, and the code should not try to access it.

Definition at line 102 of file AnaReentrantAlgorithm.cxx.

104 {
105 return StatusCode::SUCCESS;
106 }

◆ initialize()

StatusCode TElectronTestAlg::initialize ( )
finaloverridevirtual

Definition at line 18 of file TElectronTestAlg.cxx.

18 {
19
20 // input
21 ATH_CHECK(m_electronContainer.initialize());
22
23 // Decorations
24 m_pimpl = std::make_unique<Root::TElectronEfficiencyCorrectionTool>(
25 (this->name() + ".TElectronEfficiencyCorrection").c_str());
26 //
27 m_pimpl->msg().setLevel(this->msg().level());
28 //
29 std::string mapFileName = PathResolverFindCalibFile(m_mapFile);
32 std::string value = ElRecomFileHelpers::getValueByKey(mapFileName, key);
33 std::string filename = PathResolverFindCalibFile(value);
34 if (filename.empty()) {
35 ATH_MSG_ERROR("Could NOT resolve file name " << value);
36 return StatusCode::FAILURE;
37 } else {
38 ATH_MSG_INFO(" Using recommendations file = " << filename);
39 }
40 m_pimpl->addFileName(filename);
41 //
42 if (m_mode == Toys || m_mode == All) {
43 m_pimpl->bookCombToyMCScaleFactors(m_number_of_toys);
44 }
45 // We use 0 as failure ...
46 if (m_pimpl->initialize() == 0) {
48 "Could not initialize the TElectronEfficiencyCorrectionTool!");
49 return StatusCode::FAILURE;
50 }
51
52 // Auxiliary info
53 m_numberCorr = m_pimpl->getNSyst();
54 std::map<float, std::vector<float>> tmp;
55 m_pimpl->getNbins(tmp);
56 m_lowestEt = tmp.begin()->first;
57 m_doDetail = (m_mode != Toys && m_mode != Total);
58 m_doToys = (m_mode == Toys || m_mode == All);
59
60 // decorations if requested
61 const std::string baseName = m_electronContainer.key();
62 m_SF = baseName + ".EFF_" + key + "_SF";
63 m_TotalUp = baseName + ".EFF_" + key + "_Total__Up";
64 m_TotalDown = baseName + ".EFF_" + key + "_Total__Down";
65 m_uncorrUp = baseName + ".EFF_" + key + "_UnCorr__Up";
66 m_uncorrDown = baseName + ".EFF_" + key + "_UnCorr__Down";
67 m_HistIndex = baseName + ".EFF_" + key + "_HistIndex";
68 m_HistBin = baseName + ".EFF_" + key + "_HistBin";
69 m_corrUp = baseName + ".EFF_" + key + "_Corr__Up";
70 m_corrDown = baseName + ".EFF_" + key + "_Corr__Down";
71 m_toys = baseName + ".EFF_" + key + "__toys";
72
73 ATH_CHECK(m_SF.initialize(m_decorate));
74 ATH_CHECK(m_TotalUp.initialize(m_decorate));
75 ATH_CHECK(m_TotalDown.initialize(m_decorate));
82 ATH_CHECK(m_toys.initialize(m_decorate && m_doToys));
83
84 return StatusCode::SUCCESS;
85}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_idKey
Gaudi::Property< std::string > m_isoKey
Gaudi::Property< std::string > m_triggerKey
Gaudi::Property< std::string > m_recoKey
Gaudi::Property< int > m_number_of_toys
Gaudi::Property< std::string > m_mapFile
Label for the collection.
std::string getValueByKey(const std::string &mapFile, const std::string &key)
std::string convertToOneKey(const std::string &recokey, const std::string &idkey, const std::string &isokey, const std::string &trigkey)

◆ inputHandles()

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

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::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< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_corrDown

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_corrDown
private
Initial value:
{
this, "DoNotSet_CorrDown", "Electrons.CorrDown", ""}

Definition at line 88 of file TElectronTestAlg.h.

88 {
89 this, "DoNotSet_CorrDown", "Electrons.CorrDown", ""};

◆ m_corrUp

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_corrUp
private
Initial value:
{
this, "DoNotSet_CorrUp", "Electrons.CorrUp", ""}

Definition at line 86 of file TElectronTestAlg.h.

86 {
87 this, "DoNotSet_CorrUp", "Electrons.CorrUp", ""};

◆ m_dataType

Gaudi::Property<int> CP::TElectronTestAlg::m_dataType
private
Initial value:
{this, "dataType",
"Particle Data Type Full/Fast"}

Definition at line 61 of file TElectronTestAlg.h.

61 {this, "dataType",
63 "Particle Data Type Full/Fast"};

◆ m_decorate

Gaudi::Property<bool> CP::TElectronTestAlg::m_decorate {this, "doDecorate", true, "Do decorations"}
private

Definition at line 70 of file TElectronTestAlg.h.

70{this, "doDecorate", true, "Do decorations"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doDetail

bool CP::TElectronTestAlg::m_doDetail {false}
private

Definition at line 33 of file TElectronTestAlg.h.

33{false};

◆ m_doToys

bool CP::TElectronTestAlg::m_doToys {false}
private

Definition at line 34 of file TElectronTestAlg.h.

34{false};

◆ m_electronContainer

SG::ReadHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_electronContainer
private
Initial value:
{
this, "ElectronContainer", "Electrons", "The input Electrons container"}

Input collection name.

Definition at line 41 of file TElectronTestAlg.h.

41 {
42 this, "ElectronContainer", "Electrons", "The input Electrons container"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_HistBin

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_HistBin
private
Initial value:
{
this, "DoNotSet_HistBin", "Electrons.HistBin", ""}

Definition at line 84 of file TElectronTestAlg.h.

84 {
85 this, "DoNotSet_HistBin", "Electrons.HistBin", ""};

◆ m_HistIndex

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_HistIndex
private
Initial value:
{
this, "DoNotSet_HistIndex", "Electrons.HistIndex", ""}

Definition at line 82 of file TElectronTestAlg.h.

82 {
83 this, "DoNotSet_HistIndex", "Electrons.HistIndex", ""};

◆ m_idKey

Gaudi::Property<std::string> CP::TElectronTestAlg::m_idKey
private
Initial value:
{
this, "IdKey", "", "Key associated with identification working point"}

Definition at line 52 of file TElectronTestAlg.h.

52 {
53 this, "IdKey", "", "Key associated with identification working point"};

◆ m_isoKey

Gaudi::Property<std::string> CP::TElectronTestAlg::m_isoKey
private
Initial value:
{
this, "IsoKey", "", "Key associated with isolation working point"}

Definition at line 55 of file TElectronTestAlg.h.

55 {
56 this, "IsoKey", "", "Key associated with isolation working point"};

◆ m_lowestEt

double CP::TElectronTestAlg::m_lowestEt {0}
private

Number of Correlated syst.

Definition at line 36 of file TElectronTestAlg.h.

36{0};

◆ m_mapFile

Gaudi::Property<std::string> CP::TElectronTestAlg::m_mapFile
private
Initial value:
{
this, "MapFilePath",
"ElectronEfficiencyCorrection/2015_2025/rel22.2/"
"2022_Summer_Prerecom_v1/map2.txt",
"Full path to the map file"}

Label for the collection.

Definition at line 45 of file TElectronTestAlg.h.

45 {
46 this, "MapFilePath",
47 "ElectronEfficiencyCorrection/2015_2025/rel22.2/"
48 "2022_Summer_Prerecom_v1/map2.txt",
49 "Full path to the map file"};

◆ m_mode

Gaudi::Property<int> CP::TElectronTestAlg::m_mode {this, "mode", All, "Mode (All/Full/Total/Toys"}
private

Definition at line 66 of file TElectronTestAlg.h.

66{this, "mode", All, "Mode (All/Full/Total/Toys"};

◆ m_number_of_toys

Gaudi::Property<int> CP::TElectronTestAlg::m_number_of_toys
private
Initial value:
{this, "number_of_toys", 40,
"Number of toys in the ensemble"}

Definition at line 67 of file TElectronTestAlg.h.

67 {this, "number_of_toys", 40,
68 "Number of toys in the ensemble"};

◆ m_numberCorr

int CP::TElectronTestAlg::m_numberCorr {0}
private

Definition at line 35 of file TElectronTestAlg.h.

35{0};

◆ m_pimpl

std::unique_ptr<Root::TElectronEfficiencyCorrectionTool> CP::TElectronTestAlg::m_pimpl = nullptr
private

Lowest Et for the reccomendations.

This is not a tool but more of an utility

Definition at line 39 of file TElectronTestAlg.h.

◆ m_recoKey

Gaudi::Property<std::string> CP::TElectronTestAlg::m_recoKey
private
Initial value:
{this, "RecoKey", "",
"Key associated with reconstruction"}

Definition at line 50 of file TElectronTestAlg.h.

50 {this, "RecoKey", "",
51 "Key associated with reconstruction"};

◆ m_SF

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_SF
private
Initial value:
{this, "DoNotSet_SF",
"Electrons.SF", ""}

Definition at line 72 of file TElectronTestAlg.h.

72 {this, "DoNotSet_SF",
73 "Electrons.SF", ""};

◆ m_TotalDown

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_TotalDown
private
Initial value:
{
this, "DoNotSet_TotalDown", "Electrons.TotalDown", ""}

Definition at line 76 of file TElectronTestAlg.h.

76 {
77 this, "DoNotSet_TotalDown", "Electrons.TotalDown", ""};

◆ m_TotalUp

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_TotalUp
private
Initial value:
{
this, "DoNotSet_TotalUp", "Electrons.TotalUp", ""}

Definition at line 74 of file TElectronTestAlg.h.

74 {
75 this, "DoNotSet_TotalUp", "Electrons.TotalUp", ""};

◆ m_toys

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_toys
private
Initial value:
{this, "DoNotSet_",
"Electrons.toys", ""}

Definition at line 90 of file TElectronTestAlg.h.

90 {this, "DoNotSet_",
91 "Electrons.toys", ""};

◆ m_triggerKey

Gaudi::Property<std::string> CP::TElectronTestAlg::m_triggerKey
private
Initial value:
{
this, "TriggerKey", "", "Key associated with trigger working point"}

Definition at line 58 of file TElectronTestAlg.h.

58 {
59 this, "TriggerKey", "", "Key associated with trigger working point"};

◆ m_uncorrDown

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_uncorrDown
private
Initial value:
{
this, "DoNotSet_UnCorrDown", "Electrons.UnCorrDown", ""}

Definition at line 80 of file TElectronTestAlg.h.

80 {
81 this, "DoNotSet_UnCorrDown", "Electrons.UnCorrDown", ""};

◆ m_uncorrUp

SG::WriteDecorHandleKey<xAOD::ElectronContainer> CP::TElectronTestAlg::m_uncorrUp
private
Initial value:
{
this, "DoNotSet_UnCorrUp", "Electrons.UnCorrUp", ""}

Definition at line 78 of file TElectronTestAlg.h.

78 {
79 this, "DoNotSet_UnCorrUp", "Electrons.UnCorrUp", ""};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: