221 vector<float> rawEnergyVec;
225 vector<HcalDetId> detidvec;
265 if (isoPixelTracks->size()==0)
return;
267 for (reco::TrackCollection::const_iterator trit=isoProdTracks->begin(); trit!=isoProdTracks->end(); trit++)
269 reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched=isoPixelTracks->begin();
273 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin(); it!=isoPixelTracks->end(); it++)
276 if (
abs((trit->pt() - it->pt())/it->pt()) < 0.005 &&
abs(trit->eta() - it->eta()) < 0.01)
283 if (!matched)
continue;
286 if (fabs(trit->eta())>1.47&&trit->hitPattern().numberOfValidStripTECHits()<
MinNTECHitsEndcap)
continue;
289 calEnergy =
sqrt(trit->px()*trit->px()+trit->py()*trit->py()+trit->pz()*trit->pz()+0.14*0.14);
294 double corrHCAL = 1.;
298 rvert =
sqrt(trit->vx()*trit->vx()+trit->vy()*trit->vy()+trit->vz()*trit->vz());
337 const HcalDetId tempId = gHcal->getClosestCell(gPointHcal);
338 ietatrue = tempId.
ieta();
339 iphitrue = tempId.
iphi();
343 std::vector<DetId> usedHits;
358 bool hitIsUsed=
false;
359 DetId hitId=hhit->id();
360 for (uint32_t
i=0;
i<usedHits.size();
i++)
362 if (usedHits[
i]==hitId) hitIsUsed=
true;
364 if (hitIsUsed)
continue;
365 usedHits.push_back(hitId);
374 int iphihitm = (hhit->id()).iphi();
375 int ietahitm = (hhit->id()).ieta();
376 int depthhit = (hhit->id()).depth();
377 double enehit = hhit->energy() * recal;
379 if (depthhit!=1)
continue;
390 int iphihitm2 = (hhit2->id()).iphi();
391 int ietahitm2 = (hhit2->id()).ieta();
392 int depthhit2 = (hhit2->id()).depth();
393 double enehit2 = hhit2->energy() * recal;
395 if ( iphihitm==iphihitm2 && ietahitm==ietahitm2 && depthhit!=depthhit2){
397 enehit = enehit+enehit2;
404 MaxHit.
ietahitm = (hhit->id()).ieta();
405 MaxHit.
iphihitm = (hhit->id()).iphi();
406 MaxHit.
depthhit = (hhit->id()).depth();
407 MaxHit.
dr = distAtHcal;
416 Bool_t passCuts = kFALSE;
433 bool hitIsUsed=
false;
434 DetId hitId=hhit->id();
435 for (uint32_t
i=0;
i<usedHits.size();
i++)
437 if (usedHits[
i]==hitId) hitIsUsed=
true;
444 usedHits.push_back(hitId);
448 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
450 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
452 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
454 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
455 DIETA = DIETA>0 ? DIETA-1 : DIETA+1;
458 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
459 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
463 if(
AxB_==
"3x3") numbercell = 1;
464 if(
AxB_==
"5x5") numbercell = 2;
465 if(
AxB_==
"7x7") numbercell = 3;
466 if(
AxB_==
"Cone") numbercell = 1000;
468 if(
abs(DIETA)<=numbercell && (
abs(DIPHI)<=numbercell || (
abs(MaxHit.
ietahitm)>=20 &&
abs(DIPHI)<=numbercell+1)) ) {
481 rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
482 detidvec.push_back(hhit->id());
483 detiphi.push_back((hhit->id()).iphi());
484 detieta.push_back((hhit->id()).ieta());
485 i3i5.push_back(iii3i5);
492 rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
493 detidvec.push_back(hhit->id());
494 detiphi.push_back((hhit->id()).iphi());
495 detieta.push_back((hhit->id()).ieta());
496 i3i5.push_back(iii3i5);
509 input_to_L3 << rawEnergyVec.size() <<
" " << calEnergy;
512 for (
unsigned int i=0;
i<rawEnergyVec.size();
i++)
514 input_to_L3 <<
" " << rawEnergyVec.at(
i) <<
" " << detidvec.at(
i).rawId() ;
529 cell = detidvec.at(ia).rawId();
542 rawEnergyVec.clear();
561 bool hitIsUsed=
false;
562 DetId hitId=hoItr->id();
563 for (uint32_t
i=0;
i<usedHits.size();
i++)
565 if (usedHits[
i]==hitId) hitIsUsed=
true;
567 if (hitIsUsed)
continue;
569 usedHits.push_back(hitId);
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
EventNumber_t event() const
edm::EDGetTokenT< EcalRecHitCollection > tok_ecal_
bool getByToken(EDGetToken token, Handle< PROD > &result) 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< HBHERecHit >::const_iterator const_iterator
TrackDetectorAssociator trackAssociator_
double calibrationConeSize_
std::ofstream input_to_L3
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_track_
int ieta() const
get the cell ieta
double associationConeSize_
Abs< T >::type abs(const T &t)
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
double hottestHitDistance
const_iterator end() const
TrackAssociatorParameters parameters_
int iphi() const
get the cell iphi
edm::EDGetTokenT< HORecHitCollection > tok_ho_
T const * product() const
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
edm::EDGetTokenT< reco::TrackCollection > tok_track1_
const_iterator begin() const