ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonPairSelector.h
Revision: 1.11
Committed: Thu Oct 13 18:33:20 2011 UTC (13 years, 6 months ago) by mingyang
Content type: text/plain
Branch: MAIN
Changes since 1.10: +4 -2 lines
Log Message:
bdtcut as a parameter

File Contents

# User Rev Content
1 fabstoec 1.1 //--------------------------------------------------------------------------------------------------
2 mingyang 1.10 // M.Yang 2011/10/12
3 mingyang 1.11 // $Id: PhotonPairSelector.h,v 1.10 2011/10/13 17:26:45 mingyang Exp $
4 fabstoec 1.1 //
5     // PhotonPairSelector
6     //
7     // Authors: F. Stoeckli
8     //--------------------------------------------------------------------------------------------------
9    
10     #ifndef MITPHYSICS_MODS_PHOTONPAIRSELECTOR_H
11     #define MITPHYSICS_MODS_PHOTONPAIRSELECTOR_H
12    
13     #include "MitAna/TreeMod/interface/BaseMod.h"
14     #include "MitAna/DataTree/interface/PhotonFwd.h"
15     #include "MitAna/DataTree/interface/TrackCol.h"
16     #include "MitAna/DataTree/interface/VertexCol.h"
17     #include "MitAna/DataTree/interface/BeamSpotCol.h"
18     #include "MitAna/DataTree/interface/PFCandidateCol.h"
19     #include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
20     #include "MitAna/DataTree/interface/DecayParticleCol.h"
21     #include "MitAna/DataTree/interface/ElectronCol.h"
22     #include "MitAna/DataTree/interface/DecayParticleCol.h"
23     #include "MitAna/DataTree/interface/PileupInfoCol.h"
24     #include "MitAna/DataTree/interface/MCParticleCol.h"
25    
26     #include "MitPhysics/Utils/interface/PhotonTools.h"
27 bendavid 1.8 #include "MitPhysics/Utils/interface/EGEnergyCorrector.h"
28 fabstoec 1.1
29 mingyang 1.10 #include "MitPhysics/Utils/interface/MVATools.h"
30    
31 fabstoec 1.1 class TNtuple;
32     class TRandom3;
33 bendavid 1.8 class TH1D;
34 fabstoec 1.1
35     namespace mithep
36 bendavid 1.7 {
37 fabstoec 1.1 class PhotonPairSelector : public BaseMod
38     {
39     public:
40     PhotonPairSelector(const char *name ="PhotonPairSelector",
41     const char *title="Selecting PhotonPairs");
42    
43     ~PhotonPairSelector();
44    
45     enum PhotonSelection {
46     kNoPhSelection = 0,
47     kCiCPhSelection,
48 mingyang 1.10 kMVAPhSelection, //MVA
49 fabstoec 1.1 kMITPhSelection
50     };
51     enum VertexSelection {
52     kStdVtxSelection = 0,
53     kCiCVtxSelection,
54     kMITVtxSelection
55     };
56    
57     // setting all the input Names
58     void SetInputPhotonsName(const char *n){ fPhotonBranchName= n; }
59     void SetPhotonsFromBranch(bool b) { fPhotonsFromBranch = b; }
60     void SetTrackName(const char *n) { fTrackBranchName = n; }
61     void SetElectronName(const char *n) { fElectronName = n; }
62     void SetConversionName(const char *n) { fConversionName = n; }
63     void SetPUDensityName(const char *n) { fPileUpDenName = n; }
64     void SetPVName(const char *n) { fPVName = n; }
65     void SetPVFromBranch(bool b) { fPVFromBranch = b; }
66     void SetMCParticle(const char *n) { fMCParticleName = n; }
67     void SetPUInfoName(const char *n) { fPileUpName = n; }
68     void SetBeamspotName(const char *n) { fBeamspotName = n; }
69     void SetPFCandName(const char *n) { fPFCandName = n; }
70    
71     // set the type of selection
72     void SetPhotonSelType(const char *type){ fPhotonSelType = type; }
73     void SetVertexSelType(const char *type){ fVertexSelType = type; }
74    
75     // get/set the Names for the output Photon Collection
76     const char *GetOutputName() const { return fGoodPhotonsName; }
77     void SetOutputName(const char *n) { fGoodPhotonsName=n; }
78    
79     // set basic Cut variables (FOR PRE-SELECTION)
80     void SetPtMin(Double_t pt) { fPhotonPtMin = pt; }
81     void SetAbsEtaMax(Double_t eta) { fPhotonEtaMax = eta; }
82    
83     void SetLeadingPtMin(Double_t pt) { fLeadingPtMin = pt; }
84 fabstoec 1.6 void SetTrailingPtMin(Double_t pt) { fTrailingPtMin = pt; }
85 fabstoec 1.1
86     // is Data Or Not?
87     void SetIsData (Bool_t b) { fIsData = b;};
88    
89     // methods to set the MC smearing/energy correction values
90     void AddEnCorrPerRun( UInt_t sRun, UInt_t eRun,
91     Double_t corr_EB_hR9,
92     Double_t corr_EB_lR9,
93     Double_t corr_EE_hR9,
94     Double_t corr_EE_lR9) {
95    
96     fDataEnCorr_EB_hR9.push_back(corr_EB_hR9);
97     fDataEnCorr_EB_lR9.push_back(corr_EB_lR9);
98     fDataEnCorr_EE_hR9.push_back(corr_EE_hR9);
99     fDataEnCorr_EE_lR9.push_back(corr_EE_lR9);
100     fRunStart.push_back (sRun);
101     fRunEnd.push_back (eRun);
102     };
103    
104     void SetMCSmearFactors(Double_t _EB_hR9,
105     Double_t _EB_lR9,
106     Double_t _EE_hR9,
107     Double_t _EE_lR9) {
108     fMCSmear_EB_hR9 = _EB_hR9;
109     fMCSmear_EB_lR9 = _EB_lR9;
110     fMCSmear_EE_hR9 = _EE_hR9;
111     fMCSmear_EE_lR9 = _EE_lR9;
112     };
113 fabstoec 1.2
114     void ApplyEleVeto(bool a) { fApplyEleVeto = a; }
115 bendavid 1.7 void SetInvertElectronVeto(Bool_t b) { fInvertElectronVeto = b; }
116 fabstoec 1.2 void DoDataEneCorr(bool a) { fDoDataEneCorr = a; }
117     void DoMCSmear(bool a) { fDoMCSmear = a; }
118    
119 bendavid 1.7 void SetGoodElectronsFromBranch(Bool_t b) { fGoodElectronsFromBranch = b; }
120     void SetGoodElectronName(TString name) { fGoodElectronName = name; }
121 bendavid 1.8 void SetDoRegression(Bool_t b) { fDoRegression = b; }
122     void SetEtaCorrections(const TH1D *h) { fEtaCorrections = h; }
123 fabstoec 1.2
124 fabstoec 1.1 protected:
125     void Process();
126     void SlaveBegin();
127    
128     // private auxiliary methods...
129 bendavid 1.7 void FindHiggsPtAndZ(Float_t& pt, Float_t& z, Float_t& mass);
130 fabstoec 1.1 Int_t FindRunRangeIdx(UInt_t run);
131     Double_t GetDataEnCorr(Int_t runRange, PhotonTools::CiCBaseLineCats cat);
132     Double_t GetMCSmearFac(PhotonTools::CiCBaseLineCats cat);
133     Float_t GetEventCat(PhotonTools::CiCBaseLineCats cat1, PhotonTools::CiCBaseLineCats cat2);
134    
135     // Names for the input Collections
136     TString fPhotonBranchName;
137     TString fElectronName;
138 bendavid 1.7 TString fGoodElectronName;
139 fabstoec 1.1 TString fConversionName;
140     TString fTrackBranchName;
141     TString fPileUpDenName;
142     TString fPVName;
143     TString fBeamspotName;
144     TString fPFCandName;
145     TString fMCParticleName;
146     TString fPileUpName;
147    
148     TString fGoodPhotonsName; //name of exported "good photon" collection
149    
150     // Selection Types
151     TString fPhotonSelType;
152     TString fVertexSelType;
153     PhotonSelection fPhSelType;
154     VertexSelection fVtxSelType;
155    
156     // Basic Pre-Selection kinematics
157     Double_t fPhotonPtMin; // min pt cut fro PRE-SELECTION!
158     Double_t fPhotonEtaMax; // max eta cut for PRE-SELECTION!
159    
160     Double_t fLeadingPtMin;
161     Double_t fTrailingPtMin;
162    
163     // is it Data or MC?
164     Bool_t fIsData;
165    
166     // in case there's some PV pre-selection
167     Bool_t fPhotonsFromBranch;
168     Bool_t fPVFromBranch;
169 bendavid 1.7 Bool_t fGoodElectronsFromBranch;
170 fabstoec 1.1
171     const PhotonCol *fPhotons;
172     const ElectronCol *fElectrons;
173 bendavid 1.7 const ElectronCol *fGoodElectrons;
174 fabstoec 1.1 const DecayParticleCol *fConversions;
175     const TrackCol *fTracks;
176     const PileupEnergyDensityCol *fPileUpDen;
177     const VertexCol *fPV;
178     const BeamSpotCol *fBeamspot;
179     const PFCandidateCol *fPFCands;
180     const MCParticleCol *fMCParticles;
181     const PileupInfoCol *fPileUp;
182    
183     // Vectroes to hols smeraring/correction factors
184     std::vector<Double_t> fDataEnCorr_EB_hR9;
185     std::vector<Double_t> fDataEnCorr_EB_lR9;
186     std::vector<Double_t> fDataEnCorr_EE_hR9;
187     std::vector<Double_t> fDataEnCorr_EE_lR9;
188    
189     std::vector<UInt_t> fRunStart;
190     std::vector<UInt_t> fRunEnd;
191    
192     Double_t fMCSmear_EB_hR9;
193     Double_t fMCSmear_EB_lR9;
194     Double_t fMCSmear_EE_hR9;
195     Double_t fMCSmear_EE_lR9;
196    
197     // pointer to RNG ionstance for smearing
198     TRandom3* rng;
199 bendavid 1.8 EGEnergyCorrector egcor;
200     Bool_t fDoRegression;
201     TString fPhFixString;
202     TString fPhFixFile;
203 bendavid 1.9 TString fRegWeights;
204 mingyang 1.10
205 bendavid 1.8 const TH1D *fEtaCorrections;
206    
207 fabstoec 1.1 // --------------------------------
208     // some streagin flags, not adjustable yet (FIX-ME)
209     bool fDoDataEneCorr;
210     bool fDoMCSmear;
211     bool fDoVtxSelection;
212 fabstoec 1.2 bool fApplyEleVeto;
213 mingyang 1.10 Bool_t fInvertElectronVeto; //=true then invert electron veto (for cic selection only atm)
214    
215     //MVA
216     int fVariableType;
217     TString fEndcapWeights;
218     TString fBarrelWeights;
219     MVATools fTool;
220 mingyang 1.11 Float_t fbdtCutBarrel;
221     Float_t fbdtCutEndcap;
222    
223 fabstoec 1.1 ClassDef(PhotonPairSelector, 1) // Photon identification module
224     };
225     }
226     #endif