69 desc.
add<
bool>((
"doBarrel"),
true);
70 desc.
add<
bool>((
"doEndcaps"),
true);
73 desc.
add<
int>((
"clusEtaSize"), 3);
74 desc.
add<
int>((
"clusPhiSize"), 3);
75 desc.
add<
std::string>((
"barrelClusterCollection"),
"Simple3x3ClustersBarrel");
76 desc.
add<
std::string>((
"endcapClusterCollection"),
"Simple3x3ClustersEndcap");
77 desc.
add<
double>((
"clusSeedThr"), 0.5);
78 desc.
add<
double>((
"clusSeedThrEndCap"), 1.0);
79 desc.
add<
bool>((
"useRecoFlag"),
false);
80 desc.
add<
int>((
"flagLevelRecHitsToUse"), 1);
81 desc.
add<
bool>((
"useDBStatus"),
true);
82 desc.
add<
int>((
"statusLevelRecHitsToUse"), 1);
85 posCalcPSET.
add<
double>(
"T0_barl", 7.4);
86 posCalcPSET.
add<
double>(
"T0_endc", 3.1);
87 posCalcPSET.
add<
double>(
"T0_endcPresh", 1.2);
88 posCalcPSET.
add<
double>(
"W0", 4.2);
89 posCalcPSET.
add<
double>(
"X0", 0.89);
90 posCalcPSET.
add<
bool>(
"LogWeighted",
true);
93 desc.
add<
int>((
"maxNumberofSeeds"), 1000);
94 desc.
add<
int>((
"maxNumberofClusters"), 200);
95 desc.
add<
int>((
"debugLevel"), 0);
96 descriptions.
add((
"hltEgammaHLTNxNClusterProducer"), desc);
104 if (!barrelRecHitsHandle.
isValid()) {
105 LogDebug(
"") <<
"EgammaHLTNxNClusterProducer Error! can't get product eb hit!" << std::endl;
110 LogDebug(
"")<<
"EgammaHLTNxNClusterProducer nEBrechits: "<< evt.
id().
run()<<
" event "<<evt.
id().
event() <<
" "<< hits_eb->
size()<<std::endl;
120 if (!endcapRecHitsHandle.
isValid()) {
121 LogDebug(
"") <<
"EgammaHLTNxNClusterProducer Error! can't get product ee hit!" << std::endl;
126 LogDebug(
"")<<
"EgammaHLTNxNClusterProducer nEErechits: "<< evt.
id().
run()<<
" event "<<evt.
id().
event() <<
" "<< hits_ee->
size()<<std::endl;
138 if( flag != 0)
return false;
141 if( flag !=0 && flag != 4 )
return false;
144 if( flag !=0 && flag != 4 && flag != 6 && flag != 7)
return false;
148 int status = int(channelStatus[rh.
id().
rawId()].getStatusCode());
169 std::vector<EcalRecHit> seeds;
171 double clusterSeedThreshold ;
180 double energy = itt->energy();
182 if (energy > clusterSeedThreshold ) seeds.push_back(*itt);
209 std::vector<reco::BasicCluster> clusters;
210 std::vector<DetId> usedXtals;
217 for (std::vector<EcalRecHit>::iterator itseed=seeds.begin(); itseed!=seeds.end(); itseed++) {
218 DetId seed_id = itseed->id();
219 std::vector<DetId>::const_iterator usedIds;
221 std::vector<DetId>::iterator itdet =
find(usedXtals.begin(),usedXtals.end(),seed_id);
222 if(itdet != usedXtals.end())
continue;
225 std::vector<std::pair<DetId, float> > clus_used;
227 float clus_energy = 0;
229 for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
233 std::vector<DetId>::iterator itdet =
find(usedXtals.begin(),usedXtals.end(),
detid);
234 if(itdet != usedXtals.end())
continue;
237 if( hit == hits->
end())
continue;
241 usedXtals.push_back(detid);
242 clus_used.push_back(std::pair<DetId, float>(detid, 1.) );
243 clus_energy += hit->energy();
247 if( clus_energy <= 0 )
continue;
251 if (
debug_>=2 )
LogDebug(
"")<<
"nxn_cluster in run "<< evt.
id().
run()<<
" event "<<evt.
id().
event()<<
" energy: "<<clus_energy <<
" eta: "<< clus_pos.Eta()<<
" phi: "<< clus_pos.Phi()<<
" nRecHits: "<< clus_used.size() <<std::endl;
264 clusters_p->assign(clusters.begin(), clusters.end());
266 if(
debug_>=1)
LogDebug(
"")<<
"nxnclusterProducer: "<<clusters_p->size() <<
" made in barrel"<<std::endl;
270 if(
debug_>=1)
LogDebug(
"")<<
"nxnclusterProducer: "<<clusters_p->size() <<
" made in endcap"<<std::endl;
T getParameter(std::string const &) const
EventNumber_t event() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalRecHit >::const_iterator const_iterator
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int statusLevelRecHitsToUse_
uint32_t rawId() const
get the raw id
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
EgammaHLTNxNClusterProducer(const edm::ParameterSet &ps)
std::string endcapClusterCollection_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
PositionCalc posCalculator_
const_iterator end() const
double clusSeedThrEndCap_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
DetId id() const
get the id
XYZPointD XYZPoint
point in space with cartesian internal representation
Flags recoFlag() const
DEPRECATED provided for temporary backward compatibility.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
T const * product() const
~EgammaHLTNxNClusterProducer()
iterator find(key_type k)
void makeNxNClusters(edm::Event &evt, const edm::EventSetup &es, const EcalRecHitCollection *hits, const reco::CaloID::Detectors detector)
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
bool checkStatusOfEcalRecHit(const EcalChannelStatus &channelStatus, const EcalRecHit &rh)
edm::EDGetTokenT< EcalRecHitCollection > endcapHitProducer_
int flagLevelRecHitsToUse_
virtual void produce(edm::Event &, const edm::EventSetup &)
const_iterator begin() const
edm::EDGetTokenT< EcalRecHitCollection > barrelHitProducer_
std::string barrelClusterCollection_