54 double barrelSeedThreshold = ps.
getParameter<
double>(
"Multi5x5BarrelSeedThr");
55 double endcapSeedThreshold = ps.
getParameter<
double>(
"Multi5x5EndcapSeedThr");
70 const std::vector<std::string> flagnames =
71 ps.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcluded");
74 std::vector<int> v_chstatus = StringToEnumValue<EcalRecHit::Flags>(flagnames);
90 desc.
add<
bool>((
"doBarrel"),
false);
91 desc.
add<
bool>((
"doEndcaps"),
true);
92 desc.
add<
bool>((
"doIsolated"),
true);
96 posCalcPSET.
add<
double>(
"T0_barl", 7.4);
97 posCalcPSET.add<
double>(
"T0_endc", 3.1);
98 posCalcPSET.add<
double>(
"T0_endcPresh", 1.2);
99 posCalcPSET.add<
double>(
"W0", 4.2);
100 posCalcPSET.add<
double>(
"X0", 0.89);
101 posCalcPSET.add<
bool>(
"LogWeighted",
true);
107 desc.
add<
std::string>((
"endcapClusterCollection"),
"multi5x5EndcapBasicClusters");
108 desc.
add<
double>((
"Multi5x5BarrelSeedThr"), 0.5);
109 desc.
add<
double>((
"Multi5x5EndcapSeedThr"), 0.5);
112 desc.
add<
double>((
"l1LowerThr"), 5.0);
113 desc.
add<
double>((
"l1UpperThr"), 9999.);
114 desc.
add<
double>((
"l1LowerThrIgnoreIsolation"), 999.0);
115 desc.
add<
double>((
"regionEtaMargin"), 0.3);
116 desc.
add<
double>((
"regionPhiMargin"), 0.4);
118 desc.
add<std::vector<std::string> >((
"RecHitFlagToBeExcluded"), std::vector<std::string>());
119 descriptions.
add((
"hltEgammaHLTMulti5x5ClusterProducer"), desc);
137 std::vector<RectangularEtaPhiRegion> barrelRegions;
138 std::vector<RectangularEtaPhiRegion> endcapRegions;
141 for( l1extra::L1EmParticleCollection::const_iterator emItr = emIsolColl->begin(); emItr != emIsolColl->end() ;++emItr ){
146 int etaIndex = emItr->gctEmCand()->etaIndex() ;
149 int phiIndex = emItr->gctEmCand()->phiIndex() ;
159 if((
float)(etaHigh)>1.479 || (
float)(etaLow)<-1.479) isforw=1;
160 if(((
float)(etaLow)>-1.479 && (
float)(etaLow)<1.479) ||
161 ((
float)(etaHigh)>-1.479 && (
float)(etaHigh)<1.479)) isbarl=1;
172 if (etaHigh>-1.479 && etaHigh<1.479) etaHigh=-1.479;
173 if ( etaLow>-1.479 && etaLow<1.479) etaLow=1.479;
175 endcapRegions.push_back(region);
178 if (etaHigh>1.479) etaHigh=1.479;
179 if (etaLow<-1.479) etaLow=-1.479;
181 barrelRegions.push_back(region);
191 for( l1extra::L1EmParticleCollection::const_iterator emItr = emNonIsolColl->begin(); emItr != emNonIsolColl->end() ;++emItr ){
198 int etaIndex = emItr->gctEmCand()->etaIndex() ;
201 int phiIndex = emItr->gctEmCand()->phiIndex() ;
211 if((
float)(etaHigh)>1.479 || (
float)(etaLow)<-1.479) isforw=1;
212 if(((
float)(etaLow)>-1.479 && (
float)(etaLow)<1.479) ||
213 ((
float)(etaHigh)>-1.479 && (
float)(etaHigh)<1.479)) isbarl=1;
224 if (etaHigh>-1.479 && etaHigh<1.479) etaHigh=-1.479;
225 if ( etaLow>-1.479 && etaLow<1.479) etaLow=1.479;
227 endcapRegions.push_back(region);
230 if (etaHigh>1.479) etaHigh=1.479;
231 if (etaLow<-1.479) etaLow=-1.479;
233 barrelRegions.push_back(region);
258 std::cout <<
"could not get a handle on the EcalRecHitCollection!" << std::endl;
259 edm::LogError(
"EgammaHLTMulti5x5ClusterProducerError") <<
"Error! can't get the product ";
269 const std::vector<RectangularEtaPhiRegion>&
regions,
280 std::unique_ptr<CaloSubdetectorTopology>topology_p;
285 topology_p = std::make_unique<EcalBarrelTopology>(*geoHandle);
290 topology_p = std::make_unique<EcalEndcapTopology>(*geoHandle);
302 auto clusters_p = std::make_unique<reco::BasicClusterCollection>();
303 clusters_p->assign(clusters.begin(), clusters.end());
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Multi5x5ClusterAlgo * Multi5x5_p
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double etaBinHighEdge(unsigned int etaIndex, bool central=true) const
double etaBinLowEdge(unsigned int etaIndex, bool central=true) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void clusterizeECALPart(edm::Event &evt, const edm::EventSetup &es, const edm::EDGetTokenT< EcalRecHitCollection > &hitToken, const std::string &clusterCollection, const std::vector< RectangularEtaPhiRegion > ®ions, const reco::CaloID::Detectors detector) const
double l1LowerThrIgnoreIsolation_
std::string barrelClusterCollection_
edm::EDGetTokenT< l1extra::L1EmParticleCollection > l1TagNonIsolated_
std::string endcapClusterCollection_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::InputTag barrelHitCollection_
edm::EDGetTokenT< EcalRecHitCollection > barrelHitToken_
edm::EDGetTokenT< EcalRecHitCollection > endcapHitToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
PositionCalc posCalculator_
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, reco::CaloID::Detectors detector, bool regional=false, const std::vector< RectangularEtaPhiRegion > ®ions=std::vector< RectangularEtaPhiRegion >())
T const * product() const
~EgammaHLTMulti5x5ClusterProducer() override
edm::InputTag endcapHitCollection_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
void produce(edm::Event &, const edm::EventSetup &) override
const EcalRecHitCollection * getCollection(edm::Event &evt, const edm::EDGetTokenT< EcalRecHitCollection > &hitToken) const
double emJetPhiBinLowEdge(unsigned int phiIndex) const
double emJetPhiBinHighEdge(unsigned int phiIndex) const
EgammaHLTMulti5x5ClusterProducer(const edm::ParameterSet &ps)
edm::EDGetTokenT< l1extra::L1EmParticleCollection > l1TagIsolated_