186 LogWarning(
"CalibConstants")<<
" Not Found!! ";
212 {tmpEcalRecHitCollection->push_back(*recHit);}
214 {tmpEcalRecHitCollection->push_back(*recHit);}
269 std::cout <<
"no HepMCProduct found" << std::endl;
278 double maxPt = -99999.;
284 for ( HepMC::GenEvent::particle_iterator
p = myGenEvent->particles_begin();
285 p != myGenEvent->particles_end(); ++
p )
289 double pt = (*p)->momentum().perp();
290 mom_MC = (*p)->momentum().rho();
291 if(pt > maxPt) { npart++; maxPt =
pt; }
292 GlobalVector mom ((*p)->momentum().x(),(*p)->momentum().y(),(*p)->momentum().z());
295 if(
abs((*p)->pdg_id())==211) charge = (*p)->pdg_id()/
abs((*p)->pdg_id());
308 GlobalPoint barrelMC(0,0,0), endcapMC(0,0,0), forwardMC1(0,0,0), forwardMC2(0,0,0);
329 if(steppingHelixstateinfo_.
isValid() )
365 if(steppingHelixstateinfo_.
isValid() )
369 if(steppingHelixstateinfo_.
isValid() )
378 Int_t iphitrue = -10;
379 Int_t ietatrue = 100;
385 gPointHcal = barrelMC;
390 gPointHcal = endcapMC;
403 gPointHcal = forwardMC1;
412 ietatrue = tempId.
ieta();
413 iphitrue = tempId.
iphi();
424 if (gPointHcal.x()==0 && gPointHcal.y()==0 && gPointHcal.z()==0)
428 float etahcal=gPointHcal.eta();
430 if (
abs(etahcal)>5.192)
continue;
481 int iphihit = (hhit->id()).iphi();
482 int ietahit = (hhit->id()).ieta();
483 int depthhit = (hhit->id()).
depth();
484 float enehit = hhit->energy()* recal;
486 if (depthhit!=1)
continue;
495 int iphihit2 = (hhit2->id()).iphi();
496 int ietahit2 = (hhit2->id()).ieta();
497 int depthhit2 = (hhit2->id()).
depth();
498 float enehit2 = hhit2->energy() * recal;
500 if (iphihit==iphihit2 && ietahit==ietahit2 && depthhit!=depthhit2) enehit = enehit+enehit2;
508 MaxHit.
ietahitm = (hhit->id()).ieta();
509 MaxHit.
iphihitm = (hhit->id()).iphi();
510 MaxHit.
dr = distAtHcal;
525 int iphihit = (hhit->id()).iphi();
526 int ietahit = (hhit->id()).ieta();
527 int depthhit = (hhit->id()).
depth();
528 float enehit = hhit->energy()* recal;
536 int iphihit2 = (hhit2->id()).iphi();
537 int ietahit2 = (hhit2->id()).ieta();
538 int depthhit2 = (hhit2->id()).
depth();
539 float enehit2 = hhit2->energy() * recal;
541 if (iphihit==iphihit2 && ietahit==ietahit2 && depthhit!=depthhit2) enehit = enehit+enehit2;
548 MaxHit.
ietahitm = (hhit->id()).ieta();
549 MaxHit.
iphihitm = (hhit->id()).iphi();
550 MaxHit.
dr = distAtHcal;
570 int iphihit = (hhit->id()).iphi();
571 int ietahit = (hhit->id()).ieta();
572 int depthhit = (hhit->id()).
depth();
573 float enehit = hhit->energy()* recal;
578 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
579 int ietahitNoise = -ietahit;
580 int depthhitNoise = depthhit;
583 if(distAtHcal < clusterConeSize_ && MaxHit.hitenergy > 0.)
590 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
591 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();}
592 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
593 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta(); DIETA = DIETA>0 ? DIETA-1 : DIETA+1;}
594 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
595 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
599 {
e5x5 += hhit->energy();}
601 {
e3x3 += hhit->energy();}
608 int iphihit2 = (hhit2->id()).iphi();
609 int ietahit2 = (hhit2->id()).ieta();
610 int depthhit2 = (hhit2->id()).
depth();
611 float enehit2 = hhit2->energy()* recal;
613 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.)
633 int iphihit = (hhit->id()).iphi();
634 int ietahit = (hhit->id()).ieta();
635 int depthhit = (hhit->id()).
depth();
636 float enehit = hhit->energy()* recal;
639 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
640 int ietahitNoise = -ietahit;
641 int depthhitNoise = depthhit;
645 if(distAtHcal < clusterConeSize_ && MaxHit.hitenergy > 0.)
653 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
654 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();}
655 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
656 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta(); DIETA = DIETA>0 ? DIETA-1 : DIETA+1;}
657 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
658 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
662 {
e5x5 += hhit->energy();}
664 {
e3x3 += hhit->energy();}
670 int iphihit2 = (hhit2->id()).iphi();
671 int ietahit2 = (hhit2->id()).ieta();
672 int depthhit2 = (hhit2->id()).
depth();
673 float enehit2 = hhit2->energy()* recal;
675 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.01)
694 float delR_track_particle = 100;
696 for (reco::TrackCollection::const_iterator track1=generalTracks->begin(); track1!=generalTracks->end(); track1++)
702 trackP[
nTracks] =
sqrt(track1->px()*track1->px() + track1->py()*track1->py() + track1->pz()*track1->pz());
723 diphi_M_P = diphi_M_P>36 ? 72-diphi_M_P : diphi_M_P;
724 iDr =
sqrt(diphi_M_P*diphi_M_P+dieta_M_P*dieta_M_P);
734 Bool_t passCuts = kFALSE;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
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
void applyRadX0Correction(bool applyRadX0Correction)
FreeTrajectoryState const * freeState(bool withErrors=true) const
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
void propagate(const SteppingHelixStateInfo &ftsStart, const Surface &sDest, SteppingHelixStateInfo &out) const
Propagate to Plane given a starting point.
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
double associationConeSize_
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
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
T const * product() const
Int_t numValidTrkStrips[50]
MagneticField * theMagField
edm::EDGetTokenT< HORecHitCollection > tok_ho_
TrackDetectorAssociator trackAssociator_
edm::EDGetTokenT< reco::TrackCollection > tok_tracks_
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)
edm::EDGetTokenT< edm::HepMCProduct > tok_gen_
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
const_iterator begin() const
Global3DVector GlobalVector