244 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
"Hello World. TrackCollectionSize: " << isoPixelTracks->size();
246 if (isoPixelTracks->empty())
249 for (reco::TrackCollection::const_iterator trit = isoProdTracks->begin(); trit != isoProdTracks->end(); trit++) {
250 reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched = isoPixelTracks->begin();
252 bool matched =
false;
255 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin();
256 it != isoPixelTracks->end();
260 if (
abs((trit->pt() - it->pt()) / it->pt()) < 0.005 &&
abs(trit->eta() - it->eta()) < 0.01) {
270 if (isoMatched->maxPtPxl() >
maxPNear)
273 ptNear = isoMatched->maxPtPxl();
280 if (fabs(trit->eta()) > 1.47 && trit->hitPattern().numberOfValidStripTECHits() <
MinNTECHitsEndcap)
284 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
"Point 0.2.1 after numofvalidhits HB: "
285 << trit->hitPattern().numberOfValidHits();
286 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
"Point 0.2.2 after numofvalidstrips HE: "
287 << trit->hitPattern().numberOfValidStripTECHits();
289 numVH = trit->hitPattern().numberOfValidHits();
290 numVS = trit->hitPattern().numberOfValidStripTECHits();
292 trackE =
sqrt(trit->px() * trit->px() + trit->py() * trit->py() + trit->pz() * trit->pz() + 0.14 * 0.14);
300 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
"Point 0.3. Matched :: pt: " << trit->pt() <<
" wholeEnergy: " <<
trackE
346 ietatrue = tempId.
ieta();
347 iphitrue = tempId.
iphi();
354 std::vector<DetId> usedHits;
358 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
"Point 1. Entrance to HBHECollection";
369 bool hitIsUsed =
false;
370 for (uint32_t
i = 0;
i < usedHits.size();
i++) {
371 if (usedHits[
i] == hhit->id())
376 usedHits.push_back(hhit->id());
387 int iphihitm = (hhit->id()).iphi();
388 int ietahitm = (hhit->id()).ieta();
389 int depthhit = (hhit->id()).
depth();
390 float enehit = hhit->energy() * recal;
397 if (dphi > 4. * atan(1.))
398 dphi = 8. * atan(1.) - dphi;
400 float dr =
sqrt(dphi * dphi + deta * deta);
408 int iphihitm2 = (hhit2->id()).iphi();
409 int ietahitm2 = (hhit2->id()).ieta();
410 int depthhit2 = (hhit2->id()).
depth();
411 float enehit2 = hhit2->energy() * recal;
413 if (iphihitm == iphihitm2 && ietahitm == ietahitm2 && depthhit != depthhit2)
414 enehit = enehit + enehit2;
418 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
"IN CONE ieta: " << ietahitm <<
" iphi: " << iphihitm
419 <<
" depthhit: " << depthhit <<
" dr: " << dr <<
" energy: " << enehit;
425 MaxHit.
ietahitm = (hhit->id()).ieta();
426 MaxHit.
iphihitm = (hhit->id()).iphi();
427 MaxHit.
dr = distAtHcal;
440 <<
" dr: " << MaxHit.
dr;
441 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
"Track ieta: " << ietatrue <<
" iphi: " << iphitrue;
446 Bool_t passCuts = kFALSE;
470 bool hitIsUsed =
false;
471 for (uint32_t
i = 0;
i < usedHits.size();
i++) {
472 if (usedHits[
i] == hhit->id())
477 usedHits.push_back(hhit->id());
480 if (MaxHit.
ietahitm * (hhit->id()).ieta() > 0) {
481 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
483 if (MaxHit.
ietahitm * (hhit->id()).ieta() < 0) {
484 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
485 DIETA = DIETA > 0 ? DIETA - 1 : DIETA + 1;
488 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
489 DIPHI = DIPHI > 36 ? 72 - DIPHI : DIPHI;
491 int numbercell = 100;
499 if (
abs(DIETA) <= numbercell &&
500 (
abs(DIPHI) <= numbercell || (
abs(MaxHit.
ietahitm) >= 20 &&
abs(DIPHI) <= numbercell + 1))) {
503 if (passCuts && hhit->energy() > 0) {
512 if (hhit->id().ieta() == MaxHit.
ietahitm && hhit->id().iphi() == MaxHit.
iphihitm)
515 if (hhit->id().ieta() == MaxHit.
ietahitm && hhit->id().iphi() == MaxHit.
iphihitm)
516 iTime = hhit->time();
523 abs((hhit->id()).ieta()) <= 20 &&
abs(DIPHI) > 2)))) {
537 if (
abs(MaxHit.
ietahitm) == 21 &&
abs((hhit->id()).ieta()) <= 20 &&
abs(DIPHI) > 3)
546 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
549 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
558 if (
abs(MaxHit.
ietahitm) == 21 &&
abs((hhit->id()).ieta()) <= 20 &&
abs(DIPHI) > 2)
567 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
570 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
584 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
587 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
602 if (MaxHit.
ietahitm * ietatrue > 0) {
605 if (MaxHit.
ietahitm * ietatrue < 0) {
609 diphi_M_P = diphi_M_P > 36 ? 72 - diphi_M_P : diphi_M_P;
633 iDr =
sqrt(diphi_M_P * diphi_M_P + dieta_M_P * dieta_M_P);
645 edm::LogVerbatim(
"ValidIsoTrkCalib") <<
" generalTracks Size: " << generalTracks->size();
647 int n = generalTracks->size();
651 gen = generalTracks->size();
652 iso = isoProdTracks->size();
653 pix = isoPixelTracks->size();
667 Int_t gencount = 0, isocount = 0, pixcount = 0;
668 for (reco::TrackCollection::const_iterator gentr = generalTracks->begin(); gentr != generalTracks->end(); gentr++) {
669 genPt[gencount] = gentr->pt();
670 genPhi[gencount] = gentr->phi();
671 genEta[gencount] = gentr->eta();
675 for (reco::TrackCollection::const_iterator isotr = isoProdTracks->begin(); isotr != isoProdTracks->end(); isotr++) {
676 isoPt[isocount] = isotr->pt();
677 isoPhi[isocount] = isotr->phi();
678 isoEta[isocount] = isotr->eta();
682 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator pixtr = isoPixelTracks->begin();
683 pixtr != isoPixelTracks->end();
685 pixPt[pixcount] = pixtr->pt();
686 pixPhi[pixcount] = pixtr->phi();
687 pixEta[pixcount] = pixtr->eta();
Log< level::Info, true > LogVerbatim
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
EventNumber_t event() const
const bool takeGenTracks_
DetId getClosestCell(const GlobalPoint &r) const override
const edm::EDGetTokenT< reco::TrackCollection > tok_track1_
Geom::Phi< T > phi() const
std::vector< T >::const_iterator const_iterator
const double calibrationConeSize_
TrackAssociatorParameters parameters_
const Item * getValues(DetId fId, bool throwOnFail=true) const
const edm::ESGetToken< HcalRespCorrs, HcalRespCorrsRcd > tok_recalibCorrs_
math::XYZPoint trkGlobPosAtHcal
bool getData(T &iHolder) const
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
const double energyMinIso
constexpr int iphi() const
get the cell iphi
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Abs< T >::type abs(const T &t)
TrackDetectorAssociator trackAssociator_
constexpr int ieta() const
get the cell ieta
const HcalRespCorrs * respRecalib
const int MinNTrackHitsBarrel
const double energyMaxIso
const_iterator end() const
const edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
const edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_track_
T const * product() const
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
const int MinNTECHitsEndcap
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)
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Log< level::Warning, false > LogWarning
const double associationConeSize_
const_iterator begin() const