40 tok_trigcand( consumes<
trigger::TriggerFilterObjectWithRefs>(conf.getParameter<
edm::InputTag>(
"filterLabel")) ),
41 coneSizeEta0_( conf.getParameter<double>(
"EcalConeSizeEta0") ),
42 coneSizeEta1_( conf.getParameter<double>(
"EcalConeSizeEta1") ),
43 hitCountEthrEB_( conf.getParameter<double>(
"EBHitCountEnergyThreshold") ),
44 hitEthrEB_( conf.getParameter<double>(
"EBHitEnergyThreshold") ),
45 fachitCountEE_( conf.getParameter<double>(
"EEFacHitCountEnergyThreshold") ),
46 hitEthrEE0_( conf.getParameter<double>(
"EEHitEnergyThreshold0") ),
47 hitEthrEE1_( conf.getParameter<double>(
"EEHitEnergyThreshold1") ),
48 hitEthrEE2_( conf.getParameter<double>(
"EEHitEnergyThreshold2") ),
49 hitEthrEE3_( conf.getParameter<double>(
"EEHitEnergyThreshold3") )
52 produces< reco::IsolatedPixelTrackCandidateCollection >();
62 desc.
add<
double>(
"EBHitEnergyThreshold",0.10);
63 desc.
add<
double>(
"EBHitCountEnergyThreshold",0.5);
64 desc.
add<
double>(
"EEHitEnergyThreshold0",-41.0664);
65 desc.
add<
double>(
"EEHitEnergyThreshold1",68.7950);
66 desc.
add<
double>(
"EEHitEnergyThreshold2",-38.1483);
67 desc.
add<
double>(
"EEHitEnergyThreshold3",7.04303);
68 desc.
add<
double>(
"EEFacHitCountEnergyThreshold",10.0);
69 desc.
add<
double>(
"EcalConeSizeEta0",0.09);
70 desc.
add<
double>(
"EcalConeSizeEta1",0.14);
71 descriptions.
add(
"isolEcalPixelTrackProd",desc);
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;
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
void setEnergyOut(double a)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_trigcand
IsolatedEcalPixelTrackCandidateProducer(const edm::ParameterSet &)
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~IsolatedEcalPixelTrackCandidateProducer() override
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
void setEnergyIn(double a)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const double coneSizeEta0_
T const * product() const