ATLAS Offline Software
ParticleLevelLoader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 // Filename: ParticleLevelLoader.h
6 // Description:
7 // Author: Fabian Wilk
8 // Created: Sun Feb 22 13:09:33 2015
9 
10 #ifndef _TOP_PARTICLELEVEL_EVENTLOADER_H_
11 #define _TOP_PARTICLELEVEL_EVENTLOADER_H_
12 
13 #include <memory>
14 
17 
18 #include "AsgTools/AsgTool.h"
19 
20 #include "xAODCore/ShallowCopy.h"
21 
22 #include "xAODJet/Jet.h"
23 #include "xAODJet/JetContainer.h"
25 
29 
32 
33 // Forward Declarations
34 namespace top {
35  class ParticleLevelEvent;
36  class TopConfig;
37 }
38 
39 namespace top {
53  class ParticleLevelLoader final: public asg::AsgTool {
54  public:
58  ParticleLevelLoader(const std::shared_ptr<top::TopConfig>& cfg);
59 
63  virtual ~ParticleLevelLoader();
64 
74 
80  bool active() const {return m_active;}
81  protected:
83  std::unique_ptr<xAOD::TruthParticleContainer>& store,
84  std::unique_ptr<xAOD::ShallowAuxContainer>& storeAux) const;
85 
87  const xAOD::TruthParticleContainer& dressedParticles,
88  const float dressingCone = 0.1) const;
89  private:
90  // The global config object
91  const std::shared_ptr<top::TopConfig>& m_config;
92 
93  // The tools used for electron, muon, and jet object selection. The
94  // basic idea is to allow exchanging these tools for custom ones,
95  // however, this is not implemented (yet).
96  std::unique_ptr<ObjectSelectorBase<xAOD::TruthParticle> > m_objectSelector_Electron;
97  std::unique_ptr<ObjectSelectorBase<xAOD::TruthParticle> > m_objectSelector_Muon;
98  std::unique_ptr<ObjectSelectorBase<xAOD::TruthParticle> > m_objectSelector_Photon;
99  std::unique_ptr<ObjectSelectorBase<xAOD::Jet> > m_objectSelector_Jet;
100  std::unique_ptr<ObjectSelectorBase<xAOD::Jet> > m_objectSelector_LargeRJet;
101  std::unique_ptr<ObjectSelectorBase<xAOD::TruthParticle> > m_objectSelector_Tau;
102  std::unique_ptr<ParticleLevelRCJetObjectLoader> m_particleLevelRCJetObjectLoader;
103  std::map<std::string, std::unique_ptr<ParticleLevelRCJetObjectLoader> > m_particleLevelVarRCJetObjectLoader;
104  std::vector<std::string> m_VarRCJetRho;
105  std::vector<std::string> m_VarRCJetMassScale;
106  private:
107  // The dressed leptons (shallow copies of the input containers)
108  std::unique_ptr<xAOD::TruthParticleContainer> m_electronsDressed;
109  std::unique_ptr<xAOD::ShallowAuxContainer> m_electronsDressedAux;
110 
111  std::unique_ptr<xAOD::TruthParticleContainer> m_muonsDressed;
112  std::unique_ptr<xAOD::ShallowAuxContainer> m_muonsDressedAux;
113 
114  std::unique_ptr<xAOD::TruthParticleContainer> m_goodElectrons;
115  std::unique_ptr<xAOD::TruthParticleAuxContainer> m_goodElectronsAux;
116 
117  std::unique_ptr<xAOD::TruthParticleContainer> m_goodMuons;
118  std::unique_ptr<xAOD::TruthParticleAuxContainer> m_goodMuonsAux;
119 
120  std::unique_ptr<xAOD::TruthParticleContainer> m_goodSoftMuons;
121  std::unique_ptr<xAOD::TruthParticleAuxContainer> m_goodSoftMuonsAux;
122 
123  std::unique_ptr<xAOD::TruthParticleContainer> m_goodPhotons;
124  std::unique_ptr<xAOD::TruthParticleAuxContainer> m_goodPhotonsAux;
125 
126  std::unique_ptr<xAOD::JetContainer> m_goodJets;
127  std::unique_ptr<xAOD::JetAuxContainer> m_goodJetsAux;
128 
129  std::unique_ptr<xAOD::JetContainer> m_goodLargeRJets;
130  std::unique_ptr<xAOD::JetAuxContainer> m_goodLargeRJetsAux;
131 
132  std::unique_ptr<xAOD::TruthParticleContainer> m_goodTaus;
133  std::unique_ptr<xAOD::TruthParticleAuxContainer> m_goodTausAux;
134 
135  // Flag denoting whether the loader tool is active. Will be set by the
136  // constructor and remains unchanged afterwards.
137  const bool m_active;
138  };
139 }
140 
141 #endif /* _TOP_PARTICLELEVEL_EVENTLOADER_H_ */
top::ParticleLevelLoader::m_goodPhotons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodPhotons
Definition: ParticleLevelLoader.h:123
ShallowCopy.h
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
top::ParticleLevelLoader::m_goodSoftMuons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodSoftMuons
Definition: ParticleLevelLoader.h:120
top::ParticleLevelLoader::m_goodLargeRJets
std::unique_ptr< xAOD::JetContainer > m_goodLargeRJets
Definition: ParticleLevelLoader.h:129
Jet.h
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::ParticleLevelLoader::m_objectSelector_Photon
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Photon
Definition: ParticleLevelLoader.h:98
top::ParticleLevelLoader::m_active
const bool m_active
Definition: ParticleLevelLoader.h:137
TruthParticleContainer.h
top::ParticleLevelLoader::m_goodMuonsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodMuonsAux
Definition: ParticleLevelLoader.h:118
top::ParticleLevelLoader::loadDressedLeptons
bool loadDressedLeptons(const xAOD::TruthParticleContainer &input, std::unique_ptr< xAOD::TruthParticleContainer > &store, std::unique_ptr< xAOD::ShallowAuxContainer > &storeAux) const
Definition: ParticleLevelLoader.cxx:794
top::ParticleLevelLoader::m_goodTaus
std::unique_ptr< xAOD::TruthParticleContainer > m_goodTaus
Definition: ParticleLevelLoader.h:132
top::ParticleLevelLoader
Loading tool which creates a particle level event object.
Definition: ParticleLevelLoader.h:53
TruthParticleAuxContainer.h
top::ParticleLevelLoader::m_goodSoftMuonsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodSoftMuonsAux
Definition: ParticleLevelLoader.h:121
top::ParticleLevelLoader::m_particleLevelRCJetObjectLoader
std::unique_ptr< ParticleLevelRCJetObjectLoader > m_particleLevelRCJetObjectLoader
Definition: ParticleLevelLoader.h:102
top::ParticleLevelLoader::m_particleLevelVarRCJetObjectLoader
std::map< std::string, std::unique_ptr< ParticleLevelRCJetObjectLoader > > m_particleLevelVarRCJetObjectLoader
Definition: ParticleLevelLoader.h:103
top::ParticleLevelLoader::m_electronsDressedAux
std::unique_ptr< xAOD::ShallowAuxContainer > m_electronsDressedAux
Definition: ParticleLevelLoader.h:109
top::ParticleLevelLoader::m_muonsDressedAux
std::unique_ptr< xAOD::ShallowAuxContainer > m_muonsDressedAux
Definition: ParticleLevelLoader.h:112
top::ParticleLevelLoader::m_objectSelector_Jet
std::unique_ptr< ObjectSelectorBase< xAOD::Jet > > m_objectSelector_Jet
Definition: ParticleLevelLoader.h:99
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
top::ParticleLevelLoader::m_goodMuons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodMuons
Definition: ParticleLevelLoader.h:117
top::ParticleLevelEvent
Definition: ParticleLevelEvent.h:24
top::ParticleLevelLoader::m_objectSelector_Tau
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Tau
Definition: ParticleLevelLoader.h:101
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
top::ParticleLevelLoader::m_objectSelector_LargeRJet
std::unique_ptr< ObjectSelectorBase< xAOD::Jet > > m_objectSelector_LargeRJet
Definition: ParticleLevelLoader.h:100
top::ParticleLevelLoader::m_muonsDressed
std::unique_ptr< xAOD::TruthParticleContainer > m_muonsDressed
Definition: ParticleLevelLoader.h:111
top::ParticleLevelLoader::active
bool active() const
Function that can be used to test whether the ParticleLevelLoader is active.
Definition: ParticleLevelLoader.h:80
top::ParticleLevelLoader::m_goodPhotonsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodPhotonsAux
Definition: ParticleLevelLoader.h:124
MissingET.h
top::ParticleLevelLoader::m_electronsDressed
std::unique_ptr< xAOD::TruthParticleContainer > m_electronsDressed
Definition: ParticleLevelLoader.h:108
top::ParticleLevelLoader::load
ParticleLevelEvent load()
Loading function.
Definition: ParticleLevelLoader.cxx:225
ObjectSelectorBase.h
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
top::ParticleLevelLoader::m_goodElectrons
std::unique_ptr< xAOD::TruthParticleContainer > m_goodElectrons
Definition: ParticleLevelLoader.h:114
top::ParticleLevelLoader::m_goodJets
std::unique_ptr< xAOD::JetContainer > m_goodJets
Definition: ParticleLevelLoader.h:126
top::ParticleLevelLoader::m_VarRCJetRho
std::vector< std::string > m_VarRCJetRho
Definition: ParticleLevelLoader.h:104
top::ParticleLevelLoader::m_goodLargeRJetsAux
std::unique_ptr< xAOD::JetAuxContainer > m_goodLargeRJetsAux
Definition: ParticleLevelLoader.h:130
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
top::ParticleLevelLoader::m_objectSelector_Muon
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Muon
Definition: ParticleLevelLoader.h:97
JetContainer.h
top::ParticleLevelLoader::m_VarRCJetMassScale
std::vector< std::string > m_VarRCJetMassScale
Definition: ParticleLevelLoader.h:105
top::ParticleLevelLoader::m_goodJetsAux
std::unique_ptr< xAOD::JetAuxContainer > m_goodJetsAux
Definition: ParticleLevelLoader.h:127
top::ParticleLevelLoader::ParticleLevelLoader
ParticleLevelLoader(const std::shared_ptr< top::TopConfig > &cfg)
Constructor of the loader tool.
Definition: ParticleLevelLoader.cxx:36
JetAuxContainer.h
top::ParticleLevelLoader::m_goodElectronsAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodElectronsAux
Definition: ParticleLevelLoader.h:115
top::ParticleLevelLoader::m_goodTausAux
std::unique_ptr< xAOD::TruthParticleAuxContainer > m_goodTausAux
Definition: ParticleLevelLoader.h:133
AsgTool.h
TruthParticle.h
top::ParticleLevelLoader::~ParticleLevelLoader
virtual ~ParticleLevelLoader()
Destructor of the loader tool.
Definition: ParticleLevelLoader.cxx:223
ParticleLevelRCJetObjectLoader.h
MissingETContainer.h
top::ParticleLevelLoader::m_objectSelector_Electron
std::unique_ptr< ObjectSelectorBase< xAOD::TruthParticle > > m_objectSelector_Electron
Definition: ParticleLevelLoader.h:96
top::ParticleLevelLoader::m_config
const std::shared_ptr< top::TopConfig > & m_config
Definition: ParticleLevelLoader.h:91
top::ParticleLevelLoader::isDressingPhoton
bool isDressingPhoton(const xAOD::TruthParticle &photon, const xAOD::TruthParticleContainer &dressedParticles, const float dressingCone=0.1) const
Definition: ParticleLevelLoader.cxx:826