165 LogWarning(
"CalibConstants")<<
" Not Found!! ";
173 ev.getByType(hfcoll);
177 ev.getByType(hocoll);
181 ev.getByLabel(
"ecalRecHit",
"EcalRecHitsEE",ecalEE);
185 ev.getByLabel(
"ecalRecHit",
"EcalRecHitsEB",ecalEB);
191 {tmpEcalRecHitCollection->push_back(*recHit);}
193 {tmpEcalRecHitCollection->push_back(*recHit);}
198 ev.getByLabel(
"generalTracks", generalTracks);
245 ev.getByLabel(
"generator",evtMC);
248 std::cout <<
"no HepMCProduct found" << std::endl;
257 double maxPt = -99999.;
262 HepMC::GenEvent * myGenEvent =
new HepMC::GenEvent(*(evtMC->GetEvent()));
263 for ( HepMC::GenEvent::particle_iterator
p = myGenEvent->particles_begin();
264 p != myGenEvent->particles_end(); ++
p )
268 double pt = (*p)->momentum().perp();
269 mom_MC = (*p)->momentum().rho();
270 if(pt > maxPt) { npart++; maxPt = pt; }
271 GlobalVector mom ((*p)->momentum().x(),(*p)->momentum().y(),(*p)->momentum().z());
274 if(
abs((*p)->pdg_id())==211) charge = (*p)->pdg_id()/
abs((*p)->pdg_id());
287 GlobalPoint barrelMC(0,0,0), endcapMC(0,0,0), forwardMC1(0,0,0), forwardMC2(0,0,0);
308 if(steppingHelixstateinfo_.
isValid() )
344 if(steppingHelixstateinfo_.
isValid() )
348 if(steppingHelixstateinfo_.
isValid() )
357 Int_t iphitrue = -10;
358 Int_t ietatrue = 100;
364 gPointHcal = barrelMC;
369 gPointHcal = endcapMC;
382 gPointHcal = forwardMC1;
391 ietatrue = tempId.
ieta();
392 iphitrue = tempId.
iphi();
403 if (gPointHcal.x()==0 && gPointHcal.y()==0 && gPointHcal.z()==0)
407 float etahcal=gPointHcal.eta();
409 if (
abs(etahcal)>5.192)
continue;
460 int iphihit = (hhit->id()).iphi();
461 int ietahit = (hhit->id()).ieta();
462 int depthhit = (hhit->id()).depth();
463 float enehit = hhit->energy()* recal;
465 if (depthhit!=1)
continue;
474 int iphihit2 = (hhit2->id()).iphi();
475 int ietahit2 = (hhit2->id()).ieta();
476 int depthhit2 = (hhit2->id()).depth();
477 float enehit2 = hhit2->energy() * recal;
479 if (iphihit==iphihit2 && ietahit==ietahit2 && depthhit!=depthhit2) enehit = enehit+enehit2;
487 MaxHit.
ietahitm = (hhit->id()).ieta();
488 MaxHit.
iphihitm = (hhit->id()).iphi();
489 MaxHit.
dr = distAtHcal;
504 int iphihit = (hhit->id()).iphi();
505 int ietahit = (hhit->id()).ieta();
506 int depthhit = (hhit->id()).depth();
507 float enehit = hhit->energy()* recal;
515 int iphihit2 = (hhit2->id()).iphi();
516 int ietahit2 = (hhit2->id()).ieta();
517 int depthhit2 = (hhit2->id()).depth();
518 float enehit2 = hhit2->energy() * recal;
520 if (iphihit==iphihit2 && ietahit==ietahit2 && depthhit!=depthhit2) enehit = enehit+enehit2;
527 MaxHit.
ietahitm = (hhit->id()).ieta();
528 MaxHit.
iphihitm = (hhit->id()).iphi();
529 MaxHit.
dr = distAtHcal;
549 int iphihit = (hhit->id()).iphi();
550 int ietahit = (hhit->id()).ieta();
551 int depthhit = (hhit->id()).depth();
552 float enehit = hhit->energy()* recal;
557 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
558 int ietahitNoise = -ietahit;
559 int depthhitNoise = depthhit;
562 if(distAtHcal < clusterConeSize_ && MaxHit.hitenergy > 0.)
569 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
570 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();}
571 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
572 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta(); DIETA = DIETA>0 ? DIETA-1 : DIETA+1;}
573 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
574 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
578 {
e5x5 += hhit->energy();}
580 {
e3x3 += hhit->energy();}
587 int iphihit2 = (hhit2->id()).iphi();
588 int ietahit2 = (hhit2->id()).ieta();
589 int depthhit2 = (hhit2->id()).depth();
590 float enehit2 = hhit2->energy()* recal;
592 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.)
612 int iphihit = (hhit->id()).iphi();
613 int ietahit = (hhit->id()).ieta();
614 int depthhit = (hhit->id()).depth();
615 float enehit = hhit->energy()* recal;
618 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
619 int ietahitNoise = -ietahit;
620 int depthhitNoise = depthhit;
624 if(distAtHcal < clusterConeSize_ && MaxHit.hitenergy > 0.)
632 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
633 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();}
634 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
635 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta(); DIETA = DIETA>0 ? DIETA-1 : DIETA+1;}
636 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
637 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
641 {
e5x5 += hhit->energy();}
643 {
e3x3 += hhit->energy();}
649 int iphihit2 = (hhit2->id()).iphi();
650 int ietahit2 = (hhit2->id()).ieta();
651 int depthhit2 = (hhit2->id()).depth();
652 float enehit2 = hhit2->energy()* recal;
654 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.01)
673 float delR_track_particle = 100;
675 for (reco::TrackCollection::const_iterator track1=generalTracks->begin(); track1!=generalTracks->end(); track1++)
681 trackP[
nTracks] =
sqrt(track1->px()*track1->px() + track1->py()*track1->py() + track1->pz()*track1->pz());
702 diphi_M_P = diphi_M_P>36 ? 72-diphi_M_P : diphi_M_P;
703 iDr =
sqrt(diphi_M_P*diphi_M_P+dieta_M_P*dieta_M_P);
713 Bool_t passCuts = kFALSE;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
const HcalPFCorrs * pfRecalib
double ecalEnergyInCone(const GlobalPoint center, double radius, const EcalRecHitCollection ecalCol, const CaloGeometry *geo)
ReturnType plane(const PositionType &pos, const RotationType &rot) const
TrackAssociatorParameters parameters_
std::vector< EcalRecHit >::const_iterator const_iterator
Int_t numValidTrkHits[50]
tuple SteppingHelixPropagator
FreeTrajectoryState * freeState(bool withErrors=true) const
void applyRadX0Correction(bool applyRadX0Correction)
int ieta() const
get the cell ieta
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
double associationConeSize_
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &ftsStart, const Plane &pDest) const
Propagate to Plane given a starting point.
const HcalRespCorrs * respRecalib
const_iterator end() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
virtual DetId getClosestCell(const GlobalPoint &r) const
int iphi() const
get the cell iphi
GlobalPoint position() const
SteppingHelixPropagator * stepPropF
T const * product() const
Int_t numValidTrkStrips[50]
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.
double getDistInPlaneSimple(const GlobalPoint caloPoint, const GlobalPoint rechitPoint)
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
const_iterator begin() const
Global3DVector GlobalVector