218 vector<float> rawEnergyVec;
222 vector<HcalDetId> detidvec;
262 if (isoPixelTracks->size()==0)
return;
264 for (reco::TrackCollection::const_iterator trit=isoProdTracks->begin(); trit!=isoProdTracks->end(); trit++)
266 reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched=isoPixelTracks->begin();
270 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin(); it!=isoPixelTracks->end(); it++)
273 if (
abs((trit->pt() - it->pt())/it->pt()) < 0.005 &&
abs(trit->eta() - it->eta()) < 0.01)
280 if (!matched)
continue;
283 if (fabs(trit->eta())>1.47&&trit->hitPattern().numberOfValidStripTECHits()<
MinNTECHitsEndcap)
continue;
286 calEnergy =
sqrt(trit->px()*trit->px()+trit->py()*trit->py()+trit->pz()*trit->pz()+0.14*0.14);
291 double corrHCAL = 1.;
295 rvert =
sqrt(trit->vx()*trit->vx()+trit->vy()*trit->vy()+trit->vz()*trit->vz());
334 const HcalDetId tempId = gHcal->getClosestCell(gPointHcal);
335 ietatrue = tempId.
ieta();
336 iphitrue = tempId.
iphi();
340 std::vector<DetId> usedHits;
355 bool hitIsUsed=
false;
356 DetId hitId=hhit->id();
357 for (uint32_t
i=0;
i<usedHits.size();
i++)
359 if (usedHits[
i]==hitId) hitIsUsed=
true;
361 if (hitIsUsed)
continue;
362 usedHits.push_back(hitId);
371 int iphihitm = (hhit->id()).iphi();
372 int ietahitm = (hhit->id()).ieta();
373 int depthhit = (hhit->id()).depth();
374 double enehit = hhit->energy() * recal;
376 if (depthhit!=1)
continue;
387 int iphihitm2 = (hhit2->id()).iphi();
388 int ietahitm2 = (hhit2->id()).ieta();
389 int depthhit2 = (hhit2->id()).depth();
390 double enehit2 = hhit2->energy() * recal;
392 if ( iphihitm==iphihitm2 && ietahitm==ietahitm2 && depthhit!=depthhit2){
394 enehit = enehit+enehit2;
401 MaxHit.
ietahitm = (hhit->id()).ieta();
402 MaxHit.
iphihitm = (hhit->id()).iphi();
403 MaxHit.
depthhit = (hhit->id()).depth();
404 MaxHit.
dr = distAtHcal;
413 Bool_t passCuts = kFALSE;
430 bool hitIsUsed=
false;
431 DetId hitId=hhit->id();
432 for (uint32_t
i=0;
i<usedHits.size();
i++)
434 if (usedHits[
i]==hitId) hitIsUsed=
true;
441 usedHits.push_back(hitId);
445 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
447 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
449 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
451 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
452 DIETA = DIETA>0 ? DIETA-1 : DIETA+1;
455 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
456 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
460 if(
AxB_==
"3x3") numbercell = 1;
461 if(
AxB_==
"5x5") numbercell = 2;
462 if(
AxB_==
"7x7") numbercell = 3;
463 if(
AxB_==
"Cone") numbercell = 1000;
465 if(
abs(DIETA)<=numbercell && (
abs(DIPHI)<=numbercell || (
abs(MaxHit.
ietahitm)>=20 &&
abs(DIPHI)<=numbercell+1)) ) {
478 rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
479 detidvec.push_back(hhit->id());
480 detiphi.push_back((hhit->id()).iphi());
481 detieta.push_back((hhit->id()).ieta());
482 i3i5.push_back(iii3i5);
489 rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
490 detidvec.push_back(hhit->id());
491 detiphi.push_back((hhit->id()).iphi());
492 detieta.push_back((hhit->id()).ieta());
493 i3i5.push_back(iii3i5);
506 input_to_L3 << rawEnergyVec.size() <<
" " << calEnergy;
509 for (
unsigned int i=0;
i<rawEnergyVec.size();
i++)
511 input_to_L3 <<
" " << rawEnergyVec.at(
i) <<
" " << detidvec.at(
i).rawId() ;
526 cell = detidvec.at(ia).rawId();
539 rawEnergyVec.clear();
558 bool hitIsUsed=
false;
559 DetId hitId=hoItr->id();
560 for (uint32_t
i=0;
i<usedHits.size();
i++)
562 if (usedHits[
i]==hitId) hitIsUsed=
true;
564 if (hitIsUsed)
continue;
566 usedHits.push_back(hitId);
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
EventNumber_t event() const
double ecalEnergyInCone(const GlobalPoint center, double radius, const EcalRecHitCollection ecalCol, const CaloGeometry *geo)
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
double getDistInPlaneTrackDir(const GlobalPoint caloPoint, const GlobalVector caloVector, const GlobalPoint rechitPoint)
std::vector< T >::const_iterator const_iterator
TrackDetectorAssociator trackAssociator_
double calibrationConeSize_
int ieta() const
get the cell ieta
double associationConeSize_
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double hottestHitDistance
const_iterator end() const
TrackAssociatorParameters parameters_
int iphi() const
get the cell iphi
T const * product() const
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
const_iterator begin() const