ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonPairSelector.h
Revision: 1.7
Committed: Wed Aug 3 17:15:43 2011 UTC (13 years, 9 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_024b, Mit_024a, Mit_024
Changes since 1.6: +10 -121 lines
Log Message:
Reorganize photon code and add new PhotonTreeWriter class

File Contents

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