249 LogInfo(
"CalibConstants") <<
" Loaded: OK ";
252 LogWarning(
"CalibConstants") <<
" Not Found!! ";
292 if (isoPixelTracks->empty())
295 for (reco::TrackCollection::const_iterator trit = isoProdTracks->begin(); trit != isoProdTracks->end(); trit++) {
296 reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched = isoPixelTracks->begin();
301 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin();
302 it != isoPixelTracks->end();
306 if (
abs((trit->pt() - it->pt()) / it->pt()) < 0.005 &&
abs(trit->eta() - it->eta()) < 0.01) {
316 if (isoMatched->maxPtPxl() >
maxPNear)
319 ptNear = isoMatched->maxPtPxl();
325 if (fabs(trit->eta()) > 1.47 && trit->hitPattern().numberOfValidStripTECHits() <
MinNTECHitsEndcap)
331 numVH = trit->hitPattern().numberOfValidHits();
332 numVS = trit->hitPattern().numberOfValidStripTECHits();
334 trackE =
sqrt(trit->px() * trit->px() + trit->py() * trit->py() + trit->pz() * trit->pz() + 0.14 * 0.14);
361 cout <<
"zero point at Ecal" << endl;
365 cout <<
"zero point at Hcal" << endl;
383 ietatrue = tempId.
ieta();
384 iphitrue = tempId.
iphi();
391 std::vector<DetId> usedHits;
405 bool hitIsUsed =
false;
406 for (uint32_t
i = 0;
i < usedHits.size();
i++) {
407 if (usedHits[
i] == hhit->id())
412 usedHits.push_back(hhit->id());
423 int iphihitm = (hhit->id()).iphi();
424 int ietahitm = (hhit->id()).ieta();
425 int depthhit = (hhit->id()).
depth();
426 float enehit = hhit->energy() * recal;
443 int iphihitm2 = (hhit2->id()).iphi();
444 int ietahitm2 = (hhit2->id()).ieta();
445 int depthhit2 = (hhit2->id()).
depth();
446 float enehit2 = hhit2->energy() * recal;
448 if (iphihitm == iphihitm2 && ietahitm == ietahitm2 && depthhit != depthhit2)
449 enehit = enehit + enehit2;
458 MaxHit.
ietahitm = (hhit->id()).ieta();
459 MaxHit.
iphihitm = (hhit->id()).iphi();
460 MaxHit.
dr = distAtHcal;
476 Bool_t passCuts = kFALSE;
499 bool hitIsUsed =
false;
500 for (uint32_t
i = 0;
i < usedHits.size();
i++) {
501 if (usedHits[
i] == hhit->id())
506 usedHits.push_back(hhit->id());
509 if (MaxHit.
ietahitm * (hhit->id()).ieta() > 0) {
510 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
512 if (MaxHit.
ietahitm * (hhit->id()).ieta() < 0) {
513 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
514 DIETA = DIETA > 0 ? DIETA - 1 : DIETA + 1;
517 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
518 DIPHI = DIPHI > 36 ? 72 - DIPHI : DIPHI;
520 int numbercell = 100;
528 if (
abs(DIETA) <= numbercell &&
529 (
abs(DIPHI) <= numbercell || (
abs(MaxHit.
ietahitm) >= 20 &&
abs(DIPHI) <= numbercell + 1))) {
532 if (passCuts && hhit->energy() > 0) {
539 if (hhit->id().ieta() == MaxHit.
ietahitm && hhit->id().iphi() == MaxHit.
iphihitm)
542 if (hhit->id().ieta() == MaxHit.
ietahitm && hhit->id().iphi() == MaxHit.
iphihitm)
543 iTime = hhit->time();
550 abs((hhit->id()).ieta()) <= 20 &&
abs(DIPHI) > 2)))) {
564 if (
abs(MaxHit.
ietahitm) == 21 &&
abs((hhit->id()).ieta()) <= 20 &&
abs(DIPHI) > 3)
573 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
576 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
585 if (
abs(MaxHit.
ietahitm) == 21 &&
abs((hhit->id()).ieta()) <= 20 &&
abs(DIPHI) > 2)
594 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
597 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
611 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
614 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
629 if (MaxHit.
ietahitm * ietatrue > 0) {
632 if (MaxHit.
ietahitm * ietatrue < 0) {
636 diphi_M_P = diphi_M_P > 36 ? 72 - diphi_M_P : diphi_M_P;
660 iDr =
sqrt(diphi_M_P * diphi_M_P + dieta_M_P * dieta_M_P);
672 int n = generalTracks->size();
676 gen = generalTracks->size();
677 iso = isoProdTracks->size();
678 pix = isoPixelTracks->size();
692 Int_t gencount = 0, isocount = 0, pixcount = 0;
693 for (reco::TrackCollection::const_iterator gentr = generalTracks->begin(); gentr != generalTracks->end(); gentr++) {
694 genPt[gencount] = gentr->pt();
695 genPhi[gencount] = gentr->phi();
696 genEta[gencount] = gentr->eta();
700 for (reco::TrackCollection::const_iterator isotr = isoProdTracks->begin(); isotr != isoProdTracks->end(); isotr++) {
701 isoPt[isocount] = isotr->pt();
702 isoPhi[isocount] = isotr->phi();
703 isoEta[isocount] = isotr->eta();
707 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator pixtr = isoPixelTracks->begin();
708 pixtr != isoPixelTracks->end();
710 pixPt[pixcount] = pixtr->pt();
711 pixPhi[pixcount] = pixtr->phi();
712 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< T >::const_iterator const_iterator
TrackAssociatorParameters parameters_
const Item * getValues(DetId fId, bool throwOnFail=true) const
math::XYZPoint trkGlobPosAtHcal
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_track_
double calibrationConeSize_
int ieta() const
get the cell ieta
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Abs< T >::type abs(const T &t)
TrackDetectorAssociator trackAssociator_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const HcalRespCorrs * respRecalib
const_iterator end() const
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_
T const * product() const
DetId getClosestCell(const GlobalPoint &r) const override
const_iterator begin() const