23 dataLabel_(iConfig.getUntrackedParameter<
std::
string>(
"dataLabel",
"")),
25 fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
26 "file",
edm::FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
27 Cluster_src_(iConfig.getParameter<
edm::
InputTag>(
"Cluster_src")),
28 Track_src_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"Track_src")),
29 tracksCollection_in_EventTree(iConfig.getUntrackedParameter<
bool>(
"RemoveTrackClusters",
false)),
43 auto obj = std::make_unique<SiStripBadStrip>();
47 if (AlgoName ==
"SiStripHotStripAlgorithmFromClusterOccupancy") {
49 <<
" [SiStripQualityHotStripIdentifier::getNewObject] call to SiStripHotStripAlgorithmFromClusterOccupancy" 54 theIdentifier.
setMinNumEntries(parameters.getUntrackedParameter<uint32_t>(
"MinNumEntries", 100));
61 <<
" [SiStripQualityHotStripIdentifier::getNewObject] copy SiStripObject in SiStripBadStrip" << std::endl;
67 for (; rIter != rIterEnd; ++rIter) {
72 <<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists" << std::endl;
75 <<
" [SiStripQualityHotStripIdentifier::getNewObject] " << ss.str() << std::endl;
79 <<
" [SiStripQualityHotStripIdentifier::getNewObject] call for a unknow HotStrip identification algoritm" 82 std::vector<uint32_t>
a;
86 <<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists" << std::endl;
115 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::resetHistos] " << std::endl;
118 for (; it != iEnd; ++it) {
124 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] " << std::endl;
126 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it =
reader->
getAllData().begin();
127 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator iEnd =
reader->
getAllData().end();
128 for (; it != iEnd; ++it) {
129 sprintf(hname,
"h_%d", it->first);
133 std::make_shared<TH1F>(hname, hname, it->second.nApvs * 128, -0.5, it->second.nApvs * 128 - 0.5);
136 <<
" [SiStripQualityHotStripIdentifier::bookHistos] DetId " << it->first
137 <<
" already found in map. Ignoring new data" << std::endl;
144 ref->second->Fill(value);
147 <<
" [SiStripQualityHotStripIdentifier::fillHisto] Histogram not found in the list for DetId " << detid
148 <<
" Ignoring data value " << value << std::endl;
158 if (!trackCollection.
isValid()) {
160 <<
" [SiStripQualityHotStripIdentifier::algoAnalyze] missing trackCollection with label " <<
Track_src_ 165 std::set<const void*> vPSiStripCluster;
170 for (reco::TrackCollection::const_iterator
track = tC.begin();
track != tC.end();
track++) {
171 LogTrace(
"SiStripQualityHotStripIdentifier")
172 <<
"Track number " << i + 1 <<
"\n\tmomentum: " <<
track->momentum() <<
"\n\tPT: " <<
track->pt()
173 <<
"\n\tvertex: " <<
track->vertex() <<
"\n\timpact parameter: " <<
track->d0()
174 <<
"\n\tcharge: " <<
track->charge() <<
"\n\tnormalizedChi2: " <<
track->normalizedChi2()
175 <<
"\n\tFrom EXTRA : " 176 <<
"\n\t\touter PT " <<
track->outerPt() << std::endl;
181 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"\t\t Invalid Hit " << std::endl;
190 vPSiStripCluster.insert((
void*)&(matchedHit->
monoCluster()));
191 vPSiStripCluster.insert((
void*)&(matchedHit->
stereoCluster()));
192 }
else if (projectedHit) {
194 }
else if (singleHit) {
195 vPSiStripCluster.insert((
void*)&*(singleHit->
cluster()));
197 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"NULL hit" << std::endl;
203 std::stringstream
ss;
206 for (; DSViter != dsv_SiStripCluster->end(); DSViter++) {
209 for (; ClusIter != ClusIterEnd; ++
ClusIter) {
211 if (
std::find(vPSiStripCluster.begin(), vPSiStripCluster.end(), (
void*)&*ClusIter) == vPSiStripCluster.end()) {
213 ss <<
" adding cluster to histo for detid " << DSViter->id <<
" with barycenter " << ClusIter->barycenter()
215 fillHisto(DSViter->id, ClusIter->barycenter());
220 LogTrace(
"SiStripQualityHotStripIdentifier") << ss.str();
void setProbabilityThreshold(long double prob)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void fillHisto(uint32_t detid, float value)
void extractBadStrips(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)
SiStripCluster const & monoCluster() const
std::vector< Track > TrackCollection
collection of Tracks
~SiStripQualityHotStripIdentifier() override
const edm::ParameterSet conf_
Registry::const_iterator RegistryIterator
void algoEndJob() override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::unique_ptr< SiStripBadStrip > getNewObject() override
void algoBeginRun(const edm::Run &, const edm::EventSetup &) override
edm::InputTag Cluster_src_
SiStripQualityHotStripIdentifier(const edm::ParameterSet &)
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
RegistryIterator getRegistryVectorEnd() const
unsigned long long m_cacheID_
SiStrip::QualityHistosMap ClusterPositionHistoMap
bool tracksCollection_in_EventTree
void algoAnalyze(const edm::Event &, const edm::EventSetup &) override
unsigned short MinClusterWidth_
void setMinNumEntries(unsigned short m)
ClusterRef cluster() const
edm::ESHandle< SiStripQuality > SiStripQuality_
unsigned short MaxClusterWidth_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
ContainerIterator getDataVectorBegin() const
SiStripRecHit2D originalHit() const
T const * product() const
RegistryIterator getRegistryVectorBegin() const
SiStripCluster const & stereoCluster() const
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
const std::map< uint32_t, DetInfo > & getAllData() const
iterator begin()
Return an iterator to the first DetSet.
const TrackerTopology * tTopo
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
T const * product() const
void setMinNumEntriesPerStrip(unsigned short m)