206 LogWarning(
"CalibConstants")<<
" Not Found!! ";
228 double phi_MC = -999999.;
229 double eta_MC = -999999.;
238 ev.getByLabel(
"generator",evtMC);
241 std::cout <<
"no HepMCProduct found" << std::endl;
250 double maxPt = -99999.;
255 HepMC::GenEvent * myGenEvent =
new HepMC::GenEvent(*(evtMC->GetEvent()));
256 for ( HepMC::GenEvent::particle_iterator
p = myGenEvent->particles_begin();
257 p != myGenEvent->particles_end(); ++
p )
259 double phip = (*p)->momentum().phi();
260 double etap = (*p)->momentum().eta();
261 double pt = (*p)->momentum().perp();
262 mom_MC = (*p)->momentum().rho();
263 if(pt > maxPt) { npart++; maxPt =
pt; phi_MC = phip; eta_MC = etap; }
264 GlobalVector mom ((*p)->momentum().x(),(*p)->momentum().y(),(*p)->momentum().z());
267 if(
abs((*p)->pdg_id())==211) charge = (*p)->pdg_id()/
abs((*p)->pdg_id());
295 if (etahcal>2.6)
doHF = kTRUE;
304 ev.getByType(hfcoll);
309 ev.getByType(hocoll);
314 ev.getByLabel(
"ecalRecHit",
"EcalRecHitsEE",ecalEE);
318 ev.getByLabel(
"ecalRecHit",
"EcalRecHitsEB",ecalEB);
334 Int_t iphitrue = -10;
335 Int_t ietatrue = 100;
343 ietatrue = tempId.
ieta();
344 iphitrue = tempId.
iphi();
347 if (etahcal>1.392 && etahcal<3.0)
351 ietatrue = tempId.
ieta();
352 iphitrue = tempId.
iphi();
355 if (etahcal>3.0 && etahcal<5.0)
359 ietatrue = tempId.
ieta();
360 iphitrue = tempId.
iphi();
369 if (dr < 10.)
eEcalCone += ehit->energy();
377 if (dr < 10.)
eEcalCone += ehit->energy();
398 float phihit = pos.
phi();
399 float etahit = pos.eta();
401 int iphihit = (hhit->id()).iphi();
402 int ietahit = (hhit->id()).ieta();
403 int depthhit = (hhit->id()).depth();
404 float enehit = hhit->energy()* recal;
407 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
408 int ietahitNoise = ietahit;
409 int depthhitNoise = depthhit;
411 double dphi = fabs(phihcal - phihit);
412 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
413 double deta = fabs(etahcal - etahit);
414 double dr =
sqrt(dphi*dphi + deta*deta);
423 int iphihit2 = (hhit2->id()).iphi();
424 int ietahit2 = (hhit2->id()).ieta();
425 int depthhit2 = (hhit2->id()).depth();
426 float enehit2 = hhit2->energy() * recal;
428 if (iphihit==iphihit2 && ietahit==ietahit2 && depthhit!=depthhit2) enehit = enehit+enehit2;
437 MaxHit.
ietahitm = (hhit->id()).ieta();
438 MaxHit.
iphihitm = (hhit->id()).iphi();
445 if(dr<radius_ && enehit>0.01)
455 int iphihit2 = (hhit2->id()).iphi();
456 int ietahit2 = (hhit2->id()).ieta();
457 int depthhit2 = (hhit2->id()).depth();
458 float enehit2 = hhit2->energy()* recal;
460 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.01)
478 float phihit = pos.
phi();
479 float etahit = pos.eta();
481 int iphihit = (hhit->id()).iphi();
482 int ietahit = (hhit->id()).ieta();
483 int depthhit = (hhit->id()).depth();
484 float enehit = hhit->energy()* recal;
487 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
488 int ietahitNoise = ietahit;
489 int depthhitNoise = depthhit;
492 double dphi = fabs(phihcal - phihit);
493 if(dphi > 4.*atan(1.)) dphi = 8.*atan(1.) - dphi;
494 double deta = fabs(etahcal - etahit);
495 double dr =
sqrt(dphi*dphi + deta*deta);
507 MaxHit.
ietahitm = (hhit->id()).ieta();
508 MaxHit.
iphihitm = (hhit->id()).iphi();
514 if(dr<radius_ && enehit>0.01)
524 int iphihit2 = (hhit2->id()).iphi();
525 int ietahit2 = (hhit2->id()).ieta();
526 int depthhit2 = (hhit2->id()).depth();
527 float enehit2 = hhit2->energy()* recal;
529 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.01)
545 diphi_M_P = diphi_M_P>36 ? 72-diphi_M_P : diphi_M_P;
547 float iDr =
sqrt(diphi_M_P*diphi_M_P+dieta_M_P*dieta_M_P);
550 Bool_t passCuts = kFALSE;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
const HcalPFCorrs * pfRecalib
Geom::Phi< T > phi() const
TrackAssociatorParameters parameters_
std::vector< T >::const_iterator const_iterator
double getDistInPlaneSimple(const GlobalPoint caloPoint, const GlobalPoint rechitPoint)
math::XYZPoint trkGlobPosAtHcal
int ieta() const
get the cell ieta
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
const HcalRespCorrs * respRecalib
const_iterator end() const
virtual DetId getClosestCell(const GlobalPoint &r) const
int iphi() const
get the cell iphi
T const * product() const
T const * product() const
MagneticField * theMagField
TrackDetectorAssociator trackAssociator_
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
double RecalibFactor(HcalDetId id)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
const_iterator begin() const