ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonPairSelector.h
Revision: 1.1
Committed: Fri Jul 8 17:54:28 2011 UTC (13 years, 9 months ago) by fabstoec
Content type: text/plain
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 fabstoec 1.1 //--------------------------------------------------------------------------------------------------
2     // $Id: PhotonPairSelector.h,v 1.5 2011/07/06 13:59:40 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 SetTrainingPtMin(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    
109     protected:
110     void Process();
111     void SlaveBegin();
112    
113     // private auxiliary methods...
114     void FindHiggsPtAndZ(Float_t& pt, Float_t& z);
115     Int_t FindRunRangeIdx(UInt_t run);
116     Double_t GetDataEnCorr(Int_t runRange, PhotonTools::CiCBaseLineCats cat);
117     Double_t GetMCSmearFac(PhotonTools::CiCBaseLineCats cat);
118     Float_t GetEventCat(PhotonTools::CiCBaseLineCats cat1, PhotonTools::CiCBaseLineCats cat2);
119    
120     // Names for the input Collections
121     TString fPhotonBranchName;
122     TString fElectronName;
123     TString fConversionName;
124     TString fTrackBranchName;
125     TString fPileUpDenName;
126     TString fPVName;
127     TString fBeamspotName;
128     TString fPFCandName;
129     TString fMCParticleName;
130     TString fPileUpName;
131    
132     TString fGoodPhotonsName; //name of exported "good photon" collection
133    
134     // Selection Types
135     TString fPhotonSelType;
136     TString fVertexSelType;
137     PhotonSelection fPhSelType;
138     VertexSelection fVtxSelType;
139    
140     // Basic Pre-Selection kinematics
141     Double_t fPhotonPtMin; // min pt cut fro PRE-SELECTION!
142     Double_t fPhotonEtaMax; // max eta cut for PRE-SELECTION!
143    
144     Double_t fLeadingPtMin;
145     Double_t fTrailingPtMin;
146    
147     // is it Data or MC?
148     Bool_t fIsData;
149    
150     // in case there's some PV pre-selection
151     Bool_t fPhotonsFromBranch;
152     Bool_t fPVFromBranch;
153    
154     const PhotonCol *fPhotons;
155     const ElectronCol *fElectrons;
156     const DecayParticleCol *fConversions;
157     const TrackCol *fTracks;
158     const PileupEnergyDensityCol *fPileUpDen;
159     const VertexCol *fPV;
160     const BeamSpotCol *fBeamspot;
161     const PFCandidateCol *fPFCands;
162     const MCParticleCol *fMCParticles;
163     const PileupInfoCol *fPileUp;
164    
165     // Vectroes to hols smeraring/correction factors
166     std::vector<Double_t> fDataEnCorr_EB_hR9;
167     std::vector<Double_t> fDataEnCorr_EB_lR9;
168     std::vector<Double_t> fDataEnCorr_EE_hR9;
169     std::vector<Double_t> fDataEnCorr_EE_lR9;
170    
171     std::vector<UInt_t> fRunStart;
172     std::vector<UInt_t> fRunEnd;
173    
174     Double_t fMCSmear_EB_hR9;
175     Double_t fMCSmear_EB_lR9;
176     Double_t fMCSmear_EE_hR9;
177     Double_t fMCSmear_EE_lR9;
178    
179     // pointer to RNG ionstance for smearing
180     TRandom3* rng;
181    
182     // --------------------------------
183     // some streagin flags, not adjustable yet (FIX-ME)
184     bool fDoDataEneCorr;
185     bool fDoMCSmear;
186     bool fDoVtxSelection;
187    
188     // --------------------------------
189     // validation Tuple
190     TNtuple* hCiCTuple;
191    
192     ClassDef(PhotonPairSelector, 1) // Photon identification module
193     };
194     }
195     #endif