80 for (
unsigned int i=0;
i<hitLabels.size();
i++) {
81 uncalibHitTokens.push_back(consumes<EcalUncalibratedRecHitCollection>(hitLabels[
i]));
82 produces<EcalUncalibratedRecHitCollection>(productLabels[
i]);
85 for (
unsigned int i=0;
i<hitLabels.size();
i++) {
86 hitTokens.push_back(consumes<EcalRecHitCollection>(hitLabels[
i]));
87 produces<EcalRecHitCollection> (productLabels[
i]);
98 std::vector<std::string> productTags;
99 productTags.push_back(
"EcalRegionalRecHitsEB");
100 productTags.push_back(
"EcalRegionalRecHitsEE");
101 desc.
add<std::vector<std::string>>(
"productLabels", productTags);
102 std::vector<edm::InputTag> inputTags;
103 inputTags.push_back(
edm::InputTag(
"hltEcalRegionalEgammaRecHit:EcalRecHitsEB"));
104 inputTags.push_back(
edm::InputTag(
"hltEcalRegionalEgammaRecHit:EcalRecHitsEE"));
105 inputTags.push_back(
edm::InputTag(
"hltESRegionalEgammaRecHit:EcalRecHitsES"));
106 desc.
add<std::vector<edm::InputTag>>(
"ecalhitLabels", inputTags);
110 desc.
add<
bool>(
"useUncalib",
true);
111 desc.
add<
bool>(
"doIsolated",
true);
112 desc.
add<
double>(
"l1LowerThr", 5.0);
113 desc.
add<
double>(
"l1UpperThr", 999.);
114 desc.
add<
double>(
"l1LowerThrIgnoreIsolation", 0.0);
115 desc.
add<
double>(
"regionEtaMargin", 0.14);
116 desc.
add<
double>(
"regionPhiMargin", 0.4);
119 descriptions.
add((
"hltEgammaHLTRechitInRegionsProducer"), desc);
129 std::auto_ptr<const CaloSubdetectorTopology>
topology;
145 std::vector<EcalEtaPhiRegion> regions;
147 for( l1extra::L1EmParticleCollection::const_iterator emItr = emIsolColl->begin(); emItr != emIsolColl->end() ;++emItr ) {
151 int etaIndex = emItr->gctEmCand()->etaIndex();
152 int phiIndex = emItr->gctEmCand()->phiIndex();
155 double etaLow = l1CaloGeom->etaBinLowEdge(etaIndex);
156 double etaHigh = l1CaloGeom->etaBinHighEdge(etaIndex);
157 double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
158 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
171 for( l1extra::L1EmParticleCollection::const_iterator emItr = emNonIsolColl->begin(); emItr != emNonIsolColl->end() ;++emItr ) {
179 int etaIndex = emItr->gctEmCand()->etaIndex();
180 int phiIndex = emItr->gctEmCand()->phiIndex();
183 double etaLow = l1CaloGeom->etaBinLowEdge(etaIndex);
184 double etaHigh = l1CaloGeom->etaBinHighEdge(etaIndex);
185 double phiLow = l1CaloGeom->emJetPhiBinLowEdge(phiIndex);
186 double phiHigh = l1CaloGeom->emJetPhiBinHighEdge(phiIndex);
203 if (!(urhcH[i].isValid())) {
204 edm::LogError(
"ProductNotFound")<<
"could not get a handle on the EcalRecHitCollection! (" <<
hitLabels[
i].encode() <<
")" << std::endl;
209 if (uncalibRecHits->
size() == 0)
212 if ((*uncalibRecHits)[0].id().subdetId() ==
EcalBarrel) {
214 topology.reset(
new EcalBarrelTopology(geoHandle));
215 }
else if ((*uncalibRecHits)[0].
id().subdetId() ==
EcalEndcap) {
217 topology.reset(
new EcalEndcapTopology(geoHandle));
218 }
else if ((*uncalibRecHits)[0].
id().subdetId() ==
EcalPreshower) {
220 topology.reset(
new EcalPreshowerTopology (geoHandle));
221 }
else throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
223 if(regions.size() != 0) {
226 for (it = uncalibRecHits->
begin(); it != uncalibRecHits->
end(); it++){
230 std::vector<EcalEtaPhiRegion>::const_iterator region;
231 for (region=regions.begin(); region!=regions.end(); region++) {
232 if (region->inRegion(position))
233 uhits->push_back(*it);
247 if (!(rhcH[i].isValid())) {
248 edm::LogError(
"ProductNotFound")<<
"could not get a handle on the EcalRecHitCollection! (" <<
hitLabels[
i].encode() <<
")" << std::endl;
253 if (recHits->
size() == 0)
256 if ((*recHits)[0].id().subdetId() ==
EcalBarrel) {
258 topology.reset(
new EcalBarrelTopology(geoHandle));
259 }
else if ((*recHits)[0].
id().subdetId() ==
EcalEndcap) {
261 topology.reset(
new EcalEndcapTopology(geoHandle));
264 topology.reset(
new EcalPreshowerTopology (geoHandle));
265 }
else throw(std::runtime_error(
"\n\nProducer encountered invalied ecalhitcollection type.\n\n"));
267 if(regions.size() != 0) {
269 for (it = recHits->
begin(); it != recHits->
end(); it++){
273 std::vector<EcalEtaPhiRegion>::const_iterator region;
274 for (region=regions.begin(); region!=regions.end(); region++) {
275 if (region->inRegion(position))
276 hits->push_back(*it);
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::vector< edm::EDGetTokenT< EcalUncalibratedRecHitCollection > > uncalibHitTokens
edm::InputTag l1TagIsolated_
std::vector< std::string > productLabels
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
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalUncalibratedRecHit >::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
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
edm::InputTag l1TagNonIsolated_
double l1LowerThrIgnoreIsolation_
const_iterator begin() const