280 if (isoPixelTracks->empty())
283 for (reco::TrackCollection::const_iterator trit = isoProdTracks->begin(); trit != isoProdTracks->end(); trit++) {
284 reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched = isoPixelTracks->begin();
289 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin();
290 it != isoPixelTracks->end();
294 if (
abs((trit->pt() - it->pt()) / it->pt()) < 0.005 &&
abs(trit->eta() - it->eta()) < 0.01) {
304 if (isoMatched->maxPtPxl() >
maxPNear)
307 ptNear = isoMatched->maxPtPxl();
313 if (fabs(trit->eta()) > 1.47 && trit->hitPattern().numberOfValidStripTECHits() <
MinNTECHitsEndcap)
319 numVH = trit->hitPattern().numberOfValidHits();
320 numVS = trit->hitPattern().numberOfValidStripTECHits();
322 trackE =
sqrt(trit->px() * trit->px() + trit->py() * trit->py() + trit->pz() * trit->pz() + 0.14 * 0.14);
352 cout <<
"zero point at Ecal" << endl;
356 cout <<
"zero point at Hcal" << endl;
374 ietatrue = tempId.
ieta();
375 iphitrue = tempId.
iphi();
382 std::vector<DetId> usedHits;
396 bool hitIsUsed =
false;
397 for (uint32_t
i = 0;
i < usedHits.size();
i++) {
398 if (usedHits[
i] == hhit->id())
403 usedHits.push_back(hhit->id());
414 int iphihitm = (hhit->id()).
iphi();
415 int ietahitm = (hhit->id()).
ieta();
416 int depthhit = (hhit->id()).
depth();
417 float enehit = hhit->energy() * recal;
434 int iphihitm2 = (hhit2->id()).
iphi();
435 int ietahitm2 = (hhit2->id()).
ieta();
436 int depthhit2 = (hhit2->id()).
depth();
437 float enehit2 = hhit2->energy() * recal;
439 if (iphihitm == iphihitm2 && ietahitm == ietahitm2 && depthhit != depthhit2)
440 enehit = enehit + enehit2;
451 MaxHit.
dr = distAtHcal;
467 Bool_t passCuts = kFALSE;
490 bool hitIsUsed =
false;
491 for (uint32_t
i = 0;
i < usedHits.size();
i++) {
492 if (usedHits[
i] == hhit->id())
497 usedHits.push_back(hhit->id());
505 DIETA = DIETA > 0 ? DIETA - 1 : DIETA + 1;
509 DIPHI = DIPHI > 36 ? 72 - DIPHI : DIPHI;
511 int numbercell = 100;
519 if (
abs(DIETA) <= numbercell &&
520 (
abs(DIPHI) <= numbercell || (
abs(MaxHit.
ietahitm) >= 20 &&
abs(DIPHI) <= numbercell + 1))) {
523 if (passCuts && hhit->energy() > 0) {
530 if (hhit->id().ieta() == MaxHit.
ietahitm && hhit->id().iphi() == MaxHit.
iphihitm)
533 if (hhit->id().ieta() == MaxHit.
ietahitm && hhit->id().iphi() == MaxHit.
iphihitm)
534 iTime = hhit->time();
541 abs((hhit->id()).
ieta()) <= 20 &&
abs(DIPHI) > 2)))) {
564 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
567 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
585 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
588 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
602 if ((hhit->id().depth() == 1) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
605 }
else if ((hhit->id().depth() == 2) && (
abs(hhit->id().ieta()) > 17) && (
abs(hhit->id().ieta()) < 29)) {
620 if (MaxHit.
ietahitm * ietatrue > 0) {
623 if (MaxHit.
ietahitm * ietatrue < 0) {
627 diphi_M_P = diphi_M_P > 36 ? 72 - diphi_M_P : diphi_M_P;
651 iDr =
sqrt(diphi_M_P * diphi_M_P + dieta_M_P * dieta_M_P);
668 iso = isoProdTracks->size();
669 pix = isoPixelTracks->size();
683 Int_t gencount = 0, isocount = 0, pixcount = 0;
685 genPt[gencount] = gentr->pt();
686 genPhi[gencount] = gentr->phi();
687 genEta[gencount] = gentr->eta();
691 for (reco::TrackCollection::const_iterator isotr = isoProdTracks->begin(); isotr != isoProdTracks->end(); isotr++) {
692 isoPt[isocount] = isotr->pt();
693 isoPhi[isocount] = isotr->phi();
694 isoEta[isocount] = isotr->eta();
698 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator pixtr = isoPixelTracks->begin();
699 pixtr != isoPixelTracks->end();
701 pixPt[pixcount] = pixtr->pt();
702 pixPhi[pixcount] = pixtr->phi();
703 pixEta[pixcount] = pixtr->eta();
731 nTracks =
fs->
make<TH1F>(
"nTracks",
"general;number of general tracks", 11, -0.5, 10.5);
733 tTree =
fs->
make<TTree>(
"tTree",
"Tree for gen info");
735 fTree =
fs->
make<TTree>(
"fTree",
"Tree for IsoTrack Calibration");
771 fTree->Branch(
"iDr", &
iDr,
"iDr/F");
775 fTree->Branch(
"HTime",
HTime,
"HTime[numHits]/F");
785 tTree->Branch(
"gen", &
gen,
"gen/I");
786 tTree->Branch(
"iso", &
iso,
"iso/I");
787 tTree->Branch(
"pix", &
pix,
"pix/I");
788 tTree->Branch(
"genPt",
genPt,
"genPt[gen]/F");
792 tTree->Branch(
"isoPt",
isoPt,
"isoPt[iso]/F");
796 tTree->Branch(
"pixPt",
pixPt,
"pixPt[pix]/F");