1 |
// -*- C++ -*-
|
2 |
//
|
3 |
// Package: Photon
|
4 |
// Class: Photon
|
5 |
//
|
6 |
/**\class Photon Photon.cc MyCode/Photon/src/Photon.cc
|
7 |
|
8 |
Description: <one line class summary>
|
9 |
|
10 |
Implementation:
|
11 |
<Notes on implementation>
|
12 |
*/
|
13 |
//
|
14 |
// Original Author: Sean Gregory Simon
|
15 |
// Created: Fri Nov 16 09:36:56 CET 2007
|
16 |
// $Id$
|
17 |
//
|
18 |
//
|
19 |
|
20 |
/*
|
21 |
#include "CMS1/Base/interface/BaseStreamer.h"
|
22 |
#include "CMS1/Base/interface/PhotonUtil.h"
|
23 |
#include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
|
24 |
#include "DataFormats/EgammaReco/interface/ClusterShape.h"
|
25 |
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
|
26 |
#include "DataFormats/EgammaReco/interface/BasicClusterShapeAssociation.h"
|
27 |
#include "DataFormats/TrackReco/interface/Track.h"
|
28 |
#include "DataFormats/VertexReco/interface/Vertex.h"
|
29 |
#include "DataFormats/VertexReco/interface/VertexFwd.h"
|
30 |
#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
|
31 |
#include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
|
32 |
|
33 |
#include "FWCore/Framework/interface/Frameworkfwd.h"
|
34 |
#include "FWCore/Framework/interface/EDAnalyzer.h"
|
35 |
#include "FWCore/Framework/interface/Event.h"
|
36 |
#include "FWCore/Framework/interface/MakerMacros.h"
|
37 |
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
38 |
#include "FWCore/ParameterSet/interface/InputTag.h"
|
39 |
#include "DataFormats/Math/interface/Point3D.h"
|
40 |
#include "Math/VectorUtil.h"
|
41 |
*/
|
42 |
// system include files
|
43 |
#include <memory>
|
44 |
#include <cmath>
|
45 |
#include "Math/VectorUtil.h"
|
46 |
#include "DataFormats/Math/interface/LorentzVector.h"
|
47 |
|
48 |
|
49 |
#include "DataFormats/EgammaCandidates/interface/Photon.h"
|
50 |
#include "DataFormats/EgammaCandidates/interface/ConvertedPhoton.h"
|
51 |
|
52 |
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
|
53 |
#include "DataFormats/EgammaReco/interface/SuperCluster.h"
|
54 |
#include "DataFormats/EgammaReco/interface/ClusterShape.h"
|
55 |
#include "DataFormats/EgammaReco/interface/BasicClusterShapeAssociation.h"
|
56 |
#include "DataFormats/TrackReco/interface/Track.h"
|
57 |
#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
|
58 |
#include "DataFormats/VertexReco/interface/Vertex.h"
|
59 |
#include "DataFormats/VertexReco/interface/VertexFwd.h"
|
60 |
|
61 |
// user include files
|
62 |
|
63 |
//
|
64 |
// class decleration
|
65 |
//
|
66 |
namespace mycode {
|
67 |
class Photon {
|
68 |
public:
|
69 |
Photon();
|
70 |
virtual ~Photon();
|
71 |
|
72 |
// Photon Variables
|
73 |
float pt();
|
74 |
void setpt(float);
|
75 |
float et();
|
76 |
void setet(float);
|
77 |
float eta();
|
78 |
void seteta(float);
|
79 |
float phi();
|
80 |
void setphi(float);
|
81 |
reco::SuperClusterRef superCluster();
|
82 |
void setsuperCluster(reco::SuperClusterRef);
|
83 |
math::XYZVector momentum();
|
84 |
void setmomentum(math::XYZVector);
|
85 |
// MC variables
|
86 |
float MCpt();
|
87 |
void setMCpt(float);
|
88 |
float MCet();
|
89 |
void setMCet(float);
|
90 |
float MCeta();
|
91 |
void setMCeta(float);
|
92 |
float MCphi();
|
93 |
void setMCphi(float);
|
94 |
int MCid();
|
95 |
void setMCid(int);
|
96 |
float MCdeltaR();
|
97 |
void setMCdeltaR(float);
|
98 |
math::XYZVector MCmomentum();
|
99 |
void setMCmomentum(math::XYZVector);
|
100 |
// Ecal Variables
|
101 |
float r9();
|
102 |
void setr9(float);
|
103 |
float r19();
|
104 |
void setr19(float);
|
105 |
float eMax();
|
106 |
void seteMax(float);
|
107 |
float e3x3();
|
108 |
void sete3x3(float);
|
109 |
float e5x5();
|
110 |
void sete5x5(float);
|
111 |
float sigmaEtaEta();
|
112 |
void setsigmaEtaEta(float);
|
113 |
float sigmaPhiPhi();
|
114 |
void setsigmaPhiPhi(float);
|
115 |
float sigmaEtaPhi();
|
116 |
void setsigmaEtaPhi(float);
|
117 |
// Tracker Variables
|
118 |
int ntk1Cone();
|
119 |
void setntk1Cone(int);
|
120 |
int ntk2Cone();
|
121 |
void setntk2Cone(int);
|
122 |
float sumTrkPt1Cone();
|
123 |
void setsumTrkPt1Cone(float);
|
124 |
float sumTrkPt2Cone();
|
125 |
void setsumTrkPt2Cone(float);
|
126 |
float dRtrk1();
|
127 |
void setdRtrk1(float);
|
128 |
float dRtrk2();
|
129 |
void setdRtrk2(float);
|
130 |
float dRtrk3();
|
131 |
void setdRtrk3(float);
|
132 |
// Hcal Variables
|
133 |
float sumEtHcalDeltaR3();
|
134 |
void setsumEtHcalDeltaR3(float);
|
135 |
float sumEtHcalDeltaR4();
|
136 |
void setsumEtHcalDeltaR4(float);
|
137 |
float sumEtOverEtHcalDeltaR3();
|
138 |
void setsumEtOverEtHcalDeltaR3(float);
|
139 |
float sumEtOverEtHcalDeltaR4();
|
140 |
void setsumEtOverEtHcalDeltaR4(float);
|
141 |
float orcaHoverE();
|
142 |
void setorcaHoverE(float);
|
143 |
|
144 |
|
145 |
|
146 |
void getPhoton( const reco::Photon *recoPhoton );
|
147 |
void getEcalVars( edm::Handle<reco::BasicClusterShapeAssociationCollection> barrelClShp,
|
148 |
edm::Handle<reco::BasicClusterShapeAssociationCollection> endcapClShp );
|
149 |
void getTrackerVars( edm::Handle<reco::TrackCollection> tracks );
|
150 |
void getHcalVars( edm::Handle<edm::SortedCollection<CaloTower> > caloTowers );
|
151 |
|
152 |
float deltaR(float,float);
|
153 |
|
154 |
private:
|
155 |
// Photon Variables
|
156 |
float *pt_;
|
157 |
float *et_;
|
158 |
float *eta_;
|
159 |
float *phi_;
|
160 |
reco::SuperClusterRef *sclRef_;
|
161 |
math::XYZVector *momentum_;
|
162 |
// MC Variables
|
163 |
float *MCpt_;
|
164 |
float *MCet_;
|
165 |
float *MCeta_;
|
166 |
float *MCphi_;
|
167 |
int *MCid_;
|
168 |
float *MCdeltaR_;
|
169 |
math::XYZVector *MCmomentum_;
|
170 |
// Ecal Variables
|
171 |
float *r9_;
|
172 |
float *r19_;
|
173 |
float *eMax_;
|
174 |
float *e3x3_;
|
175 |
float *e5x5_;
|
176 |
float *sigmaEtaEta_;
|
177 |
float *sigmaPhiPhi_;
|
178 |
// Tracker Variables
|
179 |
int *ntk1Cone_;
|
180 |
int *ntk2Cone_;
|
181 |
float *sumTrkPt1Cone_;
|
182 |
float *sumTrkPt2Cone_;
|
183 |
float *dRtrk1_;
|
184 |
float *dRtrk2_;
|
185 |
float *dRtrk3_;
|
186 |
// Hcal Variables
|
187 |
float *sumEtHcalDeltaR3_;
|
188 |
float *sumEtHcalDeltaR4_;
|
189 |
float *sumEtOverEtHcalDeltaR3_;
|
190 |
float *sumEtOverEtHcalDeltaR4_;
|
191 |
float *orcaHoverE_;
|
192 |
};
|
193 |
|
194 |
|
195 |
typedef std::vector<mycode::Photon*> Photons;
|
196 |
typedef std::vector<mycode::Photon*>::iterator PhotonIterator;
|
197 |
|
198 |
}
|
199 |
//
|
200 |
// constructors and destructor
|
201 |
//
|
202 |
mycode::Photon::Photon()
|
203 |
{
|
204 |
// Photon Variables
|
205 |
pt_ = new float;*pt_ = -99;
|
206 |
et_ = new float;*et_ = -99;
|
207 |
eta_ = new float;*eta_ = -99;
|
208 |
phi_ = new float;*phi_ = -99;
|
209 |
sclRef_ = new reco::SuperClusterRef;
|
210 |
momentum_ = new math::XYZVector;
|
211 |
// MC Variables
|
212 |
MCpt_ = new float;*pt_ = -99;
|
213 |
MCet_ = new float;*et_ = -99;
|
214 |
MCeta_ = new float;*eta_ = -99;
|
215 |
MCphi_ = new float;*phi_ = -99;
|
216 |
MCid_ = new int;*MCid_ = -99;
|
217 |
MCdeltaR_ = new float;*MCdeltaR_ = +999;
|
218 |
MCmomentum_ = new math::XYZVector;
|
219 |
// Ecal Variables
|
220 |
r9_ = new float;*r9_ = -99;
|
221 |
r19_ = new float;*r19_ = -99;
|
222 |
eMax_ = new float;*eMax_ = -99;
|
223 |
e3x3_ = new float;*e3x3_ = -99;
|
224 |
e5x5_ = new float;*e5x5_ = -99;
|
225 |
sigmaEtaEta_ = new float;*sigmaEtaEta_ = -99;
|
226 |
sigmaPhiPhi_ = new float;*sigmaPhiPhi_ = -99;
|
227 |
// Tracker Variables
|
228 |
ntk1Cone_ = new int;*ntk1Cone_ = -99;
|
229 |
ntk2Cone_ = new int;*ntk2Cone_ = -99;
|
230 |
sumTrkPt1Cone_ = new float;*sumTrkPt1Cone_ = -99;
|
231 |
sumTrkPt2Cone_ = new float;*sumTrkPt2Cone_ = -99;
|
232 |
dRtrk1_ = new float;*dRtrk1_ = -99;
|
233 |
dRtrk2_ = new float;*dRtrk2_ = -99;
|
234 |
dRtrk3_ = new float;*dRtrk3_ = -99;
|
235 |
// Hcal Variables
|
236 |
sumEtHcalDeltaR3_ = new float;*sumEtHcalDeltaR3_ = -99;
|
237 |
sumEtHcalDeltaR4_ = new float;*sumEtHcalDeltaR4_ = -99;
|
238 |
sumEtOverEtHcalDeltaR3_ = new float;*sumEtOverEtHcalDeltaR3_ = -99;
|
239 |
sumEtOverEtHcalDeltaR4_ = new float;*sumEtOverEtHcalDeltaR4_ = -99;
|
240 |
orcaHoverE_ = new float;*orcaHoverE_ = -99;
|
241 |
}
|
242 |
|
243 |
mycode::Photon::~Photon() {
|
244 |
// Photon Variables
|
245 |
delete pt_;
|
246 |
delete et_;
|
247 |
delete eta_;
|
248 |
delete phi_;
|
249 |
delete sclRef_;
|
250 |
delete momentum_;
|
251 |
// MC Variables
|
252 |
delete MCpt_;
|
253 |
delete MCet_;
|
254 |
delete MCeta_;
|
255 |
delete MCphi_;
|
256 |
delete MCid_;
|
257 |
delete MCdeltaR_;
|
258 |
delete MCmomentum_;
|
259 |
// Ecal Variables
|
260 |
delete r9_;
|
261 |
delete r19_;
|
262 |
delete eMax_;
|
263 |
delete e3x3_;
|
264 |
delete e5x5_;
|
265 |
delete sigmaEtaEta_;
|
266 |
delete sigmaPhiPhi_;
|
267 |
// Tracker Variables
|
268 |
delete ntk1Cone_;
|
269 |
delete ntk2Cone_;
|
270 |
delete sumTrkPt1Cone_;
|
271 |
delete sumTrkPt2Cone_;
|
272 |
delete dRtrk1_;
|
273 |
delete dRtrk2_;
|
274 |
delete dRtrk3_;
|
275 |
// Hcal Variables
|
276 |
delete sumEtHcalDeltaR3_;
|
277 |
delete sumEtHcalDeltaR4_;
|
278 |
delete sumEtOverEtHcalDeltaR3_;
|
279 |
delete sumEtOverEtHcalDeltaR4_;
|
280 |
delete orcaHoverE_;
|
281 |
}
|
282 |
// Photon Variables
|
283 |
float mycode::Photon::pt() { return *pt_;}
|
284 |
void mycode::Photon::setpt(float setval) { *pt_ = setval;}
|
285 |
float mycode::Photon::et() { return *et_;}
|
286 |
void mycode::Photon::setet(float setval) { *et_ = setval;}
|
287 |
float mycode::Photon::eta() { return *eta_;}
|
288 |
void mycode::Photon::seteta(float setval) { *eta_ = setval;}
|
289 |
float mycode::Photon::phi() { return *phi_;}
|
290 |
void mycode::Photon::setphi(float setval) { *phi_ = setval;}
|
291 |
reco::SuperClusterRef mycode::Photon::superCluster() { return *sclRef_;}
|
292 |
void mycode::Photon::setsuperCluster(reco::SuperClusterRef setval) { *sclRef_ = setval;}
|
293 |
math::XYZVector mycode::Photon::momentum() { return *momentum_;}
|
294 |
void mycode::Photon::setmomentum(math::XYZVector setval) { *momentum_ = setval;}
|
295 |
// MC Variables
|
296 |
float mycode::Photon::MCpt() { return *MCpt_;}
|
297 |
void mycode::Photon::setMCpt(float setval) { *MCpt_ = setval;}
|
298 |
float mycode::Photon::MCet() { return *MCet_;}
|
299 |
void mycode::Photon::setMCet(float setval) { *MCet_ = setval;}
|
300 |
float mycode::Photon::MCeta() { return *MCeta_;}
|
301 |
void mycode::Photon::setMCeta(float setval) { *MCeta_ = setval;}
|
302 |
float mycode::Photon::MCphi() { return *MCphi_;}
|
303 |
void mycode::Photon::setMCphi(float setval) { *MCphi_ = setval;}
|
304 |
int mycode::Photon::MCid() { return *MCid_;}
|
305 |
void mycode::Photon::setMCid(int setval) { *MCid_ = setval;}
|
306 |
float mycode::Photon::MCdeltaR() { return *MCdeltaR_;}
|
307 |
void mycode::Photon::setMCdeltaR(float setval) { *MCdeltaR_ = setval;}
|
308 |
math::XYZVector mycode::Photon::MCmomentum() { return *MCmomentum_;}
|
309 |
void mycode::Photon::setMCmomentum(math::XYZVector setval) { *MCmomentum_ = setval;}
|
310 |
// Ecal Variables
|
311 |
float mycode::Photon::r9() { return *r9_;}
|
312 |
void mycode::Photon::setr9(float setval) { *r9_ = setval;}
|
313 |
float mycode::Photon::r19() { return *r19_;}
|
314 |
void mycode::Photon::setr19(float setval) { *r19_ = setval;}
|
315 |
float mycode::Photon::eMax() { return *eMax_;}
|
316 |
void mycode::Photon::seteMax(float setval) { *eMax_ = setval;}
|
317 |
float mycode::Photon::e3x3() { return *e3x3_;}
|
318 |
void mycode::Photon::sete3x3(float setval) { *e3x3_ = setval;}
|
319 |
float mycode::Photon::e5x5() { return *e5x5_;}
|
320 |
void mycode::Photon::sete5x5(float setval) { *e5x5_ = setval;}
|
321 |
float mycode::Photon::sigmaEtaEta() { return *sigmaEtaEta_;}
|
322 |
void mycode::Photon::setsigmaEtaEta(float setval) { *sigmaEtaEta_ = setval;}
|
323 |
float mycode::Photon::sigmaPhiPhi() { return *sigmaPhiPhi_;}
|
324 |
void mycode::Photon::setsigmaPhiPhi(float setval) { *sigmaPhiPhi_ = setval;}
|
325 |
// Tracker Variables
|
326 |
int mycode::Photon::ntk1Cone() { return *ntk1Cone_;}
|
327 |
void mycode::Photon::setntk1Cone(int setval) { *ntk1Cone_ = setval;}
|
328 |
int mycode::Photon::ntk2Cone() { return *ntk2Cone_;}
|
329 |
void mycode::Photon::setntk2Cone(int setval) { *ntk2Cone_ = setval;}
|
330 |
float mycode::Photon::sumTrkPt1Cone() { return *sumTrkPt1Cone_;}
|
331 |
void mycode::Photon::setsumTrkPt1Cone(float setval) { *sumTrkPt1Cone_ = setval;}
|
332 |
float mycode::Photon::sumTrkPt2Cone() { return *sumTrkPt2Cone_;}
|
333 |
void mycode::Photon::setsumTrkPt2Cone(float setval) { *sumTrkPt2Cone_ = setval;}
|
334 |
float mycode::Photon::dRtrk1() { return *dRtrk1_;}
|
335 |
void mycode::Photon::setdRtrk1(float setval) { *dRtrk1_ = setval;}
|
336 |
float mycode::Photon::dRtrk2() { return *dRtrk2_;}
|
337 |
void mycode::Photon::setdRtrk2(float setval) { *dRtrk2_ = setval;}
|
338 |
float mycode::Photon::dRtrk3() { return *dRtrk3_;}
|
339 |
void mycode::Photon::setdRtrk3(float setval) { *dRtrk3_ = setval;}
|
340 |
// Hcal Variables
|
341 |
float mycode::Photon::sumEtHcalDeltaR3() { return *sumEtHcalDeltaR3_;}
|
342 |
void mycode::Photon::setsumEtHcalDeltaR3(float setval) { *sumEtHcalDeltaR3_ = setval;}
|
343 |
float mycode::Photon::sumEtHcalDeltaR4() { return *sumEtHcalDeltaR4_;}
|
344 |
void mycode::Photon::setsumEtHcalDeltaR4(float setval) { *sumEtHcalDeltaR4_ = setval;}
|
345 |
float mycode::Photon::sumEtOverEtHcalDeltaR3() { return *sumEtOverEtHcalDeltaR3_;}
|
346 |
void mycode::Photon::setsumEtOverEtHcalDeltaR3(float setval) { *sumEtOverEtHcalDeltaR3_ = setval;}
|
347 |
float mycode::Photon::sumEtOverEtHcalDeltaR4() { return *sumEtOverEtHcalDeltaR4_;}
|
348 |
void mycode::Photon::setsumEtOverEtHcalDeltaR4(float setval) { *sumEtOverEtHcalDeltaR4_ = setval;}
|
349 |
float mycode::Photon::orcaHoverE() { return *orcaHoverE_;}
|
350 |
void mycode::Photon::setorcaHoverE(float setval) { *orcaHoverE_ = setval;}
|