ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CaloMuonTag Class Reference

#include <CaloMuonTag.h>

Inheritance diagram for CaloMuonTag:
Collaboration diagram for CaloMuonTag:

Public Member Functions

 CaloMuonTag (const std::string &type, const std::string &name, const IInterface *pInterface)
 
virtual ~CaloMuonTag ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
int caloMuonTag (const std::vector< DepositInCalo > &deposits, double eta, double pt) const override
 Returns the Tag. More...
 
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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

double interpolate (const std::string &cutName, double pt) const
 
int getPtBinLow (double pt) const
 
int getCutBin (const std::string &cutName) const
 
StatusCode getHist (TFile *file, const std::string &histName, std::unique_ptr< TH2 > &hist)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::unique_ptr< TH2 > m_hist {nullptr}
 
std::string m_tagMode
 
std::vector< std::string > m_vecCutNames
 
std::vector< int > m_vecPtBins
 
int m_numCuts {0}
 
int m_numPtBins {0}
 
std::atomic_int m_numTagged {0}
 
std::atomic_int m_numRejected {0}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Muon Tagger in the ATLAS calorimeter.

This tagger is used in the CaloTrkMuId framework. After some basic preselection CaloTrkMuIdAlg feeds a track to the TrackDepositInCaloTool. TrackDepositInCaloTool gathers the deposits that are found near that track. This tool can tag a muon track from its deposits.

Applies energy deposition veto cuts in all samplings and noise cuts in the last three layers of the hadronic calorimeter (Tile and HEC). The following scale factors are applied to correct for the pathlength traversed in the calorimeter cells.

\(E_{\rm th} = \frac{E^{\mathrm{barrel}}_{0}}{\sin^2 \theta}\) for \(|\eta|<1.7\) \(E_{\rm th} = \frac{E^{\rm end-cap}_{0}}{\ (1 - \sin \theta )^2}\) for \(|\eta|>1.7\)

There are three tags, determined by the acceptance:

0 not a muon,

1 muon in Last Calo Layer,

2 muon in Last-1 Calo Layer,

3 muon in Last-2 Calo Layer,

Author
Gustavo.Ordonez.Sanz Gusta.nosp@m.vo.O.nosp@m.rdone.nosp@m.z.Sa.nosp@m.nz@ce.nosp@m.rn.c.nosp@m.h Marcel Raas marce.nosp@m.lra@.nosp@m.cern..nosp@m.ch (contact person)

Definition at line 18 of file CaloMuonTag.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

◆ CaloMuonTag()

CaloMuonTag::CaloMuonTag ( const std::string &  type,
const std::string &  name,
const IInterface *  pInterface 
)

Definition at line 14 of file CaloMuonTag.cxx.

14  :
15  AthAlgTool(type, name, pInterface) {
16  declareInterface<ICaloMuonTag>(this);
17  declareProperty("TagMode", m_tagMode = "Tight");
18 }

◆ ~CaloMuonTag()

CaloMuonTag::~CaloMuonTag ( )
virtualdefault

Member Function Documentation

◆ caloMuonTag()

int CaloMuonTag::caloMuonTag ( const std::vector< DepositInCalo > &  deposits,
double  eta,
double  pt 
) const
overridevirtual

Returns the Tag.

Implements ICaloMuonTag.

Definition at line 85 of file CaloMuonTag.cxx.

85  {
86  std::vector<DepositInCalo>::const_iterator it = deposits.begin();
87  int numVetoesTriggered = 0;
88  int tag = 4;
89  for (; it != deposits.end(); ++it) {
90  CaloCell_ID::CaloSample sample = it->subCaloId();
91  double dep = it->energyDeposited();
92  double eLoss = it->muonEnergyLoss();
93  double diff = dep - eLoss;
94 
95  if (sample == CaloCell_ID::EMB1) {
96  if (dep > interpolate("emb1Veto", pt)) { numVetoesTriggered++; }
97  }
98  if (sample == CaloCell_ID::EMB2) {
99  if (dep > interpolate("emb2Veto", pt)) { numVetoesTriggered++; }
100  }
101  if (sample == CaloCell_ID::EMB3) {
102  if (dep > interpolate("emb3Veto", pt)) { numVetoesTriggered++; }
103  }
104  if (sample == CaloCell_ID::EME1) {
105  if (dep > interpolate("eme1Veto", pt)) { numVetoesTriggered++; }
106  }
107  if (sample == CaloCell_ID::EME2) {
108  if (dep > interpolate("eme2Veto", pt)) { numVetoesTriggered++; }
109  }
110  if (sample == CaloCell_ID::EME3) {
111  if (dep > interpolate("eme3Veto", pt)) { numVetoesTriggered++; }
112  }
113  if (sample == CaloCell_ID::TileBar0) {
114  if (tag > 3) tag = 3;
115  if (dep < interpolate("tileBar0Sig", pt)) { numVetoesTriggered++; }
116  if (dep > interpolate("tileBar0Veto", pt)) { numVetoesTriggered++; }
117  if (diff < interpolate("tileBar0DiffLow", pt)) { numVetoesTriggered++; }
118  }
119  if (sample == CaloCell_ID::TileBar1) {
120  if (tag > 2) tag = 2;
121  if (dep < interpolate("tileBar1Sig", pt)) { numVetoesTriggered++; }
122  if (dep > interpolate("tileBar1Veto", pt)) { numVetoesTriggered++; }
123  if (diff < interpolate("tileBar1DiffLow", pt)) { numVetoesTriggered++; }
124  }
125  if (sample == CaloCell_ID::TileBar2) {
126  if (tag > 1) tag = 1;
127  if (dep < interpolate("tileBar2Sig", pt)) { numVetoesTriggered++; }
128  if (dep > interpolate("tileBar2Veto", pt)) { numVetoesTriggered++; }
129  if (diff < interpolate("tileBar2DiffLow", pt)) { numVetoesTriggered++; }
130  }
131  if (sample == CaloCell_ID::TileExt0) {
132  if (tag > 3) tag = 3;
133  if (dep < interpolate("tileExt0Sig", pt)) { numVetoesTriggered++; }
134  if (diff < interpolate("tileExt0DiffLow", pt)) { numVetoesTriggered++; }
135  if (dep > interpolate("tileExt0Veto", pt)) { numVetoesTriggered++; }
136  }
137  if (sample == CaloCell_ID::TileExt1) {
138  if (tag > 2) tag = 2;
139  if (dep < interpolate("tileExt1Sig", pt)) { numVetoesTriggered++; }
140  if (diff < interpolate("tileExt1DiffLow", pt)) { numVetoesTriggered++; }
141  if (dep > interpolate("tileExt1Veto", pt)) { numVetoesTriggered++; }
142  }
143  if (sample == CaloCell_ID::TileExt2) {
144  if (tag > 1) tag = 1;
145  if (dep < interpolate("tileExt2Sig", pt)) { numVetoesTriggered++; }
146  if (diff < interpolate("tileExt2DiffLow", pt)) { numVetoesTriggered++; }
147  if (dep > interpolate("tileExt2Veto", pt)) { numVetoesTriggered++; }
148  }
149  if (sample == CaloCell_ID::HEC0) {
150  if (dep > interpolate("hec0Veto", pt)) { numVetoesTriggered++; }
151  if (dep < interpolate("hec0Sig", pt)) { numVetoesTriggered++; }
152  }
153  if (sample == CaloCell_ID::HEC1) {
154  if (tag > 3) tag = 3;
155  if (dep > interpolate("hec1Veto", pt)) { numVetoesTriggered++; }
156  if (dep < interpolate("hec1Sig", pt)) { numVetoesTriggered++; }
157  }
158  if (sample == CaloCell_ID::HEC2) {
159  if (tag > 2) tag = 2;
160  if (dep > interpolate("hec2Veto", pt)) { numVetoesTriggered++; }
161  if (dep < interpolate("hec2Sig", pt)) { numVetoesTriggered++; }
162  }
163  if (sample == CaloCell_ID::HEC3) {
164  if (tag > 1) tag = 1;
165  if (dep > interpolate("hec3Veto", pt)) { numVetoesTriggered++; }
166  if (dep < interpolate("hec3Sig", pt)) { numVetoesTriggered++; }
167  }
168 
169  if (numVetoesTriggered >= 1) {
170  m_numRejected++;
171  return 0;
172  }
173  }
174  if (tag < 3)
175  m_numTagged++;
176  else if (tag == 4)
177  return 0;
178  return tag;
179 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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

◆ finalize()

StatusCode CaloMuonTag::finalize ( )
overridevirtual

Definition at line 75 of file CaloMuonTag.cxx.

75  {
76  ATH_MSG_INFO("Number of tracks tagged : " << m_numTagged);
77  ATH_MSG_INFO("Number of tracks rejected : " << m_numRejected);
78  ATH_MSG_DEBUG("finalize() successful in " << name());
79  return StatusCode::SUCCESS;
80 }

◆ getCutBin()

int CaloMuonTag::getCutBin ( const std::string &  cutName) const
private

Definition at line 217 of file CaloMuonTag.cxx.

217  {
218  for (int i = 0; i <= m_numCuts; i++) {
219  if (cutName == m_vecCutNames[i]) return i;
220  }
221  return 0;
222 }

◆ getHist()

StatusCode CaloMuonTag::getHist ( TFile *  file,
const std::string &  histName,
std::unique_ptr< TH2 > &  hist 
)
private

Definition at line 55 of file CaloMuonTag.cxx.

55  {
56  if (!file) {
57  ATH_MSG_ERROR("NULL TFile");
58  return StatusCode::FAILURE;
59  }
60  TH2* hist = nullptr;
61  file->GetObject(histName.c_str(), hist);
62  if (!hist) {
63  ATH_MSG_ERROR("Cannot retrieve histogram: " << histName);
64  return StatusCode::FAILURE;
65  }
66  hist->SetDirectory(nullptr);
67  unique_hist.reset(hist);
68  ATH_MSG_INFO("Successfully retrieved histogram: " << histName);
69  return StatusCode::SUCCESS;
70 }

◆ getPtBinLow()

int CaloMuonTag::getPtBinLow ( double  pt) const
private

Definition at line 209 of file CaloMuonTag.cxx.

209  {
210  // Return the bin of lower pt
211  for (int i = 0; i <= m_numPtBins; i++) {
212  if (pt < m_vecPtBins[i]) return (i - 1);
213  }
214  return m_numPtBins;
215 }

◆ initialize()

StatusCode CaloMuonTag::initialize ( )
overridevirtual

Definition at line 28 of file CaloMuonTag.cxx.

28  {
29  // Retrieve histogram
30  std::string rootFilePath = PathResolverFindCalibFile("CaloTrkMuIdTools/cutBased_release21/CaloTag.CutConfig.root");
31 
32  std::unique_ptr<TFile> rootFile{TFile::Open(rootFilePath.c_str(), "READ")};
34  // Read cut names from histogram
35  m_numCuts = m_hist->GetYaxis()->GetNbins();
36  if (m_numCuts == 0) {
37  ATH_MSG_FATAL("Histogram number of cuts invalid");
38  return StatusCode::FAILURE;
39  }
40  for (int i = 0; i <= m_numCuts; i++) { m_vecCutNames.push_back(m_hist->GetYaxis()->GetBinLabel(i)); }
41  // Read pt bins from histogram
42  m_numPtBins = m_hist->GetXaxis()->GetNbins();
43  if (m_numPtBins == 0) {
44  ATH_MSG_FATAL("Histogram number of pt bins invalid");
45  return StatusCode::FAILURE;
46  }
47  for (int i = 0; i <= m_numPtBins; i++) { m_vecPtBins.push_back(atoi(m_hist->GetXaxis()->GetBinLabel(i))); }
48  ATH_MSG_DEBUG("initialize() successful in " << name());
49  return StatusCode::SUCCESS;
50 }

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

◆ interfaceID()

static const InterfaceID& ICaloMuonTag::interfaceID ( )
inlinestaticinherited

Definition at line 23 of file ICaloMuonTag.h.

23 {return IID_ICaloMuonTag;}

◆ interpolate()

double CaloMuonTag::interpolate ( const std::string &  cutName,
double  pt 
) const
private

Definition at line 184 of file CaloMuonTag.cxx.

184  {
185  double ptLow = 0, ptUp = 0, cutLow = 0, cutUp = 0, cutReturn = 0;
186  // MeV-->GeV
187  pt = pt / 1000;
188  int ptBin = getPtBinLow(pt);
189  int cutBin = getCutBin(cutName);
190  if (ptBin < 0 || ptBin > m_numPtBins || cutBin == 0 || cutBin > m_numCuts) ATH_MSG_WARNING("Bin out of bound");
191 
192  // Get lowest pt bin
193  if (ptBin < 1) cutReturn = m_hist->GetBinContent(1, cutBin);
194  // Get highest pt bin
195  else if (ptBin == m_numPtBins)
196  cutReturn = m_hist->GetBinContent(m_numPtBins, cutBin);
197  // Interpolate between bins
198  else {
199  ptUp = m_vecPtBins[ptBin + 1];
200  ptLow = m_vecPtBins[ptBin];
201  cutUp = m_hist->GetBinContent(ptBin + 1, cutBin);
202  cutLow = m_hist->GetBinContent(ptBin, cutBin);
203  cutReturn = cutLow + (cutUp - cutLow) * (pt - ptLow) / (ptUp - ptLow);
204  }
205 
206  return cutReturn;
207 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

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

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

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

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

Member Data Documentation

◆ 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_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_hist

std::unique_ptr<TH2> CaloMuonTag::m_hist {nullptr}
private

Definition at line 59 of file CaloMuonTag.h.

◆ m_numCuts

int CaloMuonTag::m_numCuts {0}
private

Definition at line 65 of file CaloMuonTag.h.

◆ m_numPtBins

int CaloMuonTag::m_numPtBins {0}
private

Definition at line 66 of file CaloMuonTag.h.

◆ m_numRejected

std::atomic_int CaloMuonTag::m_numRejected {0}
mutableprivate

Definition at line 69 of file CaloMuonTag.h.

◆ m_numTagged

std::atomic_int CaloMuonTag::m_numTagged {0}
mutableprivate

Definition at line 68 of file CaloMuonTag.h.

◆ m_tagMode

std::string CaloMuonTag::m_tagMode
private

Definition at line 60 of file CaloMuonTag.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vecCutNames

std::vector<std::string> CaloMuonTag::m_vecCutNames
private

Definition at line 63 of file CaloMuonTag.h.

◆ m_vecPtBins

std::vector<int> CaloMuonTag::m_vecPtBins
private

Definition at line 64 of file CaloMuonTag.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
CaloMuonTag::interpolate
double interpolate(const std::string &cutName, double pt) const
Definition: CaloMuonTag.cxx:184
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
plotmaker.hist
hist
Definition: plotmaker.py:148
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CaloMuonTag::m_numRejected
std::atomic_int m_numRejected
Definition: CaloMuonTag.h:69
test_pyathena.pt
pt
Definition: test_pyathena.py:11
CaloMuonTag::m_vecCutNames
std::vector< std::string > m_vecCutNames
Definition: CaloMuonTag.h:63
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
CaloMuonTag::m_vecPtBins
std::vector< int > m_vecPtBins
Definition: CaloMuonTag.h:64
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloMuonTag::getPtBinLow
int getPtBinLow(double pt) const
Definition: CaloMuonTag.cxx:209
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
file
TFile * file
Definition: tile_monitor.h:29
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
CaloMuonTag::m_numPtBins
int m_numPtBins
Definition: CaloMuonTag.h:66
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CaloMuonTag::m_numCuts
int m_numCuts
Definition: CaloMuonTag.h:65
CaloMuonTag::m_numTagged
std::atomic_int m_numTagged
Definition: CaloMuonTag.h:68
CaloMuonTag::getCutBin
int getCutBin(const std::string &cutName) const
Definition: CaloMuonTag.cxx:217
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
CaloMuonTag::m_tagMode
std::string m_tagMode
Definition: CaloMuonTag.h:60
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
CaloMuonTag::getHist
StatusCode getHist(TFile *file, const std::string &histName, std::unique_ptr< TH2 > &hist)
Definition: CaloMuonTag.cxx:55
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
fitman.k
k
Definition: fitman.py:528
CaloMuonTag::m_hist
std::unique_ptr< TH2 > m_hist
Definition: CaloMuonTag.h:59