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 sprintf(hname,
"h_%d",
it.first);
175 std::make_shared<TH1F>(hname, hname,
it.second.nApvs * 128, -0.5,
it.second.nApvs * 128 - 0.5);
178 <<
" [SiStripQualityHotStripIdentifier::bookHistos] DetId " <<
it.first
179 <<
" already found in map. Ignoring new data" << std::endl;
186 ref->second->Fill(
value);
189 <<
" [SiStripQualityHotStripIdentifier::fillHisto] Histogram not found in the list for DetId " << detid
190 <<
" Ignoring data value " <<
value << std::endl;
202 <<
" [SiStripQualityHotStripIdentifier::algoAnalyze] missing trackCollection with label " <<
Track_src_ 207 std::set<const void*> vPSiStripCluster;
212 LogTrace(
"SiStripQualityHotStripIdentifier")
213 <<
"Track number " <<
i + 1 <<
"\n\tmomentum: " <<
track.momentum() <<
"\n\tPT: " <<
track.pt()
214 <<
"\n\tvertex: " <<
track.vertex() <<
"\n\timpact parameter: " <<
track.d0()
215 <<
"\n\tcharge: " <<
track.charge() <<
"\n\tnormalizedChi2: " <<
track.normalizedChi2() <<
"\n\tFrom EXTRA : " 216 <<
"\n\t\touter PT " <<
track.outerPt() << std::endl;
221 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"\t\t Invalid Hit " << std::endl;
230 vPSiStripCluster.insert((
void*)&(matchedHit->
monoCluster()));
231 vPSiStripCluster.insert((
void*)&(matchedHit->
stereoCluster()));
232 }
else if (projectedHit) {
234 }
else if (singleHit) {
235 vPSiStripCluster.insert((
void*)&*(singleHit->
cluster()));
237 LogTrace(
"SiStripQualityHotStripIdentifier") <<
"NULL hit" << std::endl;
243 std::stringstream
ss;
245 for (
const auto& dSet : *dsv_SiStripCluster) {
246 for (
const auto& clus : dSet.data) {
248 if (
std::find(vPSiStripCluster.begin(), vPSiStripCluster.end(), (
void*)&clus) == vPSiStripCluster.end()) {
250 ss <<
" adding cluster to histo for detid " << dSet.id <<
" with barycenter " << clus.barycenter()
257 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)
std::string fullPath() const
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 TrackerTopology * tTopo
void algoBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
void setMinNumEntriesPerStrip(unsigned short m)
const bool tracksCollection_in_EventTree