ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::HIGlobalAugmentationTool Class Reference

#include <HIGlobalAugmentationTool.h>

Inheritance diagram for DerivationFramework::HIGlobalAugmentationTool:
Collaboration diagram for DerivationFramework::HIGlobalAugmentationTool:

Public Member Functions

 HIGlobalAugmentationTool (const std::string &t, const std::string &n, const IInterface *p)
 
 ~HIGlobalAugmentationTool ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
virtual StatusCode addBranches (const EventContext &ctx) const
 

Private Attributes

Gaudi::Property< int > m_nHarmonic {this, "nHarmonic", 1, "Flow harmonic starting from v2"}
 
Gaudi::Property< bool > m_doTopoClusDec {this, "doTopoClusDec", false, "Decorate with CaloTopoCluster FCal cut, non-HI mode only"}
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey { this, "EventInfoKey", "EventInfo", "" }
 
SG::ReadHandleKey< xAOD::TrackParticleContainerm_TP_key {this, "InDetTrackParticlesKey", "InDetTrackParticles"}
 
SG::ReadHandleKey< xAOD::HIEventShapeContainerm_eventShapeKey {this, "HIEventShapeKey", "HIEventShape", ""}
 
SG::ReadHandleKey< xAOD::CaloClusterContainerm_caloClusterKey {this, "CaloClusterKey", "", "Only needed if doTopoClusDec is true"}
 
PublicToolHandleArray< InDet::IInDetTrackSelectionToolm_trkSelTools {this, "TrackSelectionTools", {}, "Track selection tools (optional)"}
 track selection tool which can be optionally used for N_trk and sum pt cuts More...
 
Gaudi::Property< std::vector< std::string > > m_cutLevels {this, "cutLevels", {}, "Cut levels"}
 
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtA_Qnx
 
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtA_Qny
 
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtC_Qnx
 
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtC_Qny
 
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtA_Qnx
 
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtA_Qny
 
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtC_Qnx
 
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtC_Qny
 
std::vector< SG::AuxElement::Decorator< int > > m_decTrack_count
 

Detailed Description

Definition at line 28 of file HIGlobalAugmentationTool.h.

Constructor & Destructor Documentation

◆ HIGlobalAugmentationTool()

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

Definition at line 10 of file HIGlobalAugmentationTool.cxx.

12  : base_class(t,n,p)
13  {
14  }

◆ ~HIGlobalAugmentationTool()

DerivationFramework::HIGlobalAugmentationTool::~HIGlobalAugmentationTool ( )

Definition at line 17 of file HIGlobalAugmentationTool.cxx.

18  {
19  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::HIGlobalAugmentationTool::addBranches ( const EventContext &  ctx) const
virtual

Definition at line 59 of file HIGlobalAugmentationTool.cxx.

60  {
62 
63  //Load track particle container
65  if (!tracks.isValid()) {
66  ATH_MSG_ERROR ("Couldn't retrieve TrackParticleContainer with key " << m_TP_key);
67  return StatusCode::FAILURE;
68  }
69 
70  //Count tracks
71  unsigned int nTrackSels = m_trkSelTools.size();
72  std::vector <int> TrackParticleMultiplicity(nTrackSels,0);
73  for (const auto* tp : *tracks) {
74  if (tp) {
75  for (unsigned int its = 0; its < nTrackSels; ++its) {
76  if (m_trkSelTools[its]->accept(*tp)) ++TrackParticleMultiplicity[its];
77  }
78  }
79  }
80  //decorate eventInfo with track multiplicity
81  for (unsigned int its = 0; its < nTrackSels; ++its) {
82  (m_decTrack_count[its])(*eventInfo) = TrackParticleMultiplicity[its];
83  }
84 
85  float FCalEtA = 0;
86  float FCalEtC = 0;
87 
88  std::vector<float> FCalEtA_Qnx(m_nHarmonic,0);
89  std::vector<float> FCalEtA_Qny(m_nHarmonic,0);
90  std::vector<float> FCalEtC_Qnx(m_nHarmonic,0);
91  std::vector<float> FCalEtC_Qny(m_nHarmonic,0);
92 
93  float HalfFCalEtA = 0;
94  float HalfFCalEtC = 0;
95 
96  std::vector<float> HalfFCalEtA_Qnx(m_nHarmonic,0);
97  std::vector<float> HalfFCalEtA_Qny(m_nHarmonic,0);
98  std::vector<float> HalfFCalEtC_Qnx(m_nHarmonic,0);
99  std::vector<float> HalfFCalEtC_Qny(m_nHarmonic,0);
100 
101  // Set up the decorators for FCal Et
102  SG::AuxElement::Decorator< float > decFCalEtA("FCalEtA");
103  SG::AuxElement::Decorator< float > decFCalEtC("FCalEtC");
104 
105  SG::AuxElement::Decorator< float > decHalfFCalEtA("HalfFCalEtA");
106  SG::AuxElement::Decorator< float > decHalfFCalEtC("HalfFCalEtC");
107 
108  //Retrieve HIEventShape
110  if (!eventShape.isValid()){
111  ATH_MSG_ERROR ("Cannot retrieve HIEventShape");
112  return StatusCode::FAILURE;
113  }
114 
115  //Calculate FCal A and FCal C sums
116  for(const auto* ptrEvtShp : *eventShape){
117  if(ptrEvtShp->layer()!=21 && ptrEvtShp->layer()!=22 &&
118  ptrEvtShp->layer()!=23) continue;
119 
120  float eta = ptrEvtShp->etaMin();
121  const std::vector<float>&c1 = ptrEvtShp->etCos();
122  const std::vector<float>&s1 = ptrEvtShp->etSin();
123 
124  if (eta > 0) {
125  FCalEtA += ptrEvtShp->et();
126  for (int vn = 1; vn <= m_nHarmonic; ++vn){
127  FCalEtA_Qnx.at(vn-1) += c1.at(vn);
128  FCalEtA_Qny.at(vn-1) += s1.at(vn);
129  }
130  if(eta > 4.0) {
131  HalfFCalEtA += ptrEvtShp->et();
132  for (int vn = 1; vn <= m_nHarmonic; ++vn){
133  HalfFCalEtA_Qnx.at(vn-1) += c1.at(vn);
134  HalfFCalEtA_Qny.at(vn-1) += s1.at(vn);
135  }
136  }
137  } else if (eta < 0) {
138  FCalEtC += ptrEvtShp->et();
139  for (int vn = 1; vn <= m_nHarmonic; ++vn){
140  FCalEtC_Qnx.at(vn-1) += c1.at(vn);
141  FCalEtC_Qny.at(vn-1) += s1.at(vn);
142  }
143  if(eta < -4.0){
144  HalfFCalEtC += ptrEvtShp->et();
145  for (int vn = 1; vn <= m_nHarmonic; ++vn){
146  HalfFCalEtC_Qnx.at(vn-1) += c1.at(vn);
147  HalfFCalEtC_Qny.at(vn-1) += s1.at(vn);
148  }
149  }
150  }
151  }
152 
153  if (m_doTopoClusDec) {
154  // Setup the decorator for TopoCaloCluster cut
155  // If this is true, the event is not compatible with UPC topologies in the FCal
156  SG::AuxElement::Decorator< bool > decTopoClusterFCalCut("passUPCTopoCaloCut");
157  //Default decoration set to false
158  decTopoClusterFCalCut(*eventInfo) = false;
159 
160  //access topoClusters
162  bool hasTowerA{false};
163  bool hasTowerC{false};
164  for (const auto topo : *topos) {
165  float topo_eta = topo->eta();
166  if (abs(topo_eta) > 3.2 && abs(topo_eta) < 4.9) {
167  float topo_pt = topo->pt() * 1e-3;
168  if (topo_pt > 0.4) {
169  if (topo_eta > 0) {
170  hasTowerA = true;
171  } else {
172  hasTowerC = true;
173  }
174  }
175  }
176  }
177  //decorate
178  decTopoClusterFCalCut(*eventInfo) = (hasTowerA && hasTowerC);
179  }
180 
181 
182  //decorate
183  decFCalEtA(*eventInfo) = FCalEtA;
184  decFCalEtC(*eventInfo) = FCalEtC;
185  decHalfFCalEtA(*eventInfo) = HalfFCalEtA;
186  decHalfFCalEtC(*eventInfo) = HalfFCalEtC;
187 
188  for (int vn = 0; vn < m_nHarmonic; ++vn){
189  (m_decFCalEtA_Qnx[vn])(*eventInfo) = FCalEtA_Qnx.at(vn);
190  (m_decFCalEtA_Qny[vn])(*eventInfo) = FCalEtA_Qny.at(vn);
191  (m_decFCalEtC_Qnx[vn])(*eventInfo) = FCalEtC_Qnx.at(vn);
192  (m_decFCalEtC_Qny[vn])(*eventInfo) = FCalEtC_Qny.at(vn);
193  (m_decHalfFCalEtA_Qnx[vn])(*eventInfo) = HalfFCalEtA_Qnx.at(vn);
194  (m_decHalfFCalEtA_Qny[vn])(*eventInfo) = HalfFCalEtA_Qny.at(vn);
195  (m_decHalfFCalEtC_Qnx[vn])(*eventInfo) = HalfFCalEtC_Qnx.at(vn);
196  (m_decHalfFCalEtC_Qny[vn])(*eventInfo) = HalfFCalEtC_Qny.at(vn);
197  }
198 
199  return StatusCode::SUCCESS;
200  }

◆ finalize()

StatusCode DerivationFramework::HIGlobalAugmentationTool::finalize ( )

Definition at line 50 of file HIGlobalAugmentationTool.cxx.

51  {
52  for (auto trkSelTool : m_trkSelTools ) {
53  ATH_CHECK(trkSelTool->finalize());
54  }
55 
56  return StatusCode::SUCCESS;
57  }

◆ initialize()

StatusCode DerivationFramework::HIGlobalAugmentationTool::initialize ( )

Definition at line 22 of file HIGlobalAugmentationTool.cxx.

23  {
26  ATH_CHECK( m_eventShapeKey.initialize() );
27  ATH_CHECK( m_caloClusterKey.initialize(SG::AllowEmpty) ); // Only needed if m_doTopoClusDec = True
28  unsigned int nTrackSels = m_trkSelTools.size();
29  for (unsigned int its = 0; its < nTrackSels; ++its) {
31  m_decTrack_count.emplace_back(SG::AuxElement::Decorator<int>("TrackParticleMultiplicity_" + m_cutLevels[its] ));
32  }
33  //initilize decorators for flow vectors
34  for (int vn = 1; vn <= m_nHarmonic; ++vn) {
35  m_decFCalEtA_Qnx.emplace_back(SG::AuxElement::Decorator<float>(std::format("FCalEtA_Q{}x", vn + 1)));
36  m_decFCalEtA_Qny.emplace_back(SG::AuxElement::Decorator<float>(std::format("FCalEtA_Q{}y", vn + 1)));
37  m_decFCalEtC_Qnx.emplace_back(SG::AuxElement::Decorator<float>(std::format("FCalEtC_Q{}x", vn + 1)));
38  m_decFCalEtC_Qny.emplace_back(SG::AuxElement::Decorator<float>(std::format("FCalEtC_Q{}y", vn + 1)));
39 
40  // half FCal is for FCal with eta > 4.0 only
41  m_decHalfFCalEtA_Qnx.emplace_back(SG::AuxElement::Decorator<float>(std::format("HalfFCalEtA_Q{}x", vn + 1)));
42  m_decHalfFCalEtA_Qny.emplace_back(SG::AuxElement::Decorator<float>(std::format("HalfFCalEtA_Q{}y", vn + 1)));
43  m_decHalfFCalEtC_Qnx.emplace_back(SG::AuxElement::Decorator<float>(std::format("HalfFCalEtC_Q{}x", vn + 1)));
44  m_decHalfFCalEtC_Qny.emplace_back(SG::AuxElement::Decorator<float>(std::format("HalfFCalEtC_Q{}y", vn + 1)));
45  }
46 
47 
48  return StatusCode::SUCCESS;
49  }

Member Data Documentation

◆ m_caloClusterKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> DerivationFramework::HIGlobalAugmentationTool::m_caloClusterKey {this, "CaloClusterKey", "", "Only needed if doTopoClusDec is true"}
private

Definition at line 46 of file HIGlobalAugmentationTool.h.

◆ m_cutLevels

Gaudi::Property<std::vector<std::string> > DerivationFramework::HIGlobalAugmentationTool::m_cutLevels {this, "cutLevels", {}, "Cut levels"}
private

Definition at line 48 of file HIGlobalAugmentationTool.h.

◆ m_decFCalEtA_Qnx

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtA_Qnx
private

Definition at line 51 of file HIGlobalAugmentationTool.h.

◆ m_decFCalEtA_Qny

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtA_Qny
private

Definition at line 52 of file HIGlobalAugmentationTool.h.

◆ m_decFCalEtC_Qnx

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtC_Qnx
private

Definition at line 53 of file HIGlobalAugmentationTool.h.

◆ m_decFCalEtC_Qny

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtC_Qny
private

Definition at line 54 of file HIGlobalAugmentationTool.h.

◆ m_decHalfFCalEtA_Qnx

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtA_Qnx
private

Definition at line 56 of file HIGlobalAugmentationTool.h.

◆ m_decHalfFCalEtA_Qny

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtA_Qny
private

Definition at line 57 of file HIGlobalAugmentationTool.h.

◆ m_decHalfFCalEtC_Qnx

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtC_Qnx
private

Definition at line 58 of file HIGlobalAugmentationTool.h.

◆ m_decHalfFCalEtC_Qny

std::vector< SG::AuxElement::Decorator< float > > DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtC_Qny
private

Definition at line 59 of file HIGlobalAugmentationTool.h.

◆ m_decTrack_count

std::vector< SG::AuxElement::Decorator< int > > DerivationFramework::HIGlobalAugmentationTool::m_decTrack_count
private

Definition at line 61 of file HIGlobalAugmentationTool.h.

◆ m_doTopoClusDec

Gaudi::Property<bool> DerivationFramework::HIGlobalAugmentationTool::m_doTopoClusDec {this, "doTopoClusDec", false, "Decorate with CaloTopoCluster FCal cut, non-HI mode only"}
private

Definition at line 42 of file HIGlobalAugmentationTool.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::HIGlobalAugmentationTool::m_eventInfoKey { this, "EventInfoKey", "EventInfo", "" }
private

Definition at line 43 of file HIGlobalAugmentationTool.h.

◆ m_eventShapeKey

SG::ReadHandleKey<xAOD::HIEventShapeContainer> DerivationFramework::HIGlobalAugmentationTool::m_eventShapeKey {this, "HIEventShapeKey", "HIEventShape", ""}
private

Definition at line 45 of file HIGlobalAugmentationTool.h.

◆ m_nHarmonic

Gaudi::Property<int> DerivationFramework::HIGlobalAugmentationTool::m_nHarmonic {this, "nHarmonic", 1, "Flow harmonic starting from v2"}
private

Definition at line 41 of file HIGlobalAugmentationTool.h.

◆ m_TP_key

SG::ReadHandleKey<xAOD::TrackParticleContainer> DerivationFramework::HIGlobalAugmentationTool::m_TP_key {this, "InDetTrackParticlesKey", "InDetTrackParticles"}
private

Definition at line 44 of file HIGlobalAugmentationTool.h.

◆ m_trkSelTools

PublicToolHandleArray< InDet::IInDetTrackSelectionTool > DerivationFramework::HIGlobalAugmentationTool::m_trkSelTools {this, "TrackSelectionTools", {}, "Track selection tools (optional)"}
private

track selection tool which can be optionally used for N_trk and sum pt cuts

Definition at line 47 of file HIGlobalAugmentationTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
DerivationFramework::HIGlobalAugmentationTool::m_decTrack_count
std::vector< SG::AuxElement::Decorator< int > > m_decTrack_count
Definition: HIGlobalAugmentationTool.h:61
vtune_athena.format
format
Definition: vtune_athena.py:14
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtA_Qnx
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtA_Qnx
Definition: HIGlobalAugmentationTool.h:56
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
extractSporadic.c1
c1
Definition: extractSporadic.py:133
DerivationFramework::HIGlobalAugmentationTool::m_doTopoClusDec
Gaudi::Property< bool > m_doTopoClusDec
Definition: HIGlobalAugmentationTool.h:42
DerivationFramework::HIGlobalAugmentationTool::m_trkSelTools
PublicToolHandleArray< InDet::IInDetTrackSelectionTool > m_trkSelTools
track selection tool which can be optionally used for N_trk and sum pt cuts
Definition: HIGlobalAugmentationTool.h:47
ParticleTest.tp
tp
Definition: ParticleTest.py:25
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtC_Qnx
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtC_Qnx
Definition: HIGlobalAugmentationTool.h:53
L1TopoRatesCalculator_submatrix_plotter.topo
topo
Definition: L1TopoRatesCalculator_submatrix_plotter.py:78
DerivationFramework::HIGlobalAugmentationTool::m_eventShapeKey
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_eventShapeKey
Definition: HIGlobalAugmentationTool.h:45
DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtA_Qny
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtA_Qny
Definition: HIGlobalAugmentationTool.h:52
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
DerivationFramework::HIGlobalAugmentationTool::m_nHarmonic
Gaudi::Property< int > m_nHarmonic
Definition: HIGlobalAugmentationTool.h:41
DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtA_Qnx
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtA_Qnx
Definition: HIGlobalAugmentationTool.h:51
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
DerivationFramework::HIGlobalAugmentationTool::m_cutLevels
Gaudi::Property< std::vector< std::string > > m_cutLevels
Definition: HIGlobalAugmentationTool.h:48
beamspotman.n
n
Definition: beamspotman.py:727
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::HIGlobalAugmentationTool::m_caloClusterKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterKey
Definition: HIGlobalAugmentationTool.h:46
DerivationFramework::HIGlobalAugmentationTool::m_TP_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TP_key
Definition: HIGlobalAugmentationTool.h:44
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::HIGlobalAugmentationTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: HIGlobalAugmentationTool.h:43
DerivationFramework::HIGlobalAugmentationTool::m_decFCalEtC_Qny
std::vector< SG::AuxElement::Decorator< float > > m_decFCalEtC_Qny
Definition: HIGlobalAugmentationTool.h:54
DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtC_Qnx
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtC_Qnx
Definition: HIGlobalAugmentationTool.h:58
DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtA_Qny
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtA_Qny
Definition: HIGlobalAugmentationTool.h:57
DerivationFramework::HIGlobalAugmentationTool::m_decHalfFCalEtC_Qny
std::vector< SG::AuxElement::Decorator< float > > m_decHalfFCalEtC_Qny
Definition: HIGlobalAugmentationTool.h:59
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:27