ATLAS Offline Software
CalibrationNtupleMakerTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_CALIBRATIONNTUPLEMAKERTOOL_H
5 #define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_CALIBRATIONNTUPLEMAKERTOOL_H
6 
8 
9 #include "xAODJet/JetContainer.h"
12 
13 #include <vector>
14 
15 class TTree;
16 class TH1;
17 
19 
20 public:
21 
23  CalibrationNtupleMakerTool(const std::string& name, ISvcLocator* pSvcLocator);
24 
27 
30 
33 
36 
37  /* book the TTree branches */
38  virtual StatusCode bookTree();
39 
40 private:
41 
42  // Get a data container; implementation at end of this header file
43  template<class T> const T* getContainer( const std::string & containerName);
44 
45  int Matched(const xAOD::Jet* truth, const xAOD::JetContainer* jets, std::vector<const xAOD::Jet*>& matched, int& index) const;
46 
47  static double DRmin(const xAOD::Jet* myjet, const xAOD::JetContainer* jets, double PtMin);
48 
49  float DetectorEta(const xAOD::Jet* jet);
50 
51 
52  std::vector < std::string > m_collectionNames;
53  std::map < std::string, TTree* > m_trees;
54  std::string m_treeFolder;
55  std::string m_treeDescription;
56 
58  std::string m_vertexContainerName;
59 
60  double m_recoIsoDR;
62  double m_trueIsoDR;
64 
65  double m_matchingCut;
66 
67  TH1* m_h_events;
68 
69  float m_eventWeight = 0.0F;
70  float m_mu = 0.0F;
71  float m_npv = 0.0F;
72 
73  std::vector < int >* m_index;
74 
75  std::vector < double >* m_etaCalo;
76  std::vector < double >* m_etaDetCalo;
77  std::vector < double >* m_phiCalo;
78  std::vector < double >* m_eCalo;
79  std::vector < double >* m_mCalo;
80 
81  std::vector < double >* m_etaCorr;
82  std::vector < double >* m_etaDetCorr;
83  std::vector < double >* m_phiCorr;
84  std::vector < double >* m_eCorr;
85  std::vector < double >* m_mCorr;
86 
87  std::vector < double >* m_etaTrue;
88  std::vector < double >* m_phiTrue;
89  std::vector < double >* m_eTrue;
90  std::vector < double >* m_mTrue;
91 
92  // EventInfo
93  SG::ReadHandleKey<xAOD::EventInfo> m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"};
94 
95 };
96 
97 template<class T>
98 inline const T* CalibrationNtupleMakerTool::getContainer(const std::string & containerName){
99  const T * ptr = evtStore()->retrieve< const T >( containerName );
100  if (!ptr) {
101  ATH_MSG_WARNING("Container '"<<containerName<<"' could not be retrieved");
102  }
103  return ptr;
104 }
105 
106 
107 #endif // TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_CALIBRATIONNTUPLEMAKERTOOL_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CalibrationNtupleMakerTool::m_trueIsoDR
double m_trueIsoDR
Definition: CalibrationNtupleMakerTool.h:62
CalibrationNtupleMakerTool::initialize
StatusCode initialize()
standard Athena-Algorithm method
Definition: CalibrationNtupleMakerTool.cxx:79
CalibrationNtupleMakerTool::m_etaDetCalo
std::vector< double > * m_etaDetCalo
Definition: CalibrationNtupleMakerTool.h:76
CalibrationNtupleMakerTool::m_collectionNames
std::vector< std::string > m_collectionNames
Definition: CalibrationNtupleMakerTool.h:52
index
Definition: index.py:1
CalibrationNtupleMakerTool::m_etaCorr
std::vector< double > * m_etaCorr
Definition: CalibrationNtupleMakerTool.h:81
CalibrationNtupleMakerTool::m_recoIsoPtCut
double m_recoIsoPtCut
Definition: CalibrationNtupleMakerTool.h:61
CalibrationNtupleMakerTool::m_etaCalo
std::vector< double > * m_etaCalo
Definition: CalibrationNtupleMakerTool.h:75
CalibrationNtupleMakerTool::~CalibrationNtupleMakerTool
virtual ~CalibrationNtupleMakerTool()
Default Destructor.
CalibrationNtupleMakerTool::DRmin
static double DRmin(const xAOD::Jet *myjet, const xAOD::JetContainer *jets, double PtMin)
Definition: CalibrationNtupleMakerTool.cxx:287
CalibrationNtupleMakerTool::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition: CalibrationNtupleMakerTool.h:93
CalibrationNtupleMakerTool::m_eTrue
std::vector< double > * m_eTrue
Definition: CalibrationNtupleMakerTool.h:89
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
SG::ReadHandleKey< xAOD::EventInfo >
RunExEngineTest.PtMin
PtMin
Definition: RunExEngineTest.py:49
CalibrationNtupleMakerTool::m_vertexContainerName
std::string m_vertexContainerName
Definition: CalibrationNtupleMakerTool.h:58
AthAlgorithm.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CalibrationNtupleMakerTool::m_index
std::vector< int > * m_index
Definition: CalibrationNtupleMakerTool.h:73
CalibrationNtupleMakerTool::m_trueIsoPtCut
double m_trueIsoPtCut
Definition: CalibrationNtupleMakerTool.h:63
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
CalibrationNtupleMakerTool::finalize
StatusCode finalize()
standard Athena-Algorithm method
Definition: CalibrationNtupleMakerTool.cxx:332
CalibrationNtupleMakerTool::getContainer
const T * getContainer(const std::string &containerName)
Definition: CalibrationNtupleMakerTool.h:98
CalibrationNtupleMakerTool::m_treeFolder
std::string m_treeFolder
Definition: CalibrationNtupleMakerTool.h:54
CalibrationNtupleMakerTool::m_phiTrue
std::vector< double > * m_phiTrue
Definition: CalibrationNtupleMakerTool.h:88
CalibrationNtupleMakerTool::m_eventWeight
float m_eventWeight
Definition: CalibrationNtupleMakerTool.h:69
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CalibrationNtupleMakerTool::m_npv
float m_npv
Definition: CalibrationNtupleMakerTool.h:71
CalibrationNtupleMakerTool::m_recoIsoDR
double m_recoIsoDR
Definition: CalibrationNtupleMakerTool.h:60
CalibrationNtupleMakerTool::m_mCorr
std::vector< double > * m_mCorr
Definition: CalibrationNtupleMakerTool.h:85
CalibrationNtupleMakerTool::m_treeDescription
std::string m_treeDescription
Definition: CalibrationNtupleMakerTool.h:55
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
CalibrationNtupleMakerTool::DetectorEta
float DetectorEta(const xAOD::Jet *jet)
Definition: CalibrationNtupleMakerTool.cxx:299
CalibrationNtupleMakerTool::m_eCorr
std::vector< double > * m_eCorr
Definition: CalibrationNtupleMakerTool.h:84
CalibrationNtupleMakerTool::m_phiCalo
std::vector< double > * m_phiCalo
Definition: CalibrationNtupleMakerTool.h:77
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CalibrationNtupleMakerTool::m_trees
std::map< std::string, TTree * > m_trees
Definition: CalibrationNtupleMakerTool.h:53
CalibrationNtupleMakerTool::bookTree
virtual StatusCode bookTree()
Definition: CalibrationNtupleMakerTool.cxx:93
python.ElectronD3PDObject.matched
matched
Definition: ElectronD3PDObject.py:138
CalibrationNtupleMakerTool::m_h_events
TH1 * m_h_events
Definition: CalibrationNtupleMakerTool.h:67
EventInfo.h
CalibrationNtupleMakerTool::Matched
int Matched(const xAOD::Jet *truth, const xAOD::JetContainer *jets, std::vector< const xAOD::Jet * > &matched, int &index) const
Definition: CalibrationNtupleMakerTool.cxx:263
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
CalibrationNtupleMakerTool::m_eCalo
std::vector< double > * m_eCalo
Definition: CalibrationNtupleMakerTool.h:78
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CalibrationNtupleMakerTool
Definition: CalibrationNtupleMakerTool.h:18
CalibrationNtupleMakerTool::m_mCalo
std::vector< double > * m_mCalo
Definition: CalibrationNtupleMakerTool.h:79
CalibrationNtupleMakerTool::execute
StatusCode execute()
standard Athena-Algorithm method
Definition: CalibrationNtupleMakerTool.cxx:159
CalibrationNtupleMakerTool::m_truthJetContainerName
std::string m_truthJetContainerName
Definition: CalibrationNtupleMakerTool.h:57
CalibrationNtupleMakerTool::m_phiCorr
std::vector< double > * m_phiCorr
Definition: CalibrationNtupleMakerTool.h:83
CalibrationNtupleMakerTool::m_mTrue
std::vector< double > * m_mTrue
Definition: CalibrationNtupleMakerTool.h:90
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
CalibrationNtupleMakerTool::m_etaDetCorr
std::vector< double > * m_etaDetCorr
Definition: CalibrationNtupleMakerTool.h:82
CalibrationNtupleMakerTool::m_matchingCut
double m_matchingCut
Definition: CalibrationNtupleMakerTool.h:65
CalibrationNtupleMakerTool::CalibrationNtupleMakerTool
CalibrationNtupleMakerTool(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: CalibrationNtupleMakerTool.cxx:33
CalibrationNtupleMakerTool::m_etaTrue
std::vector< double > * m_etaTrue
Definition: CalibrationNtupleMakerTool.h:87
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
CalibrationNtupleMakerTool::m_mu
float m_mu
Definition: CalibrationNtupleMakerTool.h:70