Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
DerivationFramework::BadBatmanAugmentationTool Class Reference

#include <BadBatmanAugmentationTool.h>

Inheritance diagram for DerivationFramework::BadBatmanAugmentationTool:
Collaboration diagram for DerivationFramework::BadBatmanAugmentationTool:

Public Member Functions

 BadBatmanAugmentationTool (const std::string &t, const std::string &n, const IInterface *p)
 
StatusCode initialize ()
 
StatusCode finalize ()
 
virtual StatusCode addBranches () const
 

Private Attributes

SG::ReadHandleKey< xAOD::EventInfom_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
 
SG::ReadHandleKey< xAOD::CaloClusterContainerm_clusterContainer_key {this, "CaloCalTopoClusters", "CaloCalTopoClusters", "Input cluster container"}
 
SG::WriteDecorHandleKey< xAOD::EventInfom_isBadBatmanKey
 

Detailed Description

Definition at line 29 of file BadBatmanAugmentationTool.h.

Constructor & Destructor Documentation

◆ BadBatmanAugmentationTool()

DerivationFramework::BadBatmanAugmentationTool::BadBatmanAugmentationTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 22 of file BadBatmanAugmentationTool.cxx.

24  :
25  base_class(t,n,p)
26  {
27  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::BadBatmanAugmentationTool::addBranches ( ) const
virtual

Definition at line 50 of file BadBatmanAugmentationTool.cxx.

51  {
52  //Running BadBatmanAugmentationTool
53 
54  //Set the name of the variable to augment
55 
57 
59  if (!eventInfo.isValid()){
60  ATH_MSG_WARNING("Invalid xAOD::EventInfo datahandle"
61  << m_eventInfo_key.key());
62  return StatusCode::FAILURE;
63  }
64  auto ei = eventInfo.cptr();
65 
66  auto clusterContainer = SG::makeHandle (m_clusterContainer_key);
67  if(!clusterContainer.isValid()){
68  ATH_MSG_WARNING("Invalid xAOD::CaloClusterContainer datahandle"
70  return StatusCode::FAILURE;
71  }
72  auto clusters = clusterContainer.cptr();
73 
74  //We will now loop over the cluster container counting the number of clusters which pass the criteria
75  bool isBatman=false;
76  size_t nBatman=0;
77  const static SG::AuxElement::ConstAccessor<float> acc_AVGLARQ("AVG_LAR_Q");
78  for ( auto ipart : *clusters ) {
79  if (std::fabs(ipart->rawEta())<=2.5) continue;
80  if (std::fabs(ipart->rawEta())>=3.2) continue;
81  if (ipart->rawE()/cosh(ipart->rawEta())<500.) continue;
82  if (acc_AVGLARQ(*ipart)/65535.<=0.2) continue;
83  nBatman++;
84  }
85  //If we found more than 20 clusters then mark the event as bad
86  if (nBatman>20) isBatman=true;
87  dec_isBadBatman(*ei) = isBatman;
88 
89  return StatusCode::SUCCESS;
90  }

◆ finalize()

StatusCode DerivationFramework::BadBatmanAugmentationTool::finalize ( )

Definition at line 42 of file BadBatmanAugmentationTool.cxx.

43  {
44 
45  ATH_MSG_INFO("Finalize BadBatmanAugmentationTool");
46 
47  return StatusCode::SUCCESS;
48  }

◆ initialize()

StatusCode DerivationFramework::BadBatmanAugmentationTool::initialize ( )

Definition at line 29 of file BadBatmanAugmentationTool.cxx.

30  {
31 
32  ATH_MSG_INFO("Init BadBatmanAugmentationTool");
33 
37 
38 
39  return StatusCode::SUCCESS;
40  }

Member Data Documentation

◆ m_clusterContainer_key

SG::ReadHandleKey<xAOD::CaloClusterContainer> DerivationFramework::BadBatmanAugmentationTool::m_clusterContainer_key {this, "CaloCalTopoClusters", "CaloCalTopoClusters", "Input cluster container"}
private

Definition at line 40 of file BadBatmanAugmentationTool.h.

◆ m_eventInfo_key

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::BadBatmanAugmentationTool::m_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
private

Definition at line 39 of file BadBatmanAugmentationTool.h.

◆ m_isBadBatmanKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::BadBatmanAugmentationTool::m_isBadBatmanKey
private
Initial value:
{this
,"IsBadBatmanKey"
,"EventInfo.DFCommonJets_isBadBatman"
,"Decoration for isBadBatman flag"}

Definition at line 42 of file BadBatmanAugmentationTool.h.


The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DerivationFramework::BadBatmanAugmentationTool::m_clusterContainer_key
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainer_key
Definition: BadBatmanAugmentationTool.h:40
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
DerivationFramework::BadBatmanAugmentationTool::m_isBadBatmanKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_isBadBatmanKey
Definition: BadBatmanAugmentationTool.h:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DerivationFramework::BadBatmanAugmentationTool::m_eventInfo_key
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
Definition: BadBatmanAugmentationTool.h:39
columnar::ContainerId::eventInfo
@ eventInfo
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133