ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/ElectronIDMod.h
Revision: 1.50
Committed: Tue Jun 21 06:15:57 2011 UTC (13 years, 10 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.49: +5 -3 lines
Log Message:
updated options

File Contents

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