ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/ElectronIDMod.h
Revision: 1.42
Committed: Wed Feb 23 09:48:18 2011 UTC (14 years, 2 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.41: +10 -3 lines
Log Message:
new ele id

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 ceballos 1.42 // $Id: ElectronIDMod.h,v 1.41 2011/02/21 13:50:20 ceballos Exp $
3 loizides 1.1 //
4     // ElectronIDMod
5     //
6 loizides 1.4 // This module applies electron identification criteria and exports a pointer to a collection
7 loizides 1.5 // of "good electrons" according to the specified identification scheme.
8 loizides 1.1 //
9 loizides 1.13 // See http://indico.cern.ch/contributionDisplay.py?contribId=1&confId=42251
10     //
11 loizides 1.4 // Authors: S.Xie, C.Loizides
12 loizides 1.1 //--------------------------------------------------------------------------------------------------
13    
14 loizides 1.4 #ifndef MITPHYSICS_MODS_ELECTRONIDMOD_H
15     #define MITPHYSICS_MODS_ELECTRONIDMOD_H
16 loizides 1.1
17     #include "MitAna/TreeMod/interface/BaseMod.h"
18 loizides 1.20 #include "MitAna/DataTree/interface/ElectronFwd.h"
19     #include "MitAna/DataTree/interface/VertexFwd.h"
20 ceballos 1.41 #include "MitAna/DataTree/interface/TrackFwd.h"
21 loizides 1.20 #include "MitAna/DataTree/interface/DecayParticleFwd.h"
22 ceballos 1.41 #include "MitAna/DataTree/interface/PFCandidateFwd.h"
23 sixie 1.31 #include "MitPhysics/Utils/interface/ElectronTools.h"
24 ceballos 1.41 #include "MitPhysics/Utils/interface/IsolationTools.h"
25 ceballos 1.42 #include "MitPhysics/ElectronLikelihood/interface/ElectronLikelihood.h"
26     #include "MitPhysics/ElectronLikelihood/interface/LikelihoodSwitches.h"
27     #include "MitPhysics/ElectronLikelihood/interface/LikelihoodMeasurements.h"
28     #include <TFile.h>
29     #include <TDirectory.h>
30 loizides 1.1
31     namespace mithep
32     {
33     class ElectronIDMod : public BaseMod
34     {
35     public:
36     ElectronIDMod(const char *name="ElectronIDMod",
37 loizides 1.4 const char *title="Electron identification module");
38    
39 ceballos 1.34 Bool_t GetApplyConversionFilterType1() const { return fApplyConvFilterType1; }
40     Bool_t GetApplyConversionFilterType2() const { return fApplyConvFilterType2; }
41     Bool_t GetApplySpikeRemoval() const { return fApplySpikeRemoval; }
42     Bool_t GetApplyD0Cut() const { return fApplyD0Cut; }
43     Double_t GetCaloIsoCut() const { return fCaloIsolationCut; }
44     Double_t GetEcalJurIsoCut() const { return fEcalJuraIsoCut; }
45     Double_t GetCombIsoCut() const { return fCombIsolationCut; }
46     const char *GetGoodName() const { return GetGoodElectronsName(); }
47     const char *GetGoodElectronsName() const { return fGoodElectronsName; }
48     Double_t GetHcalIsoCut() const { return fHcalIsolationCut; }
49     Double_t GetIDLikelihoodCut() const { return fIDLikelihoodCut; }
50     const char *GetIDType() const { return fElectronIDType; }
51     const char *GetInputName() const { return fElectronBranchName; }
52     const char *GetIsoType() const { return fElectronIsoType; }
53     const char *GetOutputName() const { return GetGoodElectronsName(); }
54     Double_t GetPtMin() const { return fElectronPtMin; }
55 ceballos 1.37 Double_t GetEtaMax() const { return fElectronEtaMax; }
56 ceballos 1.34 Bool_t GetReverseD0Cut() const { return fReverseD0Cut; }
57     Bool_t GetReverseIsoCut() const { return fReverseIsoCut; }
58 bendavid 1.35 Bool_t GetApplyTriggerMatching() const { return fApplyTriggerMatching; }
59 ceballos 1.34 Double_t GetTrackIsoCut() const { return fTrackIsolationCut; }
60     Bool_t GetChargeFilter() const { return fChargeFilter; }
61 ceballos 1.42 Bool_t Likelihood(const Electron *ele) const;
62 sixie 1.31 Bool_t PassIDCut(const Electron *el, ElectronTools::EElIdType idType) const;
63 ceballos 1.41 Bool_t PassIsolationCut(const Electron *el, ElectronTools::EElIsoType isoType,
64     const TrackCol *tracks, const Vertex *vertex) const;
65 ceballos 1.34 Bool_t GetCombinedIdCut() const { return fCombinedIdCut; }
66     void SetApplyConversionFilterType1(Bool_t b){ fApplyConvFilterType1 = b; }
67     void SetApplyConversionFilterType2(Bool_t b){ fApplyConvFilterType2 = b; }
68     void SetNExpectedHitsInnerCut(Double_t cut) {fNExpectedHitsInnerCut = cut;}
69     void SetApplySpikeRemoval(Bool_t b) { fApplySpikeRemoval = b; }
70     void SetApplyD0Cut(Bool_t b) { fApplyD0Cut = b; }
71     void SetCaloIsoCut(Double_t cut) { fCaloIsolationCut = cut; }
72     void SetCombIsoCut(Double_t cut) { fCombIsolationCut = cut; }
73     void SetD0Cut(Double_t cut) { fD0Cut = cut; }
74     void SetEcalJurIsoCut(Double_t cut) { fEcalJuraIsoCut = cut; }
75     void SetGoodElectronsName(const char *n) { fGoodElectronsName = n; }
76 ceballos 1.41 void SetOldMuonsName(const char *n) { fOldMuonsName = n; }
77     void SetOldElectronsName(const char *n) { fOldElectronsName = n; }
78 ceballos 1.34 void SetGoodName(const char *n) { SetGoodElectronsName(n); }
79     void SetHcalIsoCut(Double_t cut) { fHcalIsolationCut = cut; }
80     void SetIDLikelihoodCut(Double_t cut) { fIDLikelihoodCut = cut; }
81     void SetIDType(const char *type) { fElectronIDType = type; }
82     void SetInputName(const char *n) { fElectronBranchName = n; }
83     void SetIsoType(const char *type) { fElectronIsoType = type; }
84 bendavid 1.36 void SetTriggerObjectsName(const char *n) { fTrigObjectsName = n; }
85 ceballos 1.34 void SetOutputName(const char *n) { SetGoodElectronsName(n); }
86     void SetPtMin(Double_t pt) { fElectronPtMin = pt; }
87 bendavid 1.38 void SetEtMin(Double_t et) { fElectronEtMin = et; }
88     void SetEtaMax(Double_t eta) { fElectronEtaMax = eta; }
89 ceballos 1.34 void SetReverseD0Cut(Bool_t b) { fReverseD0Cut = b; }
90     void SetReverseIsoCut(Bool_t b) { fReverseIsoCut = b; }
91 ceballos 1.37 void SetApplyTriggerMatching(Bool_t b) { fApplyTriggerMatching = b; }
92 ceballos 1.34 void SetTrackIsoCut(Double_t cut) { fTrackIsolationCut = cut; }
93     void SetChargeFilter(Bool_t b) { fChargeFilter = b; }
94 bendavid 1.40 void SetNWrongHitsMax(UInt_t n) { fNWrongHitsMax = n; }
95 ceballos 1.34 void SetCombinedIdCut(Bool_t b) { fCombinedIdCut = b; }
96 bendavid 1.38 void SetApplyEcalFiducial(Bool_t b) { fApplyEcalFiducial = b; }
97     void SetApplyEcalSeeded(Bool_t b) { fApplyEcalSeeded = b; }
98     void SetApplyCombinedIso(Bool_t b) { fApplyCombinedIso = b; }
99 dkralph 1.39 void SetElectronsFromBranch(Bool_t b) { fElectronsFromBranch = b; }
100 ceballos 1.42 void SetLH(ElectronLikelihood *l) { fLH = l; }
101 ceballos 1.27 void Setup();
102 loizides 1.4
103 loizides 1.1 protected:
104 sixie 1.26 void Process();
105     void SlaveBegin();
106 ceballos 1.42 void Terminate();
107 loizides 1.7
108 sixie 1.31 TString fElectronBranchName; //name of electron collection (input)
109     TString fConversionBranchName; //name of electron collection (input)
110     TString fGoodElectronsName; //name of exported "good electrons" col
111 ceballos 1.41 TString fOldMuonsName; //name of imported "old muon" collection
112     TString fOldElectronsName; //name of imported "old electron" collection
113 sixie 1.31 TString fVertexName; //name of vertex collection
114 bendavid 1.40 TString fBeamSpotName; //name of beamspot collection
115 ceballos 1.41 TString fTrackName; //name of track collection
116     TString fPFCandidatesName; //name of pfcandidates collection
117 sixie 1.31 TString fElectronIDType; //type of electron ID we impose
118     TString fElectronIsoType; //type of electron Isolation we impose
119 bendavid 1.35 TString fTrigObjectsName; //name of trigger object collection
120 sixie 1.31 Double_t fElectronPtMin; //min pt cut
121 bendavid 1.38 Double_t fElectronEtMin; //min pt cut
122 ceballos 1.37 Double_t fElectronEtaMax; //max eta cut
123 sixie 1.31 Double_t fIDLikelihoodCut; //cut value for ID likelihood
124     Double_t fTrackIsolationCut; //cut value for track isolation
125     Double_t fCaloIsolationCut; //cut value for calo isolation
126     Double_t fEcalJuraIsoCut; //cut value for ecal jurassic isolation
127     Double_t fHcalIsolationCut; //cut value for hcal isolation
128     Double_t fCombIsolationCut; //cut value for combined isolation
129 ceballos 1.34 Bool_t fApplyConvFilterType1; //whether remove conversions using fit method
130     Bool_t fApplyConvFilterType2; //whether remove conversions using DCotTheta method
131 bendavid 1.40 UInt_t fNWrongHitsMax; //whether to use wrong hits req
132 sixie 1.31 //for conversion removal
133 ceballos 1.34 Double_t fNExpectedHitsInnerCut; //cut value for NExpectedHitsInner maximum
134 ceballos 1.33 Bool_t fCombinedIdCut; //whether to use full combined id
135 sixie 1.32 Bool_t fApplySpikeRemoval; //whether apply d0 cut
136 sixie 1.31 Bool_t fApplyD0Cut; //whether apply d0 cut
137     Bool_t fChargeFilter; //whether apply GSF and CFT equal requirement
138     Double_t fD0Cut; //max d0
139     Bool_t fReverseIsoCut; //apply reversion iso cut (default=0)
140     Bool_t fReverseD0Cut; //apply reversion d0 cut (default=0)
141 bendavid 1.35 Bool_t fApplyTriggerMatching; //match to hlt electron (default=0)
142 bendavid 1.38 Bool_t fApplyEcalSeeded; //require ecal seeded flag
143     Bool_t fApplyCombinedIso; //apply combined isolation
144     Bool_t fApplyEcalFiducial; //apply ecal fiducial cuts on supercluster eta
145 dkralph 1.39 Bool_t fElectronsFromBranch; //where to get input electrons
146 sixie 1.31 ElectronTools::EElIdType fElIdType; //!identification scheme
147     ElectronTools::EElIsoType fElIsoType; //!isolation scheme
148     const ElectronCol *fElectrons; //!electron collection
149     const DecayParticleCol *fConversions; //!conversion collection
150     const VertexCol *fVertices; //!vertices branches
151 bendavid 1.40 const BeamSpotCol *fBeamSpot; //!beamspot branch
152 ceballos 1.41 const TrackCol *fTracks; //!Track branch
153     const PFCandidateCol *fPFCandidates; //!pfcandidate branch
154    
155     MuonCol *fOldMuons; //!pointer to old muon collection
156     ElectronCol *fOldElectrons; //!pointer to old electron collection
157 ceballos 1.42 ElectronLikelihood *fLH; //LH
158 loizides 1.8 ClassDef(ElectronIDMod, 1) // Electron identification module
159 loizides 1.1 };
160     }
161     #endif