46 useUncalib_ (ps.getParameter<
bool>(
"useUncalib")),
47 doIsolated_ (ps.getParameter<
bool>(
"doIsolated")),
49 l1TokenNonIsolated_(consumes<
T1Collection>(ps.getParameter<
edm::InputTag>(
"l1TagNonIsolated"))),
50 l1LowerThr_ (ps.getParameter<double> (
"l1LowerThr")),
51 l1UpperThr_ (ps.getParameter<double> (
"l1UpperThr")),
52 l1LowerThrIgnoreIsolation_(ps.getParameter<double> (
"l1LowerThrIgnoreIsolation")),
53 regionEtaMargin_(ps.getParameter<double>(
"regionEtaMargin")),
54 regionPhiMargin_(ps.getParameter<double>(
"regionPhiMargin")),
55 hitLabels (ps.getParameter<
std::vector<
edm::InputTag>>(
"ecalhitLabels")),
56 productLabels(ps.getParameter<
std::vector<
std::
string>>(
"productLabels")) {
78 std::vector<std::string> productTags;
79 productTags.push_back(
"EcalRegionalRecHitsEB");
80 productTags.push_back(
"EcalRegionalRecHitsEE");
81 desc.
add<std::vector<std::string>>(
"productLabels", productTags);
83 inputTags.push_back(
edm::InputTag(
"hltEcalRegionalEgammaRecHit:EcalRecHitsEB"));
84 inputTags.push_back(
edm::InputTag(
"hltEcalRegionalEgammaRecHit:EcalRecHitsEE"));
85 inputTags.push_back(
edm::InputTag(
"hltESRegionalEgammaRecHit:EcalRecHitsES"));
86 desc.
add<std::vector<edm::InputTag>>(
"ecalhitLabels",
inputTags);
89 desc.
add<
bool>(
"useUncalib",
true);
90 desc.
add<
bool>(
"doIsolated",
true);
91 desc.
add<
double>(
"l1LowerThr", 5.0);
92 desc.
add<
double>(
"l1UpperThr", 999.);
93 desc.
add<
double>(
"l1LowerThrIgnoreIsolation", 0.0);
94 desc.
add<
double>(
"regionEtaMargin", 0.14);
95 desc.
add<
double>(
"regionPhiMargin", 0.4);
107 std::unique_ptr<const CaloSubdetectorTopology>
topology;
123 std::vector<EcalEtaPhiRegion> regions;
133 auto uhits = std::make_unique<EcalUncalibratedRecHitCollection>();
136 if (!(urhcH[i].isValid())) {
137 edm::LogError(
"ProductNotFound")<<
"could not get a handle on the EcalRecHitCollection! (" <<
hitLabels[
i].encode() <<
")" << std::endl;
142 if (!uncalibRecHits->
empty()) {
143 if ((*uncalibRecHits)[0].id().subdetId() ==
EcalBarrel) {
145 topology = std::make_unique<EcalBarrelTopology>(geoHandle);
146 }
else if ((*uncalibRecHits)[0].id().subdetId() ==
EcalEndcap) {
148 topology = std::make_unique<EcalEndcapTopology>(geoHandle);
149 }
else if ((*uncalibRecHits)[0].id().subdetId() ==
EcalPreshower) {
151 topology = std::make_unique<EcalPreshowerTopology>(geoHandle);
152 }
else throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
154 if(!regions.empty()) {
157 for (it = uncalibRecHits->
begin(); it != uncalibRecHits->
end(); it++){
160 std::vector<EcalEtaPhiRegion>::const_iterator region;
161 for (region=regions.begin(); region!=regions.end(); region++) {
162 if (region->inRegion(this_cell.
etaPos(),this_cell.
phiPos())) {
163 uhits->push_back(*it);
178 auto hits = std::make_unique<EcalRecHitCollection>();
181 if (!(rhcH[i].isValid())) {
182 edm::LogError(
"ProductNotFound")<<
"could not get a handle on the EcalRecHitCollection! (" <<
hitLabels[
i].encode() <<
")" << std::endl;
187 if (!recHits->
empty()) {
188 if ((*recHits)[0].id().subdetId() ==
EcalBarrel) {
190 topology = std::make_unique<EcalBarrelTopology>(geoHandle);
191 }
else if ((*recHits)[0].id().subdetId() ==
EcalEndcap) {
193 topology = std::make_unique<EcalEndcapTopology>(geoHandle);
196 topology = std::make_unique<EcalPreshowerTopology>(geoHandle);
197 }
else throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
199 if(!regions.empty()) {
201 for (it = recHits->
begin(); it != recHits->
end(); it++){
204 std::vector<EcalEtaPhiRegion>::const_iterator region;
205 for (region=regions.begin(); region!=regions.end(); region++) {
206 if (region->inRegion(this_cell.
etaPos(),this_cell.
phiPos())) {
207 hits->push_back(*it);
222 for (
unsigned int candItr = 0 ; candItr < theCandidateCollection.size(); candItr++){
253 template<
typename T1>
255 for (
unsigned int candItr = 0 ; candItr < theCandidateCollection.size(); candItr++){
256 T1 emItr = theCandidateCollection.at(candItr);
HLTRechitInRegionsProducer(const edm::ParameterSet &ps)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::string defaultModuleLabel()
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< T1 > T1Collection
double etaBinHighEdge(unsigned int etaIndex, bool central=true) const
HLTRechitInRegionsProducer< reco::RecoChargedCandidate > MuonHLTRechitInRegionsProducer
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< edm::InputTag > hitLabels
CaloTopology const * topology(0)
double etaBinLowEdge(unsigned int etaIndex, bool central=true) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
HLTRechitInRegionsProducer< l1extra::L1EmParticle > EgammaHLTRechitInRegionsProducer
#define DEFINE_FWK_MODULE(type)
const std::vector< std::string > productLabels
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
const L1GctEmCand * gctEmCand() const
const edm::EDGetTokenT< T1Collection > l1TokenIsolated_
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > hitTokens
unsigned phiIndex() const override
get phi index (0-17)
unsigned etaIndex() const override
get eta index -6 to -0, +0 to +6 (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
double et() const final
transverse energy
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const_iterator end() const
void produce(edm::Event &, const edm::EventSetup &) override
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double regionEtaMargin_
~HLTRechitInRegionsProducer() override
const double regionPhiMargin_
const edm::EDGetTokenT< T1Collection > l1TokenNonIsolated_
double emJetPhiBinLowEdge(unsigned int phiIndex) const
const double l1LowerThrIgnoreIsolation_
void getEtaPhiRegions(std::vector< EcalEtaPhiRegion > *, T1Collection, const L1CaloGeometry &, bool)
const_iterator begin() const
std::vector< edm::EDGetTokenT< EcalUncalibratedRecHitCollection > > uncalibHitTokens
double emJetPhiBinHighEdge(unsigned int phiIndex) const