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);
91 desc.
add<
bool>((
"doBarrel"),
false);
92 desc.
add<
bool>((
"doEndcaps"),
true);
93 desc.
add<
bool>((
"doIsolated"),
true);
97 posCalcPSET.
add<
double>(
"T0_barl", 7.4);
98 posCalcPSET.add<
double>(
"T0_endc", 3.1);
99 posCalcPSET.add<
double>(
"T0_endcPresh", 1.2);
100 posCalcPSET.add<
double>(
"W0", 4.2);
101 posCalcPSET.add<
double>(
"X0", 0.89);
102 posCalcPSET.add<
bool>(
"LogWeighted",
true);
108 desc.
add<
std::string>((
"endcapClusterCollection"),
"multi5x5EndcapBasicClusters");
109 desc.
add<
double>((
"Multi5x5BarrelSeedThr"), 0.5);
110 desc.
add<
double>((
"Multi5x5EndcapSeedThr"), 0.5);
113 desc.
add<
double>((
"l1LowerThr"), 5.0);
114 desc.
add<
double>((
"l1UpperThr"), 9999.);
115 desc.
add<
double>((
"l1LowerThrIgnoreIsolation"), 999.0);
116 desc.
add<
double>((
"regionEtaMargin"), 0.3);
117 desc.
add<
double>((
"regionPhiMargin"), 0.4);
119 desc.
add<std::vector<std::string> >((
"RecHitFlagToBeExcluded"), std::vector<std::string>());
120 descriptions.
add((
"hltEgammaHLTMulti5x5ClusterProducer"), desc);
138 std::vector<RectangularEtaPhiRegion> barrelRegions;
139 std::vector<RectangularEtaPhiRegion> endcapRegions;
142 for( l1extra::L1EmParticleCollection::const_iterator emItr = emIsolColl->begin(); emItr != emIsolColl->end() ;++emItr ){
147 int etaIndex = emItr->gctEmCand()->etaIndex() ;
150 int phiIndex = emItr->gctEmCand()->phiIndex() ;
160 if((
float)(etaHigh)>1.479 || (
float)(etaLow)<-1.479) isforw=1;
161 if(((
float)(etaLow)>-1.479 && (
float)(etaLow)<1.479) ||
162 ((
float)(etaHigh)>-1.479 && (
float)(etaHigh)<1.479)) isbarl=1;
173 if (etaHigh>-1.479 && etaHigh<1.479) etaHigh=-1.479;
174 if ( etaLow>-1.479 && etaLow<1.479) etaLow=1.479;
176 endcapRegions.push_back(region);
179 if (etaHigh>1.479) etaHigh=1.479;
180 if (etaLow<-1.479) etaLow=-1.479;
182 barrelRegions.push_back(region);
192 for( l1extra::L1EmParticleCollection::const_iterator emItr = emNonIsolColl->begin(); emItr != emNonIsolColl->end() ;++emItr ){
199 int etaIndex = emItr->gctEmCand()->etaIndex() ;
202 int phiIndex = emItr->gctEmCand()->phiIndex() ;
212 if((
float)(etaHigh)>1.479 || (
float)(etaLow)<-1.479) isforw=1;
213 if(((
float)(etaLow)>-1.479 && (
float)(etaLow)<1.479) ||
214 ((
float)(etaHigh)>-1.479 && (
float)(etaHigh)<1.479)) isbarl=1;
225 if (etaHigh>-1.479 && etaHigh<1.479) etaHigh=-1.479;
226 if ( etaLow>-1.479 && etaLow<1.479) etaLow=1.479;
228 endcapRegions.push_back(region);
231 if (etaHigh>1.479) etaHigh=1.479;
232 if (etaLow<-1.479) etaLow=-1.479;
234 barrelRegions.push_back(region);
260 std::cout <<
"could not get a handle on the EcalRecHitCollection!" << std::endl;
261 edm::LogError(
"EgammaHLTMulti5x5ClusterProducerError") <<
"Error! can't get the product ";
271 const std::vector<RectangularEtaPhiRegion>&
regions,
301 clusters =
Multi5x5_p->
makeClusters(hitCollection_p, geometry_p, topology_p, geometryES_p, detector,
true, regions);
304 auto clusters_p = std::make_unique<reco::BasicClusterCollection>();
305 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
double l1LowerThrIgnoreIsolation_
std::string barrelClusterCollection_
edm::EDGetTokenT< l1extra::L1EmParticleCollection > l1TagNonIsolated_
std::string endcapClusterCollection_
void clusterizeECALPart(edm::Event &evt, const edm::EventSetup &es, edm::EDGetTokenT< EcalRecHitCollection > &hitToken, const std::string &clusterCollection, const std::vector< RectangularEtaPhiRegion > ®ions, const reco::CaloID::Detectors detector)
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)
const EcalRecHitCollection * getCollection(edm::Event &evt, edm::EDGetTokenT< EcalRecHitCollection > &hitToken)
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
double emJetPhiBinLowEdge(unsigned int phiIndex) const
double emJetPhiBinHighEdge(unsigned int phiIndex) const
EgammaHLTMulti5x5ClusterProducer(const edm::ParameterSet &ps)
edm::EDGetTokenT< l1extra::L1EmParticleCollection > l1TagIsolated_