ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/PhotonPairSelector.h
Revision: 1.2
Committed: Fri Jul 15 17:24:37 2011 UTC (13 years, 9 months ago) by fabstoec
Content type: text/plain
Branch: MAIN
Changes since 1.1: +10 -3 lines
Log Message:
added/improved stuff for CiC Selection

File Contents

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