1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: ConversionRemoval.h,v 1.3 2009/01/12 10:26:47 bendavid Exp $
|
3 |
//
|
4 |
// DiMuonResonance
|
5 |
//
|
6 |
// This is an analysis module which allows to study the properties of dimuon resonances. The
|
7 |
// implementation is reasonably general to at least allow the study of Jpsis and Upsilons without
|
8 |
// any code change.
|
9 |
//
|
10 |
// Authors: C.Paus
|
11 |
//--------------------------------------------------------------------------------------------------
|
12 |
#ifndef MODS_CONVERSIONREMOVAL_H
|
13 |
#define MODS_CONVERSIONREMOVAL_H
|
14 |
|
15 |
#include <TH2F.h>
|
16 |
#include <TStopwatch.h>
|
17 |
|
18 |
#include "MitAna/TreeMod/interface/BaseMod.h"
|
19 |
#include "MitAna/DataTree/interface/EvtSelData.h"
|
20 |
#include "MitAna/DataTree/interface/CollectionsFwd.h"
|
21 |
#include "MitAna/DataTree/interface/Collections.h"
|
22 |
|
23 |
|
24 |
class TH1F;
|
25 |
|
26 |
namespace mithep
|
27 |
{
|
28 |
class ConversionRemoval : public BaseMod
|
29 |
{
|
30 |
public:
|
31 |
enum ECuts {
|
32 |
eNDaughters,
|
33 |
ePt,
|
34 |
eRho,
|
35 |
eEta,
|
36 |
eL,
|
37 |
eDxy,
|
38 |
eCharge,
|
39 |
eDaughters,
|
40 |
eProb,
|
41 |
ePV,
|
42 |
eNTracks,
|
43 |
eBx,
|
44 |
eBptx,
|
45 |
eClusVtx,
|
46 |
eSharedHits
|
47 |
};
|
48 |
|
49 |
enum EElectronCuts {
|
50 |
eEPt,
|
51 |
eEEta,
|
52 |
eENMissingHits,
|
53 |
eENWrongHits,
|
54 |
eENHits,
|
55 |
eENStereoHits,
|
56 |
eENPixelHits,
|
57 |
eEProb,
|
58 |
eEPxb1,
|
59 |
eDz
|
60 |
};
|
61 |
|
62 |
enum ESimCuts {
|
63 |
eSimPdg,
|
64 |
eSimEta,
|
65 |
eSimPt,
|
66 |
eSimRho,
|
67 |
eSimElectronPt,
|
68 |
eSimElectronEta,
|
69 |
eSimDaughters,
|
70 |
eCleanElectron
|
71 |
};
|
72 |
|
73 |
ConversionRemoval(const char *name = "ConversionRemoval",
|
74 |
const char *title = "Analysis Module of photon conversions");
|
75 |
~ConversionRemoval() {}
|
76 |
|
77 |
// Standard entry points allowing data processing
|
78 |
void Begin ();
|
79 |
void Process ();
|
80 |
void SlaveBegin ();
|
81 |
void SlaveTerminate();
|
82 |
void Terminate ();
|
83 |
BitMask16 FailedCuts(const DecayParticle* c);
|
84 |
Bool_t PassConvCuts(const Conversion* p);
|
85 |
BitMask16 FailedElectronCuts(const DaughterData* d, Bool_t trackQuality=kTRUE);
|
86 |
Bool_t PassTrackCuts(const Track* t);
|
87 |
BitMask16 FailedSimCuts(const MCParticle* p);
|
88 |
Bool_t PassPhotonCuts(const Photon *p);
|
89 |
const Electron* ElectronMatch(const MCParticle *p);
|
90 |
const MCParticle *GenElectronMatch(const MCParticle *p);
|
91 |
const MCParticle* SimMatch(const DecayParticle* p);
|
92 |
const MCParticle* SimMatch(const Track *t);
|
93 |
UInt_t NTracks(const TrackCol *col);
|
94 |
//Double_t TrackPtIsolation(const DecayParticle *p, Double_t r);
|
95 |
Double_t DCotTheta(const DecayParticle *c);
|
96 |
Double_t DPhi(const DecayParticle *c);
|
97 |
Double_t TwoPionMass(const DecayParticle *c);
|
98 |
const DecayParticle *MatchingConversion(const DecayParticle *c, const DecayParticleCol *col) const;
|
99 |
const Electron *MatchingElectron(const ChargedParticle *c, const ElectronCol *col) const;
|
100 |
const Electron *MatchingElectron(const Electron *ein, const ElectronCol *col) const;
|
101 |
Bool_t PassRho(Double_t rho);
|
102 |
|
103 |
const MCParticle *SimConversionMatch(const Electron *e);
|
104 |
const MCParticle *SimWeMatch(const Electron *e);
|
105 |
const Electron *ElectronMatch(const DecayParticle *d, const ElectronCol *c);
|
106 |
|
107 |
void SetConversionName(TString convName) { fMvfConvName = convName; }
|
108 |
|
109 |
//set cuts
|
110 |
void SetPtMin(Double_t ptMin) { fPtMin = ptMin; }
|
111 |
void SetEtaMax(Double_t etaMax) { fEtaMax = etaMax; }
|
112 |
void SetProbMin(Double_t probMin) { fProbMin = probMin; }
|
113 |
void SetNHitsMin(UInt_t nhits) { fNHitsMin = nhits; }
|
114 |
void SetNStereoHitsMin(UInt_t nhits) { fNStereoHitsMin = nhits; }
|
115 |
void SetNPixelHitsMin(UInt_t nhits) { fNPixelHitsMin = nhits; }
|
116 |
void SetTrackProbMin(Double_t trackProb) { fTrackProbMin = trackProb; }
|
117 |
void SetLxyMin(Double_t lxy) { fLxyMin = lxy; }
|
118 |
void SetLzMin(Double_t lz) { fLzMin = lz; }
|
119 |
void SetAbsDxyMax(Double_t dxy) { fAbsDxyMax = dxy; }
|
120 |
void SetExcludePXB1(Bool_t ex) { fExcludePXB1 = ex; }
|
121 |
void SetMassMax(Double_t mass) { fMassMax = mass; }
|
122 |
void SetMissedHitsMax(UInt_t hits) { fMissedHitsMax = hits; }
|
123 |
void SetWrongHitsMax(UInt_t hits) { fWrongHitsMax = hits; }
|
124 |
void SetElectronPtMin(Double_t pt) { fElectronPtMin = pt; }
|
125 |
void SetElectronEtaMax(Double_t eta) { fElectronEtaMax = eta; }
|
126 |
void AddRhoRange(Double_t lower, Double_t upper);
|
127 |
void SetComputeEff(Bool_t b=kTRUE) { fComputeEff = b; }
|
128 |
void SetTrackerElectronsName(TString name) { fTrkElectronName = name; }
|
129 |
void SetGoodElectronsName(TString name) { fGoodElectronsName = name; }
|
130 |
void SetGoodTwoClusterElectronsName(TString name) { fGoodTwoClusterElectronsName = name; }
|
131 |
void SetBadElectronsName(TString name) { fBadElectronsName = name; }
|
132 |
void SetRequireCleanElectron(Bool_t b=kTRUE) { fRequireCleanElectron = b; }
|
133 |
void SetCleanElectronsName(TString name) { fCleanElectronsName = name; }
|
134 |
void SetTrackQualityFirstOnly(Bool_t b=kTRUE) { fTrackQualityFirstOnly = b; }
|
135 |
void SetHitBasedMatching(Bool_t b=kTRUE) { fHitBasedMatching = b; }
|
136 |
void SetMatchWe(Bool_t b=kTRUE) { fMatchWe = b; }
|
137 |
void SetMatchSimConv(Bool_t b=kTRUE) { fMatchSimConv = b; }
|
138 |
void SetFakingConversionsName(TString name) { fFakingConversionsName = name; }
|
139 |
void SetRemovedElectronsName(TString name) { fRemovedElectronsName = name; }
|
140 |
void SetAllConversionElectronsName(TString name) { fAllConversionElectronsName = name; }
|
141 |
void SetRequireGoodPv(Bool_t b) { fRequireGoodPv = b; }
|
142 |
void SetMaxTrackDzPv(Double_t x) { fMaxTrackDzPv = x; }
|
143 |
void SetMinClusterVtxQual(Double_t x) { fMinClusterVtxQual = x; }
|
144 |
void SetMaxSharedHits(UInt_t n) { fMaxNSharedHits = n; }
|
145 |
void SetMinSharedHits(UInt_t n) { fMinNSharedHits = n; }
|
146 |
|
147 |
|
148 |
protected:
|
149 |
Double_t fPtMin; //minimum pt cut on conversions
|
150 |
Double_t fEtaMax; //maximum Eta cut on conversions
|
151 |
Double_t fProbMin; //minimum fit probability cut on conversions
|
152 |
UInt_t fNHitsMin;//
|
153 |
UInt_t fNStereoHitsMin;//
|
154 |
UInt_t fNPixelHitsMin;//
|
155 |
Double_t fTrackProbMin;//
|
156 |
Double_t fLxyMin; //minimum decay length
|
157 |
Double_t fLzMin; //min z decay length
|
158 |
Double_t fAbsDxyMax; //max impact parameter of conversion (to PV)
|
159 |
Bool_t fExcludePXB1;
|
160 |
Double_t fMassMax;
|
161 |
UInt_t fMissedHitsMax;
|
162 |
UInt_t fWrongHitsMax;
|
163 |
Double_t fElectronPtMin;
|
164 |
Double_t fElectronEtaMax;
|
165 |
std::vector<Double_t> fRhoLbs;
|
166 |
std::vector<Double_t> fRhoUbs;
|
167 |
Bool_t fComputeEff;
|
168 |
Bool_t fHitBasedMatching;
|
169 |
Bool_t fRequireCleanElectron;
|
170 |
Bool_t fTrackQualityFirstOnly;
|
171 |
Bool_t fMatchWe;
|
172 |
Bool_t fMatchSimConv;
|
173 |
Bool_t fRequireGoodPv;
|
174 |
Double_t fMaxTrackDzPv;
|
175 |
Double_t fMinClusterVtxQual;
|
176 |
UInt_t fMaxNSharedHits;
|
177 |
UInt_t fMinNSharedHits;
|
178 |
|
179 |
const TrackCol *fTracks; //! point to track branch
|
180 |
const TrackCol *fGsfTracks; //! point to track branch
|
181 |
const TrackCol *fInOutTracks; //!
|
182 |
const TrackCol *fOutInTracks; //!
|
183 |
const ElectronCol *fElectrons; //! point to electron branch
|
184 |
const ElectronCol *fTrkElectrons; //! point to tracker electron branch
|
185 |
const PhotonCol *fPhotons; //! point to photon branch
|
186 |
const MCParticleCol *fMCParticles; //!
|
187 |
const DecayParticleCol *fMvfConversions; //!
|
188 |
const DecayParticleCol *fMvfConversionsUnconstrained; //!
|
189 |
const VertexCol *fPrimaryVertexes; //!
|
190 |
const EvtSelData *fEvtSel; //!
|
191 |
ElectronCol *fCleanElectrons;
|
192 |
|
193 |
TString fMCPartName; // name of particle collection
|
194 |
TString fTrackName; // name of track collection
|
195 |
TString fConvElectronName; // name of electron collection
|
196 |
TString fPhotonName; // name of photon collection
|
197 |
TString fMvfConvName;
|
198 |
TString fMvfConvUnconstrainedName;
|
199 |
TString fElectronName;
|
200 |
TString fTrkElectronName;
|
201 |
TString fCleanElectronsName;
|
202 |
TStopwatch fTimer;
|
203 |
|
204 |
TString fGoodElectronsName;
|
205 |
TString fGoodTwoClusterElectronsName;
|
206 |
TString fBadElectronsName;
|
207 |
|
208 |
TString fFakingConversionsName;
|
209 |
TString fRemovedElectronsName;
|
210 |
TString fAllConversionElectronsName;
|
211 |
|
212 |
TH1F *hConversionRadius; //! Conversion radius
|
213 |
TH1F *hConversionRadiusBarrel; //! Conversion radius, barrel only
|
214 |
TH1F *hConversionZ; //!
|
215 |
TH2F *hConversionRPhi; //! conversion position in R-phi plane
|
216 |
TH2F *hConversionRZ; //!
|
217 |
TH2F *hConversionFoldedRZ; //!
|
218 |
TH1F *hGammaPt; //! photon pt
|
219 |
TH1F *hGammaEta; //! photon eta
|
220 |
TH1F *hGammaMass; //! photon mass
|
221 |
TH1F *hGammaPhi;//! photon phi
|
222 |
TH1F *hSimMatchedGammaMass; //!
|
223 |
TH1F *hConvProb; //! conversion vertex fit probability
|
224 |
TH1F *hConvChi2; //! conversion vertex fit chi squared
|
225 |
TH1F *hSimMatchedConvChi2; //!
|
226 |
TH1F *hConvDCotTheta;//!
|
227 |
TH1F *hConvDCotThetaPreCut;//!
|
228 |
TH1F *hConvEOverP; //! conversion E over P
|
229 |
TH1F *hElectronPt; //! pt of conversion electrons
|
230 |
TH1F *hMinElectronPt; //!
|
231 |
TH1F *hSimMinElectronPt; //!
|
232 |
TH1F *hSimMatchedMinElectronPt; //!
|
233 |
TH1F *hSimMatchedMinElectronSimPt; //!
|
234 |
TH1F *hElectronEta; //! eta of conversion electrons
|
235 |
TH1F *hEPairMass; //! invariant mass of electron track pair
|
236 |
TH1F *hEPairDeltaPhi; //! angle between electron momentum vectors
|
237 |
TH1F *hGenNumDaughters; //!
|
238 |
TH1F *hGenDaughterPt; //!
|
239 |
TH1F *hGenDecayRadius; //!
|
240 |
TH1F *hSimPt; //!
|
241 |
TH1F *hSimEta; //!
|
242 |
TH1F *hSimConvRadius; //!
|
243 |
TH2F *hSimConvPosition; //!
|
244 |
TH1F *hTrackSimMatchType; //!
|
245 |
TH1F *hParentSimMatchType; //!
|
246 |
TH1F *hSimMatchedConvRadius; //!
|
247 |
TH1F *hSimMatchedConvProb; //!
|
248 |
TH1F *hSimMatchedEPairMass; //!
|
249 |
TH1F *hSimMatchedEPairDeltaPhi; //!
|
250 |
TH1F *hSimMatchedSimConvRadius; //!
|
251 |
TH1F *hSimMatchedConvResolution; //!
|
252 |
TH1F *hSimMatchedConvPhiRes; //!
|
253 |
TH1F *hSimMatchedConvEOverP; //!
|
254 |
TH1F *hSimMatchedElectronPt; //!
|
255 |
TH1F *hSimMatchedGammaPt; //!
|
256 |
TH1F *hSimMatchedGammaEta; //!
|
257 |
TH1F *hSimMatchedSimGammaPt; //!
|
258 |
TH1F *hSimMatchedSimGammaEta; //!
|
259 |
TH1F *hTrackChi2;//!
|
260 |
TH1F *hTrackProb;//!
|
261 |
TH1F *hTrackNHits;//!
|
262 |
TH1F *hTrackNWrongHits;//!
|
263 |
TH1F *hTrackNMissingHits;//!
|
264 |
TH1F *hNSharedHits;//!
|
265 |
TH2F *hTrackNHitsProb;//!
|
266 |
TH1F *hTrackD0; //!
|
267 |
TH1F *hTrackDzPv; //!
|
268 |
TH1F *hUnMatchedTrackChi2;//!
|
269 |
TH1F *hUnMatchedTrackProb;//!
|
270 |
TH1F *hUnMatchedTrackNHits;//!
|
271 |
TH2F *hUnMatchedTrackNHitsProb;//!
|
272 |
TH1F *hUnMatchedTrackD0; //!
|
273 |
TH1F *hSimMatchedTrackChi2;//!
|
274 |
TH1F *hSimMatchedTrackProb;//!
|
275 |
TH1F *hSimMatchedTrackNHits;//!
|
276 |
TH2F *hSimMatchedTrackNHitsProb;//!
|
277 |
TH1F *hSimMatchedTrackD0; //!
|
278 |
TH1F *hLxy; //!
|
279 |
TH1F *hLxyOverLxyErr; //!
|
280 |
TH1F *hLz; //!
|
281 |
TH1F *hLzOverLzErr; //!
|
282 |
TH1F *hDxy;//!
|
283 |
TH1F *hSimMatchedLxy; //!
|
284 |
TH1F *hSimMatchedLz; //!
|
285 |
TH1F *hSimMatchedDxy;//!
|
286 |
TH1F *hNTracks; //!
|
287 |
TH1F *hSimMatchedNTracks; //!
|
288 |
TH1F *hIsolation;//!
|
289 |
TH1F *hSimMatchedIsolation; //!
|
290 |
TH1F *hNConversions; //!
|
291 |
TH1F *hDoubleConvMass; //!
|
292 |
TH1F *hConvGammaMass; //!
|
293 |
TH1F *hPiPiMass; //!
|
294 |
|
295 |
TH1F *hAllConversionElectronPt;
|
296 |
TH1F *hAllConversionElectronEta;
|
297 |
TH1F *hRemovedElectronPt;
|
298 |
TH1F *hRemovedElectronEta;
|
299 |
|
300 |
TH1F *hAllConversionElectronPtWrongCharge;
|
301 |
TH1F *hAllConversionElectronEtaWrongCharge;
|
302 |
TH1F *hRemovedElectronPtWrongCharge;
|
303 |
TH1F *hRemovedElectronEtaWrongCharge;
|
304 |
|
305 |
TH1F *hAllConversionElectronChargeAssign;
|
306 |
TH1F *hRemovedElectronChargeAssign;
|
307 |
|
308 |
TH1F *hTrackAlgo;
|
309 |
|
310 |
TH1F *hCharge;
|
311 |
TH2F *hPt1Pt2;
|
312 |
|
313 |
TH1F *hClusVtxDiff;
|
314 |
TH1F *hClusVtxQual;
|
315 |
|
316 |
|
317 |
|
318 |
ClassDef(ConversionRemoval,1)
|
319 |
};
|
320 |
}
|
321 |
#endif
|