ATLAS Offline Software
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

virtual StatusCode initialize () override final
 
virtual StatusCode addBranches (const EventContext &ctx) const override final
 

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 27 of file BadBatmanAugmentationTool.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::BadBatmanAugmentationTool::addBranches ( const EventContext &  ctx) const
finaloverridevirtual

Definition at line 33 of file BadBatmanAugmentationTool.cxx.

34  {
35  //Running BadBatmanAugmentationTool
36 
37  //Set the name of the variable to augment
38 
40 
41  auto eventInfo = SG::makeHandle (m_eventInfo_key, ctx);
42  if (!eventInfo.isValid()){
43  ATH_MSG_WARNING("Invalid xAOD::EventInfo datahandle"
44  << m_eventInfo_key.key());
45  return StatusCode::FAILURE;
46  }
47  auto ei = eventInfo.cptr();
48 
49  auto clusterContainer = SG::makeHandle (m_clusterContainer_key, ctx);
50  if(!clusterContainer.isValid()){
51  ATH_MSG_WARNING("Invalid xAOD::CaloClusterContainer datahandle"
53  return StatusCode::FAILURE;
54  }
55  auto clusters = clusterContainer.cptr();
56 
57  //We will now loop over the cluster container counting the number of clusters which pass the criteria
58  bool isBatman=false;
59  size_t nBatman=0;
60  const static SG::AuxElement::ConstAccessor<float> acc_AVGLARQ("AVG_LAR_Q");
61  for ( auto ipart : *clusters ) {
62  if (std::fabs(ipart->rawEta())<=2.5) continue;
63  if (std::fabs(ipart->rawEta())>=3.2) continue;
64  if (ipart->rawE()/cosh(ipart->rawEta())<500.) continue;
65  if (acc_AVGLARQ(*ipart)/65535.<=0.2) continue;
66  nBatman++;
67  }
68  //If we found more than 20 clusters then mark the event as bad
69  if (nBatman>20) isBatman=true;
70  dec_isBadBatman(*ei) = isBatman;
71 
72  return StatusCode::SUCCESS;
73  }

◆ initialize()

StatusCode DerivationFramework::BadBatmanAugmentationTool::initialize ( )
finaloverridevirtual

Definition at line 20 of file BadBatmanAugmentationTool.cxx.

21  {
22 
23  ATH_MSG_INFO("Init BadBatmanAugmentationTool");
24 
28 
29 
30  return StatusCode::SUCCESS;
31  }

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 38 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 37 of file BadBatmanAugmentationTool.h.

◆ m_isBadBatmanKey

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

Definition at line 40 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:38
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:40
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:270
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:37
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