40 tok_trigcand( consumes<
trigger::TriggerFilterObjectWithRefs>(conf.getParameter<
edm::InputTag>(
"filterLabel")) ),
41 coneSizeEta0_( conf.getParameter<double>(
"EcalConeSizeEta0") ),
42 coneSizeEta1_( conf.getParameter<double>(
"EcalConeSizeEta1") ),
43 hitCountEthr_( conf.getParameter<double>(
"ECHitCountEnergyThreshold") ),
44 hitEthr_( conf.getParameter<double>(
"ECHitEnergyThreshold") )
47 produces< reco::IsolatedPixelTrackCandidateCollection >();
55 edm::LogInfo(
"HcalIsoTrack") <<
"==============Inside IsolatedEcalPixelTrackCandidateProducer";
73 std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
75 int nCand=isoPixTrackRefs.size();
77 auto iptcCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
81 for (
int p=0;
p<nCand;
p++) {
82 int nhitIn(0), nhitOut(0);
83 double inEnergy(0), outEnergy(0);
84 std::pair<double,double> etaPhi(isoPixTrackRefs[
p]->
track()->
eta(), isoPixTrackRefs[
p]->
track()->
phi());
85 if (isoPixTrackRefs[
p]->etaPhiEcalValid()) etaPhi = isoPixTrackRefs[
p]->etaPhiEcal();
86 double etaAbs =
std::abs(etaPhi.first);
89 edm::LogInfo(
"HcalIsoTrack") <<
"Track: eta/phi " << etaPhi.first <<
"/" << etaPhi.second <<
" pt:" << isoPixTrackRefs[
p]->track()->pt() <<
" cone " << coneSize_ <<
"\n" <<
"rechit size EB/EE : " << ecalEB->
size() <<
"/" << ecalEE->
size() <<
" coneSize_: " << coneSize_;
97 inEnergy += (eItr->energy());
99 if (eItr->energy() >
hitEthr_) outEnergy += (eItr->energy());
101 edm::LogInfo(
"HcalIsoTrack") <<
"Rechit Close to the track has energy " << eItr->energy() <<
" eta/phi: " << pos.
eta() <<
"/" << pos.
phi() <<
" deltaR: " <<
R;
112 inEnergy += (eItr->energy());
114 if (eItr->energy() >
hitEthr_) outEnergy += (eItr->energy());
116 edm::LogInfo(
"HcalIsoTrack") <<
"Rechit Close to the track has energy " << eItr->energy() <<
" eta/phi: " << pos.
eta() <<
"/" << pos.
phi() <<
" deltaR: " <<
R;
122 edm::LogInfo(
"HcalIsoTrack") <<
"nhitIn:" << nhitIn <<
" inEnergy:" << inEnergy <<
" nhitOut:" << nhitOut <<
" outEnergy:" << outEnergy;
129 iptcCollection->push_back(newca);
132 edm::LogInfo(
"HcalIsoTrack") <<
"ncand:" << nCand <<
" outcollction size:" << iptcCollection->size();
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const double hitCountEthr_
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
const edm::EDGetTokenT< EcalRecHitCollection > tok_eb
const double coneSizeEta1_
~IsolatedEcalPixelTrackCandidateProducer()
const edm::EDGetTokenT< EcalRecHitCollection > tok_ee
void setEnergyOut(double a)
Abs< T >::type abs(const T &t)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
const_iterator end() const
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
IsolatedEcalPixelTrackCandidateProducer(const edm::ParameterSet &)
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
void setEnergyIn(double a)
const double coneSizeEta0_
T const * product() const
const_iterator begin() const