ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/ElectronIDMod.h
Revision: 1.41
Committed: Mon Feb 21 13:50:20 2011 UTC (14 years, 2 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.40: +18 -4 lines
Log Message:
new beta

File Contents

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