50 std::unique_ptr<SiStripBadStrip>
getNewObject()
override;
77 dataLabel_(iConfig.getUntrackedParameter<
std::
string>(
"dataLabel",
"")),
79 fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
"file",
81 Cluster_src_(iConfig.getParameter<
edm::
InputTag>(
"Cluster_src")),
82 Track_src_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"Track_src")),
83 tracksCollection_in_EventTree(iConfig.getUntrackedParameter<
bool>(
"RemoveTrackClusters",
false)),
94 auto obj = std::make_unique<SiStripBadStrip>();
98 if (
AlgoName ==
"SiStripHotStripAlgorithmFromClusterOccupancy") {
100 <<
" [SiStripQualityHotStripIdentifier::getNewObject] call to SiStripHotStripAlgorithmFromClusterOccupancy" 114 <<
" [SiStripQualityHotStripIdentifier::getNewObject] copy SiStripObject in SiStripBadStrip" << std::endl;
116 std::stringstream
ss;
120 for (; rIter != rIterEnd; ++rIter) {
122 qobj->getDataVectorBegin() + rIter->iend);
125 <<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists" << std::endl;
128 <<
" [SiStripQualityHotStripIdentifier::getNewObject] " <<
ss.str() << std::endl;
132 <<
" [SiStripQualityHotStripIdentifier::getNewObject] call for a unknow HotStrip identification algoritm" 135 std::vector<uint32_t>
a;
139 <<
"[SiStripQualityHotStripIdentifier::getNewObject] detid already exists" << std::endl;
161 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::resetHistos] " << std::endl;
168 edm::LogInfo(
"SiStripQualityHotStripIdentifier") <<
" [SiStripQualityHotStripIdentifier::bookHistos] " << std::endl;
171 for (
const auto&
it :
info.getAllData()) {
172 sprintf(hname,
"h_%d",
it.first);
176 std::make_shared<TH1F>(hname, hname,
it.second.nApvs * 128, -0.5,
it.second.nApvs * 128 - 0.5);
179 <<
" [SiStripQualityHotStripIdentifier::bookHistos] DetId " <<
it.first
180 <<
" already found in map. Ignoring new data" << std::endl;
187 ref->second->Fill(
value);
190 <<
" [SiStripQualityHotStripIdentifier::fillHisto] Histogram not found in the list for DetId " <<
detid 191 <<
" Ignoring data value " <<
value << std::endl;
203 <<
" [SiStripQualityHotStripIdentifier::algoAnalyze] missing trackCollection with label " <<
Track_src_ 208 std::set<const void*> vPSiStripCluster;
213 LogTrace(
"SiStripQualityHotStripIdentifier")
214 <<
"Track number " <<
i + 1 <<
"\n\tmomentum: " <<
track.momentum() <<
"\n\tPT: " <<
track.pt()
215 <<
"\n\tvertex: " <<
track.vertex() <<
"\n\timpact parameter: " <<
track.d0()
216 <<
"\n\tcharge: " <<
track.charge() <<
"\n\tnormalizedChi2: " <<
track.normalizedChi2() <<
"\n\tFrom EXTRA : " 217 <<
"\n\t\touter PT " <<
track.outerPt() << std::endl;
222 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"\t\t Invalid Hit " << std::endl;
231 vPSiStripCluster.insert((
void*)&(matchedHit->
monoCluster()));
232 vPSiStripCluster.insert((
void*)&(matchedHit->
stereoCluster()));
233 }
else if (projectedHit) {
235 }
else if (singleHit) {
236 vPSiStripCluster.insert((
void*)&*(singleHit->
cluster()));
238 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"NULL hit" << std::endl;
244 std::stringstream
ss;
246 for (
const auto& dSet : *dsv_SiStripCluster) {
247 for (
const auto& clus : dSet.data) {
249 if (
std::find(vPSiStripCluster.begin(), vPSiStripCluster.end(), (
void*)&clus) == vPSiStripCluster.end()) {
251 ss <<
" adding cluster to histo for detid " << dSet.id <<
" with barycenter " << clus.barycenter()
258 LogTrace(
"SiStripQualityHotStripIdentifier") <<
ss.str();
void setProbabilityThreshold(long double prob)
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
T getParameter(std::string const &) const
~SiStripQualityHotStripIdentifier() override=default
void fillHisto(uint32_t detid, float value)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::InputTag Cluster_src_
const edm::FileInPath fp_
const edm::ParameterSet conf_
const edm::InputTag Track_src_
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)
ClusterRef cluster() const
std::unique_ptr< SiStripBadStrip > getNewObject() override
void algoBeginRun(const edm::Run &, const edm::EventSetup &) override
T getUntrackedParameter(std::string const &, T const &) const
SiStripQualityHotStripIdentifier(const edm::ParameterSet &)
edm::ESWatcher< SiStripQualityRcd > stripQualityWatcher_
const std::string dataLabel_
std::unordered_map< unsigned int, std::shared_ptr< TH1F > > QualityHistosMap
SiStripCluster const & monoCluster() const
SiStrip::QualityHistosMap ClusterPositionHistoMap
const SiStripQuality * stripQuality_
void algoAnalyze(const edm::Event &, const edm::EventSetup &) override
unsigned short MinClusterWidth_
void extractBadStrips(SiStripQuality *, HistoMap &, const SiStripQuality *)
void setMinNumEntries(unsigned short m)
void algoBeginJob(const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
SiStripDetInfo read(std::string filePath)
unsigned short MaxClusterWidth_
Log< level::Info, false > LogInfo
SiStripCluster const & stereoCluster() const
bool check(const edm::EventSetup &iSetup)
SiStripRecHit2D originalHit() const
std::pair< ContainerIterator, ContainerIterator > Range
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static constexpr char const *const kDefaultFile
const std::string & fullPath() const
const TrackerTopology * tTopo
void algoBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
void setMinNumEntriesPerStrip(unsigned short m)
const bool tracksCollection_in_EventTree