97 reco::SuperClusterCollection::const_iterator maxclusbarrel;
98 reco::SuperClusterCollection::const_iterator maxclusendcap;
100 double vetmax = -100.;
103 pCorrectedIslandBarrelSuperClusters);
104 if (!pCorrectedIslandBarrelSuperClusters.isValid()) {
107 *pCorrectedIslandBarrelSuperClusters;
113 maxclusbarrel = correctedIslandBarrelSuperClusters->begin();
114 for(reco::SuperClusterCollection::const_iterator aClus = correctedIslandBarrelSuperClusters->begin();
115 aClus != correctedIslandBarrelSuperClusters->end(); aClus++) {
116 double vet = aClus->energy()/cosh(aClus->eta());
117 cout<<
" Barrel supercluster " << vet <<
" energy "<<aClus->energy()<<
" eta "<<aClus->eta()<<endl;
122 maxclusbarrel = aClus;
132 pCorrectedIslandEndcapSuperClusters);
133 if (!pCorrectedIslandEndcapSuperClusters.isValid()) {
136 *pCorrectedIslandEndcapSuperClusters;
142 maxclusendcap = correctedIslandEndcapSuperClusters->end();
143 double vetmaxe = vetmax;
144 for(reco::SuperClusterCollection::const_iterator aClus = correctedIslandEndcapSuperClusters->begin();
145 aClus != correctedIslandEndcapSuperClusters->end(); aClus++) {
146 double vet = aClus->energy()/cosh(aClus->eta());
152 maxclusendcap = aClus;
159 cout<<
" Number of gammas "<<nclusb<<
" "<<ncluse<<endl;
161 if( nclusb == 0 && ncluse == 0 ) {
163 iEvent.
put( outputTColl,
"GammaJetTracksCollection");
164 iEvent.
put( miniEcalRecHitCollection,
"GammaJetEcalRecHitCollection");
165 iEvent.
put( miniHBHERecHitCollection,
"GammaJetHBHERecHitCollection");
166 iEvent.
put( miniHORecHitCollection,
"GammaJetHORecHitCollection");
167 iEvent.
put( miniHFRecHitCollection,
"GammaJetHFRecHitCollection");
168 iEvent.
put(
result,
"GammaJetGammaBackToBackCollection");
169 iEvent.
put( resultjet,
"GammaJetJetBackToBackCollection");
174 double phigamma = -100.;
175 double etagamma = -100.;
178 result->push_back(*maxclusendcap);
179 phigamma = (*maxclusendcap).phi();
180 etagamma = (*maxclusendcap).eta();
184 result->push_back(*maxclusbarrel);
185 phigamma = (*maxclusbarrel).phi();
186 etagamma = (*maxclusbarrel).eta();
196 double phijet = -100.;
197 double etajet = -100.;
198 double phijet0 = -100.;
199 double etajet0 = -100.;
201 std::vector<edm::EDGetTokenT<reco::CaloJetCollection> >::const_iterator ic;
212 reco::CaloJetCollection::const_iterator
jet = jets->begin ();
216 if( jets->size() == 0 )
continue;
221 for (; jet != jets->end (); jet++)
223 phijet0 = (*jet).phi();
224 etajet0 = (*jet).eta();
228 if(numjet > 3)
break;
230 cout<<
" phi,eta "<< phigamma<<
" "<< etagamma<<
" "<<phijet0<<
" "<<etajet0<<endl;
234 double dphi = fabs(phigamma-phijet0);
235 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
236 double deta = fabs(etagamma-etajet0);
237 double dr =
sqrt(dphi*dphi+deta*deta);
238 if(dr < 0.5 )
continue;
239 resultjet->push_back ((*jet));
241 dphi = dphi*180./(4.*atan(1.));
242 if( fabs(dphi-180) < 30. )
246 phijet = (*jet).phi();
247 etajet = (*jet).eta();
250 if(iejet == 0) resultjet->clear();
254 if( resultjet->size() == 0 ) {
256 iEvent.
put( outputTColl,
"GammaJetTracksCollection");
257 iEvent.
put( miniEcalRecHitCollection,
"GammaJetEcalRecHitCollection");
258 iEvent.
put( miniHBHERecHitCollection,
"GammaJetHBHERecHitCollection");
259 iEvent.
put( miniHORecHitCollection,
"GammaJetHORecHitCollection");
260 iEvent.
put( miniHFRecHitCollection,
"GammaJetHFRecHitCollection");
261 iEvent.
put(
result,
"GammaJetGammaBackToBackCollection");
262 iEvent.
put( resultjet,
"GammaJetJetBackToBackCollection");
274 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator
i;
281 cout<<
" No ECAL input "<<endl;
286 recHit != (*ec).end(); ++recHit)
290 double phihit = pos.
phi();
291 double etahit = pos.
eta();
293 double dphi = fabs(phigamma - phihit);
294 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
295 double deta = fabs(etagamma - etahit);
296 double dr =
sqrt(dphi*dphi + deta*deta);
297 if(dr<1.) miniEcalRecHitCollection->push_back(*recHit);
299 dphi = fabs(phijet - phihit);
300 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
301 deta = fabs(etajet - etahit);
302 dr =
sqrt(dphi*dphi + deta*deta);
303 if(dr<1.4) miniEcalRecHitCollection->push_back(*recHit);
313 if (!hbhe.isValid()) {
323 double phihit = pos.
phi();
324 double etahit = pos.
eta();
326 double dphi = fabs(phigamma - phihit);
327 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
328 double deta = fabs(etagamma - etahit);
329 double dr =
sqrt(dphi*dphi + deta*deta);
332 if(dr<1.) miniHBHERecHitCollection->push_back(*hbheItr);
333 dphi = fabs(phijet - phihit);
334 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
335 deta = fabs(etajet - etahit);
336 dr =
sqrt(dphi*dphi + deta*deta);
337 if(dr<1.4) miniHBHERecHitCollection->push_back(*hbheItr);
355 double phihit = pos.
phi();
356 double etahit = pos.
eta();
358 double dphi = fabs(phigamma - phihit);
359 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
360 double deta = fabs(etagamma - etahit);
361 double dr =
sqrt(dphi*dphi + deta*deta);
363 if(dr<1.) miniHORecHitCollection->push_back(*hoItr);
364 dphi = fabs(phijet - phihit);
365 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
366 deta = fabs(etajet - etahit);
367 dr =
sqrt(dphi*dphi + deta*deta);
368 if(dr<1.4) miniHORecHitCollection->push_back(*hoItr);
389 double phihit = pos.
phi();
390 double etahit = pos.
eta();
392 double dphi = fabs(phigamma - phihit);
393 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
394 double deta = fabs(etagamma - etahit);
395 double dr =
sqrt(dphi*dphi + deta*deta);
397 if(dr<1.) miniHFRecHitCollection->push_back(*hfItr);
398 dphi = fabs(phijet - phihit);
399 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
400 deta = fabs(etajet - etahit);
401 dr =
sqrt(dphi*dphi + deta*deta);
403 if( dr < 1.4 ) miniHFRecHitCollection->push_back(*hfItr);
424 for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++)
427 double deta = track->momentum().eta() - etagamma;
429 double dphi = fabs(track->momentum().phi() - phigamma);
431 if (dphi > atan(1.)*4.) dphi = 8.*atan(1.) - dphi;
432 double ddir1 =
sqrt(deta*deta+dphi*dphi);
436 deta = track->momentum().eta() - etajet;
437 dphi = fabs(track->momentum().phi() - phijet);
438 if (dphi > atan(1.)*4.) dphi = 8.*atan(1.) - dphi;
439 double ddir2 =
sqrt(deta*deta+dphi*dphi);
441 if( ddir1 < 1.4 || ddir2 < 1.4)
443 outputTColl->push_back(*track);
450 iEvent.
put( outputTColl,
"GammaJetTracksCollection");
451 iEvent.
put( miniEcalRecHitCollection,
"GammaJetEcalRecHitCollection");
452 iEvent.
put( miniHBHERecHitCollection,
"GammaJetHBHERecHitCollection");
453 iEvent.
put( miniHORecHitCollection,
"GammaJetHORecHitCollection");
454 iEvent.
put( miniHFRecHitCollection,
"GammaJetHFRecHitCollection");
455 iEvent.
put(
result,
"GammaJetGammaBackToBackCollection");
456 iEvent.
put( resultjet,
"GammaJetJetBackToBackCollection");
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::SuperClusterCollection > tok_EESC_
Geom::Phi< T > phi() const
std::vector< Track > TrackCollection
collection of Tracks
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::vector< edm::EDGetTokenT< reco::CaloJetCollection > > toks_calo_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::TrackCollection > tok_inputTrack_
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
tuple correctedIslandEndcapSuperClusters
const_iterator end() const
tuple correctedIslandBarrelSuperClusters
edm::EDGetTokenT< HORecHitCollection > tok_ho_
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
const_iterator begin() const
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
edm::EDGetTokenT< reco::SuperClusterCollection > tok_EBSC_