CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SiStripQualityHotStripIdentifierRoot Class Reference

#include <SiStripQualityHotStripIdentifierRoot.h>

Inheritance diagram for SiStripQualityHotStripIdentifierRoot:
ConditionDBWriter< SiStripBadStrip > edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 SiStripQualityHotStripIdentifierRoot (const edm::ParameterSet &)
 
 ~SiStripQualityHotStripIdentifierRoot () override
 
- Public Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
 ConditionDBWriter (const edm::ParameterSet &iConfig)
 
 ~ConditionDBWriter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void algoAnalyze (const edm::Event &, const edm::EventSetup &) override
 
void algoBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void algoBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void algoEndJob () override
 
void bookHistos ()
 
std::unique_ptr< SiStripBadStripgetNewObject () override
 

Private Attributes

uint32_t calibrationthreshold
 
SiStrip::QualityHistosMap ClusterPositionHistoMap
 
const edm::ParameterSet conf_
 
std::string dirpath
 
DQMStoredqmStore_
 
TFile * file0
 
std::string filename
 
unsigned short MaxClusterWidth_
 
double MeanNumberOfCluster
 
unsigned short MinClusterWidth_
 
const SiStripQualitySiStripQuality_
 
edm::ESGetToken
< SiStripQuality,
SiStripQualityRcd
stripQualityToken_
 
edm::ESWatcher< SiStripQualityRcdstripQualityWatcher_
 
SiStripHotStripAlgorithmFromClusterOccupancytheIdentifier
 
SiStripBadAPVAlgorithmFromClusterOccupancytheIdentifier2
 
SiStripBadAPVandHotStripAlgorithmFromClusterOccupancytheIdentifier3
 
edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
tkGeomToken_
 
double TotNumberOfEvents
 
const TrackerGeometrytracker_
 
const TrackerTopologytTopo
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 
bool UseInputDB_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
void setDoStore (const bool doStore)
 When set to false the payload will not be written to the db. More...
 
void storeOnDbNow ()
 
cond::Time_t timeOfLastIOV ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 35 of file SiStripQualityHotStripIdentifierRoot.h.

Member Typedef Documentation

Definition at line 38 of file SiStripQualityHotStripIdentifierRoot.h.

Definition at line 37 of file SiStripQualityHotStripIdentifierRoot.h.

Constructor & Destructor Documentation

SiStripQualityHotStripIdentifierRoot::SiStripQualityHotStripIdentifierRoot ( const edm::ParameterSet iConfig)
explicit

Definition at line 25 of file SiStripQualityHotStripIdentifierRoot.cc.

References dqmStore_, edm::ParameterSet::getUntrackedParameter(), Utilities::operator, AlCaHLTBitMon_QueryRunRegistry::string, and stripQualityToken_.

27  UseInputDB_(iConfig.getUntrackedParameter<bool>("UseInputDB", false)),
28  conf_(iConfig),
29  tracker_(nullptr),
30  tTopo(nullptr),
31  filename(iConfig.getUntrackedParameter<std::string>("rootFilename", "CondDB_TKCC_20X_v3_hlt_50822.root")),
32  dirpath(iConfig.getUntrackedParameter<std::string>("rootDirPath", "")),
35  calibrationthreshold(iConfig.getUntrackedParameter<uint32_t>("CalibrationThreshold", 10000)),
36  tTopoToken_(esConsumes<edm::Transition::BeginRun>()),
37  tkGeomToken_(esConsumes<edm::Transition::BeginRun>()),
39  ? decltype(stripQualityToken_)(esConsumes<edm::Transition::BeginRun>(
40  edm::ESInputTag{"", iConfig.getUntrackedParameter<std::string>("dataLabel", "")}))
41  : decltype(stripQualityToken_){}) {
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
SiStripQualityHotStripIdentifierRoot::~SiStripQualityHotStripIdentifierRoot ( )
override

Definition at line 51 of file SiStripQualityHotStripIdentifierRoot.cc.

51 {}

Member Function Documentation

void SiStripQualityHotStripIdentifierRoot::algoAnalyze ( const edm::Event ,
const edm::EventSetup  
)
inlineoverrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 52 of file SiStripQualityHotStripIdentifierRoot.h.

52 {};
void SiStripQualityHotStripIdentifierRoot::algoBeginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
inlineoverrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 47 of file SiStripQualityHotStripIdentifierRoot.h.

47 {}
void SiStripQualityHotStripIdentifierRoot::algoBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 245 of file SiStripQualityHotStripIdentifierRoot.cc.

References edm::ESWatcher< T >::check(), edm::EventSetup::getData(), SiStripQuality_, stripQualityToken_, stripQualityWatcher_, tkGeomToken_, tracker_, tTopo, tTopoToken_, and UseInputDB_.

245  {
246  tTopo = &iSetup.getData(tTopoToken_);
247  tracker_ = &iSetup.getData(tkGeomToken_);
248  if (UseInputDB_ && stripQualityWatcher_.check(iSetup)) {
250  }
251 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
edm::ESWatcher< SiStripQualityRcd > stripQualityWatcher_
void SiStripQualityHotStripIdentifierRoot::algoEndJob ( )
overrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 253 of file SiStripQualityHotStripIdentifierRoot.cc.

References ClusterPositionHistoMap.

253  {
254  //Clear map
255  ClusterPositionHistoMap.clear();
256 }
void SiStripQualityHotStripIdentifierRoot::bookHistos ( )
private

Definition at line 258 of file SiStripQualityHotStripIdentifierRoot.cc.

References c, ClusterPositionHistoMap, conf_, dirpath, dqmStore_, dqm::implementation::IGetter::getAllContents(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, MeanNumberOfCluster, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, and TotNumberOfEvents.

Referenced by getNewObject().

258  {
259  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
260  << " [SiStripQualityHotStripIdentifierRoot::bookHistos] " << dirpath << std::endl;
261  std::vector<MonitorElement*> MEs = dqmStore_->getAllContents(dirpath);
262  //"DQMData/Run 50908/SiStrip/MechanicalView");
263  // "/DQMData/Run 50908/SiStrip/Run summary/MechanicalView/TID/side_2/wheel_3/ring_2/mono_modules/module_402676874");
264  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
265  << " [SiStripQualityHotStripIdentifierRoot::bookHistos] vector size " << MEs.size() << std::endl;
266 
267  std::vector<MonitorElement*>::const_iterator iter = MEs.begin();
268  std::vector<MonitorElement*>::const_iterator iterEnd = MEs.end();
269 
271  bool gotNentries = true;
272  if (parameters.getUntrackedParameter<uint32_t>("NumberOfEvents", 0) == 0 &&
273  parameters.getUntrackedParameter<double>("OccupancyThreshold", 0) != 0)
274  gotNentries = false;
275  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
276  << "[SiStripQualityHotStripIdentifierRoot::bookHistos] gotNentries flag " << gotNentries << " number of "
277  << parameters.getUntrackedParameter<uint32_t>("NumberOfEvents", 0) << " occup "
278  << parameters.getUntrackedParameter<double>("OccupancyThreshold", 0) << " OccupancyHisto"
279  << parameters.getUntrackedParameter<std::string>("OccupancyHisto") << std::endl;
280 
281  // Check Number of Events
282  for (; iter != iterEnd; ++iter) {
283  std::string me_name = (*iter)->getName();
284 
285  if (!gotNentries && strstr(me_name.c_str(), "TotalNumberOfCluster__T") != nullptr &&
286  strstr(me_name.c_str(), "Profile") == nullptr) {
287  TotNumberOfEvents = ((TH1F*)(*iter)->getTH1F())->GetEntries();
288  MeanNumberOfCluster = ((TH1F*)(*iter)->getTH1F())->GetMean();
289  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
290  << "Total Number of Events: " << TotNumberOfEvents << std::endl;
291 
292  gotNentries = true;
293  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
294  << "[SiStripQualityHotStripIdentifierRoot::bookHistos] gotNentries flag " << gotNentries << std::endl;
295  break;
296  }
297  }
298  if (!gotNentries) {
299  edm::LogWarning("SiStripQualityHotStripIdentifierRoot")
300  << " [SiStripQualityHotStripIdentifierRoot::bookHistos] :: Histogram with to check # of events missing"
301  << std::endl;
302  }
303  for (; iter != iterEnd; ++iter) {
304  std::string me_name = (*iter)->getName();
305 
306  if (strstr(me_name.c_str(), (parameters.getUntrackedParameter<std::string>("OccupancyHisto")).c_str()) == nullptr)
307  continue;
308 
309  unsigned int detid = 0;
310  char title[128];
311  sprintf(title, "%s", me_name.c_str());
312  char* saveptr;
313  char* ptr = strtok_r(title, "__", &saveptr);
314  int c = 0;
315  while (ptr != nullptr) {
316  if (c == 2) {
317  detid = atol(ptr);
318  break;
319  }
320  ptr = strtok_r(nullptr, "_", &saveptr);
321  c++;
322  }
323  LogDebug("SiStripQualityHotStripIdentifierRoot")
324  << " [SiStripQualityHotStripIdentifierRoot::bookHistos] detid " << detid << std::endl;
325 
326  ClusterPositionHistoMap[detid] = std::make_shared<TH1F>(*(*iter)->getTH1F());
327  }
328 }
T getUntrackedParameter(std::string const &, T const &) const
const edm::EventSetup & c
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
Definition: DQMStore.cc:609
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Log< level::Warning, false > LogWarning
#define LogDebug(id)
std::unique_ptr< SiStripBadStrip > SiStripQualityHotStripIdentifierRoot::getNewObject ( )
overrideprivatevirtual

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 53 of file SiStripQualityHotStripIdentifierRoot.cc.

References a, HLT_FULL_cff::AlgoName, bookHistos(), calibrationthreshold, ClusterPositionHistoMap, conf_, SiStripBadAPVAlgorithmFromClusterOccupancy::extractBadAPVs(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::extractBadAPVSandStrips(), SiStripHotStripAlgorithmFromClusterOccupancy::extractBadStrips(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), SiStripDetInfoFileReader::kDefaultFile, MeanNumberOfCluster, getGTfromDQMFile::obj, sistrip::SpyUtilities::range(), SiStripDetInfoFileReader::read(), SiStripBadAPVAlgorithmFromClusterOccupancy::setAbsoluteLowThreshold(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setAbsoluteLowThreshold(), SiStripBadAPVAlgorithmFromClusterOccupancy::setAbsoluteOccupancyThreshold(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setAbsoluteOccupancyThreshold(), ConditionDBWriter< SiStripBadStrip >::setDoStore(), SiStripBadAPVAlgorithmFromClusterOccupancy::setHighOccupancyThreshold(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setHighOccupancyThreshold(), SiStripBadAPVAlgorithmFromClusterOccupancy::setLowOccupancyThreshold(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setLowOccupancyThreshold(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setMinNumEntries(), SiStripHotStripAlgorithmFromClusterOccupancy::setMinNumEntries(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setMinNumEntriesPerStrip(), SiStripHotStripAlgorithmFromClusterOccupancy::setMinNumEntriesPerStrip(), SiStripBadAPVAlgorithmFromClusterOccupancy::setMinNumOfEvents(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setMinNumOfEvents(), SiStripBadAPVAlgorithmFromClusterOccupancy::setNumberIterations(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setNumberIterations(), SiStripBadAPVAlgorithmFromClusterOccupancy::setNumberOfEvents(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setNumberOfEvents(), SiStripHotStripAlgorithmFromClusterOccupancy::setNumberOfEvents(), SiStripHotStripAlgorithmFromClusterOccupancy::setOccupancyThreshold(), SiStripBadAPVAlgorithmFromClusterOccupancy::setOutputFileName(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setOutputFileName(), SiStripHotStripAlgorithmFromClusterOccupancy::setOutputFileName(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setProbabilityThreshold(), SiStripHotStripAlgorithmFromClusterOccupancy::setProbabilityThreshold(), SiStripBadAPVAlgorithmFromClusterOccupancy::setTrackerGeometry(), SiStripHotStripAlgorithmFromClusterOccupancy::setTrackerGeometry(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setTrackerGeometry(), AlCaHarvesting_cff::SiStripQuality, SiStripQuality_, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, theIdentifier, theIdentifier2, theIdentifier3, TotNumberOfEvents, tracker_, and tTopo.

53  {
54  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
55  << "SiStripQualityHotStripIdentifierRoot::getNewObject called" << std::endl;
56 
57  auto obj = std::make_unique<SiStripBadStrip>();
58 
60  std::string AlgoName = parameters.getParameter<std::string>("AlgoName");
61 
62  bookHistos();
63 
65  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
66  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] Total number of events is " << TotNumberOfEvents
67  << " which is bigger than " << calibrationthreshold << ". Calibration is preparing to be launched."
68  << std::endl;
69  if (MeanNumberOfCluster > 0.01) {
70  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
71  << "Mean Number of Cluster is " << MeanNumberOfCluster << ". Calibration is launched." << std::endl;
72 
73  if (AlgoName == "SiStripHotStripAlgorithmFromClusterOccupancy") {
74  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " [SiStripQualityHotStripIdentifierRoot::getNewObject] "
75  "call to SiStripHotStripAlgorithmFromClusterOccupancy"
76  << std::endl;
77 
79  theIdentifier->setProbabilityThreshold(parameters.getUntrackedParameter<double>("ProbabilityThreshold", 1.E-7));
80  theIdentifier->setMinNumEntries(parameters.getUntrackedParameter<uint32_t>("MinNumEntries", 100));
81  theIdentifier->setMinNumEntriesPerStrip(parameters.getUntrackedParameter<uint32_t>("MinNumEntriesPerStrip", 5));
82  theIdentifier->setOccupancyThreshold(parameters.getUntrackedParameter<double>("OccupancyThreshold", 1.E-5));
85  conf_.getUntrackedParameter<std::string>("OccupancyRootFile", "Occupancy.root"),
86  conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false));
88 
89  const auto detInfo =
91  SiStripQuality* qobj = new SiStripQuality(detInfo);
93  qobj,
95  SiStripQuality_); //here I insert SiStripQuality as input and get qobj as output
96 
97  //----------
98 
99  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
100  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
101  << std::endl;
102 
103  std::stringstream ss;
104 
105  SiStripBadStrip::RegistryIterator rIter = qobj->getRegistryVectorBegin();
106  SiStripBadStrip::RegistryIterator rIterEnd = qobj->getRegistryVectorEnd();
107  for (; rIter != rIterEnd; ++rIter) {
108  SiStripBadStrip::Range range(qobj->getDataVectorBegin() + rIter->ibegin,
109  qobj->getDataVectorBegin() + rIter->iend);
110  if (!obj->put(rIter->detid, range))
111  edm::LogError("SiStripQualityHotStripIdentifierRoot")
112  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
113  }
114  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
115  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
116  } else if (AlgoName == "SiStripBadAPVAlgorithmFromClusterOccupancy") {
117  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " [SiStripQualityHotStripIdentifierRoot::getNewObject] "
118  "call to SiStripBadAPVAlgorithmFromClusterOccupancy"
119  << std::endl;
120 
122  theIdentifier2->setLowOccupancyThreshold(parameters.getUntrackedParameter<double>("LowOccupancyThreshold", 5));
124  parameters.getUntrackedParameter<double>("HighOccupancyThreshold", 10));
125  theIdentifier2->setAbsoluteLowThreshold(parameters.getUntrackedParameter<double>("AbsoluteLowThreshold", 0));
126  theIdentifier2->setNumberIterations(parameters.getUntrackedParameter<uint32_t>("NumberIterations", 2));
128  parameters.getUntrackedParameter<double>("OccupancyThreshold", 1.E-5));
132  conf_.getUntrackedParameter<std::string>("OccupancyRootFile", "Occupancy.root"),
133  conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false));
135 
136  const auto detInfo =
138  SiStripQuality* qobj = new SiStripQuality(detInfo);
140 
141  //----------
142 
143  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
144  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
145  << std::endl;
146 
147  std::stringstream ss;
148 
149  SiStripBadStrip::RegistryIterator rIter = qobj->getRegistryVectorBegin();
150  SiStripBadStrip::RegistryIterator rIterEnd = qobj->getRegistryVectorEnd();
151  for (; rIter != rIterEnd; ++rIter) {
152  SiStripBadStrip::Range range(qobj->getDataVectorBegin() + rIter->ibegin,
153  qobj->getDataVectorBegin() + rIter->iend);
154  if (!obj->put(rIter->detid, range))
155  edm::LogError("SiStripQualityHotStripIdentifierRoot")
156  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
157  }
158  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
159  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
160 
161  } else if (AlgoName == "SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy") {
162  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
163  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] call to "
164  "SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy"
165  << std::endl;
166 
169  parameters.getUntrackedParameter<double>("ProbabilityThreshold", 1.E-7));
170  theIdentifier3->setMinNumEntries(parameters.getUntrackedParameter<uint32_t>("MinNumEntries", 100));
172  parameters.getUntrackedParameter<uint32_t>("MinNumEntriesPerStrip", 5));
175  conf_.getUntrackedParameter<std::string>("OccupancyRootFile", "Occupancy.root"),
176  conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false),
177  conf_.getUntrackedParameter<std::string>("DQMHistoOutputFile", "DQMHistos.root"),
178  conf_.getUntrackedParameter<bool>("WriteDQMHistoOutputFile", false));
180  theIdentifier3->setLowOccupancyThreshold(parameters.getUntrackedParameter<double>("LowOccupancyThreshold", 5));
182  parameters.getUntrackedParameter<double>("HighOccupancyThreshold", 10));
183  theIdentifier3->setAbsoluteLowThreshold(parameters.getUntrackedParameter<double>("AbsoluteLowThreshold", 0));
184  theIdentifier3->setNumberIterations(parameters.getUntrackedParameter<uint32_t>("NumberIterations", 2));
186  parameters.getUntrackedParameter<double>("OccupancyThreshold", 1.E-5));
188 
189  const auto detInfo =
191  SiStripQuality* qobj = new SiStripQuality(detInfo);
193  qobj,
195  SiStripQuality_); //here I insert SiStripQuality as input and get qobj as output
196 
197  //----------
198 
199  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
200  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
201  << std::endl;
202 
203  std::stringstream ss;
204 
205  SiStripBadStrip::RegistryIterator rIter = qobj->getRegistryVectorBegin();
206  SiStripBadStrip::RegistryIterator rIterEnd = qobj->getRegistryVectorEnd();
207  for (; rIter != rIterEnd; ++rIter) {
208  SiStripBadStrip::Range range(qobj->getDataVectorBegin() + rIter->ibegin,
209  qobj->getDataVectorBegin() + rIter->iend);
210  if (!obj->put(rIter->detid, range))
211  edm::LogError("SiStripQualityHotStripIdentifierRoot")
212  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
213  }
214  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
215  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
216  } else {
217  edm::LogError("SiStripQualityHotStripIdentifierRoot") << " [SiStripQualityHotStripIdentifierRoot::getNewObject]"
218  " call for a unknow HotStrip identification algoritm"
219  << std::endl;
220 
221  std::vector<uint32_t> a;
222  SiStripBadStrip::Range range(a.begin(), a.end());
223  if (!obj->put(0xFFFFFFFF, range))
224  edm::LogError("SiStripQualityHotStripIdentifierRoot")
225  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
226  }
227  }
228 
229  else {
230  edm::LogWarning("SiStripQualityHotStripIdentifierRoot")
231  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] :: Empty Events :: "
232  << "Mean Number of Cluster is " << MeanNumberOfCluster << " Calibration NOT launched" << std::endl;
233  setDoStore(false); // Don't put anything in the sqlite-file!
234  }
235  } else {
236  edm::LogWarning("SiStripQualityHotStripIdentifierRoot")
237  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] :: Not Enough Events :: "
238  << "Total number of events is " << TotNumberOfEvents << " Calibration NOT launched" << std::endl;
239  setDoStore(false); // Don't put anything in the sqlite-file!
240  }
241 
242  return obj;
243 }
T getUntrackedParameter(std::string const &, T const &) const
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy * theIdentifier3
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile, std::string DQMOutfileName, bool WriteDQMHistograms)
void extractBadAPVSandStrips(SiStripQuality *, HistoMap &, const SiStripQuality *)
Registry::const_iterator RegistryIterator
Log< level::Error, false > LogError
const uint16_t range(const Frame &aFrame)
SiStripHotStripAlgorithmFromClusterOccupancy * theIdentifier
void extractBadAPVs(SiStripQuality *, HistoMap &, const SiStripQuality *)
void extractBadStrips(SiStripQuality *, HistoMap &, const SiStripQuality *)
SiStripDetInfo read(std::string filePath)
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
void setDoStore(const bool doStore)
When set to false the payload will not be written to the db.
double a
Definition: hdecay.h:119
std::pair< ContainerIterator, ContainerIterator > Range
SiStripBadAPVAlgorithmFromClusterOccupancy * theIdentifier2
static constexpr char const *const kDefaultFile
Log< level::Warning, false > LogWarning

Member Data Documentation

uint32_t SiStripQualityHotStripIdentifierRoot::calibrationthreshold
private

Definition at line 73 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStrip::QualityHistosMap SiStripQualityHotStripIdentifierRoot::ClusterPositionHistoMap
private

Definition at line 80 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoEndJob(), bookHistos(), and getNewObject().

const edm::ParameterSet SiStripQualityHotStripIdentifierRoot::conf_
private

Definition at line 60 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

std::string SiStripQualityHotStripIdentifierRoot::dirpath
private

Definition at line 69 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos().

DQMStore* SiStripQualityHotStripIdentifierRoot::dqmStore_
private
TFile* SiStripQualityHotStripIdentifierRoot::file0
private

Definition at line 68 of file SiStripQualityHotStripIdentifierRoot.h.

std::string SiStripQualityHotStripIdentifierRoot::filename
private
unsigned short SiStripQualityHotStripIdentifierRoot::MaxClusterWidth_
private

Definition at line 70 of file SiStripQualityHotStripIdentifierRoot.h.

double SiStripQualityHotStripIdentifierRoot::MeanNumberOfCluster
private

Definition at line 72 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

unsigned short SiStripQualityHotStripIdentifierRoot::MinClusterWidth_
private

Definition at line 70 of file SiStripQualityHotStripIdentifierRoot.h.

const SiStripQuality* SiStripQualityHotStripIdentifierRoot::SiStripQuality_
private

Definition at line 64 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

edm::ESGetToken<SiStripQuality, SiStripQualityRcd> SiStripQualityHotStripIdentifierRoot::stripQualityToken_
private
edm::ESWatcher<SiStripQualityRcd> SiStripQualityHotStripIdentifierRoot::stripQualityWatcher_
private

Definition at line 78 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

SiStripHotStripAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier
private

Definition at line 81 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStripBadAPVAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier2
private

Definition at line 82 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier3
private

Definition at line 83 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripQualityHotStripIdentifierRoot::tkGeomToken_
private

Definition at line 76 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

double SiStripQualityHotStripIdentifierRoot::TotNumberOfEvents
private

Definition at line 71 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

const TrackerGeometry* SiStripQualityHotStripIdentifierRoot::tracker_
private

Definition at line 62 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

const TrackerTopology* SiStripQualityHotStripIdentifierRoot::tTopo
private

Definition at line 63 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripQualityHotStripIdentifierRoot::tTopoToken_
private

Definition at line 75 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

bool SiStripQualityHotStripIdentifierRoot::UseInputDB_
private

Definition at line 59 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().