ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonPairSelector.h
Revision: 1.6
Committed: Wed Jul 27 17:50:52 2011 UTC (13 years, 9 months ago) by fabstoec
Content type: text/plain
Branch: MAIN
Changes since 1.5: +2 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 fabstoec 1.1 //--------------------------------------------------------------------------------------------------
2 fabstoec 1.6 // $Id: PhotonPairSelector.h,v 1.5 2011/07/27 15:17:36 bendavid Exp $
3 fabstoec 1.1 //
4     // PhotonPairSelector
5     //
6     // Authors: F. Stoeckli
7     //--------------------------------------------------------------------------------------------------
8    
9     #ifndef MITPHYSICS_MODS_PHOTONPAIRSELECTOR_H
10     #define MITPHYSICS_MODS_PHOTONPAIRSELECTOR_H
11    
12     #include "MitAna/TreeMod/interface/BaseMod.h"
13     #include "MitAna/DataTree/interface/PhotonFwd.h"
14     #include "MitAna/DataTree/interface/TrackCol.h"
15     #include "MitAna/DataTree/interface/VertexCol.h"
16     #include "MitAna/DataTree/interface/BeamSpotCol.h"
17     #include "MitAna/DataTree/interface/PFCandidateCol.h"
18     #include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
19     #include "MitAna/DataTree/interface/DecayParticleCol.h"
20     #include "MitAna/DataTree/interface/ElectronCol.h"
21     #include "MitAna/DataTree/interface/DecayParticleCol.h"
22     #include "MitAna/DataTree/interface/PileupInfoCol.h"
23     #include "MitAna/DataTree/interface/MCParticleCol.h"
24    
25     #include "MitPhysics/Utils/interface/PhotonTools.h"
26    
27     class TNtuple;
28     class TRandom3;
29    
30     namespace mithep
31     {
32 bendavid 1.4
33     class PhotonPairSelectorPhoton
34 bendavid 1.3 {
35     public:
36     void SetVars(const Photon *p, const MCParticle *m = 0);
37 bendavid 1.5 Float_t Ecor() const { return ecor; };
38     Float_t Ecorerr() const { return ecorerr; };
39    
40 bendavid 1.3 private:
41     Float_t e;
42     Float_t pt;
43     Float_t eta;
44     Float_t phi;
45     Float_t r9;
46 bendavid 1.5 Float_t e3x3;
47 bendavid 1.3 Float_t e5x5;
48     Float_t sce;
49     Float_t scrawe;
50     Float_t scpse;
51     Float_t sceta;
52     Float_t scphi;
53 bendavid 1.5 UInt_t scnclusters;
54     UInt_t scnhits;
55     Float_t hovere;
56     Float_t sigietaieta;
57 bendavid 1.3 Bool_t isbarrel;
58     Bool_t isr9reco;
59     Bool_t isr9cat;
60     UChar_t phcat;
61 bendavid 1.5
62     //quantities from seed basic cluster
63     Float_t sigiphiphi;
64     Float_t covietaiphi;
65     Float_t emax;
66     Float_t e2nd;
67     Float_t etop;
68     Float_t ebottom;
69     Float_t eleft;
70     Float_t eright;
71     Float_t e1x3;
72     Float_t e3x1;
73     Float_t e1x5;
74     Float_t e2x2;
75     Float_t e4x4;
76     Float_t e2x5max;
77     Float_t e2x5top;
78     Float_t e2x5bottom;
79     Float_t e2x5left;
80     Float_t e2x5right;
81    
82     //energy correction quantities from PhotonFix
83     Float_t ecor;
84     Float_t ecorerr;
85     Float_t etac;
86     Float_t etas;
87     Float_t etam;
88     Float_t phic;
89     Float_t phis;
90     Float_t phim;
91     Float_t xz;
92     Float_t xc;
93     Float_t xs;
94     Float_t xm;
95     Float_t yz;
96     Float_t yc;
97     Float_t ys;
98     Float_t ym;
99    
100     //generator level quantities
101 bendavid 1.3 Bool_t ispromptgen;
102     Float_t gene;
103     Float_t genpt;
104     Float_t geneta;
105     Float_t genphi;
106 bendavid 1.5 Float_t genz;
107 bendavid 1.3
108    
109    
110     };
111    
112 bendavid 1.4 class PhotonPairSelectorDiphotonEvent
113 bendavid 1.3 {
114     public:
115     Float_t rho;
116     Float_t genHiggspt;
117     Float_t genHiggsZ;
118     Float_t gencostheta;
119     Float_t vtxZ;
120 bendavid 1.5 Int_t nVtx;
121 bendavid 1.3 Int_t numPU;
122     Int_t numPUminus;
123     Int_t numPUplus;
124     Float_t mass;
125     Float_t ptgg;
126     Float_t costheta;
127     UInt_t evt;
128     UInt_t run;
129     UInt_t lumi;
130     UChar_t evtcat;
131 bendavid 1.5
132     //corrected quantities from PhotonFix corrections
133     Float_t masscor;
134     Float_t masscorerr;
135    
136 bendavid 1.4 PhotonPairSelectorPhoton photons[2];
137    
138 bendavid 1.3
139     };
140    
141 fabstoec 1.1 class PhotonPairSelector : public BaseMod
142     {
143     public:
144     PhotonPairSelector(const char *name ="PhotonPairSelector",
145     const char *title="Selecting PhotonPairs");
146    
147     ~PhotonPairSelector();
148    
149     enum PhotonSelection {
150     kNoPhSelection = 0,
151     kCiCPhSelection,
152     kMITPhSelection
153     };
154     enum VertexSelection {
155     kStdVtxSelection = 0,
156     kCiCVtxSelection,
157     kMITVtxSelection
158     };
159    
160     // setting all the input Names
161     void SetInputPhotonsName(const char *n){ fPhotonBranchName= n; }
162     void SetPhotonsFromBranch(bool b) { fPhotonsFromBranch = b; }
163     void SetTrackName(const char *n) { fTrackBranchName = n; }
164     void SetElectronName(const char *n) { fElectronName = n; }
165     void SetConversionName(const char *n) { fConversionName = n; }
166     void SetPUDensityName(const char *n) { fPileUpDenName = n; }
167     void SetPVName(const char *n) { fPVName = n; }
168     void SetPVFromBranch(bool b) { fPVFromBranch = b; }
169     void SetMCParticle(const char *n) { fMCParticleName = n; }
170     void SetPUInfoName(const char *n) { fPileUpName = n; }
171     void SetBeamspotName(const char *n) { fBeamspotName = n; }
172     void SetPFCandName(const char *n) { fPFCandName = n; }
173    
174     // set the type of selection
175     void SetPhotonSelType(const char *type){ fPhotonSelType = type; }
176     void SetVertexSelType(const char *type){ fVertexSelType = type; }
177    
178     // get/set the Names for the output Photon Collection
179     const char *GetOutputName() const { return fGoodPhotonsName; }
180     void SetOutputName(const char *n) { fGoodPhotonsName=n; }
181    
182     // set basic Cut variables (FOR PRE-SELECTION)
183     void SetPtMin(Double_t pt) { fPhotonPtMin = pt; }
184     void SetAbsEtaMax(Double_t eta) { fPhotonEtaMax = eta; }
185    
186     void SetLeadingPtMin(Double_t pt) { fLeadingPtMin = pt; }
187 fabstoec 1.6 void SetTrailingPtMin(Double_t pt) { fTrailingPtMin = pt; }
188 fabstoec 1.1
189     // is Data Or Not?
190     void SetIsData (Bool_t b) { fIsData = b;};
191    
192     // methods to set the MC smearing/energy correction values
193     void AddEnCorrPerRun( UInt_t sRun, UInt_t eRun,
194     Double_t corr_EB_hR9,
195     Double_t corr_EB_lR9,
196     Double_t corr_EE_hR9,
197     Double_t corr_EE_lR9) {
198    
199     fDataEnCorr_EB_hR9.push_back(corr_EB_hR9);
200     fDataEnCorr_EB_lR9.push_back(corr_EB_lR9);
201     fDataEnCorr_EE_hR9.push_back(corr_EE_hR9);
202     fDataEnCorr_EE_lR9.push_back(corr_EE_lR9);
203     fRunStart.push_back (sRun);
204     fRunEnd.push_back (eRun);
205     };
206    
207     void SetMCSmearFactors(Double_t _EB_hR9,
208     Double_t _EB_lR9,
209     Double_t _EE_hR9,
210     Double_t _EE_lR9) {
211     fMCSmear_EB_hR9 = _EB_hR9;
212     fMCSmear_EB_lR9 = _EB_lR9;
213     fMCSmear_EE_hR9 = _EE_hR9;
214     fMCSmear_EE_lR9 = _EE_lR9;
215     };
216 fabstoec 1.2
217     void ApplyEleVeto(bool a) { fApplyEleVeto = a; }
218     void DoDataEneCorr(bool a) { fDoDataEneCorr = a; }
219     void DoMCSmear(bool a) { fDoMCSmear = a; }
220    
221     void SetTupleName(const char* c) { fTupleName = c; }
222    
223 fabstoec 1.1 protected:
224     void Process();
225     void SlaveBegin();
226    
227     // private auxiliary methods...
228     void FindHiggsPtAndZ(Float_t& pt, Float_t& z);
229     Int_t FindRunRangeIdx(UInt_t run);
230     Double_t GetDataEnCorr(Int_t runRange, PhotonTools::CiCBaseLineCats cat);
231     Double_t GetMCSmearFac(PhotonTools::CiCBaseLineCats cat);
232     Float_t GetEventCat(PhotonTools::CiCBaseLineCats cat1, PhotonTools::CiCBaseLineCats cat2);
233    
234     // Names for the input Collections
235     TString fPhotonBranchName;
236     TString fElectronName;
237     TString fConversionName;
238     TString fTrackBranchName;
239     TString fPileUpDenName;
240     TString fPVName;
241     TString fBeamspotName;
242     TString fPFCandName;
243     TString fMCParticleName;
244     TString fPileUpName;
245    
246     TString fGoodPhotonsName; //name of exported "good photon" collection
247    
248     // Selection Types
249     TString fPhotonSelType;
250     TString fVertexSelType;
251     PhotonSelection fPhSelType;
252     VertexSelection fVtxSelType;
253    
254     // Basic Pre-Selection kinematics
255     Double_t fPhotonPtMin; // min pt cut fro PRE-SELECTION!
256     Double_t fPhotonEtaMax; // max eta cut for PRE-SELECTION!
257    
258     Double_t fLeadingPtMin;
259     Double_t fTrailingPtMin;
260    
261     // is it Data or MC?
262     Bool_t fIsData;
263    
264     // in case there's some PV pre-selection
265     Bool_t fPhotonsFromBranch;
266     Bool_t fPVFromBranch;
267    
268     const PhotonCol *fPhotons;
269     const ElectronCol *fElectrons;
270     const DecayParticleCol *fConversions;
271     const TrackCol *fTracks;
272     const PileupEnergyDensityCol *fPileUpDen;
273     const VertexCol *fPV;
274     const BeamSpotCol *fBeamspot;
275     const PFCandidateCol *fPFCands;
276     const MCParticleCol *fMCParticles;
277     const PileupInfoCol *fPileUp;
278    
279     // Vectroes to hols smeraring/correction factors
280     std::vector<Double_t> fDataEnCorr_EB_hR9;
281     std::vector<Double_t> fDataEnCorr_EB_lR9;
282     std::vector<Double_t> fDataEnCorr_EE_hR9;
283     std::vector<Double_t> fDataEnCorr_EE_lR9;
284    
285     std::vector<UInt_t> fRunStart;
286     std::vector<UInt_t> fRunEnd;
287    
288     Double_t fMCSmear_EB_hR9;
289     Double_t fMCSmear_EB_lR9;
290     Double_t fMCSmear_EE_hR9;
291     Double_t fMCSmear_EE_lR9;
292    
293     // pointer to RNG ionstance for smearing
294     TRandom3* rng;
295    
296     // --------------------------------
297     // some streagin flags, not adjustable yet (FIX-ME)
298     bool fDoDataEneCorr;
299     bool fDoMCSmear;
300     bool fDoVtxSelection;
301 fabstoec 1.2 bool fApplyEleVeto;
302 fabstoec 1.1
303     // --------------------------------
304     // validation Tuple
305 fabstoec 1.2 TString fTupleName;
306 bendavid 1.3 PhotonPairSelectorDiphotonEvent* fDiphotonEvent;
307 bendavid 1.4 PhotonPairSelectorPhoton* fSinglePhoton;
308 bendavid 1.3 TTree* hCiCTuple;
309 bendavid 1.4 TTree* hCiCTupleSingle;
310 fabstoec 1.1
311     ClassDef(PhotonPairSelector, 1) // Photon identification module
312     };
313     }
314     #endif