22 dataLabel_(iConfig.getUntrackedParameter<std::
string>(
"dataLabel",
"")),
24 fp_(iConfig.getUntrackedParameter<edm::FileInPath>(
"file",
25 edm::FileInPath(SiStripDetInfoFileReader::
kDefaultFile))),
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)),
41 auto obj = std::make_unique<SiStripBadStrip>();
45 if (AlgoName ==
"SiStripHotStripAlgorithmFromClusterOccupancy") {
47 <<
" [SiStripQualityHotStripIdentifier::getNewObject] call to SiStripHotStripAlgorithmFromClusterOccupancy"
52 theIdentifier.
setMinNumEntries(parameters.getUntrackedParameter<uint32_t>(
"MinNumEntries", 100));
61 <<
" [SiStripQualityHotStripIdentifier::getNewObject] copy SiStripObject in SiStripBadStrip" << std::endl;
67 for (; rIter != rIterEnd; ++rIter) {
69 qobj->getDataVectorBegin() + rIter->iend);
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;
108 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::resetHistos] " << std::endl;
115 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] " << std::endl;
118 sprintf(hname,
"h_%d", it.first);
122 std::make_shared<TH1F>(hname, hname, it.second.nApvs * 128, -0.5, it.second.nApvs * 128 - 0.5);
125 <<
" [SiStripQualityHotStripIdentifier::bookHistos] DetId " << it.first
126 <<
" already found in map. Ignoring new data" << std::endl;
133 ref->second->Fill(value);
136 <<
" [SiStripQualityHotStripIdentifier::fillHisto] Histogram not found in the list for DetId " << detid
137 <<
" Ignoring data value " << value << std::endl;
147 if (!trackCollection.
isValid()) {
149 <<
" [SiStripQualityHotStripIdentifier::algoAnalyze] missing trackCollection with label " <<
Track_src_
154 std::set<const void*> vPSiStripCluster;
158 for (
const auto&
track : *(trackCollection.
product())) {
159 LogTrace(
"SiStripQualityHotStripIdentifier")
160 <<
"Track number " << i + 1 <<
"\n\tmomentum: " <<
track.momentum() <<
"\n\tPT: " <<
track.pt()
161 <<
"\n\tvertex: " <<
track.vertex() <<
"\n\timpact parameter: " <<
track.d0()
162 <<
"\n\tcharge: " <<
track.charge() <<
"\n\tnormalizedChi2: " <<
track.normalizedChi2() <<
"\n\tFrom EXTRA : "
163 <<
"\n\t\touter PT " <<
track.outerPt() << std::endl;
166 for (
auto const& recHit :
track.recHits()) {
167 if (!recHit->isValid()) {
168 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"\t\t Invalid Hit " << std::endl;
177 vPSiStripCluster.insert((
void*)&(matchedHit->
monoCluster()));
178 vPSiStripCluster.insert((
void*)&(matchedHit->
stereoCluster()));
179 }
else if (projectedHit) {
181 }
else if (singleHit) {
182 vPSiStripCluster.insert((
void*)&*(singleHit->
cluster()));
184 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"NULL hit" << std::endl;
190 std::stringstream
ss;
192 for (
const auto& dSet : *dsv_SiStripCluster) {
193 for (
const auto& clus : dSet.data) {
195 if (
std::find(vPSiStripCluster.begin(), vPSiStripCluster.end(), (
void*)&clus) == vPSiStripCluster.end()) {
197 ss <<
" adding cluster to histo for detid " << dSet.id <<
" with barycenter " << clus.barycenter()
204 LogTrace(
"SiStripQualityHotStripIdentifier") << ss.str();
void setProbabilityThreshold(long double prob)
T getUntrackedParameter(std::string const &, T const &) const
void fillHisto(uint32_t detid, float value)
SiStripCluster const & monoCluster() const
~SiStripQualityHotStripIdentifier() override
const edm::ParameterSet conf_
Registry::const_iterator RegistryIterator
void algoEndJob() override
Log< level::Error, false > LogError
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
const uint16_t range(const Frame &aFrame)
bool getData(T &iHolder) const
edm::InputTag Cluster_src_
SiStripQualityHotStripIdentifier(const edm::ParameterSet &)
edm::ESWatcher< SiStripQualityRcd > stripQualityWatcher_
SiStrip::QualityHistosMap ClusterPositionHistoMap
const SiStripQuality * stripQuality_
bool tracksCollection_in_EventTree
void algoAnalyze(const edm::Event &, const edm::EventSetup &) override
unsigned short MinClusterWidth_
void extractBadStrips(SiStripQuality *, HistoMap &, const SiStripQuality *)
void setMinNumEntries(unsigned short m)
ClusterRef cluster() const
SiStripDetInfo read(std::string filePath)
unsigned short MaxClusterWidth_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
SiStripRecHit2D originalHit() const
Log< level::Info, false > LogInfo
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
T const * product() const
T getParameter(std::string const &) const
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
bool check(const edm::EventSetup &iSetup)
SiStripCluster const & stereoCluster() const
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
static constexpr char const *const kDefaultFile
const TrackerTopology * tTopo
void setMinNumEntriesPerStrip(unsigned short m)