48 |
|
#include "FWCore/Utilities/interface/InputTag.h" |
49 |
|
#include "DataFormats/HeavyIonEvent/interface/CentralityBins.h" |
50 |
|
#include "DataFormats/CaloTowers/interface/CaloTower.h" |
51 |
< |
#include "DataFormats/HeavyIonEvent/interface/Centrality.h" |
51 |
> |
#include "DataFormats/HeavyIonEvent/interface/CentralityProvider.h" |
52 |
|
#include "SimDataFormats/HiGenData/interface/GenHIEvent.h" |
53 |
|
#include "DataFormats/PatCandidates/interface/Jet.h" |
54 |
|
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" |
55 |
|
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" |
56 |
|
#include "DataFormats/HcalDetId/interface/HcalDetId.h" |
57 |
|
|
58 |
+ |
#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" |
59 |
+ |
|
60 |
|
#include "TNtuple.h" |
61 |
|
|
62 |
|
using namespace std; |
77 |
|
virtual void endJob() ; |
78 |
|
|
79 |
|
// ----------member data --------------------------- |
78 |
– |
|
79 |
– |
|
80 |
– |
edm::Handle<reco::Centrality> cent; |
80 |
|
edm::Handle<vector<double> > ktRhos; |
81 |
|
edm::Handle<vector<double> > akRhos; |
82 |
|
|
90 |
|
edm::Handle<HBHERecHitCollection> hbheHits1; |
91 |
|
edm::Handle<HBHERecHitCollection> hbheHits2; |
92 |
|
|
93 |
+ |
edm::Handle<reco::BasicClusterCollection> bClusters1; |
94 |
+ |
edm::Handle<reco::BasicClusterCollection> bClusters2; |
95 |
+ |
|
96 |
+ |
|
97 |
|
typedef vector<EcalRecHit>::const_iterator EcalIterator; |
98 |
|
typedef vector<HFRecHit>::const_iterator HFIterator; |
99 |
|
typedef vector<HBHERecHit>::const_iterator HBHEIterator; |
108 |
|
edm::InputTag EBSrc2_; |
109 |
|
edm::InputTag EESrc1_; |
110 |
|
edm::InputTag EESrc2_; |
111 |
+ |
|
112 |
+ |
edm::InputTag BCSrc1_; |
113 |
+ |
edm::InputTag BCSrc2_; |
114 |
+ |
|
115 |
|
edm::InputTag signalTag_; |
109 |
– |
edm::InputTag centTag_; |
116 |
|
|
117 |
+ |
TNtuple* ntBC; |
118 |
|
TNtuple* ntEB; |
119 |
|
TNtuple* ntEE; |
120 |
|
TNtuple* ntHBHE; |
123 |
|
|
124 |
|
double cone; |
125 |
|
bool jetsOnly_; |
126 |
+ |
bool doBasicClusters_; |
127 |
|
|
128 |
|
edm::Service<TFileService> fs; |
129 |
< |
const CentralityBins * cbins_; |
129 |
> |
CentralityProvider* centrality_; |
130 |
|
const CaloGeometry *geo; |
131 |
|
}; |
132 |
|
|
142 |
|
// constructors and destructor |
143 |
|
// |
144 |
|
RecHitComparison::RecHitComparison(const edm::ParameterSet& iConfig) : |
145 |
< |
cbins_(0), |
145 |
> |
centrality_(0), |
146 |
|
geo(0), |
147 |
|
cone(0.5) |
148 |
|
{ |
149 |
|
//now do what ever initialization is needed |
142 |
– |
centTag_ = iConfig.getUntrackedParameter<edm::InputTag>("centrality",edm::InputTag("hiCentrality","","RECO")); |
143 |
– |
|
150 |
|
jetsOnly_ = iConfig.getUntrackedParameter<bool>("jetsOnly",false); |
151 |
+ |
doBasicClusters_ = iConfig.getUntrackedParameter<bool>("doBasicClusters",false); |
152 |
|
signalTag_ = iConfig.getUntrackedParameter<edm::InputTag>("signalJets",edm::InputTag("iterativeCone5CaloJets","","SIGNAL")); |
153 |
|
|
154 |
|
HcalRecHitHFSrc1_ = iConfig.getUntrackedParameter<edm::InputTag>("hcalHFRecHitSrc1",edm::InputTag("hfreco")); |
159 |
|
EBSrc2_ = iConfig.getUntrackedParameter<edm::InputTag>("EBRecHitSrc2",edm::InputTag("ecalRecHit","EcalRecHitsEB","SIGNALONLY")); |
160 |
|
EESrc1_ = iConfig.getUntrackedParameter<edm::InputTag>("EERecHitSrc1",edm::InputTag("ecalRecHit","EcalRecHitsEE","RECO")); |
161 |
|
EESrc2_ = iConfig.getUntrackedParameter<edm::InputTag>("EERecHitSrc2",edm::InputTag("ecalRecHit","EcalRecHitsEE","SIGNALONLY")); |
162 |
< |
|
162 |
> |
BCSrc1_ = iConfig.getUntrackedParameter<edm::InputTag>("BasicClusterSrc1",edm::InputTag("ecalRecHit","EcalRecHitsEB","RECO")); |
163 |
> |
BCSrc2_ = iConfig.getUntrackedParameter<edm::InputTag>("BasicClusterSrc2",edm::InputTag("ecalRecHit","EcalRecHitsEB","SIGNALONLY")); |
164 |
|
} |
165 |
|
|
166 |
|
|
181 |
|
void |
182 |
|
RecHitComparison::analyze(const edm::Event& ev, const edm::EventSetup& iSetup) |
183 |
|
{ |
184 |
< |
|
177 |
< |
if(!cbins_) cbins_ = getCentralityBinsFromDB(iSetup); |
184 |
> |
if(!centrality_) centrality_ = new CentralityProvider(iSetup); |
185 |
|
if(!geo){ |
186 |
|
edm::ESHandle<CaloGeometry> pGeo; |
187 |
|
iSetup.get<CaloGeometryRecord>().get(pGeo); |
189 |
|
} |
190 |
|
|
191 |
|
using namespace edm; |
185 |
– |
|
186 |
– |
ev.getByLabel(centTag_,cent); |
192 |
|
ev.getByLabel(EBSrc1_,ebHits1); |
193 |
< |
ev.getByLabel(EBSrc1_,ebHits2); |
193 |
> |
ev.getByLabel(EBSrc2_,ebHits2); |
194 |
|
ev.getByLabel(signalTag_,signalJets); |
195 |
|
|
196 |
|
ev.getByLabel(HcalRecHitHFSrc1_,hfHits1); |
201 |
|
ev.getByLabel(EESrc1_,eeHits1); |
202 |
|
ev.getByLabel(EESrc2_,eeHits2); |
203 |
|
|
204 |
< |
double hf = cent->EtHFhitSum(); |
205 |
< |
double sumet = cent->EtMidRapiditySum(); |
206 |
< |
int run = ev.id().run(); |
207 |
< |
run = 1; |
208 |
< |
int bin = cbins_->getBin(hf); |
209 |
< |
int margin = 0; |
204 |
> |
if(doBasicClusters_){ |
205 |
> |
ev.getByLabel(BCSrc1_,bClusters1); |
206 |
> |
ev.getByLabel(BCSrc2_,bClusters2); |
207 |
> |
} |
208 |
> |
|
209 |
> |
centrality_->newEvent(ev,iSetup); |
210 |
> |
double hf = centrality_->centralityValue(); |
211 |
> |
int bin = centrality_->getBin(); |
212 |
|
|
213 |
|
vector<double> fFull; |
214 |
|
vector<double> f05; |
297 |
|
double eta2 = pos2.eta(); |
298 |
|
double phi2 = pos2.eta(); |
299 |
|
double et2 = e2*sin(pos2.theta()); |
300 |
< |
if(!jetsOnly_ || isjet) ntEB->Fill(e1,et1,e2,et2,eta2,phi2,sumet,hf,bin,jetpt,drjet); |
300 |
> |
if(!jetsOnly_ || isjet) ntEB->Fill(e1,et1,e2,et2,eta2,phi2,hf,bin,jetpt,drjet); |
301 |
|
} |
302 |
|
|
303 |
|
for(unsigned int i = 0; i < eeHits1->size(); ++i){ |
334 |
|
double eta2 = pos2.eta(); |
335 |
|
double phi2 = pos2.eta(); |
336 |
|
double et2 = e2*sin(pos2.theta()); |
337 |
< |
if(!jetsOnly_ || isjet) ntEE->Fill(e1,et1,e2,et2,eta2,phi2,sumet,hf,bin,jetpt,drjet); |
337 |
> |
if(!jetsOnly_ || isjet) ntEE->Fill(e1,et1,e2,et2,eta2,phi2,hf,bin,jetpt,drjet); |
338 |
|
} |
339 |
|
|
340 |
|
for(unsigned int i = 0; i < hbheHits1->size(); ++i){ |
371 |
|
double eta2 = pos2.eta(); |
372 |
|
double phi2 = pos2.eta(); |
373 |
|
double et2 = e2*sin(pos2.theta()); |
374 |
< |
if(!jetsOnly_ || isjet) ntHBHE->Fill(e1,et1,e2,et2,eta2,phi2,sumet,hf,bin,jetpt,drjet); |
374 |
> |
if(!jetsOnly_ || isjet) ntHBHE->Fill(e1,et1,e2,et2,eta2,phi2,hf,bin,jetpt,drjet); |
375 |
|
} |
376 |
|
|
377 |
|
for(unsigned int i = 0; i < hfHits1->size(); ++i){ |
408 |
|
double eta2 = pos2.eta(); |
409 |
|
double phi2 = pos2.eta(); |
410 |
|
double et2 = e2*sin(pos2.theta()); |
411 |
< |
if(!jetsOnly_ || isjet) ntHF->Fill(e1,et1,e2,et2,eta2,phi2,sumet,hf,bin,jetpt,drjet); |
411 |
> |
if(!jetsOnly_ || isjet) ntHF->Fill(e1,et1,e2,et2,eta2,phi2,hf,bin,jetpt,drjet); |
412 |
|
} |
413 |
|
|
414 |
|
for(unsigned int j1 = 0 ; j1 < signalJets->size(); ++j1){ |
427 |
|
void |
428 |
|
RecHitComparison::beginJob() |
429 |
|
{ |
430 |
< |
ntEB = fs->make<TNtuple>("ntEB","","e1:et1:e2:et2:eta:phi:sumet:hf:bin:ptjet:drjet"); |
431 |
< |
ntEE = fs->make<TNtuple>("ntEE","","e1:et1:e2:et2:eta:phi:sumet:hf:bin:ptjet:drjet"); |
432 |
< |
ntHBHE = fs->make<TNtuple>("ntHBHE","","e1:et1:e2:et2:eta:phi:sumet:hf:bin:ptjet:drjet"); |
433 |
< |
ntHF = fs->make<TNtuple>("ntHF","","e1:et1:e2:et2:eta:phi:sumet:hf:bin:ptjet:drjet"); |
430 |
> |
ntEB = fs->make<TNtuple>("ntEB","","e1:et1:e2:et2:eta:phi:hf:bin:ptjet:drjet"); |
431 |
> |
ntEE = fs->make<TNtuple>("ntEE","","e1:et1:e2:et2:eta:phi:hf:bin:ptjet:drjet"); |
432 |
> |
ntHBHE = fs->make<TNtuple>("ntHBHE","","e1:et1:e2:et2:eta:phi:hf:bin:ptjet:drjet"); |
433 |
> |
ntHF = fs->make<TNtuple>("ntHF","","e1:et1:e2:et2:eta:phi:hf:bin:ptjet:drjet"); |
434 |
> |
|
435 |
> |
ntBC = fs->make<TNtuple>("ntBC","","e1:et1:e2:et2:eta:phi:hf:bin:ptjet:drjet"); |
436 |
> |
|
437 |
|
ntjet = fs->make<TNtuple>("ntjet","","bin:pt:eta:ethit:f05:f1:f15:f2:f25:f3:em:emf"); |
438 |
|
|
439 |
|
} |