ATLAS Offline Software
HFOR_Truth.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 #ifndef HFOR_HFOR_Truth_H
6 #define HFOR_HFOR_Truth_H
7 
8 #include <vector>
9 #include <map>
10 #include <string>
11 
12 // Framework include(s):
13 #include "AsgTools/AsgTool.h"
14 
17 
20 
23 
24 #include "xAODJet/JetContainer.h"
26 
28 
30 {
31  public:
32  HFOR_Truth ();
33 
34  //This method will navigate through the MC container, finds final state quarks
35  //and finds if overlaps are present.
36  HFORType findOverlap( const xAOD::TruthEventContainer &truthEvent,const xAOD::JetContainer* jets =nullptr );
37 
38  // This method will determine the type of action (keep or kill the event) using
39  // b and c truth jets.
41 
42  void finalize() ;
43 
44  //Sets the sample type based on the sample DSID
45  void setSampleType(unsigned int runNumber) ;
46 
47  //Helper to get back the current sample type
49 
50  //Helper to get back the name of the current sample (light, bb, cc, c or unknown)
51  std::string getSampleName() ;
52 
53  //Calling this tells the method we want to do jet based removal
55 
56  //Calling this tells the method we want to do angular based removal
58 
59  //Set the size of the cone to be used in the heavy quark classification
60  void setMatchConeSize(double deltaR) ;
61 
62  //Returns the current size of the cone to be used in the heavy quark classification
63  double getMatchConeSize() const ;
64 
65  //Reads a file written according to BOOST property tree with the DSID and type
66  int readRunConfig(std::string runConfigFile) ;
67 
68  //Bookkeeper accessors
69  unsigned long int getNquarks(const std::string& process, int flavor) ;
70  unsigned long int getNclass(HFORType) ;
71 
72  std::map<std::string, std::map<int, std::vector<float> > > getdR() ;
73 
74  private :
75  bool m_debug;
78 
81 
82  double m_matchCone ;
83  std::string m_sampleName ;
85  std::map < HFORType, std::string> m_sampleNameMap ;
86 
87  std::string m_runConfigFile ;
88 
89  std::map < HFORType, std::vector<unsigned int> > m_runConfigMap ;
90 
91  std::map< std::string, std::map <int, std::vector<const xAOD::TruthParticle* > > > m_qq ;
92 
93 
94  //Helper to check the parent type of the b or c quark
95  static std::map<std::string, bool> checkAncestor(const xAOD::TruthParticle* ancestor, const xAOD::TruthParticle* bcQuark) ;
96 
97  // Here we will take the final state quarks found in this event and classify
98  // them as from Matrix Element, Gluon Spliting PDF or MPI.
99  bool findHFQuarks(const std::map <int, std::vector<const xAOD::TruthParticle* > >& fsQuarksMap) ;
100 
101  //Based on the angle between the 2 b or c quarks and it's classification as from
102  //ME or GS the event will be flagged to be killed or kept
103  HFORType angularBasedRemoval( void ) ;
104 
105  //Helper to return if 2 particles are same flavor
106  static bool is_sameFlavor(const xAOD::TruthParticle* x, const xAOD::TruthParticle* y) ;
107 
108  //Helper to return if a given particle is final state particle
109  bool is_FinalState(const xAOD::TruthParticle* bcQuark) const ;
110 
111  //Helper to return if a particle is a proton
112  static bool is_proton(const xAOD::TruthParticle* x) ;
113 
114  //Book-keepers for what the tool is doing
115  //Create a map to hold the number of quarks identifyed
116  std::map<std::string, std::map<int, unsigned long int > > m_Nquarks ;
117  std::map<HFORType, unsigned long int> m_Nclass ;
118  std::map<std::string, std::map<int, std::vector<float> > > m_dR ;
119 
120 };
121 
122 
123 #endif
124 
HFOR_Truth::m_sampleNameMap
std::map< HFORType, std::string > m_sampleNameMap
Definition: HFOR_Truth.h:85
HFOR_Truth
Definition: HFOR_Truth.h:30
HFOR_Truth::finalize
void finalize()
HFOR_Truth::getNquarks
unsigned long int getNquarks(const std::string &process, int flavor)
Definition: HFOR_Truth.cxx:871
HFOR_Truth::is_FinalState
bool is_FinalState(const xAOD::TruthParticle *bcQuark) const
Definition: HFOR_Truth.cxx:295
HFORType
HFORType
Definition: HFORTypes.h:9
TruthParticleContainer.h
HFOR_Truth::m_jetBasedHFOR_pT_min
double m_jetBasedHFOR_pT_min
Definition: HFOR_Truth.h:76
HFOR_Truth::setSampleType
void setSampleType(unsigned int runNumber)
Definition: HFOR_Truth.cxx:687
HFOR_Truth::is_sameFlavor
static bool is_sameFlavor(const xAOD::TruthParticle *x, const xAOD::TruthParticle *y)
Definition: HFOR_Truth.cxx:647
x
#define x
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
HFOR_Truth::readRunConfig
int readRunConfig(std::string runConfigFile)
Definition: HFOR_Truth.cxx:658
HFOR_Truth::m_Nclass
std::map< HFORType, unsigned long int > m_Nclass
Definition: HFOR_Truth.h:117
HFOR_Truth::m_jetBased_HFOR
bool m_jetBased_HFOR
Definition: HFOR_Truth.h:80
TruthParticleAuxContainer.h
HFOR_Truth::m_sampleName
std::string m_sampleName
Definition: HFOR_Truth.h:83
HFOR_Truth::m_angularBased_HFOR
bool m_angularBased_HFOR
Definition: HFOR_Truth.h:79
HFOR_Truth::getSampleName
std::string getSampleName()
Definition: HFOR_Truth.cxx:720
HFOR_Truth::checkAncestor
static std::map< std::string, bool > checkAncestor(const xAOD::TruthParticle *ancestor, const xAOD::TruthParticle *bcQuark)
Definition: HFOR_Truth.cxx:606
HFOR_Truth::m_Nquarks
std::map< std::string, std::map< int, unsigned long int > > m_Nquarks
Definition: HFOR_Truth.h:116
HFOR_Truth::getdR
std::map< std::string, std::map< int, std::vector< float > > > getdR()
Definition: HFOR_Truth.cxx:892
HFOR_Truth::m_dR
std::map< std::string, std::map< int, std::vector< float > > > m_dR
Definition: HFOR_Truth.h:118
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
HFOR_Truth::findHFQuarks
bool findHFQuarks(const std::map< int, std::vector< const xAOD::TruthParticle * > > &fsQuarksMap)
Definition: HFOR_Truth.cxx:343
HFOR_Truth::getNclass
unsigned long int getNclass(HFORType)
Definition: HFOR_Truth.cxx:882
HFOR_Truth::m_sampleType
HFORType m_sampleType
Definition: HFOR_Truth.h:84
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
HFOR_Truth::setMatchConeSize
void setMatchConeSize(double deltaR)
Definition: HFOR_Truth.cxx:728
HFOR_Truth::getSampleType
HFORType getSampleType()
Definition: HFOR_Truth.cxx:712
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
HFOR_Truth::m_qq
std::map< std::string, std::map< int, std::vector< const xAOD::TruthParticle * > > > m_qq
Definition: HFOR_Truth.h:91
HFOR_Truth::m_debug
bool m_debug
Definition: HFOR_Truth.h:75
HFOR_Truth::m_runConfigFile
std::string m_runConfigFile
Definition: HFOR_Truth.h:87
HFOR_Truth::angularBasedRemoval
HFORType angularBasedRemoval(void)
Definition: HFOR_Truth.cxx:752
HFOR_Truth::findOverlap
HFORType findOverlap(const xAOD::TruthEventContainer &truthEvent, const xAOD::JetContainer *jets=nullptr)
Definition: HFOR_Truth.cxx:106
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
y
#define y
JetContainer.h
HFOR_Truth::m_runConfigMap
std::map< HFORType, std::vector< unsigned int > > m_runConfigMap
Definition: HFOR_Truth.h:89
HFORTypes.h
HFOR_Truth::HFOR_Truth
HFOR_Truth()
Definition: HFOR_Truth.cxx:39
TruthEventAuxContainer.h
HFOR_Truth::is_proton
static bool is_proton(const xAOD::TruthParticle *x)
Definition: HFOR_Truth.cxx:637
JetAuxContainer.h
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
HFOR_Truth::m_jetBasedHFOR_eta_max
double m_jetBasedHFOR_eta_max
Definition: HFOR_Truth.h:77
AsgTool.h
HFOR_Truth::m_matchCone
double m_matchCone
Definition: HFOR_Truth.h:82
TruthEventContainer.h
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
HFOR_Truth::jetBasedRemoval
HFORType jetBasedRemoval(const xAOD::JetContainer *jets)
Definition: HFOR_Truth.cxx:193
HFOR_Truth::setAngularBasedHFOR
void setAngularBasedHFOR()
Definition: HFOR_Truth.h:57
HFOR_Truth::getMatchConeSize
double getMatchConeSize() const
Definition: HFOR_Truth.cxx:740
HFOR_Truth::setJetBasedHFOR
void setJetBasedHFOR()
Definition: HFOR_Truth.h:54