22 dataLabel_(iConfig.getUntrackedParameter<
std::
string>(
"dataLabel",
"")),
24 fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
25 "file",
edm::FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
26 Cluster_src_(iConfig.getParameter<
edm::InputTag>(
"Cluster_src")),
27 Track_src_(iConfig.getUntrackedParameter<
edm::InputTag>(
"Track_src")),
28 tracksCollection_in_EventTree(iConfig.getUntrackedParameter<
bool>(
"RemoveTrackClusters",
false)),
42 auto obj = std::make_unique<SiStripBadStrip>();
46 if (AlgoName ==
"SiStripHotStripAlgorithmFromClusterOccupancy") {
48 <<
" [SiStripQualityHotStripIdentifier::getNewObject] call to SiStripHotStripAlgorithmFromClusterOccupancy" 53 theIdentifier.
setMinNumEntries(parameters.getUntrackedParameter<uint32_t>(
"MinNumEntries", 100));
60 <<
" [SiStripQualityHotStripIdentifier::getNewObject] copy SiStripObject in SiStripBadStrip" << std::endl;
66 for (; rIter != rIterEnd; ++rIter) {
69 if (!
obj->put(rIter->detid, range))
71 <<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists" << std::endl;
74 <<
" [SiStripQualityHotStripIdentifier::getNewObject] " << ss.str() << std::endl;
78 <<
" [SiStripQualityHotStripIdentifier::getNewObject] call for a unknow HotStrip identification algoritm" 81 std::vector<uint32_t>
a;
83 if (!
obj->put(0xFFFFFFFF, range))
85 <<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists" << std::endl;
114 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::resetHistos] " << std::endl;
117 for (; it != iEnd; ++it) {
123 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] " << std::endl;
125 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it =
reader->
getAllData().begin();
126 std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator iEnd =
reader->
getAllData().end();
127 for (; it != iEnd; ++it) {
128 sprintf(hname,
"h_%d", it->first);
132 boost::shared_ptr<TH1F>(
new TH1F(hname, hname, it->second.nApvs * 128, -0.5, it->second.nApvs * 128 - 0.5));
135 <<
" [SiStripQualityHotStripIdentifier::bookHistos] DetId " << it->first
136 <<
" already found in map. Ignoring new data" << std::endl;
143 ref->second->Fill(value);
146 <<
" [SiStripQualityHotStripIdentifier::fillHisto] Histogram not found in the list for DetId " << detid
147 <<
" Ignoring data value " << value << std::endl;
157 if (!trackCollection.
isValid()) {
159 <<
" [SiStripQualityHotStripIdentifier::algoAnalyze] missing trackCollection with label " <<
Track_src_ 164 std::set<const void*> vPSiStripCluster;
169 for (reco::TrackCollection::const_iterator
track = tC.begin();
track != tC.end();
track++) {
170 LogTrace(
"SiStripQualityHotStripIdentifier")
171 <<
"Track number " << i + 1 <<
"\n\tmomentum: " <<
track->momentum() <<
"\n\tPT: " <<
track->pt()
172 <<
"\n\tvertex: " <<
track->vertex() <<
"\n\timpact parameter: " <<
track->d0()
173 <<
"\n\tcharge: " <<
track->charge() <<
"\n\tnormalizedChi2: " <<
track->normalizedChi2()
174 <<
"\n\tFrom EXTRA : " 175 <<
"\n\t\touter PT " <<
track->outerPt() << std::endl;
180 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"\t\t Invalid Hit " << std::endl;
189 vPSiStripCluster.insert((
void*)&(matchedHit->
monoCluster()));
190 vPSiStripCluster.insert((
void*)&(matchedHit->
stereoCluster()));
191 }
else if (projectedHit) {
193 }
else if (singleHit) {
194 vPSiStripCluster.insert((
void*)&*(singleHit->
cluster()));
196 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"NULL hit" << std::endl;
202 std::stringstream ss;
205 for (; DSViter != dsv_SiStripCluster->end(); DSViter++) {
208 for (; ClusIter != ClusIterEnd; ++
ClusIter) {
210 if (
std::find(vPSiStripCluster.begin(), vPSiStripCluster.end(), (
void*)&*ClusIter) == vPSiStripCluster.end()) {
212 ss <<
" adding cluster to histo for detid " << DSViter->id <<
" with barycenter " << ClusIter->barycenter()
214 fillHisto(DSViter->id, ClusIter->barycenter());
219 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
const std::map< uint32_t, DetInfo > & getAllData() const
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
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)