00001
00002 #ifndef SUSYTOOLS_SUSYOBJDEF_XAODTOOL_H
00003 #define SUSYTOOLS_SUSYOBJDEF_XAODTOOL_H
00004
00005
00006 #include "AsgTools/IAsgTool.h"
00007
00008
00009 #include "xAODEgamma/Electron.h"
00010 #include "xAODEgamma/ElectronContainer.h"
00011 #include "xAODMuon/Muon.h"
00012 #include "xAODMuon/MuonContainer.h"
00013 #include "xAODTracking/TrackingPrimitives.h"
00014 #include "xAODTracking/Vertex.h"
00015 #include "xAODJet/Jet.h"
00016 #include "xAODJet/JetContainer.h"
00017 #include "xAODEgamma/Photon.h"
00018 #include "xAODEgamma/PhotonContainer.h"
00019 #include "xAODTau/TauJet.h"
00020 #include "xAODTau/TauJetContainer.h"
00021 #include "xAODEventInfo/EventInfo.h"
00022 #include "xAODJet/JetTypes.h"
00023 #include "xAODMissingET/MissingET.h"
00024 #include "xAODMissingET/MissingETContainer.h"
00025 #include "xAODCore/ShallowCopy.h"
00026 #include "xAODTruth/TruthParticleContainer.h"
00027 #include "xAODTruth/TruthEvent.h"
00028 #include "TrigDecisionTool/ChainGroup.h"
00029
00030
00031 #include "PATInterfaces/CorrectionCode.h"
00032 #include "PATInterfaces/ISystematicsTool.h"
00033
00034 #include "MCTruthClassifier/MCTruthClassifier.h"
00035
00036 namespace ST {
00037
00038 struct SystInfo{
00039 CP::SystematicSet systset;
00040 bool affectsKinematics;
00041 bool affectsWeights;
00042 unsigned int affectsType;
00043 std::set<unsigned int> affectedWeights;
00044 };
00045
00046
00047 enum SystObjType {
00048 Unknown = 0,
00049 Jet,
00050 Egamma,
00051 Electron,
00052 Photon,
00053 Muon,
00054 Tau,
00055 BTag,
00056 MET_TST,
00057 MET_CST,
00058 MET_Track,
00059 EventWeight
00060 };
00061
00062
00063
00064
00065
00066 namespace Weights {
00067 static const unsigned int Unknown = 0;
00068
00069 namespace Jet {
00070 static const unsigned int Btag = 1001;
00071 static const unsigned int JVT = 1002;
00072 }
00073
00074 namespace Muon {
00075 static const unsigned int Reconstruction = 1101;
00076 static const unsigned int Isolation = 1102;
00077 static const unsigned int ID = 1103;
00078 static const unsigned int Trigger = 1104;
00079 }
00080
00081 namespace Electron {
00082 static const unsigned int Reconstruction = 1201;
00083 static const unsigned int Isolation = 1202;
00084 static const unsigned int ID = 1203;
00085 static const unsigned int Trigger = 1204;
00086 static const unsigned int ChargeID = 1205;
00087 }
00088
00089 namespace Tau {
00090 static const unsigned int Reconstruction = 1301;
00091 static const unsigned int Trigger = 1302;
00092 }
00093
00094 namespace Photon {
00095 static const unsigned int Reconstruction = 1401;
00096 static const unsigned int Isolation = 1402;
00097 static const unsigned int ID = 1403;
00098 static const unsigned int Trigger = 1404;
00099 }
00100 }
00101
00102 static const double DUMMYDEF = -999.;
00103
00104
00105 static inline bool testAffectsObject(xAOD::Type::ObjectType type, unsigned int test) {
00106 switch(test) {
00107 case Jet: return (type==xAOD::Type::Jet);
00108 case Egamma: return (type==xAOD::Type::Electron||type==xAOD::Type::Photon);
00109 case Electron: return (type==xAOD::Type::Electron);
00110 case Photon: return (type==xAOD::Type::Photon);
00111 case Muon: return (type==xAOD::Type::Muon);
00112 case Tau: return (type==xAOD::Type::Tau);
00113 case BTag: return (type==xAOD::Type::BTag);
00114 default: break;
00115 }
00116 return false;
00117 }
00118
00119
00120 static inline std::string testAffectsObject(unsigned int test) {
00121 switch(test) {
00122 case Jet: return "Jet";
00123 case Egamma: return "Egamma";
00124 case Electron: return "Electron";
00125 case Photon: return "Photon";
00126 case Muon: return "Muon";
00127 case Tau: return "Tau";
00128 case MET_TST:
00129 case MET_CST:
00130 case MET_Track: return "MET";
00131 case EventWeight: return "EventWeight";
00132 default: break;
00133 }
00134 return "Unknown";
00135 }
00136
00137
00138
00139
00140
00141
00142
00143 class ISUSYObjDef_xAODTool : public virtual asg::IAsgTool {
00144
00145
00146 ASG_TOOL_INTERFACE( ST::ISUSYObjDef_xAODTool )
00147
00148 public:
00149 virtual StatusCode readConfig() = 0;
00150
00151 virtual int getMCShowerType(const std::string& sample_name="") const = 0;
00152
00153
00154 virtual StatusCode setBoolProperty(const std::string& name, const bool& property) = 0;
00155
00156
00157 virtual StatusCode FillMuon(xAOD::Muon& input, const float ptcut, const float etacut) = 0;
00158 virtual StatusCode FillJet(xAOD::Jet& input, const bool doCalib = true, const bool isFat = false) = 0;
00159 virtual StatusCode FillTau(xAOD::TauJet& input) = 0;
00160 virtual StatusCode FillElectron(xAOD::Electron& input, const float etcut, const float etacut) = 0;
00161 virtual StatusCode FillPhoton(xAOD::Photon& input, const float ptcut, const float etacut) = 0;
00162
00163 virtual const xAOD::Vertex* GetPrimVtx() const = 0;
00164
00165 virtual StatusCode GetJets(xAOD::JetContainer*& copy,xAOD::ShallowAuxContainer*& copyaux,const bool recordSG=false, const std::string& jetkey="", const xAOD::JetContainer* containerToBeCopied = 0) = 0;
00166 virtual StatusCode GetJetsSyst(const xAOD::JetContainer& calibjets,xAOD::JetContainer*& copy,xAOD::ShallowAuxContainer*& copyaux, const bool recordSG=false, const std::string& jetkey="") = 0;
00167 virtual StatusCode GetFatJets(xAOD::JetContainer*& copy, xAOD::ShallowAuxContainer*& copyaux, const bool recordSG = false, const std::string& jetkey = "", const bool doLargeRdecorations = false, const xAOD::JetContainer* containerToBeCopied = 0) = 0;
00168 virtual StatusCode GetTaus(xAOD::TauJetContainer*& copy,xAOD::ShallowAuxContainer*& copyaux,const bool recordSG=false,const std::string& taukey="TauJets", const xAOD::TauJetContainer* containerToBeCopied = 0) = 0;
00169 virtual StatusCode GetMuons(xAOD::MuonContainer*& copy,xAOD::ShallowAuxContainer*& copyaux,const bool recordSG=false,const std::string& muonkey="Muons", const xAOD::MuonContainer* containerToBeCopied = 0) = 0;
00170 virtual StatusCode GetElectrons(xAOD::ElectronContainer*& copy,xAOD::ShallowAuxContainer*& copyaux,const bool recordSG=false,const std::string& elekey="Electrons", const xAOD::ElectronContainer* containerToBeCopied = 0) = 0;
00171 virtual StatusCode GetPhotons(xAOD::PhotonContainer*& copy,xAOD::ShallowAuxContainer*& copyaux,const bool recordSG=false,const std::string& photonkey="Photons", const xAOD::PhotonContainer* containerToBeCopied = 0) = 0;
00172 virtual StatusCode GetMET(xAOD::MissingETContainer& met,
00173 const xAOD::JetContainer* jet,
00174 const xAOD::ElectronContainer* elec = 0,
00175 const xAOD::MuonContainer* muon = 0,
00176 const xAOD::PhotonContainer* gamma = 0,
00177 const xAOD::TauJetContainer* taujet = 0,
00178 bool doTST=true, bool doJVTCut=true,
00179 const xAOD::IParticleContainer* invis = 0) = 0;
00180
00181 virtual StatusCode GetTrackMET(xAOD::MissingETContainer& met,
00182 const xAOD::JetContainer* jet,
00183 const xAOD::ElectronContainer* elec = 0,
00184 const xAOD::MuonContainer* muon = 0
00185
00186
00187 ) = 0;
00188
00189 virtual StatusCode setRunNumber(const int run_number) = 0;
00190
00191
00192
00193 virtual bool IsSignalJet(const xAOD::Jet& input, const float ptcut, const float etacut) const = 0;
00194
00195 virtual bool IsBadJet(const xAOD::Jet& input) const = 0;
00196
00197 virtual bool IsBJetLoose(const xAOD::Jet& input) const = 0;
00198 virtual bool JetPassJVT(xAOD::Jet& input, bool update_jvt) = 0;
00199
00200 virtual bool IsHighPtMuon(const xAOD::Muon& input) const = 0;
00201
00202 virtual bool IsSignalMuon(const xAOD::Muon& input, const float ptcut, const float d0sigcut, const float z0cut, const float etacut = DUMMYDEF) const = 0;
00203
00204 virtual bool IsSignalElectron(const xAOD::Electron& input, const float etcut, const float d0sigcut, const float z0cut, const float etacut = DUMMYDEF) const = 0;
00205
00206 virtual bool IsCosmicMuon(const xAOD::Muon& input,const float z0cut, const float d0cut) const = 0;
00207
00208 virtual bool IsSignalTau(const xAOD::TauJet& input, const float ptcut, const float etacut) const = 0;
00209
00210 virtual bool IsBadMuon(const xAOD::Muon& input, const float qopcut) const = 0;
00211
00212 virtual bool IsSignalPhoton(const xAOD::Photon& input, const float ptcut, const float etacut = DUMMYDEF) const = 0;
00213
00214
00215
00216 virtual bool IsBJet(const xAOD::Jet& input) const = 0;
00217
00218 virtual bool IsTruthBJet(const xAOD::Jet& input) const = 0;
00219
00220 virtual int IsBJetContinuous(const xAOD::Jet& input) const = 0;
00221
00222 virtual double JVT_SF(const xAOD::JetContainer* jets) = 0;
00223
00224 virtual double JVT_SFsys(const xAOD::JetContainer* jets, const CP::SystematicSet& systConfig) = 0;
00225
00226 virtual float BtagSF(const xAOD::JetContainer* jets) const = 0;
00227
00228 virtual float BtagSFsys(const xAOD::JetContainer* jets, const CP::SystematicSet& systConfig) = 0;
00229
00230 virtual float GetSignalMuonSF(const xAOD::Muon& mu, const bool recoSF = true, const bool isoSF = true, const bool doBadMuonHP = true, const bool warnOVR = true) = 0;
00231
00232 virtual float GetSignalElecSF(const xAOD::Electron& el, const bool recoSF = true, const bool idSF = true, const bool triggerSF = true, const bool isoSF = true, const std::string& trigExpr = "e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose", const bool chfSF = false) = 0;
00233
00234 virtual double GetEleTriggerEfficiency(const xAOD::Electron& el, const std::string& trigExpr = "e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose") const = 0;
00235
00236 virtual double GetEleTriggerEfficiencySF(const xAOD::Electron& el, const std::string& trigExpr = "e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose") const = 0;
00237
00238
00239 virtual double GetMuonTriggerEfficiency(const xAOD::Muon& mu, const std::string& trigExpr = "HLT_mu20_iloose_L1MU15_OR_HLT_mu50", const bool isdata = false) = 0;
00240
00241
00242
00243 virtual double GetTotalMuonTriggerSF(const xAOD::MuonContainer& sfmuons, const std::string& trigExpr) = 0;
00244
00245 virtual double GetTotalMuonSF(const xAOD::MuonContainer& muons, const bool recoSF = true, const bool isoSF = true, const std::string& trigExpr = "HLT_mu20_iloose_L1MU15_OR_HLT_mu50", const bool bmhptSF = true) = 0;
00246
00247 virtual float GetTotalElectronSF(const xAOD::ElectronContainer& electrons, const bool recoSF = true, const bool idSF = true, const bool triggerSF = true, const bool isoSF = true, const std::string& trigExpr = "singleLepton", const bool chfSF = false) = 0;
00248
00249 virtual double GetTotalMuonSFsys(const xAOD::MuonContainer& muons, const CP::SystematicSet& systConfig, const bool recoSF = true, const bool isoSF = true, const std::string& trigExpr = "HLT_mu20_iloose_L1MU15_OR_HLT_mu50", const bool bmhptSF = true) = 0;
00250
00251 virtual float GetTotalElectronSFsys(const xAOD::ElectronContainer& electrons, const CP::SystematicSet& systConfig, const bool recoSF = true, const bool idSF = true, const bool triggerSF = true, const bool isoSF = true, const std::string& trigExpr = "singleLepton", const bool chfSF = false) = 0;
00252
00253 virtual double GetSignalTauSF(const xAOD::TauJet& tau, const bool idSF = true, const bool triggerSF = true, const std::string& trigExpr = "tau25_medium1_tracktwo") = 0;
00254
00255 virtual double GetSignalTauSFsys(const xAOD::TauJet& tau, const CP::SystematicSet& systConfig, const bool idSF = true, const bool triggerSF = true, const std::string& trigExpr = "tau25_medium1_tracktwo") = 0;
00256
00257 virtual double GetTauTriggerEfficiencySF(const xAOD::TauJet& tau, const std::string& trigExpr = "tau25_medium1_tracktwo") = 0;
00258
00259 virtual double GetTotalTauSF(const xAOD::TauJetContainer& taus, const bool idSF = true, const bool triggerSF = true, const std::string& trigExpr = "tau25_medium1_tracktwo") = 0;
00260
00261 virtual double GetTotalTauSFsys(const xAOD::TauJetContainer& taus, const CP::SystematicSet& systConfig, const bool idSF = true, const bool triggerSF = true, const std::string& trigExpr = "tau25_medium1_tracktwo") = 0;
00262
00263 virtual double GetSignalPhotonSF(const xAOD::Photon& ph, const bool effSF = true, const bool isoSF = true) const = 0;
00264
00265 virtual double GetSignalPhotonSFsys(const xAOD::Photon& ph, const CP::SystematicSet& systConfig, const bool effSF = true, const bool isoSF = true) = 0;
00266
00267 virtual double GetTotalPhotonSF(const xAOD::PhotonContainer& photons, const bool effSF = true, const bool isoSF = true) const = 0;
00268
00269 virtual double GetTotalPhotonSFsys(const xAOD::PhotonContainer& photons, const CP::SystematicSet& systConfig, const bool effSF = true, const bool isoSF = true) = 0;
00270
00271 virtual double GetTotalJetSF(const xAOD::JetContainer* jets, const bool btagSF = true, const bool jvtSF = true) = 0;
00272
00273 virtual double GetTotalJetSFsys(const xAOD::JetContainer* jets, const CP::SystematicSet& systConfig, const bool btagSF = true, const bool jvtSF = true) = 0;
00274
00275 virtual bool IsMETTrigPassed(unsigned int runnumber = 0, bool j400_OR = false) const = 0;
00276 virtual bool IsMETTrigPassed(const std::string& triggerName, bool j400_OR = false) const = 0;
00277
00278 virtual bool IsTrigPassed(const std::string&, unsigned int condition=TrigDefs::Physics) const = 0;
00279
00280 virtual bool IsTrigMatched(const xAOD::IParticle *part, const std::string& tr_item) = 0;
00281 virtual bool IsTrigMatched(const xAOD::IParticle *part1, const xAOD::IParticle *part2, const std::string& tr_item) = 0;
00282 virtual bool IsTrigMatched(const std::vector<const xAOD::IParticle*>& v, const std::string& tr_item) = 0;
00283 virtual bool IsTrigMatched(const std::initializer_list<const xAOD::IParticle*> &v, const std::string& tr_item) = 0;
00284
00285 virtual void TrigMatch(const xAOD::IParticle* p, std::initializer_list<std::string>::iterator, std::initializer_list<std::string>::iterator) = 0;
00286 virtual void TrigMatch(const xAOD::IParticle* p, const std::vector<std::string>& items) = 0;
00287 virtual void TrigMatch(const xAOD::IParticle* p, const std::initializer_list<std::string>& items) = 0;
00288 virtual void TrigMatch(const xAOD::IParticleContainer* v, const std::vector<std::string>& items) = 0;
00289 virtual void TrigMatch(const xAOD::IParticleContainer* v, const std::initializer_list<std::string>& items) = 0;
00290 virtual void TrigMatch(const std::initializer_list<const xAOD::IParticle*>& v, const std::vector<std::string>& items) = 0;
00291 virtual void TrigMatch(const std::initializer_list<const xAOD::IParticle*>& v, const std::initializer_list<std::string>& items) = 0;
00292 virtual void TrigMatch(const xAOD::IParticle* p, const std::string& item) = 0;
00293 virtual void TrigMatch(const xAOD::IParticleContainer* v, const std::string& item) = 0;
00294 virtual void TrigMatch(const std::initializer_list<const xAOD::IParticle*> &v, const std::string& item) = 0;
00295
00296
00297 virtual float GetTrigPrescale(const std::string&) const = 0;
00298
00299 virtual const Trig::ChainGroup* GetTrigChainGroup(const std::string&) const = 0;
00300
00301 virtual float GetPileupWeight() = 0;
00302
00303 virtual ULong64_t GetPileupWeightHash( ) = 0;
00304
00305 virtual float GetDataWeight(const std::string&) = 0;
00306
00307 virtual float GetCorrectedAverageInteractionsPerCrossing() = 0;
00308
00309 virtual double GetSumOfWeights(int channel) = 0;
00310
00311 virtual unsigned int GetRandomRunNumber(bool muDependentRRN = true) = 0;
00312
00313 virtual StatusCode ApplyPRWTool(bool muDependentRRN = true) = 0;
00314
00315 virtual unsigned int GetRunNumber() const = 0;
00316
00317 virtual int treatAsYear() const = 0;
00318
00319 virtual StatusCode OverlapRemoval(const xAOD::ElectronContainer *electrons, const xAOD::MuonContainer *muons, const xAOD::JetContainer *jets,
00320 const xAOD::PhotonContainer* gamma = 0, const xAOD::TauJetContainer* taujet = 0, const xAOD::JetContainer *fatjets = 0) = 0;
00321
00322 virtual CP::SystematicCode resetSystematics() = 0;
00323
00324 virtual CP::SystematicCode applySystematicVariation( const CP::SystematicSet& systConfig ) = 0;
00325
00326 virtual bool isPrompt(const xAOD::IParticle* part) const = 0;
00327
00328 virtual StatusCode FindSusyHP(const xAOD::TruthParticleContainer *truthP, int& pdgid1, int& pdgid2, bool isTruth3 = false) const = 0;
00329
00330 virtual StatusCode FindSusyHP(const xAOD::TruthEvent *truthE, int& pdgid1, int& pdgid2) const = 0;
00331
00332 virtual std::vector<ST::SystInfo> getSystInfoList() const = 0;
00333
00334 virtual std::string TrigSingleLep() const = 0;
00335 virtual std::string TrigDiLep() const = 0;
00336 virtual std::string TrigMixLep() const = 0;
00337
00338
00339
00340
00341 virtual float getSherpaVjetsNjetsWeight() const = 0;
00342 virtual float getSherpaVjetsNjetsWeight(const std::string& jetContainer) const = 0;
00343
00344 enum DataSource {
00345 Undefined = -1,
00346 Data,
00347 FullSim,
00348 AtlfastII
00349 };
00350
00351 };
00352
00353 }
00354
00355 #endif // SUSYTOOLS_SUSYOBJDEF_XAODTOOL_H