ATLAS Offline Software
Loading...
Searching...
No Matches
AsgPhotonIsEMSelector Class Reference

Photon isEM selector. More...

#include <AsgPhotonIsEMSelector.h>

Inheritance diagram for AsgPhotonIsEMSelector:
Collaboration diagram for AsgPhotonIsEMSelector:

Public Member Functions

virtual void print () const
 Print the state of the tool.
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 sysInitialize () override
 Perform system initialization for an algorithm.
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
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

ASG_TOOL_CLASS3(AsgPhotonIsEMSelector, IAsgPhotonIsEMSelector, IAsgEGammaIsEMSelector, IAsgSelectionTool) public ~AsgPhotonIsEMSelector ()
 Default constructor.
virtual StatusCode initialize ()
 AlgTool initialize method.
virtual const asg::AcceptInfogetAcceptInfo () const
 Method to get the plain AcceptInfo.
virtual asg::AcceptData accept (const xAOD::IParticle *part) const
 Accept with generic interface.
virtual asg::AcceptData accept (const EventContext &ctx, const xAOD::IParticle *part) const
virtual asg::AcceptData accept (const EventContext &ctx, const xAOD::Egamma *part) const
 Accept with Egamma objects.
virtual asg::AcceptData accept (const EventContext &ctx, const xAOD::Photon *part) const
 The main accept method: the actual cuts are applied here.
virtual asg::AcceptData accept (const EventContext &ctx, const xAOD::Electron *part) const
 The main accept method: the actual cuts are applied here.
virtual std::string getOperatingPointName () const
 Method to get the operating point.
virtual StatusCode execute (const EventContext &ctx, const xAOD::Egamma *eg, unsigned int &isEM) const
 The basic isem.
float getMu (const EventContext &ctx) const
int RunNumber (const EventContext &ctx) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::string m_WorkingPoint
 Working Point.
std::string m_configFile
 Config File.
Root::TPhotonIsEMSelectorm_rootTool
 Pointer to the underlying ROOT based tool.
bool m_useF3core
 use f3core or f3 (default: use f3)
bool m_caloOnly
 Flag for calo only cut-base.
float m_trigEtTh
bool m_skipAmbiguityCut
bool m_removeTRTConversion
bool m_isMuDep = false
SG::ReadHandleKey< xAOD::EventInfom_EvtInfoKey
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

Photon isEM selector.

Author
Jovan Mitrevski Karsten Koeneke
Date
Dec 2011 - Fab 2012 11-MAR-2014 convert to ASG tool

Definition at line 38 of file AsgPhotonIsEMSelector.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

◆ ~AsgPhotonIsEMSelector()

AsgPhotonIsEMSelector::~AsgPhotonIsEMSelector ( )
private

Default constructor.

Destructor

Definition at line 82 of file AsgPhotonIsEMSelector.cxx.

83{
84 delete m_rootTool;
85}
Root::TPhotonIsEMSelector * m_rootTool
Pointer to the underlying ROOT based tool.

Member Function Documentation

◆ accept() [1/5]

asg::AcceptData AsgPhotonIsEMSelector::accept ( const EventContext & ctx,
const xAOD::Egamma * part ) const
privatevirtual

Accept with Egamma objects.

Implements IAsgEGammaIsEMSelector.

Definition at line 247 of file AsgPhotonIsEMSelector.cxx.

249{
250
251 if (eg) {
252 unsigned int isEM = ~0;
253 StatusCode sc = execute(ctx, eg, isEM);
254 if (sc.isFailure()) {
255 ATH_MSG_ERROR("could not calculate isEM");
256 return m_rootTool->accept();
257 }
258 return m_rootTool->fillAccept(isEM);
259 }
260
261 ATH_MSG_ERROR("AsgElectronIsEMSelector::accept was given a bad argument");
262 return m_rootTool->accept();
263}
#define ATH_MSG_ERROR(x)
static Double_t sc
virtual StatusCode execute(const EventContext &ctx, const xAOD::Egamma *eg, unsigned int &isEM) const
The basic isem.
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ accept() [2/5]

asg::AcceptData AsgPhotonIsEMSelector::accept ( const EventContext & ctx,
const xAOD::Electron * part ) const
privatevirtual

The main accept method: the actual cuts are applied here.

Implements IAsgEGammaIsEMSelector.

Definition at line 271 of file AsgPhotonIsEMSelector.cxx.

273{
274 return accept(ctx, static_cast<const xAOD::Egamma*>(el));
275}
virtual asg::AcceptData accept(const xAOD::IParticle *part) const
Accept with generic interface.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17

◆ accept() [3/5]

asg::AcceptData AsgPhotonIsEMSelector::accept ( const EventContext & ctx,
const xAOD::IParticle * part ) const
privatevirtual

Implements IAsgEGammaIsEMSelector.

Definition at line 233 of file AsgPhotonIsEMSelector.cxx.

235{
236
237 if (part->type() == xAOD::Type::Photon ||
238 part->type() == xAOD::Type::Electron) {
239 return accept(ctx, static_cast<const xAOD::Egamma*>(part));
240 }
241
243 "AsgElectronIsEMSelector::could not convert argument to Photon/Electron");
244 return m_rootTool->accept();
245}
@ Photon
The object is a photon.
Definition ObjectType.h:47
@ Electron
The object is an electron.
Definition ObjectType.h:46

◆ accept() [4/5]

asg::AcceptData AsgPhotonIsEMSelector::accept ( const EventContext & ctx,
const xAOD::Photon * part ) const
privatevirtual

The main accept method: the actual cuts are applied here.

Implements IAsgEGammaIsEMSelector.

Definition at line 265 of file AsgPhotonIsEMSelector.cxx.

267{
268 return accept(ctx, static_cast<const xAOD::Egamma*>(ph));
269}

◆ accept() [5/5]

asg::AcceptData AsgPhotonIsEMSelector::accept ( const xAOD::IParticle * part) const
privatevirtual

Accept with generic interface.

Implements IAsgEGammaIsEMSelector.

Definition at line 227 of file AsgPhotonIsEMSelector.cxx.

228{
229 return AsgPhotonIsEMSelector::accept(Gaudi::Hive::currentContext(), part);
230}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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 AsgPhotonIsEMSelector::execute ( const EventContext & ctx,
const xAOD::Egamma * eg,
unsigned int & isEM ) const
privatevirtual

The basic isem.

Implements IAsgEGammaIsEMSelector.

Definition at line 318 of file AsgPhotonIsEMSelector.cxx.

321{
322 //
323 // Particle identification for photons based on cuts
324 // trigEtTh : threshold in ET as applied by trigger
325 //
326 (void)ctx;
327
328 // initialisation
329 isEM = 0;
330
331 // protection against null pointer
332 if (eg == nullptr) {
333 ATH_MSG_ERROR("eg == 0");
334 // if object is bad then use the bit for "bad eta"
335 isEM = (0x1 << egammaPID::ClusterEtaRange_Photon);
336 return StatusCode::SUCCESS;
337 }
338
339 // protection against bad clusters
340 const xAOD::CaloCluster* cluster = eg->caloCluster();
341 if (cluster == nullptr) {
342 ATH_MSG_ERROR("exiting because cluster is NULL " << cluster);
343 // if object is bad then use the bit for "bad eta"
344 isEM = (0x1 << egammaPID::ClusterEtaRange_Photon);
345 return StatusCode::SUCCESS;
346 }
347
348 // Fill variables
349 // eta position in second sampling
350 const float eta2 = fabsf(cluster->etaBE(2));
351 // transverse energy in calorimeter (using eta position in second sampling)
352 const double energy = cluster->e();
353 double et = 0.;
354 if (eta2 < 999.) {
355 const double cosheta = cosh(eta2);
356 et = (cosheta != 0.) ? energy / cosheta : 0.;
357 }
358
359 // variables based on HCAL
360 // transverse energy in 1st scintillator of hadronic calorimeter/ET
361 float Rhad1 = eg->showerShapeValue(xAOD::EgammaParameters::Rhad1);
362 // transverse energy in hadronic calorimeter/ET
363 float Rhad = eg->showerShapeValue(xAOD::EgammaParameters::Rhad);
364
365 // variables based on S2 of EM CAL
366 // E(7*7) in 2nd sampling
367 float e277 = eg->showerShapeValue(xAOD::EgammaParameters::e277);
368 // E(3*7)/E(7*7) in 2nd sampling
369 float Reta = eg->showerShapeValue(xAOD::EgammaParameters::Reta);
370 // E(3*3)/E(3*7) in 2nd sampling
371 float Rphi = eg->showerShapeValue(xAOD::EgammaParameters::Rphi);
372 // shower width in 2nd sampling
373 float weta2c = eg->showerShapeValue(xAOD::EgammaParameters::weta2);
374
375 // variables based on S1 of EM CAL
376 // fraction of energy reconstructed in the 1st sampling
377 float f1 = eg->showerShapeValue(xAOD::EgammaParameters::f1);
378 // shower width in 3 strips in 1st sampling
379 float weta1c = eg->showerShapeValue(xAOD::EgammaParameters::weta1);
380 // (E of 1st max in strips-E of 2nd max)/(E of 1st max+E of 2nd max)
381 float Eratio = eg->showerShapeValue(xAOD::EgammaParameters::Eratio);
382 // E(2nd max)-E(min) in strips
383 float DeltaE = eg->showerShapeValue(xAOD::EgammaParameters::DeltaE);
384 // total shower width in 1st sampling
385 float wtot = eg->showerShapeValue(xAOD::EgammaParameters::wtots1);
386 // E(+/-3)-E(+/-1)/E(+/-1)
387 float fracm = eg->showerShapeValue(xAOD::EgammaParameters::fracs1);
388
389 float f3(0);
390 if (m_useF3core) {
391 f3 = eg->showerShapeValue(xAOD::EgammaParameters::f3core);
392 } else {
393 f3 = eg->showerShapeValue(xAOD::EgammaParameters::f3);
394 }
395
396 // cut on E/p
397 double ep = 1.0; // default passes
398
399 if (m_caloOnly) {
400 ATH_MSG_DEBUG("Doing CaloCutsOnly");
401 } else {
403 eg)) // returns false if not photon or no conversion
404 {
405 const xAOD::Photon* ph = static_cast<const xAOD::Photon*>(eg);
407 if (p != 0.) {
408 ep = energy / p;
409 } else {
410 ep = 9999999.;
411 }
412 }
413 }
414
415 // modifiy et when dealing with trigger
416 // to be sure that it will take the correct bin (VD)
417 if (m_trigEtTh > 0)
418 et = m_trigEtTh * 1.01;
419
420 // pileup
421 float mu = m_isMuDep ? this->getMu(ctx) : -999;
422
423 //runnumber
424 int runnumber = this->RunNumber(ctx);
425 bool excludeTRT = false;
426
427 if(runnumber >= 410000 && m_removeTRTConversion) excludeTRT = true; // exclude TRT converted photons only for Run-3
428
429
430 // apply calorimeter selection for photons
431 isEM = m_rootTool->calcIsEm(eta2,
432 et,
433 Rhad1,
434 Rhad,
435 e277,
436 Reta,
437 Rphi,
438 weta2c,
439 f1,
440 Eratio,
441 DeltaE,
442 weta1c,
443 wtot,
444 fracm,
445 f3,
446 ep,
448 mu);
449
450 // Add ambiguity resolution cut for photon (vs electron)
451 // to reproduce release 21.2 ambiguity tool configuration
452 if (!m_skipAmbiguityCut){
453 static const SG::AuxElement::Accessor<uint8_t> acc("ambiguityType");
454 int AmbiguityType = acc(*eg);
458 }
459 }
460
461 return StatusCode::SUCCESS;
462}
#define ATH_MSG_DEBUG(x)
float et(const xAOD::jFexSRJetRoI *j)
float getMu(const EventContext &ctx) const
bool m_caloOnly
Flag for calo only cut-base.
int RunNumber(const EventContext &ctx) const
bool m_useF3core
use f3core or f3 (default: use f3)
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
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.
static std::vector< uint32_t > runnumber
Definition iLumiCalc.h:37
@ AmbiguityResolution_Photon
ambiguity resolution for photon (vs electron)
@ ClusterEtaRange_Photon
cluster eta range
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Amg::Vector3D momentumAtVertex(const xAOD::Photon *, bool debug=false)
return the momentum at the vertex (which can be 0)
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
Definition EgammaDefs.h:32
@ wtots1
shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips...
@ f3core
E3(3x3)/E fraction of the energy reconstructed in the third compartment of the electromagnetic calori...
Definition EgammaEnums.h:66
@ e277
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 7x7
Definition EgammaEnums.h:81
@ f3
fraction of energy reconstructed in 3rd sampling
Definition EgammaEnums.h:55
@ f1
E1/E = fraction of energy reconstructed in the first sampling, where E1 is energy in all strips belon...
Definition EgammaEnums.h:53
@ Eratio
(emaxs1-e2tsts1)/(emaxs1+e2tsts1)
@ DeltaE
e2tsts1-emins1
@ fracs1
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strip...
@ weta2
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...
@ weta1
shower width using +/-3 strips around the one with the maximal energy deposit: w3 strips = sqrt{sum(E...
Definition EgammaEnums.h:98
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Photon_v1 Photon
Definition of the current "egamma version".

◆ 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

◆ getAcceptInfo()

const asg::AcceptInfo & AsgPhotonIsEMSelector::getAcceptInfo ( ) const
privatevirtual

Method to get the plain AcceptInfo.

This is needed so that one can already get the AcceptInfo and query what cuts are defined before the first object is passed to the tool.

Implements IAsgSelectionTool.

Definition at line 218 of file AsgPhotonIsEMSelector.cxx.

219{
220 return m_rootTool->getAcceptInfo();
221}

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getMu()

float AsgPhotonIsEMSelector::getMu ( const EventContext & ctx) const
private

Definition at line 464 of file AsgPhotonIsEMSelector.cxx.

464 {
465 SG::ReadHandle<xAOD::EventInfo> evtI(m_EvtInfoKey, ctx);
466 if (!evtI.isValid()) {
467 ATH_MSG_WARNING("Cannot find EventInfo, returning -999.");
468 return -999;
469 }
470 return evtI->actualInteractionsPerCrossing();
471}
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< xAOD::EventInfo > m_EvtInfoKey

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getOperatingPointName()

std::string AsgPhotonIsEMSelector::getOperatingPointName ( ) const
privatevirtual

Method to get the operating point.

Get the name of the current operating point.

Implements IAsgEGammaIsEMSelector.

Definition at line 281 of file AsgPhotonIsEMSelector.cxx.

282{
283 //
284 // For Loose, Medium and Tight ignore if the difference is in bit 23
285 if (m_rootTool->m_isEMMask == egammaPID::PhotonLoose ||
286 (egammaPID::PhotonLoose ^ m_rootTool->m_isEMMask) ==
288 return "Loose";
289 }
290 if (m_rootTool->m_isEMMask == egammaPID::PhotonMedium ||
291 (egammaPID::PhotonMedium ^ m_rootTool->m_isEMMask) ==
293 return "Medium";
294 }
295 if (m_rootTool->m_isEMMask == egammaPID::PhotonTight ||
296 (egammaPID::PhotonTight ^ m_rootTool->m_isEMMask) ==
298 return "Tight";
299 }
300 if (m_rootTool->m_isEMMask == egammaPID::PhotonLooseEF) {
301 return "LooseEF";
302 }
303 if (m_rootTool->m_isEMMask == egammaPID::PhotonMediumEF) {
304 return "MediumEF";
305 }
306 if (m_rootTool->m_isEMMask == 0) {
307 return "No cuts applied";
308 }
309
310 ATH_MSG_ERROR("Didn't recognize the given operating point with mask: "
311 << m_rootTool->m_isEMMask);
312 return "";
313}
const unsigned int PhotonLooseEF
TrigEgamma Pid Definitions.
const unsigned int PhotonMediumEF
Medium photon selection for online EF.
const unsigned int PhotonMedium
Medium photon selection.
const unsigned int PhotonLoose
Loose photon selection.
const unsigned int PhotonTight
Tight photon selection.

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode AsgPhotonIsEMSelector::initialize ( void )
privatevirtual

AlgTool initialize method.

----— Read in the TEnv config ---—///

----— Use helpers to read in the cut arrays ---—///

Reimplemented from asg::AsgTool.

Definition at line 89 of file AsgPhotonIsEMSelector.cxx.

90{
91 if (!m_WorkingPoint.empty()) {
96 }
97
99 if (filename.empty()) {
100 ATH_MSG_ERROR("Could not locate " << m_configFile);
101 return StatusCode::FAILURE;
102 }
103 TEnv env;
104 env.ReadFile(filename.c_str(), kEnvLocal);
106 // Override the mask via the config only if it is not set
107 if (m_rootTool->m_isEMMask == egammaPID::EgPidUndefined) {
108 unsigned int mask(
109 env.GetValue("isEMMask", static_cast<int>(egammaPID::EgPidUndefined)));
110 m_rootTool->m_isEMMask = mask;
111 }
113 m_rootTool->m_cutBinEta_photonsNonConverted =
114 AsgConfigHelper::HelperFloat("CutBinEta_photonsNonConverted", env);
115 m_rootTool->m_cutBinEnergy_photonsNonConverted =
116 AsgConfigHelper::HelperFloat("CutBinEnergy_photonsNonConverted", env);
117 m_rootTool->m_cutBinMu_photonsNonConverted =
118 AsgConfigHelper::HelperFloat("CutBinMu_photonsNonConverted", env);
119 m_rootTool->m_e277_photonsNonConverted =
120 AsgConfigHelper::HelperFloat("e277_photonsNonConverted", env);
121 m_rootTool->m_cutHadLeakage_photonsNonConverted =
122 AsgConfigHelper::HelperFloat("CutHadLeakage_photonsNonConverted", env);
123 m_rootTool->m_Reta37_photonsNonConverted =
124 AsgConfigHelper::HelperFloat("Reta37_photonsNonConverted", env);
125 m_rootTool->m_Rphi33_photonsNonConverted =
126 AsgConfigHelper::HelperFloat("Rphi33_photonsNonConverted", env);
127 m_rootTool->m_weta2_photonsNonConverted =
128 AsgConfigHelper::HelperFloat("weta2_photonsNonConverted", env);
129 m_rootTool->m_cutBinEtaStrips_photonsNonConverted =
130 AsgConfigHelper::HelperFloat("CutBinEtaStrips_photonsNonConverted", env);
131 m_rootTool->m_cutBinEnergyStrips_photonsNonConverted =
132 AsgConfigHelper::HelperFloat("CutBinEnergyStrips_photonsNonConverted", env);
133 m_rootTool->m_cutBinMuStrips_photonsNonConverted =
134 AsgConfigHelper::HelperFloat("CutBinMuStrips_photonsNonConverted", env);
135 m_rootTool->m_f1_photonsNonConverted =
136 AsgConfigHelper::HelperFloat("f1_photonsNonConverted", env);
137 m_rootTool->m_deltae_photonsNonConverted =
138 AsgConfigHelper::HelperFloat("deltae_photonsNonConverted", env);
139 m_rootTool->m_DEmaxs1_photonsNonConverted =
140 AsgConfigHelper::HelperFloat("DEmaxs1_photonsNonConverted", env);
141 m_rootTool->m_wtot_photonsNonConverted =
142 AsgConfigHelper::HelperFloat("wtot_photonsNonConverted", env);
143 m_rootTool->m_fracm_photonsNonConverted =
144 AsgConfigHelper::HelperFloat("fracm_photonsNonConverted", env);
145 m_rootTool->m_w1_photonsNonConverted =
146 AsgConfigHelper::HelperFloat("w1_photonsNonConverted", env);
147 m_rootTool->m_cutF3_photonsNonConverted =
148 AsgConfigHelper::HelperFloat("CutF3_photonsNonConverted", env);
149 m_rootTool->m_cutBinEta_photonsConverted =
150 AsgConfigHelper::HelperFloat("CutBinEta_photonsConverted", env);
151 m_rootTool->m_cutBinEnergy_photonsConverted =
152 AsgConfigHelper::HelperFloat("CutBinEnergy_photonsConverted", env);
153 m_rootTool->m_cutBinMu_photonsConverted =
154 AsgConfigHelper::HelperFloat("CutBinMu_photonsConverted", env);
155 m_rootTool->m_e277_photonsConverted =
156 AsgConfigHelper::HelperFloat("e277_photonsConverted", env);
157 m_rootTool->m_cutHadLeakage_photonsConverted =
158 AsgConfigHelper::HelperFloat("CutHadLeakage_photonsConverted", env);
159 m_rootTool->m_Reta37_photonsConverted =
160 AsgConfigHelper::HelperFloat("Reta37_photonsConverted", env);
161 m_rootTool->m_Rphi33_photonsConverted =
162 AsgConfigHelper::HelperFloat("Rphi33_photonsConverted", env);
163 m_rootTool->m_weta2_photonsConverted =
164 AsgConfigHelper::HelperFloat("weta2_photonsConverted", env);
165 m_rootTool->m_cutBinEtaStrips_photonsConverted =
166 AsgConfigHelper::HelperFloat("CutBinEtaStrips_photonsConverted", env);
167 m_rootTool->m_cutBinEnergyStrips_photonsConverted =
168 AsgConfigHelper::HelperFloat("CutBinEnergyStrips_photonsConverted", env);
169 m_rootTool->m_cutBinMuStrips_photonsConverted =
170 AsgConfigHelper::HelperFloat("CutBinMuStrips_photonsConverted", env);
171 m_rootTool->m_f1_photonsConverted =
172 AsgConfigHelper::HelperFloat("f1_photonsConverted", env);
173 m_rootTool->m_deltae_photonsConverted =
174 AsgConfigHelper::HelperFloat("deltae_photonsConverted", env);
175 m_rootTool->m_DEmaxs1_photonsConverted =
176 AsgConfigHelper::HelperFloat("DEmaxs1_photonsConverted", env);
177 m_rootTool->m_wtot_photonsConverted =
178 AsgConfigHelper::HelperFloat("wtot_photonsConverted", env);
179 m_rootTool->m_fracm_photonsConverted =
180 AsgConfigHelper::HelperFloat("fracm_photonsConverted", env);
181 m_rootTool->m_w1_photonsConverted =
182 AsgConfigHelper::HelperFloat("w1_photonsConverted", env);
183 m_rootTool->m_cutminEp_photonsConverted =
184 AsgConfigHelper::HelperFloat("CutminEp_photonsConverted", env);
185 m_rootTool->m_cutmaxEp_photonsConverted =
186 AsgConfigHelper::HelperFloat("CutmaxEp_photonsConverted", env);
187 m_rootTool->m_cutF3_photonsConverted =
188 AsgConfigHelper::HelperFloat("CutF3_photonsConverted", env);
189
190 // Get the message level and set the underlying ROOT tool message level
191 // accordingly
192 m_rootTool->msg().setLevel(this->msg().level());
193
194 // We need to initialize the underlying ROOT TSelectorTool
195 if (m_rootTool->initialize().isFailure()) {
196 ATH_MSG_ERROR("Could not initialize the TPhotonIsEMSelector!");
197 return StatusCode::FAILURE;
198 }
199
200 // if we use mu-dependent menu
201 m_isMuDep =
202 !m_rootTool->m_cutBinMu_photonsNonConverted.empty() ||
203 !m_rootTool->m_cutBinMu_photonsConverted.empty() ||
204 !m_rootTool->m_cutBinMuStrips_photonsNonConverted.empty() ||
205 !m_rootTool->m_cutBinMuStrips_photonsConverted.empty();
206 ATH_CHECK(m_EvtInfoKey.initialize());
207 if (m_isMuDep)
208 ATH_MSG_INFO("Running a mu-dependent photon ID menu");
209
210 return StatusCode::SUCCESS;
211}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::string m_configFile
Config File.
std::string m_WorkingPoint
Working Point.
unsigned int findMask(const std::string &input, const std::map< std::string, unsigned int > &maskmap)
std::string findConfigFile(const std::string &input, const std::map< std::string, std::string > &configmap)
std::vector< float > HelperFloat(const std::string &input, TEnv &env)
const std::map< std::string, std::string > PhotonCutPointToConfFile
const std::map< std::string, unsigned int > PhotonCutPointToMask
const unsigned int EgPidUndefined
MsgStream & msg
Definition testRead.cxx:32

◆ 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.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ 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.

◆ print()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ RunNumber()

int AsgPhotonIsEMSelector::RunNumber ( const EventContext & ctx) const
private

Definition at line 473 of file AsgPhotonIsEMSelector.cxx.

473 {
474 SG::ReadHandle<xAOD::EventInfo> evtI(m_EvtInfoKey, ctx);
475 if (!evtI.isValid()) {
476 ATH_MSG_WARNING("Cannot find EventInfo, returning -999.");
477 return -999;
478 }
479 return evtI->runNumber();
480}

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_caloOnly

bool AsgPhotonIsEMSelector::m_caloOnly
private

Flag for calo only cut-base.

Definition at line 96 of file AsgPhotonIsEMSelector.h.

◆ m_configFile

std::string AsgPhotonIsEMSelector::m_configFile
private

Config File.

Definition at line 87 of file AsgPhotonIsEMSelector.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_EvtInfoKey

SG::ReadHandleKey<xAOD::EventInfo> AsgPhotonIsEMSelector::m_EvtInfoKey
private
Initial value:
{ this,
"EventInfo", "EventInfo", "The event info object key" }

Definition at line 109 of file AsgPhotonIsEMSelector.h.

109 { this,
110 "EventInfo", "EventInfo", "The event info object key" };

◆ 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_isMuDep

bool AsgPhotonIsEMSelector::m_isMuDep = false
private

Definition at line 106 of file AsgPhotonIsEMSelector.h.

◆ m_removeTRTConversion

bool AsgPhotonIsEMSelector::m_removeTRTConversion
private

Definition at line 103 of file AsgPhotonIsEMSelector.h.

◆ m_rootTool

Root::TPhotonIsEMSelector* AsgPhotonIsEMSelector::m_rootTool
private

Pointer to the underlying ROOT based tool.

Definition at line 90 of file AsgPhotonIsEMSelector.h.

◆ m_skipAmbiguityCut

bool AsgPhotonIsEMSelector::m_skipAmbiguityCut
private

Definition at line 100 of file AsgPhotonIsEMSelector.h.

◆ m_trigEtTh

float AsgPhotonIsEMSelector::m_trigEtTh
private

Definition at line 97 of file AsgPhotonIsEMSelector.h.

◆ m_useF3core

bool AsgPhotonIsEMSelector::m_useF3core
private

use f3core or f3 (default: use f3)

Definition at line 93 of file AsgPhotonIsEMSelector.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.

◆ m_WorkingPoint

std::string AsgPhotonIsEMSelector::m_WorkingPoint
private

Working Point.

Definition at line 84 of file AsgPhotonIsEMSelector.h.


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