170 std::vector<Provenance const*> theProvenance;
182 (*myout_part)<<
"Event "<<iEvent.
id().
run()<<
" "<<iEvent.
id().
event()<<endl;
183 (*myout_jet)<<
"Event "<<iEvent.
id().
run()<<
" "<<iEvent.
id().
event()<<endl;
184 (*myout_hcal)<<
"Event "<<iEvent.
id().
run()<<
" "<<iEvent.
id().
event()<<endl;
185 (*myout_ecal)<<
"Event "<<iEvent.
id().
run()<<
" "<<iEvent.
id().
event()<<endl;
186 (*myout_photon)<<
"Event "<<iEvent.
id().
run()<<
" "<<iEvent.
id().
event()<<endl;
189 std::vector<edm::InputTag>::const_iterator ic;
193 double etlost = -100.1;
201 reco::CaloJetCollection::const_iterator
jet = jets->begin ();
202 cout<<
" Size of Calo jets "<<jets->size()<<endl;
205 if(jets->size() > 0 )
208 for (; jet != jets->end (); jet++)
210 cout<<
" Jet et "<<(*jet).et()<<
" "<<(*jet).eta()<<
" "<<(*jet).phi()<<endl;
212 if(ij<4) (*myout_jet)<<jettype<<
" "<<
reco<<
" "<<ij<<
" "<<(*jet).et()<<
" "<<(*jet).eta()<<
" "<<(*jet).phi()
213 <<
" "<<iEvent.
id().
event()<<endl;
227 cout<<
" Calojets are missed "<<endl;
232 cout<<
" We filled CaloJet part "<<jetexist<<endl;
234 if( jetexist < 0 ) (*myout_jet)<<jetexist<<
" "<<
reco<<
" "<<etlost
235 <<
" "<<etlost<<
" "<<etlost
236 <<
" "<<iEvent.
id().
event()<<endl;
239 std::vector<edm::InputTag>::const_iterator
i;
240 vector<CaloRecHit> theRecHits;
248 recHit != (*ec).end(); ++recHit)
253 theRecHits.push_back(*recHit);
255 if( (*recHit).energy()>
ecut[recHit->detid().subdetId()-1][0] )
256 (*
myout_ecal)<<recHit->detid().subdetId()<<
" "<<(*recHit).energy()<<
" "<<pos.
phi()<<
" "<<pos.
eta()
257 <<
" "<<iEvent.
id().
event()<<endl;
263 cout<<
" Ecal collection is missed "<<endl;
268 cout<<
" Fill EcalRecHits "<<endl;
278 hbheItr != (*hbhe).end(); ++hbheItr)
282 (*myout_hcal)<<
id.subdetId()<<
" "<<(*hbheItr).energy()<<
" "<<pos.
phi()<<
283 " "<<pos.
eta()<<
" "<<iEvent.
id().
event()<<endl;
284 theRecHits.push_back(*hbheItr);
289 cout<<
" HBHE collection is missed "<<endl;
295 for(
int i = 0;
i<9;
i++)
312 for(reco::SuperClusterCollection::const_iterator aClus = correctedSuperClusters->begin();
313 aClus != correctedSuperClusters->end(); aClus++) {
314 double vet = aClus->energy()/cosh(aClus->eta());
315 cout<<
" Supercluster " << ij<<
" Et "<< vet <<
" energy "<<aClus->energy()<<
" eta "<<aClus->eta()<<
" Cut "<<
CutOnEgammaEnergy_<<endl;
319 float gammaiso_ecal[9] = {0.,0.,0.,0.,0.,0.,0.,0.,0.};
320 for(vector<CaloRecHit>::iterator it = theRecHits.begin(); it != theRecHits.end(); it++)
325 double deta = fabs(eta-aClus->eta());
326 double dphi = fabs(phi-aClus->phi());
327 if(dphi>4.*atan(1.)) dphi = 8.*atan(1.)-dphi;
328 double dr =
sqrt(deta*deta+dphi*dphi);
331 if( fabs(aClus->eta()) > 1.47 ) rmin = 0.07*(fabs(aClus->eta())-.47)*1.2;
332 if( fabs(aClus->eta()) > 2.2 ) rmin = 0.07*(fabs(aClus->eta())-.47)*1.4;
336 for (
int i = 0;
i<3;
i++)
338 for (
int j = 0;
j<3;
j++)
343 if(it->detid().subdetId() == 1) ecutn =
ecut[0][
j];
344 if(it->detid().subdetId() == 2) ecutn =
ecut[1][
j];
345 if( dr>rmin && dr<
risol[
i])
347 if((*it).energy() > ecutn) gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).energy()/cosh(eta);
354 if( dr>rmin && dr<
risol[i])
356 if((*it).energy() > ecutn)
358 gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).energy()/cosh(eta);
373 for (
int ii = 0; ii<9 ; ii++)
383 (*myout_photon)<<ij<<
" "<<
barrel<<
" "<<vet<<
" "<<aClus->eta()<<
" "<<aClus->phi()<<
" "<<iEvent.
id().
event()<<endl;
384 (*myout_photon)<<ij<<
" "<<gammaiso_ecal[0]<<
" "<<gammaiso_ecal[1] <<
" "<<gammaiso_ecal[2]<<
" "<<gammaiso_ecal[3]
385 <<
" "<<gammaiso_ecal[4]<<
" "<<gammaiso_ecal[5]<<
" "<<gammaiso_ecal[6]<<
" "<<gammaiso_ecal[7]<<
" "<<gammaiso_ecal[8]<<endl;
392 cout<<
" Ecal barrel clusters are missed "<<endl;
397 cout<<
" After iso cuts "<<jetexist<<endl;
399 double ecluslost = -100.1;
400 if(jetexist<0) (*myout_photon)<<jetexist<<
" "<<
barrel<<
" "<<ecluslost<<
" "<<ecluslost
401 <<
" "<<ecluslost<<
" "<<iEvent.
id().
event()<<endl;
403 cout<<
" Event is ready "<<endl;
EventNumber_t event() const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
double CutOnEgammaEnergy_
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::ofstream * myout_ecal
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
T const * product() const
float GammaIsoEcal[9][20]