77 tok_trigcand(consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::
InputTag>(
"filterLabel"))),
79 coneSizeEta0_(conf.getParameter<double>(
"EcalConeSizeEta0")),
80 coneSizeEta1_(conf.getParameter<double>(
"EcalConeSizeEta1")),
81 hitCountEthrEB_(conf.getParameter<double>(
"EBHitCountEnergyThreshold")),
82 hitEthrEB_(conf.getParameter<double>(
"EBHitEnergyThreshold")),
83 fachitCountEE_(conf.getParameter<double>(
"EEFacHitCountEnergyThreshold")),
84 hitEthrEE0_(conf.getParameter<double>(
"EEHitEnergyThreshold0")),
85 hitEthrEE1_(conf.getParameter<double>(
"EEHitEnergyThreshold1")),
86 hitEthrEE2_(conf.getParameter<double>(
"EEHitEnergyThreshold2")),
87 hitEthrEE3_(conf.getParameter<double>(
"EEHitEnergyThreshold3")) {
89 produces<reco::IsolatedPixelTrackCandidateCollection>();
99 desc.
add<
double>(
"EBHitEnergyThreshold", 0.10);
100 desc.
add<
double>(
"EBHitCountEnergyThreshold", 0.5);
101 desc.
add<
double>(
"EEHitEnergyThreshold0", -41.0664);
102 desc.
add<
double>(
"EEHitEnergyThreshold1", 68.7950);
103 desc.
add<
double>(
"EEHitEnergyThreshold2", -38.1483);
104 desc.
add<
double>(
"EEHitEnergyThreshold3", 7.04303);
105 desc.
add<
double>(
"EEFacHitCountEnergyThreshold", 10.0);
106 desc.
add<
double>(
"EcalConeSizeEta0", 0.09);
107 desc.
add<
double>(
"EcalConeSizeEta1", 0.14);
108 descriptions.
add(
"isolEcalPixelTrackProd", desc);
116 edm::LogVerbatim(
"HcalIsoTrack") <<
"==============Inside IsolatedEcalPixelTrackCandidateProducer";
132 std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
134 int nCand = isoPixTrackRefs.size();
136 auto iptcCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
143 for (
int p = 0;
p < nCand;
p++) {
144 int nhitIn(0), nhitOut(0);
145 double inEnergy(0), outEnergy(0);
146 std::pair<double, double> etaPhi(isoPixTrackRefs[
p]->
track()->
eta(), isoPixTrackRefs[
p]->
track()->
phi());
147 if (isoPixTrackRefs[
p]->etaPhiEcalValid())
148 etaPhi = isoPixTrackRefs[
p]->etaPhiEcal();
149 double etaAbs =
std::abs(etaPhi.first);
152 edm::LogVerbatim(
"HcalIsoTrack") <<
"Track: eta/phi " << etaPhi.first <<
"/" << etaPhi.second
153 <<
" pt:" << isoPixTrackRefs[
p]->track()->pt() <<
" cone " << coneSize_ <<
"\n"
154 <<
"rechit size EB/EE : " << ecalEB->size() <<
"/" << ecalEE->size()
155 <<
" coneSize_: " << coneSize_;
159 for (
auto eItr : *(ecalEB.
product())) {
164 inEnergy += (eItr.energy());
169 outEnergy += (eItr.energy());
173 edm::LogVerbatim(
"HcalIsoTrack") <<
"EBRechit close to the track has E " << eItr.energy()
174 <<
" eta/phi: " << pos.
eta() <<
"/" << pos.
phi() <<
" deltaR: " <<
R;
181 for (
auto eItr : *(ecalEE.
product())) {
190 inEnergy += (eItr.energy());
194 if (eItr.energy() > hitEthr) {
195 outEnergy += (eItr.energy());
199 edm::LogVerbatim(
"HcalIsoTrack") <<
"EERechit close to the track has E " << eItr.energy()
200 <<
" eta/phi: " << pos.
eta() <<
"/" << pos.
phi() <<
" deltaR: " <<
R;
206 edm::LogVerbatim(
"HcalIsoTrack") <<
"nhitIn:" << nhitIn <<
" inEnergy:" << inEnergy <<
" nhitOut:" << nhitOut
207 <<
" outEnergy:" << outEnergy;
214 iptcCollection->push_back(newca);
217 edm::LogVerbatim(
"HcalIsoTrack") <<
"ncand:" << nCand <<
" outcollction size:" << iptcCollection->size();
Log< level::Info, true > LogVerbatim
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const double fachitCountEE_
Geom::Phi< T > phi() const
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
const double hitCountEthrEB_
const edm::EDGetTokenT< EcalRecHitCollection > tok_eb
const double coneSizeEta1_
const edm::EDGetTokenT< EcalRecHitCollection > tok_ee
bool getData(T &iHolder) const
void setEnergyOut(double a)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
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 setEnergyIn(double a)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const double coneSizeEta0_
tok_geom_(esConsumes< CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun >())