27 UseInputDB_(iConfig.getUntrackedParameter<bool>(
"UseInputDB",
false)),
31 filename(iConfig.getUntrackedParameter<std::
string>(
"rootFilename",
"CondDB_TKCC_20X_v3_hlt_50822.root")),
32 dirpath(iConfig.getUntrackedParameter<std::
string>(
"rootDirPath",
"")),
34 MeanNumberOfCluster(0),
35 calibrationthreshold(iConfig.getUntrackedParameter<uint32_t>(
"CalibrationThreshold", 10000)),
38 stripQualityToken_(UseInputDB_
45 edm::LogInfo(
"SiStripQualityHotStripIdentifierRoot") <<
" before opening file " <<
filename.c_str();
47 edm::LogInfo(
"SiStripQualityHotStripIdentifierRoot") <<
" after opening file ";
55 <<
"SiStripQualityHotStripIdentifierRoot::getNewObject called" << std::endl;
57 auto obj = std::make_unique<SiStripBadStrip>();
66 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] Total number of events is " <<
TotNumberOfEvents
67 <<
" which is bigger than " <<
calibrationthreshold <<
". Calibration is preparing to be launched."
71 <<
"Mean Number of Cluster is " <<
MeanNumberOfCluster <<
". Calibration is launched." << std::endl;
73 if (AlgoName ==
"SiStripHotStripAlgorithmFromClusterOccupancy") {
74 edm::LogInfo(
"SiStripQualityHotStripIdentifierRoot") <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] "
75 "call to SiStripHotStripAlgorithmFromClusterOccupancy"
100 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
103 std::stringstream
ss;
107 for (; rIter != rIterEnd; ++rIter) {
109 qobj->getDataVectorBegin() + rIter->iend);
112 <<
"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
115 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
116 }
else if (AlgoName ==
"SiStripBadAPVAlgorithmFromClusterOccupancy") {
117 edm::LogInfo(
"SiStripQualityHotStripIdentifierRoot") <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] "
118 "call to SiStripBadAPVAlgorithmFromClusterOccupancy"
124 parameters.getUntrackedParameter<
double>(
"HighOccupancyThreshold", 10));
128 parameters.getUntrackedParameter<
double>(
"OccupancyThreshold", 1.E-5));
144 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
147 std::stringstream
ss;
151 for (; rIter != rIterEnd; ++rIter) {
153 qobj->getDataVectorBegin() + rIter->iend);
156 <<
"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
159 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
161 }
else if (AlgoName ==
"SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy") {
163 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] call to "
164 "SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy"
169 parameters.getUntrackedParameter<
double>(
"ProbabilityThreshold", 1.E-7));
172 parameters.getUntrackedParameter<uint32_t>(
"MinNumEntriesPerStrip", 5));
182 parameters.getUntrackedParameter<
double>(
"HighOccupancyThreshold", 10));
186 parameters.getUntrackedParameter<
double>(
"OccupancyThreshold", 1.E-5));
200 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
203 std::stringstream
ss;
207 for (; rIter != rIterEnd; ++rIter) {
209 qobj->getDataVectorBegin() + rIter->iend);
212 <<
"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
215 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
217 edm::LogError(
"SiStripQualityHotStripIdentifierRoot") <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject]"
218 " call for a unknow HotStrip identification algoritm"
221 std::vector<uint32_t>
a;
225 <<
"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
231 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] :: Empty Events :: "
232 <<
"Mean Number of Cluster is " <<
MeanNumberOfCluster <<
" Calibration NOT launched" << std::endl;
237 <<
" [SiStripQualityHotStripIdentifierRoot::getNewObject] :: Not Enough Events :: "
238 <<
"Total number of events is " <<
TotNumberOfEvents <<
" Calibration NOT launched" << std::endl;
260 <<
" [SiStripQualityHotStripIdentifierRoot::bookHistos] " <<
dirpath << std::endl;
265 <<
" [SiStripQualityHotStripIdentifierRoot::bookHistos] vector size " << MEs.size() << std::endl;
267 std::vector<MonitorElement*>::const_iterator iter = MEs.begin();
268 std::vector<MonitorElement*>::const_iterator iterEnd = MEs.end();
271 bool gotNentries =
true;
276 <<
"[SiStripQualityHotStripIdentifierRoot::bookHistos] gotNentries flag " << gotNentries <<
" number of "
282 for (; iter != iterEnd; ++iter) {
285 if (!gotNentries && strstr(me_name.c_str(),
"TotalNumberOfCluster__T") !=
nullptr &&
286 strstr(me_name.c_str(),
"Profile") ==
nullptr) {
294 <<
"[SiStripQualityHotStripIdentifierRoot::bookHistos] gotNentries flag " << gotNentries << std::endl;
300 <<
" [SiStripQualityHotStripIdentifierRoot::bookHistos] :: Histogram with to check # of events missing"
303 for (; iter != iterEnd; ++iter) {
309 unsigned int detid = 0;
311 sprintf(title,
"%s", me_name.c_str());
313 char* ptr = strtok_r(title,
"__", &saveptr);
315 while (ptr !=
nullptr) {
320 ptr = strtok_r(
nullptr,
"_", &saveptr);
323 LogDebug(
"SiStripQualityHotStripIdentifierRoot")
324 <<
" [SiStripQualityHotStripIdentifierRoot::bookHistos] detid " << detid << std::endl;
void setProbabilityThreshold(long double prob)
void setAbsoluteLowThreshold(long double absolute_low)
T getUntrackedParameter(std::string const &, T const &) const
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
static const char tracker_[]
const edm::EventSetup & c
SiStripQualityHotStripIdentifierRoot(const edm::ParameterSet &)
const SiStripQuality * SiStripQuality_
SiStrip::QualityHistosMap ClusterPositionHistoMap
void setNumberIterations(int number_iterations)
double MeanNumberOfCluster
SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy * theIdentifier3
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile, std::string DQMOutfileName, bool WriteDQMHistograms)
void setAbsoluteOccupancyThreshold(long double absolute_occupancy)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
void setAbsoluteLowThreshold(long double absolute_low)
void extractBadAPVSandStrips(SiStripQuality *, HistoMap &, const SiStripQuality *)
void setNumberOfEvents(double Nevents)
void setTrackerGeometry(const TrackerGeometry *tkgeom)
~SiStripQualityHotStripIdentifierRoot() override
void setHighOccupancyThreshold(long double high_occupancy)
Registry::const_iterator RegistryIterator
Log< level::Error, false > LogError
void setLowOccupancyThreshold(long double low_occupancy)
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
uint32_t calibrationthreshold
const uint16_t range(const Frame &aFrame)
bool getData(T &iHolder) const
const TrackerTopology * tTopo
SiStripHotStripAlgorithmFromClusterOccupancy * theIdentifier
void algoEndJob() override
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
void extractBadAPVs(SiStripQuality *, HistoMap &, const SiStripQuality *)
void setLowOccupancyThreshold(long double low_occupancy)
void extractBadStrips(SiStripQuality *, HistoMap &, const SiStripQuality *)
void setMinNumEntries(unsigned short m)
void algoBeginRun(const edm::Run &, const edm::EventSetup &) override
void setOccupancyThreshold(long double occupancy)
SiStripDetInfo read(std::string filePath)
const TrackerGeometry * tracker_
void setTrackerGeometry(const TrackerGeometry *tkgeom)
void setAbsoluteOccupancyThreshold(long double occupancy)
void setNumberOfEvents(double Nevents)
Log< level::Info, false > LogInfo
void setProbabilityThreshold(long double prob)
const edm::ParameterSet conf_
void setTrackerGeometry(const TrackerGeometry *tkgeom)
T getParameter(std::string const &) const
void setNumberIterations(int number_iterations)
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
bool check(const edm::EventSetup &iSetup)
void setDoStore(const bool doStore)
When set to false the payload will not be written to the db.
void setMinNumEntries(unsigned short m)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
edm::ESWatcher< SiStripQualityRcd > stripQualityWatcher_
std::pair< ContainerIterator, ContainerIterator > Range
SiStripBadAPVAlgorithmFromClusterOccupancy * theIdentifier2
static constexpr char const *const kDefaultFile
Log< level::Warning, false > LogWarning
void setNumberOfEvents(double Nevents)
void setHighOccupancyThreshold(long double high_occupancy)
DQM_DEPRECATED bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
std::unique_ptr< SiStripBadStrip > getNewObject() override
void setMinNumEntriesPerStrip(unsigned short m)
void setMinNumEntriesPerStrip(unsigned short m)