185 LogWarning(
"CalibConstants")<<
" Not Found!! ";
193 ev.getByToken(
tok_hf_, hfcoll);
197 ev.getByToken(
tok_ho_, hocoll);
211 {tmpEcalRecHitCollection->push_back(*recHit);}
213 {tmpEcalRecHitCollection->push_back(*recHit);}
268 std::cout <<
"no HepMCProduct found" << std::endl;
277 double maxPt = -99999.;
282 HepMC::GenEvent * myGenEvent =
new HepMC::GenEvent(*(evtMC->GetEvent()));
283 for ( HepMC::GenEvent::particle_iterator
p = myGenEvent->particles_begin();
284 p != myGenEvent->particles_end(); ++
p )
288 double pt = (*p)->momentum().perp();
289 mom_MC = (*p)->momentum().rho();
290 if(pt > maxPt) { npart++; maxPt =
pt; }
291 GlobalVector mom ((*p)->momentum().x(),(*p)->momentum().y(),(*p)->momentum().z());
294 if(
abs((*p)->pdg_id())==211) charge = (*p)->pdg_id()/
abs((*p)->pdg_id());
307 GlobalPoint barrelMC(0,0,0), endcapMC(0,0,0), forwardMC1(0,0,0), forwardMC2(0,0,0);
328 if(steppingHelixstateinfo_.
isValid() )
364 if(steppingHelixstateinfo_.
isValid() )
367 steppingHelixstateinfo_ =
stepPropF->propagate(*freetrajectorystate_, (*aPlane2));
368 if(steppingHelixstateinfo_.
isValid() )
377 Int_t iphitrue = -10;
378 Int_t ietatrue = 100;
384 gPointHcal = barrelMC;
389 gPointHcal = endcapMC;
402 gPointHcal = forwardMC1;
411 ietatrue = tempId.
ieta();
412 iphitrue = tempId.
iphi();
423 if (gPointHcal.x()==0 && gPointHcal.y()==0 && gPointHcal.z()==0)
427 float etahcal=gPointHcal.eta();
429 if (
abs(etahcal)>5.192)
continue;
480 int iphihit = (hhit->id()).iphi();
481 int ietahit = (hhit->id()).ieta();
482 int depthhit = (hhit->id()).depth();
483 float enehit = hhit->energy()* recal;
485 if (depthhit!=1)
continue;
494 int iphihit2 = (hhit2->id()).iphi();
495 int ietahit2 = (hhit2->id()).ieta();
496 int depthhit2 = (hhit2->id()).depth();
497 float enehit2 = hhit2->energy() * recal;
499 if (iphihit==iphihit2 && ietahit==ietahit2 && depthhit!=depthhit2) enehit = enehit+enehit2;
507 MaxHit.
ietahitm = (hhit->id()).ieta();
508 MaxHit.
iphihitm = (hhit->id()).iphi();
509 MaxHit.
dr = distAtHcal;
524 int iphihit = (hhit->id()).iphi();
525 int ietahit = (hhit->id()).ieta();
526 int depthhit = (hhit->id()).depth();
527 float enehit = hhit->energy()* recal;
535 int iphihit2 = (hhit2->id()).iphi();
536 int ietahit2 = (hhit2->id()).ieta();
537 int depthhit2 = (hhit2->id()).depth();
538 float enehit2 = hhit2->energy() * recal;
540 if (iphihit==iphihit2 && ietahit==ietahit2 && depthhit!=depthhit2) enehit = enehit+enehit2;
547 MaxHit.
ietahitm = (hhit->id()).ieta();
548 MaxHit.
iphihitm = (hhit->id()).iphi();
549 MaxHit.
dr = distAtHcal;
569 int iphihit = (hhit->id()).iphi();
570 int ietahit = (hhit->id()).ieta();
571 int depthhit = (hhit->id()).depth();
572 float enehit = hhit->energy()* recal;
577 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
578 int ietahitNoise = -ietahit;
579 int depthhitNoise = depthhit;
582 if(distAtHcal < clusterConeSize_ && MaxHit.hitenergy > 0.)
589 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
590 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();}
591 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
592 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta(); DIETA = DIETA>0 ? DIETA-1 : DIETA+1;}
593 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
594 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
598 {
e5x5 += hhit->energy();}
600 {
e3x3 += hhit->energy();}
607 int iphihit2 = (hhit2->id()).iphi();
608 int ietahit2 = (hhit2->id()).ieta();
609 int depthhit2 = (hhit2->id()).depth();
610 float enehit2 = hhit2->energy()* recal;
612 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.)
632 int iphihit = (hhit->id()).iphi();
633 int ietahit = (hhit->id()).ieta();
634 int depthhit = (hhit->id()).depth();
635 float enehit = hhit->energy()* recal;
638 int iphihitNoise = iphihit >36 ? iphihit-36 : iphihit+36;
639 int ietahitNoise = -ietahit;
640 int depthhitNoise = depthhit;
644 if(distAtHcal < clusterConeSize_ && MaxHit.hitenergy > 0.)
652 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
653 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();}
654 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
655 { DIETA = MaxHit.
ietahitm - (hhit->id()).ieta(); DIETA = DIETA>0 ? DIETA-1 : DIETA+1;}
656 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
657 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
661 {
e5x5 += hhit->energy();}
663 {
e3x3 += hhit->energy();}
669 int iphihit2 = (hhit2->id()).iphi();
670 int ietahit2 = (hhit2->id()).ieta();
671 int depthhit2 = (hhit2->id()).depth();
672 float enehit2 = hhit2->energy()* recal;
674 if (iphihitNoise == iphihit2 && ietahitNoise == ietahit2 && depthhitNoise == depthhit2 && enehit2>0.01)
693 float delR_track_particle = 100;
695 for (reco::TrackCollection::const_iterator track1=generalTracks->begin(); track1!=generalTracks->end(); track1++)
701 trackP[
nTracks] =
sqrt(track1->px()*track1->px() + track1->py()*track1->py() + track1->pz()*track1->pz());
722 diphi_M_P = diphi_M_P>36 ? 72-diphi_M_P : diphi_M_P;
723 iDr =
sqrt(diphi_M_P*diphi_M_P+dieta_M_P*dieta_M_P);
733 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
FreeTrajectoryState const * freeState(bool withErrors=true) const
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
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
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
T const * product() const
Int_t numValidTrkStrips[50]
T const * product() const
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_
const_iterator begin() const
Global3DVector GlobalVector