ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonIDMod.h
(Generate patch)

Comparing UserCode/MitPhysics/Mods/interface/PhotonIDMod.h (file contents):
Revision 1.26 by bendavid, Sun May 27 17:02:19 2012 UTC vs.
Revision 1.32 by mingyang, Fri Jun 21 19:04:27 2013 UTC

# Line 26 | Line 26
26   #include "MitAna/DataTree/interface/PFCandidateCol.h"
27  
28   #include "MitPhysics/Utils/interface/MVATools.h"
29 + #include "MitPhysics/Utils/interface/PhotonTools.h"
30 + #include "MitPhysics/Utils/interface/RhoUtilities.h"
31 +
32 + class TRandom3;
33  
34   namespace mithep
35   {
# Line 88 | Line 92 | namespace mithep
92  
93      void                SetPVName(const char *n)          { fPVName = n;                 }
94      void                SetPVFromBranch(bool b)           { fPVFromBranch = b;           }
95 <    void                SetIsData (Bool_t b) { fIsData = b;};
95 >    void                SetIsData (Bool_t b) { fIsData = b;}
96 >    void                Set2012HCP (Bool_t b) { f2012HCP = b;}
97 >
98 >    void                SetShowerShapeType(const char *type) { fShowerShapeType        = type;    }
99 >
100 >        // methods to set the MC smearing/energy correction values
101 >    void                AddEnCorrPerRun( UInt_t sRun, UInt_t eRun,
102 >                                         Double_t corr_EBlowEta_hR9central,
103 >                                         Double_t corr_EBlowEta_hR9gap,
104 >                                         Double_t corr_EBlowEta_lR9,
105 >                                         Double_t corr_EBhighEta_hR9,
106 >                                         Double_t corr_EBhighEta_lR9,                                        
107 >                                         Double_t corr_EElowEta_hR9,
108 >                                         Double_t corr_EElowEta_lR9,
109 >                                         Double_t corr_EEhighEta_hR9,
110 >                                         Double_t corr_EEhighEta_lR9) {
111 >
112 >      fDataEnCorr_EBlowEta_hR9central.push_back(corr_EBlowEta_hR9central);
113 >      fDataEnCorr_EBlowEta_hR9gap.push_back(corr_EBlowEta_hR9gap);
114 >      fDataEnCorr_EBlowEta_lR9.push_back(corr_EBlowEta_lR9);
115 >      fDataEnCorr_EBhighEta_hR9.push_back(corr_EBhighEta_hR9);
116 >      fDataEnCorr_EBhighEta_lR9.push_back(corr_EBhighEta_lR9);      
117 >      fDataEnCorr_EElowEta_hR9.push_back(corr_EElowEta_hR9);
118 >      fDataEnCorr_EElowEta_lR9.push_back(corr_EElowEta_lR9);      
119 >      fDataEnCorr_EEhighEta_hR9.push_back(corr_EEhighEta_hR9);
120 >      fDataEnCorr_EEhighEta_lR9.push_back(corr_EEhighEta_lR9);      
121 >      fRunStart.push_back         (sRun);
122 >      fRunEnd.push_back           (eRun);
123 >    };
124 >
125 >    void                SetMCSmearFactors(Double_t _EBlowEta_hR9central,
126 >                                          Double_t _EBlowEta_hR9gap,
127 >                                          Double_t _EBlowEta_lR9,
128 >                                          Double_t _EBhighEta_hR9,
129 >                                          Double_t _EBhighEta_lR9,
130 >                                          Double_t _EElowEta_hR9,
131 >                                          Double_t _EElowEta_lR9,
132 >                                          Double_t _EEhighEta_hR9,
133 >                                          Double_t _EEhighEta_lR9) {
134 >      fMCSmear_EBlowEta_hR9central = _EBlowEta_hR9central;
135 >      fMCSmear_EBlowEta_hR9gap = _EBlowEta_hR9gap;
136 >      fMCSmear_EBlowEta_lR9 = _EBlowEta_lR9;
137 >      fMCSmear_EBhighEta_hR9 = _EBhighEta_hR9;
138 >      fMCSmear_EBhighEta_lR9 = _EBhighEta_lR9;      
139 >      fMCSmear_EElowEta_hR9 = _EElowEta_hR9;
140 >      fMCSmear_EElowEta_lR9 = _EElowEta_lR9;
141 >      fMCSmear_EEhighEta_hR9 = _EEhighEta_hR9;
142 >      fMCSmear_EEhighEta_lR9 = _EEhighEta_lR9;      
143 >    };
144 >
145 >
146 >    void                AddEnCorrPerRun2012HCP( UInt_t sRun, UInt_t eRun,
147 >                                                Double_t corr_EBlowEta_hR9central,
148 >                                                Double_t corr_EBlowEta_hR9gap,
149 >                                                Double_t corr_EBlowEta_lR9central,
150 >                                                Double_t corr_EBlowEta_lR9gap,
151 >                                                Double_t corr_EBhighEta_hR9,
152 >                                                Double_t corr_EBhighEta_lR9,                                        
153 >                                                Double_t corr_EElowEta_hR9,
154 >                                                Double_t corr_EElowEta_lR9,
155 >                                                Double_t corr_EEhighEta_hR9,
156 >                                                Double_t corr_EEhighEta_lR9) {
157 >      fDataEnCorr_EBlowEta_hR9central.push_back(corr_EBlowEta_hR9central);
158 >      fDataEnCorr_EBlowEta_hR9gap.push_back(corr_EBlowEta_hR9gap);
159 >      fDataEnCorr_EBlowEta_lR9central.push_back(corr_EBlowEta_lR9central);
160 >      fDataEnCorr_EBlowEta_lR9gap.push_back(corr_EBlowEta_lR9gap);
161 >      fDataEnCorr_EBhighEta_hR9.push_back(corr_EBhighEta_hR9);
162 >      fDataEnCorr_EBhighEta_lR9.push_back(corr_EBhighEta_lR9);      
163 >      fDataEnCorr_EElowEta_hR9.push_back(corr_EElowEta_hR9);
164 >      fDataEnCorr_EElowEta_lR9.push_back(corr_EElowEta_lR9);      
165 >      fDataEnCorr_EEhighEta_hR9.push_back(corr_EEhighEta_hR9);
166 >      fDataEnCorr_EEhighEta_lR9.push_back(corr_EEhighEta_lR9);      
167 >      fRunStart.push_back         (sRun);
168 >      fRunEnd.push_back           (eRun);
169 >    };
170 >
171 >    void SetMCSmearFactors2012HCP(Double_t _EBlowEta_hR9central,
172 >                                  Double_t _EBlowEta_hR9gap,
173 >                                  Double_t _EBlowEta_lR9central,
174 >                                  Double_t _EBlowEta_lR9gap,
175 >                                  Double_t _EBhighEta_hR9,
176 >                                  Double_t _EBhighEta_lR9,
177 >                                  Double_t _EElowEta_hR9,
178 >                                  Double_t _EElowEta_lR9,
179 >                                  Double_t _EEhighEta_hR9,
180 >                                  Double_t _EEhighEta_lR9) {
181 >      fMCSmear_EBlowEta_hR9central = _EBlowEta_hR9central;
182 >      fMCSmear_EBlowEta_hR9gap = _EBlowEta_hR9gap;
183 >      fMCSmear_EBlowEta_lR9central = _EBlowEta_lR9central;
184 >      fMCSmear_EBlowEta_lR9gap = _EBlowEta_lR9gap;
185 >      fMCSmear_EBhighEta_hR9 = _EBhighEta_hR9;
186 >      fMCSmear_EBhighEta_lR9 = _EBhighEta_lR9;      
187 >      fMCSmear_EElowEta_hR9 = _EElowEta_hR9;
188 >      fMCSmear_EElowEta_lR9 = _EElowEta_lR9;
189 >      fMCSmear_EEhighEta_hR9 = _EEhighEta_hR9;
190 >      fMCSmear_EEhighEta_lR9 = _EEhighEta_lR9;      
191 >    };
192 >
193 >
194      void                SetGoodElectronsFromBranch(Bool_t b) { fGoodElectronsFromBranch = b; }
195      void                SetGoodElectronName(TString name) { fGoodElectronName = name; }
196  
197      void                SetBdtCutBarrel(double a) {fbdtCutBarrel = a; }
198      void                SetBdtCutEndcap(double a) {fbdtCutEndcap = a; }
199  
200 <    void                SetDoMCR9Scaling(Bool_t b)        { fDoMCR9Scaling = b; }
201 <    void                SetMCR9Scale(Double_t ebscale, Double_t eescale) { fMCR9ScaleEB = ebscale; fMCR9ScaleEE = eescale; }
202 <    void                SetDoMCSigIEtaIEtaScaling(Bool_t b)        { fDoMCSigIEtaIEtaScaling = b; }
203 <    void                SetDoMCWidthScaling(Bool_t b)        { fDoMCWidthScaling = b; }
200 >
201 >    void                DoDataEneCorr(bool a)              { fDoDataEneCorr = a; }
202 >    void                DoMCSmear(bool a)                  { fDoMCSmear     = a; }
203 >    void                SetDoShowerShapeScaling(Bool_t b)  { fDoShowerShapeScaling = b; }
204 >
205 >    // replaced by ShowerShapeScaling (fab)
206 > /*     void                SetDoMCR9Scaling(Bool_t b)        { fDoMCR9Scaling = b; } */
207 > /*     void                SetMCR9Scale(Double_t ebscale, Double_t eescale) { fMCR9ScaleEB = ebscale; fMCR9ScaleEE = eescale; } */
208 > /*     void                SetDoMCSigIEtaIEtaScaling(Bool_t b)        { fDoMCSigIEtaIEtaScaling = b; } */
209 > /*     void                SetDoMCWidthScaling(Bool_t b)        { fDoMCWidthScaling = b; } */
210 >
211      void                SetDoMCErrScaling(Bool_t b)        { fDoMCErrScaling = b; }
212      void                SetMCErrScale(Double_t ebscale, Double_t eescale) { fMCErrScaleEB = ebscale; fMCErrScaleEE = eescale; }
213  
214 +    void                SetIdMVAType(const char *type)    { fIdMVATypeName        = type;    }
215 +
216 +    void                SetRhoType(RhoUtilities::RhoType type) { fRhoType = type ; }
217 +
218        enum EPhIdType {
219          kIdUndef = 0,       //not defined
220          kTight,             //"Tight"
221          kLoose,             //"Loose"
222          kLooseEM,           //"LooseEM"
223 <        kBaseLineCiC,        //"2011" Hgg BaseLine CiC
224 <        kBaseLineCiCPF,        //"2012" Hgg BaseLine CiC
225 <        kMITMVAId,          // MingMing MVA ID
226 <        kMITPhSelection,    //MIT loose preselection (for mva)
223 >        kBaseLineCiC,         //"2011" Hgg BaseLine CiC
224 >        kBaseLineCiCPF,       //"2012" Hgg BaseLine CiC
225 >        kBaseLineCiCPFNoPresel,       //"2012" Hgg BaseLine CiC plus eleveto -- for mono photon
226 >        kMITMVAId,            // MingMing MVA ID
227 >        kMITPhSelection,      //MIT loose preselection (for mva)
228          kMITPFPhSelection,    //MIT loose preselection (for mva)
229 <        kCustomId           //"Custom"
229 >        kMITPFPhSelection_NoTrigger,    //MIT loose preselection (for mva, no Trigger)
230 >        kVgamma2011Selection, // Vgamma 2011 Photon ID
231 >        kTrivialSelection,    // only pt & eta cuts
232 >        kCustomId             //"Custom"
233        };
234  
235        enum EPhIsoType {
# Line 127 | Line 244 | namespace mithep
244        void                Process();
245        void                SlaveBegin();
246  
247 +      Int_t               FindRunRangeIdx(UInt_t run);
248 +      Double_t            GetDataEnCorr(Int_t runRange, PhotonTools::eScaleCats cat);
249 +      Double_t            GetMCSmearFac(PhotonTools::eScaleCats cat);   // last flag in case of special smearing for error computation
250 +      Double_t            GetDataEnCorrHCP(Int_t runRange, PhotonTools::eScaleCats cat);
251 +      Double_t            GetMCSmearFacHCP(PhotonTools::eScaleCats cat);   // last flag in case of special smearing for error computation
252 +      
253        TString             fPhotonBranchName;     //name of photon collection (input)
254        TString             fGoodPhotonsName;      //name of exported "good photon" collection
255        TString             fTrackBranchName;      // name of the track collection (only needed for PU corrected isolation)
# Line 155 | Line 278 | namespace mithep
278        EPhIdType           fPhIdType;             //!identification scheme
279        EPhIsoType          fPhIsoType;            //!isolation scheme
280        Bool_t              fFiduciality;          //=true then apply fiducual requirement
281 +
282        Double_t            fEtaWidthEB;           //max Eta Width in ECAL Barrel
283        Double_t            fEtaWidthEE;           //max Eta Width in ECAL End Cap
284        Double_t            fAbsEtaMax;            //max Abs Eta
# Line 179 | Line 303 | namespace mithep
303  
304        Double_t fbdtCutBarrel;
305        Double_t fbdtCutEndcap;
306 +
307 +      // ----------------------------------------------------------------
308 +      // these guys should go away.... (let MVATools handle this)   (fab)
309        int                         fVariableType;
310        TString                     fEndcapWeights;
311        TString                     fBarrelWeights;
312 +      // ----------------------------------------------------------------
313        MVATools                    fTool;
314 +      TString                     fIdMVATypeName;
315 +      MVATools::IdMVAType         fIdMVAType;
316 +      // ----------------------------------------------------------------
317  
318        Bool_t fDoMCR9Scaling;
319        Double_t fMCR9ScaleEB;
# Line 200 | Line 331 | namespace mithep
331        Bool_t              fGoodElectronsFromBranch;
332        Bool_t              fIsData;
333  
334 +      Bool_t              f2012HCP;
335 +
336 +
337 +      // showershape
338 +      TString                                fShowerShapeType;
339 +      PhotonTools::ShowerShapeScales         fSSType;
340 +      
341 +      bool                  fDoDataEneCorr;
342 +      bool                  fDoMCSmear;
343 +      Bool_t                fDoShowerShapeScaling;
344 +
345 +
346 +      // Vectroes to hols smeraring/correction factors
347 +      std::vector<Double_t> fDataEnCorr_EBlowEta_hR9central;
348 +      std::vector<Double_t> fDataEnCorr_EBlowEta_hR9gap;
349 +      std::vector<Double_t> fDataEnCorr_EBlowEta_lR9;
350 +      std::vector<Double_t> fDataEnCorr_EBlowEta_lR9central;
351 +      std::vector<Double_t> fDataEnCorr_EBlowEta_lR9gap;
352 +      std::vector<Double_t> fDataEnCorr_EBhighEta_hR9;
353 +      std::vector<Double_t> fDataEnCorr_EBhighEta_lR9;    
354 +      std::vector<Double_t> fDataEnCorr_EElowEta_hR9;
355 +      std::vector<Double_t> fDataEnCorr_EElowEta_lR9;
356 +      std::vector<Double_t> fDataEnCorr_EEhighEta_hR9;
357 +      std::vector<Double_t> fDataEnCorr_EEhighEta_lR9;
358 +    
359 +      std::vector<UInt_t>   fRunStart;
360 +      std::vector<UInt_t>   fRunEnd;
361 +      
362 +      Double_t              fMCSmear_EBlowEta_hR9central;
363 +      Double_t              fMCSmear_EBlowEta_hR9gap;
364 +      Double_t              fMCSmear_EBlowEta_lR9;
365 +      Double_t              fMCSmear_EBlowEta_lR9central;
366 +      Double_t              fMCSmear_EBlowEta_lR9gap;
367 +      Double_t              fMCSmear_EBhighEta_hR9;
368 +      Double_t              fMCSmear_EBhighEta_lR9;    
369 +      Double_t              fMCSmear_EElowEta_hR9;
370 +      Double_t              fMCSmear_EElowEta_lR9;
371 +      Double_t              fMCSmear_EEhighEta_hR9;
372 +      Double_t              fMCSmear_EEhighEta_lR9;    
373 +      
374 +      TRandom3* fRng;
375  
376 +      RhoUtilities::RhoType fRhoType;
377  
378      ClassDef(PhotonIDMod, 1) // Photon identification module
379    };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines