265 LogInfo(
"CalibConstants")<<
" Loaded: OK ";
268 LogWarning(
"CalibConstants")<<
" Not Found!! ";
309 if (isoPixelTracks->size()==0)
return;
312 for (reco::TrackCollection::const_iterator trit=isoProdTracks->begin(); trit!=isoProdTracks->end(); trit++)
315 reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched=isoPixelTracks->begin();
320 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin(); it!=isoPixelTracks->end(); it++)
324 if (
abs((trit->pt() - it->pt())/it->pt()) < 0.005 &&
abs(trit->eta() - it->eta()) < 0.01)
333 if (!matched)
continue;
334 if(isoMatched->maxPtPxl() >
maxPNear)
continue;
336 ptNear = isoMatched->maxPtPxl();
342 if (fabs(trit->eta())>1.47&&trit->hitPattern().numberOfValidStripTECHits()<
MinNTECHitsEndcap)
continue;
347 numVH = trit->hitPattern().numberOfValidHits();
348 numVS = trit->hitPattern().numberOfValidStripTECHits();
352 trackE =
sqrt(trit->px()*trit->px()+trit->py()*trit->py()+trit->pz()*trit->pz()+0.14*0.14);
394 const HcalDetId tempId = gHcal->getClosestCell(gPointHcal);
395 ietatrue = tempId.
ieta();
396 iphitrue = tempId.
iphi();
404 std::vector<DetId> usedHits;
421 bool hitIsUsed=
false;
422 for (uint32_t
i=0;
i<usedHits.size();
i++)
424 if (usedHits[
i]==hhit->id()) hitIsUsed=
true;
426 if (hitIsUsed)
continue;
427 usedHits.push_back(hhit->id());
438 int iphihitm = (hhit->id()).iphi();
439 int ietahitm = (hhit->id()).ieta();
440 int depthhit = (hhit->id()).depth();
441 float enehit = hhit->energy() * recal;
443 if (depthhit!=1)
continue;
461 int iphihitm2 = (hhit2->id()).iphi();
462 int ietahitm2 = (hhit2->id()).ieta();
463 int depthhit2 = (hhit2->id()).depth();
464 float enehit2 = hhit2->energy() * recal;
466 if (iphihitm==iphihitm2 && ietahitm==ietahitm2 && depthhit!=depthhit2) enehit = enehit+enehit2;
478 MaxHit.
ietahitm = (hhit->id()).ieta();
479 MaxHit.
iphihitm = (hhit->id()).iphi();
480 MaxHit.
dr = distAtHcal;
497 Bool_t passCuts = kFALSE;
522 bool hitIsUsed=
false;
523 for (uint32_t
i=0;
i<usedHits.size();
i++)
525 if (usedHits[
i]==hhit->id()) hitIsUsed=
true;
527 if (hitIsUsed)
continue;
528 usedHits.push_back(hhit->id());
531 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
533 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
535 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
537 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
538 DIETA = DIETA>0 ? DIETA-1 : DIETA+1;
541 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
542 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
554 if(
abs(DIETA)<=numbercell && (
abs(DIPHI)<=numbercell || (
abs(MaxHit.
ietahitm)>=20 &&
abs(DIPHI)<=numbercell+1)) )
558 if(passCuts && hhit->energy()>0)
572 if (hhit->id().ieta() == MaxHit.
ietahitm && hhit->id().iphi() == MaxHit.
iphihitm)
iTime = hhit->time();
598 if (
abs(MaxHit.
ietahitm)==21 &&
abs((hhit->id()).ieta())<=20 &&
abs(DIPHI)>3)
continue;
606 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29))
611 else if((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29))
625 if (
abs(MaxHit.
ietahitm)==21 &&
abs((hhit->id()).ieta())<=20 &&
abs(DIPHI)>2)
continue;
633 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29))
638 else if((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29))
656 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29))
661 else if((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29))
682 diphi_M_P = diphi_M_P>36 ? 72-diphi_M_P : diphi_M_P;
708 iDr =
sqrt(diphi_M_P*diphi_M_P+dieta_M_P*dieta_M_P);
728 iso = isoProdTracks->size();
729 pix = isoPixelTracks->size();
743 Int_t gencount=0, isocount=0, pixcount=0;
746 genPt[gencount] = gentr->pt();
747 genPhi[gencount] = gentr->phi();
748 genEta[gencount] = gentr->eta();
752 for (reco::TrackCollection::const_iterator isotr=isoProdTracks->begin(); isotr!=isoProdTracks->end(); isotr++)
754 isoPt[isocount] = isotr->pt();
755 isoPhi[isocount] = isotr->phi();
756 isoEta[isocount] = isotr->eta();
760 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator pixtr=isoPixelTracks->begin(); pixtr!=isoPixelTracks->end(); pixtr++)
762 pixPt[pixcount] = pixtr->pt();
763 pixPhi[pixcount] = pixtr->phi();
764 pixEta[pixcount] = pixtr->eta();
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
EventNumber_t event() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
std::vector< HBHERecHit >::const_iterator const_iterator
TrackAssociatorParameters parameters_
math::XYZPoint trkGlobPosAtHcal
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_track_
double calibrationConeSize_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
TrackDetectorAssociator trackAssociator_
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const HcalRespCorrs * respRecalib
int iphi() const
get the cell iphi
T const * product() const
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
double getDistInPlaneSimple(const GlobalPoint caloPoint, const GlobalPoint rechitPoint)
double associationConeSize_
edm::EDGetTokenT< reco::TrackCollection > tok_track1_