|
ATLAS Offline Software
|
#include <TElectronTestAlg.h>
|
| 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. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
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 . 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 |
|
Definition at line 24 of file TElectronTestAlg.h.
◆ StoreGateSvc_t
◆ mode
◆ TElectronTestAlg()
CP::TElectronTestAlg::TElectronTestAlg |
( |
const std::string & |
n, |
|
|
ISvcLocator * |
l |
|
) |
| |
|
inline |
◆ cardinality()
unsigned int AthReentrantAlgorithm::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.
Override this to return 0 for reentrant algorithms.
Definition at line 55 of file AthReentrantAlgorithm.cxx.
◆ 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);
◆ 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.
◆ 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.
◆ 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()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode TElectronTestAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
finaloverridevirtual |
Definition at line 87 of file TElectronTestAlg.cxx.
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>>
100 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, double>> uncorrUp;
101 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, double>>
103 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, int>> HistIndex;
104 std::optional<SG::WriteDecorHandle<xAOD::ElectronContainer, int>> HistBin;
128 toys.emplace(
m_toys, ctx);
137 if (std::abs(
el->eta()) > 2.469 ||
el->pt() < 10000) {
147 HistIndex.value()(*el) =
result.histIndex;
148 HistBin.value()(*el) =
result.histBinNum;
149 corrUp.value()(*el) =
result.Corr;
150 corrDown.value()(*el) =
result.Corr;
153 toys.value()(*el) =
result.toys;
160 double cluster_eta(-9999.9);
163 ATH_MSG_ERROR(
"ERROR no cluster associated to the Electron \n");
164 return StatusCode::FAILURE;
168 if (accAuthor.isAvailable(*
el) &&
170 cluster_eta = cluster->
eta();
172 cluster_eta = cluster->
etaBE(2);
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.;
193 return StatusCode::FAILURE;
197 ATH_MSG_INFO(
"--------------------------------------------");
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) {
232 corrUp.value()(*el) = std::move(
up);
233 corrDown.value()(*el) = std::move(down);
236 toys.value()(*el) = std::move(
result.toys);
241 return StatusCode::SUCCESS;
◆ 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
◆ extraOutputDeps()
const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ 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.
105 return StatusCode::SUCCESS;
◆ initialize()
StatusCode TElectronTestAlg::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 18 of file TElectronTestAlg.cxx.
24 m_pimpl = std::make_unique<Root::TElectronEfficiencyCorrectionTool>(
25 (this->
name() +
".TElectronEfficiencyCorrection").c_str());
36 return StatusCode::FAILURE;
46 if (
m_pimpl->initialize() == 0) {
48 "Could not initialize the TElectronEfficiencyCorrectionTool!");
49 return StatusCode::FAILURE;
54 std::map<float, std::vector<float>>
tmp;
62 m_SF = baseName +
".EFF_" +
key +
"_SF";
71 m_toys = baseName +
".EFF_" +
key +
"__toys";
84 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.
◆ isClonable()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, InDet::SiSPGNNTrackMaker, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ 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.
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ sysExecute()
StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::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 InputMakerBase, and HypoBase.
Definition at line 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ 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_corrDown
Initial value:{
this, "DoNotSet_CorrDown", "Electrons.CorrDown", ""}
Definition at line 88 of file TElectronTestAlg.h.
◆ m_corrUp
Initial value:{
this, "DoNotSet_CorrUp", "Electrons.CorrUp", ""}
Definition at line 86 of file TElectronTestAlg.h.
◆ 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.
◆ m_decorate
Gaudi::Property<bool> CP::TElectronTestAlg::m_decorate {this, "doDecorate", true, "Do decorations"} |
|
private |
◆ m_detStore
◆ m_doDetail
bool CP::TElectronTestAlg::m_doDetail {false} |
|
private |
◆ m_doToys
bool CP::TElectronTestAlg::m_doToys {false} |
|
private |
◆ m_electronContainer
Initial value:{
this, "ElectronContainer", "Electrons", "The input Electrons container"}
Input collection name.
Definition at line 41 of file TElectronTestAlg.h.
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
◆ m_HistBin
Initial value:{
this, "DoNotSet_HistBin", "Electrons.HistBin", ""}
Definition at line 84 of file TElectronTestAlg.h.
◆ m_HistIndex
Initial value:{
this, "DoNotSet_HistIndex", "Electrons.HistIndex", ""}
Definition at line 82 of file TElectronTestAlg.h.
◆ 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.
◆ 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.
◆ m_lowestEt
double CP::TElectronTestAlg::m_lowestEt {0} |
|
private |
◆ 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.
◆ m_mode
Gaudi::Property<int> CP::TElectronTestAlg::m_mode {this, "mode", All, "Mode (All/Full/Total/Toys"} |
|
private |
◆ 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.
◆ m_numberCorr
int CP::TElectronTestAlg::m_numberCorr {0} |
|
private |
◆ m_pimpl
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.
◆ m_SF
Initial value:{this, "DoNotSet_SF",
"Electrons.SF", ""}
Definition at line 72 of file TElectronTestAlg.h.
◆ m_TotalDown
Initial value:{
this, "DoNotSet_TotalDown", "Electrons.TotalDown", ""}
Definition at line 76 of file TElectronTestAlg.h.
◆ m_TotalUp
Initial value:{
this, "DoNotSet_TotalUp", "Electrons.TotalUp", ""}
Definition at line 74 of file TElectronTestAlg.h.
◆ m_toys
Initial value:{this, "DoNotSet_",
"Electrons.toys", ""}
Definition at line 90 of file TElectronTestAlg.h.
◆ 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.
◆ m_uncorrDown
Initial value:{
this, "DoNotSet_UnCorrDown", "Electrons.UnCorrDown", ""}
Definition at line 80 of file TElectronTestAlg.h.
◆ m_uncorrUp
Initial value:{
this, "DoNotSet_UnCorrUp", "Electrons.UnCorrUp", ""}
Definition at line 78 of file TElectronTestAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Extra patterns decribing particle interation process.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_TotalUp
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_TotalDown
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_corrUp
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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)
const float SF[NF]
Cross sections for Fluor.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_uncorrDown
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContainer
Input collection name.
Helper class to provide constant type-safe access to aux data.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_uncorrUp
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_HistIndex
Gaudi::Property< std::string > m_mapFile
Label for the collection.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_HistBin
Gaudi::Property< int > m_dataType
virtual void setOwner(IDataHandleHolder *o)=0
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Gaudi::Property< std::string > m_isoKey
Description of a calorimeter cluster.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
virtual double eta() const
The pseudorapidity ( ) of the particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
std::pair< std::vector< unsigned int >, bool > res
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_toys
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< std::string > m_idKey
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Gaudi::Property< int > m_mode
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_SF
virtual StatusCode sysInitialize() override
Override sysInitialize.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_corrDown
double m_lowestEt
Number of Correlated syst.
the base class for EventLoop reentrant algorithms
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::unique_ptr< Root::TElectronEfficiencyCorrectionTool > m_pimpl
Lowest Et for the reccomendations.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
std::string convertToOneKey(const std::string &recokey, const std::string &idkey, const std::string &isokey, const std::string &trigkey)
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Property< std::string > m_recoKey
Gaudi::Property< std::string > m_triggerKey
Gaudi::Property< bool > m_decorate
std::string getValueByKey(const std::string &mapFile, const std::string &key)
Gaudi::Property< int > m_number_of_toys
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual double e() const
The total energy of the particle.