67 const std::vector<std::string> flagnames = ps.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcluded");
68 const std::vector<int> flagsexcl = StringToEnumValue<EcalRecHit::Flags>(flagnames);
70 const std::vector<std::string> severitynames = ps.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcluded");
71 const std::vector<int> severitiesexcl = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynames);
74 for (
unsigned int i=0;
i<hitLabels.size();
i++)
75 hitTokens.push_back(consumes<EcalRecHitCollection>(hitLabels[
i]));
77 produces<EcalRecHitCollection> (
"EcalRegionalRecHitsEB");
78 produces<EcalRecHitCollection> (
"EcalRegionalRecHitsEE");
79 produces<EcalRecHitCollection> (
"EcalRegionalRecHitsES");
90 std::vector<edm::InputTag> inputTags;
91 inputTags.push_back(
edm::InputTag(
"hltEcalRegionalEgammaRecHit:EcalRecHitsEB"));
92 inputTags.push_back(
edm::InputTag(
"hltEcalRegionalEgammaRecHit:EcalRecHitsEE"));
93 inputTags.push_back(
edm::InputTag(
"hltESRegionalEgammaRecHit:EcalRecHitsES"));
94 desc.
add<std::vector<edm::InputTag>>(
"ecalhitLabels", inputTags);
98 desc.
add<
bool>(
"doIsolated",
true);
99 desc.
add<
double>(
"l1LowerThr", 5.0);
100 desc.
add<
double>(
"l1UpperThr", 999.);
101 desc.
add<
double>(
"l1LowerThrIgnoreIsolation", 0.0);
102 desc.
add<
double>(
"regionEtaMargin", 0.14);
103 desc.
add<
double>(
"regionPhiMargin", 0.4);
104 desc.
add<std::vector<std::string> >(
"RecHitFlagToBeExcluded", std::vector<std::string>());
105 desc.
add<std::vector<std::string> >(
"RecHitSeverityToBeExcluded", std::vector<std::string>());
106 descriptions.
add((
"hltEgammaHLTRechitInRegionsProducer"), desc);
119 if (!(rhcH[i].isValid())) {
120 edm::LogError(
"ProductNotFound")<<
"could not get a handle on the EcalRecHitCollection! (" <<
hitLabels[
i].encode() <<
")" << std::endl;
130 std::auto_ptr<const CaloSubdetectorTopology> topology;
150 std::vector<EcalEtaPhiRegion> regions;
153 for( l1extra::L1EmParticleCollection::const_iterator emItr = emIsolColl->begin(); emItr != emIsolColl->end() ;++emItr ) {
157 int etaIndex = emItr->gctEmCand()->etaIndex();
158 int phiIndex = emItr->gctEmCand()->phiIndex();
161 double etaLow = l1CaloGeom->etaBinLowEdge(etaIndex);
162 double etaHigh = l1CaloGeom->etaBinHighEdge(etaIndex);
163 double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
164 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
177 for( l1extra::L1EmParticleCollection::const_iterator emItr = emNonIsolColl->begin(); emItr != emNonIsolColl->end() ;++emItr ) {
185 int etaIndex = emItr->gctEmCand()->etaIndex();
186 int phiIndex = emItr->gctEmCand()->phiIndex();
189 double etaLow = l1CaloGeom->etaBinLowEdge(etaIndex);
190 double etaHigh = l1CaloGeom->etaBinHighEdge(etaIndex);
191 double phiLow = l1CaloGeom->emJetPhiBinLowEdge(phiIndex);
192 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge(phiIndex);
208 topology.reset(
new EcalBarrelTopology(geoHandle));
209 }
else if(
hitLabels[
i].
encode() ==
"hltEcalRegionalEgammaRecHit:EcalRecHitsEE") {
211 topology.reset(
new EcalEndcapTopology(geoHandle));
212 }
else if(
hitLabels[
i].
encode() ==
"hltESRegionalEgammaRecHit:EcalRecHitsES") {
214 topology.reset(
new EcalPreshowerTopology (geoHandle));
215 }
else throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
217 if(regions.size() != 0) {
220 for (it = recHits->
begin(); it != recHits->
end(); it++){
226 std::vector<EcalEtaPhiRegion>::const_iterator region;
227 for (region=regions.begin(); region!=regions.end(); region++) {
230 if (region->inRegion(position)) {
232 hitsEB->push_back(*it);
234 hitsEE->push_back(*it);
236 hitsES->push_back(*it);
244 evt.
put(hitsEB,
"EcalRegionalRecHitsEB");
245 evt.
put(hitsEE,
"EcalRegionalRecHitsEE");
246 evt.
put(hitsES,
"EcalRegionalRecHitsES");
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
edm::InputTag l1TagIsolated_
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalRecHit >::const_iterator const_iterator
~EgammaHLTRechitInRegionsProducer()
static int position[TOTALCHAMBERS][3]
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< edm::InputTag > hitLabels
virtual void produce(edm::Event &, const edm::EventSetup &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > hitTokens
const_iterator end() const
EgammaHLTRechitInRegionsProducer(const edm::ParameterSet &ps)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T const * product() const
ESHandle< TrackerGeometry > geometry
edm::InputTag hitproducer_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
edm::InputTag l1TagNonIsolated_
double l1LowerThrIgnoreIsolation_
const_iterator begin() const