77 edm::LogInfo(
"HcalIsoTrack") <<
"==============Inside IsolatedEcalPixelTrackCandidateProducer";
89 edm::LogInfo(
"HcalIsoTrack") <<
"ecal Collections isValid: " 96 std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
98 int nCand=isoPixTrackRefs.size();
100 auto iptcCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
110 for (
int p=0;
p<nCand;
p++) {
111 int nhitIn(0), nhitOut(0);
112 double inEnergy(0), outEnergy(0);
113 std::pair<double,double> etaPhi(isoPixTrackRefs[
p]->
track()->
eta(), isoPixTrackRefs[
p]->
track()->
phi());
114 if (isoPixTrackRefs[
p]->etaPhiEcalValid()) etaPhi = isoPixTrackRefs[
p]->etaPhiEcal();
115 double etaAbs =
std::abs(etaPhi.first);
118 edm::LogInfo(
"HcalIsoTrack") <<
"Track: eta/phi " << etaPhi.first <<
"/" 119 << etaPhi.second <<
" pt:" 120 << isoPixTrackRefs[
p]->track()->pt()
121 <<
" cone " << coneSize_ <<
"\n" 122 <<
"rechit size EB/EE : " << ecalEB->
size()
123 <<
"/" << ecalEE->
size() <<
" coneSize_: " 128 for (
auto eItr : *(ecalEB.
product())) {
133 inEnergy += (eItr.energy());
137 outEnergy += (eItr.energy());
141 edm::LogInfo(
"HcalIsoTrack") <<
"EBRechit close to the track has E " 142 << eItr.energy() <<
" eta/phi: " 143 << pos.
eta() <<
"/" << pos.
phi()
151 for (
auto eItr : *(ecalEE.
product())) {
160 inEnergy += (eItr.energy());
163 if (eItr.energy() > hitEthr) {
164 outEnergy += (eItr.energy());
168 edm::LogInfo(
"HcalIsoTrack") <<
"EERechit close to the track has E " 169 << eItr.energy() <<
" eta/phi: " 170 << pos.
eta() <<
"/" << pos.
phi()
177 edm::LogInfo(
"HcalIsoTrack") <<
"nhitIn:" << nhitIn <<
" inEnergy:" 178 << inEnergy <<
" nhitOut:" << nhitOut
179 <<
" outEnergy:" << outEnergy;
182 newca.setEnergyIn(inEnergy);
183 newca.setEnergyOut(outEnergy);
184 newca.setNHitIn(nhitIn);
185 newca.setNHitOut(nhitOut);
186 iptcCollection->push_back(newca);
189 edm::LogInfo(
"HcalIsoTrack") <<
"ncand:" << nCand <<
" outcollction size:" 190 << 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 fachitCountEE_
Geom::Phi< T > phi() const
const double hitCountEthrEB_
const edm::EDGetTokenT< EcalRecHitCollection > tok_eb
const double coneSizeEta1_
const edm::EDGetTokenT< EcalRecHitCollection > tok_ee
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Abs< T >::type abs(const T &t)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
T const * product() const
const double coneSizeEta0_
T const * product() const