26 mInputCalo = iConfig.
getParameter<std::vector<edm::InputTag> >(
"srcCalo");
27 ecalLabels_=iConfig.
getParameter<std::vector<edm::InputTag> >(
"ecalInputs");
29 correctedIslandBarrelSuperClusterCollection_ = iConfig.
getParameter<std::string>(
"correctedIslandBarrelSuperClusterCollection");
30 correctedIslandBarrelSuperClusterProducer_ = iConfig.
getParameter<std::string>(
"correctedIslandBarrelSuperClusterProducer");
31 correctedIslandEndcapSuperClusterCollection_ = iConfig.
getParameter<std::string>(
"correctedIslandEndcapSuperClusterCollection");
32 correctedIslandEndcapSuperClusterProducer_ = iConfig.
getParameter<std::string>(
"correctedIslandEndcapSuperClusterProducer");
37 produces<reco::TrackCollection>(
"GammaJetTracksCollection");
38 produces<EcalRecHitCollection>(
"GammaJetEcalRecHitCollection");
39 produces<HBHERecHitCollection>(
"GammaJetHBHERecHitCollection");
40 produces<HORecHitCollection>(
"GammaJetHORecHitCollection");
41 produces<HFRecHitCollection>(
"GammaJetHFRecHitCollection");
42 produces<CaloJetCollection>(
"GammaJetJetBackToBackCollection");
43 produces<reco::SuperClusterCollection>(
"GammaJetGammaBackToBackCollection");
84 reco::SuperClusterCollection::const_iterator maxclusbarrel;
85 reco::SuperClusterCollection::const_iterator maxclusendcap;
87 double vetmax = -100.;
89 iEvent.
getByLabel(correctedIslandBarrelSuperClusterProducer_,
90 correctedIslandBarrelSuperClusterCollection_,
91 pCorrectedIslandBarrelSuperClusters);
92 if (!pCorrectedIslandBarrelSuperClusters.isValid()) {
94 if (!allowMissingInputs_) {
95 *pCorrectedIslandBarrelSuperClusters;
101 maxclusbarrel = correctedIslandBarrelSuperClusters->begin();
102 for(reco::SuperClusterCollection::const_iterator aClus = correctedIslandBarrelSuperClusters->begin();
103 aClus != correctedIslandBarrelSuperClusters->end(); aClus++) {
104 double vet = aClus->energy()/cosh(aClus->eta());
105 cout<<
" Barrel supercluster " << vet <<
" energy "<<aClus->energy()<<
" eta "<<aClus->eta()<<endl;
110 maxclusbarrel = aClus;
119 iEvent.
getByLabel(correctedIslandEndcapSuperClusterProducer_,
120 correctedIslandEndcapSuperClusterCollection_,
121 pCorrectedIslandEndcapSuperClusters);
122 if (!pCorrectedIslandEndcapSuperClusters.isValid()) {
124 if (!allowMissingInputs_) {
125 *pCorrectedIslandEndcapSuperClusters;
131 maxclusendcap = correctedIslandEndcapSuperClusters->end();
132 double vetmaxe = vetmax;
133 for(reco::SuperClusterCollection::const_iterator aClus = correctedIslandEndcapSuperClusters->begin();
134 aClus != correctedIslandEndcapSuperClusters->end(); aClus++) {
135 double vet = aClus->energy()/cosh(aClus->eta());
141 maxclusendcap = aClus;
148 cout<<
" Number of gammas "<<nclusb<<
" "<<ncluse<<endl;
150 if( nclusb == 0 && ncluse == 0 ) {
152 iEvent.
put( outputTColl,
"GammaJetTracksCollection");
153 iEvent.
put( miniEcalRecHitCollection,
"GammaJetEcalRecHitCollection");
154 iEvent.
put( miniHBHERecHitCollection,
"GammaJetHBHERecHitCollection");
155 iEvent.
put( miniHORecHitCollection,
"GammaJetHORecHitCollection");
156 iEvent.
put( miniHFRecHitCollection,
"GammaJetHFRecHitCollection");
157 iEvent.
put( result,
"GammaJetGammaBackToBackCollection");
158 iEvent.
put( resultjet,
"GammaJetJetBackToBackCollection");
163 double phigamma = -100.;
164 double etagamma = -100.;
167 result->push_back(*maxclusendcap);
168 phigamma = (*maxclusendcap).phi();
169 etagamma = (*maxclusendcap).eta();
173 result->push_back(*maxclusbarrel);
174 phigamma = (*maxclusbarrel).phi();
175 etagamma = (*maxclusbarrel).eta();
185 double phijet = -100.;
186 double etajet = -100.;
187 double phijet0 = -100.;
188 double etajet0 = -100.;
190 std::vector<edm::InputTag>::const_iterator ic;
191 for (ic=mInputCalo.begin(); ic!=mInputCalo.end(); ic++) {
197 if (!allowMissingInputs_) {
201 reco::CaloJetCollection::const_iterator
jet = jets->begin ();
205 if( jets->size() == 0 )
continue;
210 for (; jet != jets->end (); jet++)
212 phijet0 = (*jet).phi();
213 etajet0 = (*jet).eta();
217 if(numjet > 3)
break;
219 cout<<
" phi,eta "<< phigamma<<
" "<< etagamma<<
" "<<phijet0<<
" "<<etajet0<<endl;
223 double dphi = fabs(phigamma-phijet0);
224 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
225 double deta = fabs(etagamma-etajet0);
226 double dr =
sqrt(dphi*dphi+deta*deta);
227 if(dr < 0.5 )
continue;
228 resultjet->push_back ((*jet));
230 dphi = dphi*180./(4.*atan(1.));
231 if( fabs(dphi-180) < 30. )
235 phijet = (*jet).phi();
236 etajet = (*jet).eta();
239 if(iejet == 0) resultjet->clear();
243 if( resultjet->size() == 0 ) {
245 iEvent.
put( outputTColl,
"GammaJetTracksCollection");
246 iEvent.
put( miniEcalRecHitCollection,
"GammaJetEcalRecHitCollection");
247 iEvent.
put( miniHBHERecHitCollection,
"GammaJetHBHERecHitCollection");
248 iEvent.
put( miniHORecHitCollection,
"GammaJetHORecHitCollection");
249 iEvent.
put( miniHFRecHitCollection,
"GammaJetHFRecHitCollection");
250 iEvent.
put( result,
"GammaJetGammaBackToBackCollection");
251 iEvent.
put( resultjet,
"GammaJetJetBackToBackCollection");
263 std::vector<edm::InputTag>::const_iterator
i;
264 for (
i=ecalLabels_.begin();
i!=ecalLabels_.end();
i++) {
269 if (!allowMissingInputs_) {
270 cout<<
" No ECAL input "<<endl;
275 recHit != (*ec).end(); ++recHit)
279 double phihit = pos.
phi();
280 double etahit = pos.
eta();
282 double dphi = fabs(phigamma - phihit);
283 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
284 double deta = fabs(etagamma - etahit);
285 double dr =
sqrt(dphi*dphi + deta*deta);
286 if(dr<1.) miniEcalRecHitCollection->push_back(*recHit);
288 dphi = fabs(phijet - phihit);
289 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
290 deta = fabs(etajet - etahit);
291 dr =
sqrt(dphi*dphi + deta*deta);
292 if(dr<1.4) miniEcalRecHitCollection->push_back(*recHit);
302 if (!hbhe.isValid()) {
304 if (!allowMissingInputs_) {
312 double phihit = pos.
phi();
313 double etahit = pos.
eta();
315 double dphi = fabs(phigamma - phihit);
316 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
317 double deta = fabs(etagamma - etahit);
318 double dr =
sqrt(dphi*dphi + deta*deta);
321 if(dr<1.) miniHBHERecHitCollection->push_back(*hbheItr);
322 dphi = fabs(phijet - phihit);
323 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
324 deta = fabs(etajet - etahit);
325 dr =
sqrt(dphi*dphi + deta*deta);
326 if(dr<1.4) miniHBHERecHitCollection->push_back(*hbheItr);
336 if (!allowMissingInputs_) {
344 double phihit = pos.
phi();
345 double etahit = pos.
eta();
347 double dphi = fabs(phigamma - phihit);
348 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
349 double deta = fabs(etagamma - etahit);
350 double dr =
sqrt(dphi*dphi + deta*deta);
352 if(dr<1.) miniHORecHitCollection->push_back(*hoItr);
353 dphi = fabs(phijet - phihit);
354 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
355 deta = fabs(etajet - etahit);
356 dr =
sqrt(dphi*dphi + deta*deta);
357 if(dr<1.4) miniHORecHitCollection->push_back(*hoItr);
368 if (!allowMissingInputs_) {
378 double phihit = pos.
phi();
379 double etahit = pos.
eta();
381 double dphi = fabs(phigamma - phihit);
382 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
383 double deta = fabs(etagamma - etahit);
384 double dr =
sqrt(dphi*dphi + deta*deta);
386 if(dr<1.) miniHFRecHitCollection->push_back(*hfItr);
387 dphi = fabs(phijet - phihit);
388 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
389 deta = fabs(etajet - etahit);
390 dr =
sqrt(dphi*dphi + deta*deta);
392 if( dr < 1.4 ) miniHFRecHitCollection->push_back(*hfItr);
401 iEvent.
getByLabel(m_inputTrackLabel,trackCollection);
402 if (!trackCollection.isValid()) {
404 if (!allowMissingInputs_) {
413 for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++)
416 double deta = track->momentum().eta() - etagamma;
418 double dphi = fabs(track->momentum().phi() - phigamma);
420 if (dphi > atan(1.)*4.) dphi = 8.*atan(1.) - dphi;
421 double ddir1 =
sqrt(deta*deta+dphi*dphi);
425 deta = track->momentum().eta() - etajet;
426 dphi = fabs(track->momentum().phi() - phijet);
427 if (dphi > atan(1.)*4.) dphi = 8.*atan(1.) - dphi;
428 double ddir2 =
sqrt(deta*deta+dphi*dphi);
430 if( ddir1 < 1.4 || ddir2 < 1.4)
432 outputTColl->push_back(*track);
439 iEvent.
put( outputTColl,
"GammaJetTracksCollection");
440 iEvent.
put( miniEcalRecHitCollection,
"GammaJetEcalRecHitCollection");
441 iEvent.
put( miniHBHERecHitCollection,
"GammaJetHBHERecHitCollection");
442 iEvent.
put( miniHORecHitCollection,
"GammaJetHORecHitCollection");
443 iEvent.
put( miniHFRecHitCollection,
"GammaJetHFRecHitCollection");
444 iEvent.
put( result,
"GammaJetGammaBackToBackCollection");
445 iEvent.
put( resultjet,
"GammaJetJetBackToBackCollection");
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void produce(edm::Event &, const edm::EventSetup &)
Geom::Phi< T > phi() const
std::vector< Track > TrackCollection
collection of Tracks
std::vector< T >::const_iterator const_iterator
AlCaGammaJetProducer(const edm::ParameterSet &)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
tuple correctedIslandEndcapSuperClusters
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const_iterator end() const
tuple correctedIslandBarrelSuperClusters
const_iterator begin() const
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects