222 vector<float> rawEnergyVec;
226 vector<HcalDetId> detidvec;
266 if (isoPixelTracks->size()==0)
return;
268 for (reco::TrackCollection::const_iterator trit=isoProdTracks->begin(); trit!=isoProdTracks->end(); trit++)
270 reco::IsolatedPixelTrackCandidateCollection::const_iterator isoMatched=isoPixelTracks->begin();
274 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator it = isoPixelTracks->begin(); it!=isoPixelTracks->end(); it++)
277 if (
abs((trit->pt() - it->pt())/it->pt()) < 0.005 &&
abs(trit->eta() - it->eta()) < 0.01)
284 if (!matched)
continue;
287 if (fabs(trit->eta())>1.47&&trit->hitPattern().numberOfValidStripTECHits()<
MinNTECHitsEndcap)
continue;
290 calEnergy =
sqrt(trit->px()*trit->px()+trit->py()*trit->py()+trit->pz()*trit->pz()+0.14*0.14);
295 double corrHCAL = 1.;
299 rvert =
sqrt(trit->vx()*trit->vx()+trit->vy()*trit->vy()+trit->vz()*trit->vz());
338 const HcalDetId tempId = gHcal->getClosestCell(gPointHcal);
339 ietatrue = tempId.
ieta();
340 iphitrue = tempId.
iphi();
344 std::vector<DetId> usedHits;
359 bool hitIsUsed=
false;
360 DetId hitId=hhit->id();
361 for (uint32_t
i=0;
i<usedHits.size();
i++)
363 if (usedHits[
i]==hitId) hitIsUsed=
true;
365 if (hitIsUsed)
continue;
366 usedHits.push_back(hitId);
375 int iphihitm = (hhit->id()).iphi();
376 int ietahitm = (hhit->id()).ieta();
377 int depthhit = (hhit->id()).depth();
378 double enehit = hhit->energy() * recal;
380 if (depthhit!=1)
continue;
391 int iphihitm2 = (hhit2->id()).iphi();
392 int ietahitm2 = (hhit2->id()).ieta();
393 int depthhit2 = (hhit2->id()).depth();
394 double enehit2 = hhit2->energy() * recal;
396 if ( iphihitm==iphihitm2 && ietahitm==ietahitm2 && depthhit!=depthhit2){
398 enehit = enehit+enehit2;
405 MaxHit.
ietahitm = (hhit->id()).ieta();
406 MaxHit.
iphihitm = (hhit->id()).iphi();
407 MaxHit.
depthhit = (hhit->id()).depth();
408 MaxHit.
dr = distAtHcal;
417 Bool_t passCuts = kFALSE;
434 bool hitIsUsed=
false;
435 DetId hitId=hhit->id();
436 for (uint32_t
i=0;
i<usedHits.size();
i++)
438 if (usedHits[
i]==hitId) hitIsUsed=
true;
445 usedHits.push_back(hitId);
449 if(MaxHit.
ietahitm*(hhit->id()).ieta()>0)
451 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
453 if(MaxHit.
ietahitm*(hhit->id()).ieta()<0)
455 DIETA = MaxHit.
ietahitm - (hhit->id()).ieta();
456 DIETA = DIETA>0 ? DIETA-1 : DIETA+1;
459 int DIPHI =
abs(MaxHit.
iphihitm - (hhit->id()).iphi());
460 DIPHI = DIPHI>36 ? 72-DIPHI : DIPHI;
464 if(
AxB_==
"3x3") numbercell = 1;
465 if(
AxB_==
"5x5") numbercell = 2;
466 if(
AxB_==
"7x7") numbercell = 3;
467 if(
AxB_==
"Cone") numbercell = 1000;
469 if(
abs(DIETA)<=numbercell && (
abs(DIPHI)<=numbercell || (
abs(MaxHit.
ietahitm)>=20 &&
abs(DIPHI)<=numbercell+1)) ) {
482 rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
483 detidvec.push_back(hhit->id());
484 detiphi.push_back((hhit->id()).iphi());
485 detieta.push_back((hhit->id()).ieta());
486 i3i5.push_back(iii3i5);
493 rawEnergyVec.push_back(hhit->energy() * recal * corrHCAL);
494 detidvec.push_back(hhit->id());
495 detiphi.push_back((hhit->id()).iphi());
496 detieta.push_back((hhit->id()).ieta());
497 i3i5.push_back(iii3i5);
510 input_to_L3 << rawEnergyVec.size() <<
" " << calEnergy;
513 for (
unsigned int i=0;
i<rawEnergyVec.size();
i++)
515 input_to_L3 <<
" " << rawEnergyVec.at(
i) <<
" " << detidvec.at(
i).rawId() ;
530 cell = detidvec.at(ia).rawId();
543 rawEnergyVec.clear();
562 bool hitIsUsed=
false;
563 DetId hitId=hoItr->id();
564 for (uint32_t
i=0;
i<usedHits.size();
i++)
566 if (usedHits[
i]==hitId) hitIsUsed=
true;
568 if (hitIsUsed)
continue;
570 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