1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// M.Yang 2011/10/12
|
3 |
// $Id: PhotonMvaMod.h,v 1.13 2011/11/18 00:07:16 bendavid Exp $
|
4 |
//
|
5 |
// PhotonMvaMod
|
6 |
//
|
7 |
//Precompute regression energy corrections and id bdt output to save memory and cpu time
|
8 |
//in subsequent module chains.
|
9 |
//
|
10 |
// Authors: J.Bendavid
|
11 |
//--------------------------------------------------------------------------------------------------
|
12 |
|
13 |
#ifndef MITPHYSICS_MODS_PHOTONMVAMOD_H
|
14 |
#define MITPHYSICS_MODS_PHOTONMVAMOD_H
|
15 |
|
16 |
#include "MitAna/TreeMod/interface/BaseMod.h"
|
17 |
#include "MitAna/DataTree/interface/PhotonFwd.h"
|
18 |
#include "MitAna/DataTree/interface/TrackCol.h"
|
19 |
#include "MitAna/DataTree/interface/VertexCol.h"
|
20 |
#include "MitAna/DataTree/interface/BeamSpotCol.h"
|
21 |
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
22 |
#include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
|
23 |
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
24 |
#include "MitAna/DataTree/interface/ElectronCol.h"
|
25 |
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
26 |
#include "MitAna/DataTree/interface/PileupInfoCol.h"
|
27 |
#include "MitAna/DataTree/interface/MCParticleCol.h"
|
28 |
|
29 |
#include "MitPhysics/Utils/interface/PhotonTools.h"
|
30 |
#include "MitPhysics/Utils/interface/EGEnergyCorrector.h"
|
31 |
|
32 |
#include "MitPhysics/Utils/interface/MVATools.h"
|
33 |
#include "MitPhysics/Utils/interface/VertexTools.h"
|
34 |
|
35 |
class TNtuple;
|
36 |
class TRandom3;
|
37 |
class TH1D;
|
38 |
|
39 |
namespace mithep
|
40 |
{
|
41 |
class PhotonMvaMod : public BaseMod
|
42 |
{
|
43 |
public:
|
44 |
PhotonMvaMod(const char *name ="PhotonMvaMod",
|
45 |
const char *title="Selecting PhotonPairs");
|
46 |
|
47 |
~PhotonMvaMod();
|
48 |
|
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 |
|
66 |
// get/set the Names for the output Photon Collection
|
67 |
const char *GetOutputName() const { return fGoodPhotonsName; }
|
68 |
void SetOutputName(const char *n) { fGoodPhotonsName=n; }
|
69 |
|
70 |
// set basic Cut variables (FOR PRE-SELECTION)
|
71 |
void SetPtMin(Double_t pt) { fPhotonPtMin = pt; }
|
72 |
void SetAbsEtaMax(Double_t eta) { fPhotonEtaMax = eta; }
|
73 |
|
74 |
// is Data Or Not?
|
75 |
void SetIsData (Bool_t b) { fIsData = b;};
|
76 |
|
77 |
|
78 |
|
79 |
void ApplyEleVeto(bool a) { fApplyEleVeto = a; }
|
80 |
|
81 |
void SetDoRegression(Bool_t b) { fDoRegression = b; }
|
82 |
|
83 |
void SetRegressionVersion(UInt_t v) { fRegressionVersion = v; }
|
84 |
void SetRegressionWeights(TString f) { fRegWeights = f; }
|
85 |
|
86 |
protected:
|
87 |
void Process();
|
88 |
void SlaveBegin();
|
89 |
|
90 |
// private auxiliary methods...
|
91 |
// Names for the input Collections
|
92 |
TString fPhotonBranchName;
|
93 |
TString fElectronName;
|
94 |
TString fGoodElectronName;
|
95 |
TString fConversionName;
|
96 |
TString fTrackBranchName;
|
97 |
TString fPileUpDenName;
|
98 |
TString fPVName;
|
99 |
TString fBeamspotName;
|
100 |
TString fPFCandName;
|
101 |
TString fMCParticleName;
|
102 |
TString fPileUpName;
|
103 |
|
104 |
TString fGoodPhotonsName; //name of exported "good photon" collection
|
105 |
|
106 |
|
107 |
// Basic Pre-Selection kinematics
|
108 |
Double_t fPhotonPtMin; // min pt cut fro PRE-SELECTION!
|
109 |
Double_t fPhotonEtaMax; // max eta cut for PRE-SELECTION!
|
110 |
|
111 |
// is it Data or MC?
|
112 |
Bool_t fIsData;
|
113 |
|
114 |
// in case there's some PV pre-selection
|
115 |
Bool_t fPhotonsFromBranch;
|
116 |
Bool_t fPVFromBranch;
|
117 |
Bool_t fGoodElectronsFromBranch;
|
118 |
|
119 |
const PhotonCol *fPhotons;
|
120 |
const ElectronCol *fElectrons;
|
121 |
const ElectronCol *fGoodElectrons;
|
122 |
const DecayParticleCol *fConversions;
|
123 |
const TrackCol *fTracks;
|
124 |
const PileupEnergyDensityCol *fPileUpDen;
|
125 |
const VertexCol *fPV;
|
126 |
const BeamSpotCol *fBeamspot;
|
127 |
const PFCandidateCol *fPFCands;
|
128 |
const MCParticleCol *fMCParticles;
|
129 |
const PileupInfoCol *fPileUp;
|
130 |
|
131 |
EGEnergyCorrector egcor;
|
132 |
Bool_t fDoRegression;
|
133 |
TString fPhFixString;
|
134 |
TString fPhFixFile;
|
135 |
TString fRegWeights;
|
136 |
|
137 |
const TH1D *fEtaCorrections;
|
138 |
|
139 |
// --------------------------------
|
140 |
bool fApplyEleVeto;
|
141 |
UInt_t fRegressionVersion;
|
142 |
|
143 |
|
144 |
ClassDef(PhotonMvaMod, 1) // Photon identification module
|
145 |
};
|
146 |
}
|
147 |
#endif
|