CMS 3D CMS Logo

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::EDAnalyzer edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
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 dataLabel_
 
std::string dirpath
 
DQMStoredqmStore_
 
TFile * file0
 
std::string filename
 
unsigned long long m_cacheID_
 
unsigned short MaxClusterWidth_
 
double MeanNumberOfCluster
 
unsigned short MinClusterWidth_
 
edm::ESHandle< SiStripQualitySiStripQuality_
 
SiStripHotStripAlgorithmFromClusterOccupancytheIdentifier
 
SiStripBadAPVAlgorithmFromClusterOccupancytheIdentifier2
 
SiStripBadAPVandHotStripAlgorithmFromClusterOccupancytheIdentifier3
 
edm::ESHandle< TrackerGeometrytheTrackerGeom
 
double TotNumberOfEvents
 
const TrackerGeometrytracker_
 
const TrackerTopologytTopo
 
bool UseInputDB_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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)
 
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<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)
 

Detailed Description

Definition at line 36 of file SiStripQualityHotStripIdentifierRoot.h.

Member Typedef Documentation

Definition at line 39 of file SiStripQualityHotStripIdentifierRoot.h.

Definition at line 38 of file SiStripQualityHotStripIdentifierRoot.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file SiStripQualityHotStripIdentifierRoot.cc.

References dqmStore_, filename, dqm::dqmstoreimpl::DQMStore::open(), and Utilities::operator.

26  m_cacheID_(0),
27  dataLabel_(iConfig.getUntrackedParameter<std::string>("dataLabel", "")),
28  UseInputDB_(iConfig.getUntrackedParameter<bool>("UseInputDB", false)),
29  conf_(iConfig),
30  tracker_(nullptr),
31  tTopo(nullptr),
32  filename(iConfig.getUntrackedParameter<std::string>("rootFilename", "CondDB_TKCC_20X_v3_hlt_50822.root")),
33  dirpath(iConfig.getUntrackedParameter<std::string>("rootDirPath", "")),
36  calibrationthreshold(iConfig.getUntrackedParameter<uint32_t>("CalibrationThreshold", 10000)) {
38 
39  if (!filename.empty()) {
40  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " before opening file " << filename.c_str();
41  dqmStore_->open(filename, false);
42  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " after opening file ";
43  }
44 }
T getUntrackedParameter(std::string const &, T const &) const
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2626
SiStripQualityHotStripIdentifierRoot::~SiStripQualityHotStripIdentifierRoot ( )
override

Definition at line 46 of file SiStripQualityHotStripIdentifierRoot.cc.

46 {}

Member Function Documentation

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

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 53 of file SiStripQualityHotStripIdentifierRoot.h.

References bookHistos(), and getNewObject().

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

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 48 of file SiStripQualityHotStripIdentifierRoot.h.

References algoEndJob().

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

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 234 of file SiStripQualityHotStripIdentifierRoot.cc.

References dataLabel_, edm::EventSetup::get(), m_cacheID_, edm::ESHandle< T >::product(), SiStripQuality_, theTrackerGeom, tracker_, tTopo, and UseInputDB_.

234  {
235  //Retrieve tracker topology from geometry
236  edm::ESHandle<TrackerTopology> tTopoHandle;
237  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
238  tTopo = tTopoHandle.product();
239 
241  tracker_ = &(*theTrackerGeom);
242 
243  if (UseInputDB_) {
244  unsigned long long cacheID = iSetup.get<SiStripQualityRcd>().cacheIdentifier();
245 
246  if (m_cacheID_ == cacheID)
247  return;
248 
249  m_cacheID_ = cacheID;
250 
252  }
253 }
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityHotStripIdentifierRoot::algoEndJob ( )
overrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 255 of file SiStripQualityHotStripIdentifierRoot.cc.

References ClusterPositionHistoMap.

Referenced by algoBeginLuminosityBlock().

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

Definition at line 260 of file SiStripQualityHotStripIdentifierRoot.cc.

References HltBtagPostValidation_cff::c, ClusterPositionHistoMap, conf_, dirpath, dqmStore_, dqm::dqmstoreimpl::DQMStore::getAllContents(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, MeanNumberOfCluster, EcalMEFormatter_cfi::MEs, AlCaHLTBitMon_QueryRunRegistry::string, overlapproblemtsosanalyzer_cfi::title, and TotNumberOfEvents.

Referenced by algoAnalyze(), and getNewObject().

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

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 48 of file SiStripQualityHotStripIdentifierRoot.cc.

References a, HLTSiStripMonitoring_cff::AlgoName, bookHistos(), calibrationthreshold, ClusterPositionHistoMap, conf_, SiStripBadAPVAlgorithmFromClusterOccupancy::extractBadAPVs(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::extractBadAPVSandStrips(), SiStripHotStripAlgorithmFromClusterOccupancy::extractBadStrips(), SiStripBadStrip::getDataVectorBegin(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), edm::ParameterSet::getUntrackedParameter(), MeanNumberOfCluster, getGTfromDQMFile::obj, FastTimerService_cff::range, 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.

Referenced by algoAnalyze().

48  {
49  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
50  << "SiStripQualityHotStripIdentifierRoot::getNewObject called" << std::endl;
51 
52  auto obj = std::make_unique<SiStripBadStrip>();
53 
55  std::string AlgoName = parameters.getParameter<std::string>("AlgoName");
56 
57  bookHistos();
58 
60  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
61  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] Total number of events is " << TotNumberOfEvents
62  << " which is bigger than " << calibrationthreshold << ". Calibration is preparing to be launched."
63  << std::endl;
64  if (MeanNumberOfCluster > 0.01) {
65  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
66  << "Mean Number of Cluster is " << MeanNumberOfCluster << ". Calibration is launched." << std::endl;
67 
68  if (AlgoName == "SiStripHotStripAlgorithmFromClusterOccupancy") {
69  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " [SiStripQualityHotStripIdentifierRoot::getNewObject] "
70  "call to SiStripHotStripAlgorithmFromClusterOccupancy"
71  << std::endl;
72 
74  theIdentifier->setProbabilityThreshold(parameters.getUntrackedParameter<double>("ProbabilityThreshold", 1.E-7));
75  theIdentifier->setMinNumEntries(parameters.getUntrackedParameter<uint32_t>("MinNumEntries", 100));
76  theIdentifier->setMinNumEntriesPerStrip(parameters.getUntrackedParameter<uint32_t>("MinNumEntriesPerStrip", 5));
77  theIdentifier->setOccupancyThreshold(parameters.getUntrackedParameter<double>("OccupancyThreshold", 1.E-5));
80  conf_.getUntrackedParameter<std::string>("OccupancyRootFile", "Occupancy.root"),
81  conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false));
83 
84  SiStripQuality* qobj = new SiStripQuality();
86  qobj,
88  SiStripQuality_); //here I insert SiStripQuality as input and get qobj as output
89 
90  //----------
91 
92  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
93  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
94  << std::endl;
95 
96  std::stringstream ss;
97 
100  for (; rIter != rIterEnd; ++rIter) {
101  SiStripBadStrip::Range range(qobj->getDataVectorBegin() + rIter->ibegin,
102  qobj->getDataVectorBegin() + rIter->iend);
103  if (!obj->put(rIter->detid, range))
104  edm::LogError("SiStripQualityHotStripIdentifierRoot")
105  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
106  }
107  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
108  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
109  } else if (AlgoName == "SiStripBadAPVAlgorithmFromClusterOccupancy") {
110  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " [SiStripQualityHotStripIdentifierRoot::getNewObject] "
111  "call to SiStripBadAPVAlgorithmFromClusterOccupancy"
112  << std::endl;
113 
115  theIdentifier2->setLowOccupancyThreshold(parameters.getUntrackedParameter<double>("LowOccupancyThreshold", 5));
117  parameters.getUntrackedParameter<double>("HighOccupancyThreshold", 10));
118  theIdentifier2->setAbsoluteLowThreshold(parameters.getUntrackedParameter<double>("AbsoluteLowThreshold", 0));
119  theIdentifier2->setNumberIterations(parameters.getUntrackedParameter<uint32_t>("NumberIterations", 2));
121  parameters.getUntrackedParameter<double>("OccupancyThreshold", 1.E-5));
125  conf_.getUntrackedParameter<std::string>("OccupancyRootFile", "Occupancy.root"),
126  conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false));
128 
129  SiStripQuality* qobj = new SiStripQuality();
131 
132  //----------
133 
134  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
135  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
136  << std::endl;
137 
138  std::stringstream ss;
139 
142  for (; rIter != rIterEnd; ++rIter) {
143  SiStripBadStrip::Range range(qobj->getDataVectorBegin() + rIter->ibegin,
144  qobj->getDataVectorBegin() + rIter->iend);
145  if (!obj->put(rIter->detid, range))
146  edm::LogError("SiStripQualityHotStripIdentifierRoot")
147  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
148  }
149  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
150  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
151 
152  } else if (AlgoName == "SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy") {
153  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
154  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] call to "
155  "SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy"
156  << std::endl;
157 
160  parameters.getUntrackedParameter<double>("ProbabilityThreshold", 1.E-7));
161  theIdentifier3->setMinNumEntries(parameters.getUntrackedParameter<uint32_t>("MinNumEntries", 100));
163  parameters.getUntrackedParameter<uint32_t>("MinNumEntriesPerStrip", 5));
166  conf_.getUntrackedParameter<std::string>("OccupancyRootFile", "Occupancy.root"),
167  conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false),
168  conf_.getUntrackedParameter<std::string>("DQMHistoOutputFile", "DQMHistos.root"),
169  conf_.getUntrackedParameter<bool>("WriteDQMHistoOutputFile", false));
171  theIdentifier3->setLowOccupancyThreshold(parameters.getUntrackedParameter<double>("LowOccupancyThreshold", 5));
173  parameters.getUntrackedParameter<double>("HighOccupancyThreshold", 10));
174  theIdentifier3->setAbsoluteLowThreshold(parameters.getUntrackedParameter<double>("AbsoluteLowThreshold", 0));
175  theIdentifier3->setNumberIterations(parameters.getUntrackedParameter<uint32_t>("NumberIterations", 2));
177  parameters.getUntrackedParameter<double>("OccupancyThreshold", 1.E-5));
179 
180  SiStripQuality* qobj = new SiStripQuality();
182  qobj,
184  SiStripQuality_); //here I insert SiStripQuality as input and get qobj as output
185 
186  //----------
187 
188  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
189  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"
190  << std::endl;
191 
192  std::stringstream ss;
193 
196  for (; rIter != rIterEnd; ++rIter) {
197  SiStripBadStrip::Range range(qobj->getDataVectorBegin() + rIter->ibegin,
198  qobj->getDataVectorBegin() + rIter->iend);
199  if (!obj->put(rIter->detid, range))
200  edm::LogError("SiStripQualityHotStripIdentifierRoot")
201  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
202  }
203  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")
204  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
205  } else {
206  edm::LogError("SiStripQualityHotStripIdentifierRoot") << " [SiStripQualityHotStripIdentifierRoot::getNewObject]"
207  " call for a unknow HotStrip identification algoritm"
208  << std::endl;
209 
210  std::vector<uint32_t> a;
211  SiStripBadStrip::Range range(a.begin(), a.end());
212  if (!obj->put(0xFFFFFFFF, range))
213  edm::LogError("SiStripQualityHotStripIdentifierRoot")
214  << "[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists" << std::endl;
215  }
216  }
217 
218  else {
219  edm::LogWarning("SiStripQualityHotStripIdentifierRoot")
220  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] :: Empty Events :: "
221  << "Mean Number of Cluster is " << MeanNumberOfCluster << " Calibration NOT launched" << std::endl;
222  setDoStore(false); // Don't put anything in the sqlite-file!
223  }
224  } else {
225  edm::LogWarning("SiStripQualityHotStripIdentifierRoot")
226  << " [SiStripQualityHotStripIdentifierRoot::getNewObject] :: Not Enough Events :: "
227  << "Total number of events is " << TotNumberOfEvents << " Calibration NOT launched" << std::endl;
228  setDoStore(false); // Don't put anything in the sqlite-file!
229  }
230 
231  return obj;
232 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
void extractBadStrips(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)
SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy * theIdentifier3
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile, std::string DQMOutfileName, bool WriteDQMHistograms)
Registry::const_iterator RegistryIterator
RegistryIterator getRegistryVectorEnd() const
SiStripHotStripAlgorithmFromClusterOccupancy * theIdentifier
ContainerIterator getDataVectorBegin() const
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
RegistryIterator getRegistryVectorBegin() const
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
void extractBadAPVs(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)
SiStripBadAPVAlgorithmFromClusterOccupancy * theIdentifier2
void extractBadAPVSandStrips(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)

Member Data Documentation

uint32_t SiStripQualityHotStripIdentifierRoot::calibrationthreshold
private

Definition at line 77 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStrip::QualityHistosMap SiStripQualityHotStripIdentifierRoot::ClusterPositionHistoMap
private

Definition at line 79 of file SiStripQualityHotStripIdentifierRoot.h.

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

const edm::ParameterSet SiStripQualityHotStripIdentifierRoot::conf_
private

Definition at line 64 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

std::string SiStripQualityHotStripIdentifierRoot::dataLabel_
private

Definition at line 61 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

std::string SiStripQualityHotStripIdentifierRoot::dirpath
private

Definition at line 73 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos().

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

Definition at line 72 of file SiStripQualityHotStripIdentifierRoot.h.

std::string SiStripQualityHotStripIdentifierRoot::filename
private
unsigned long long SiStripQualityHotStripIdentifierRoot::m_cacheID_
private

Definition at line 60 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

unsigned short SiStripQualityHotStripIdentifierRoot::MaxClusterWidth_
private

Definition at line 74 of file SiStripQualityHotStripIdentifierRoot.h.

double SiStripQualityHotStripIdentifierRoot::MeanNumberOfCluster
private

Definition at line 76 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

unsigned short SiStripQualityHotStripIdentifierRoot::MinClusterWidth_
private

Definition at line 74 of file SiStripQualityHotStripIdentifierRoot.h.

edm::ESHandle<SiStripQuality> SiStripQualityHotStripIdentifierRoot::SiStripQuality_
private

Definition at line 62 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

SiStripHotStripAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier
private

Definition at line 80 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStripBadAPVAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier2
private

Definition at line 81 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier3
private

Definition at line 82 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

edm::ESHandle<TrackerGeometry> SiStripQualityHotStripIdentifierRoot::theTrackerGeom
private

Definition at line 66 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

double SiStripQualityHotStripIdentifierRoot::TotNumberOfEvents
private

Definition at line 75 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

const TrackerGeometry* SiStripQualityHotStripIdentifierRoot::tracker_
private

Definition at line 67 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

const TrackerTopology* SiStripQualityHotStripIdentifierRoot::tTopo
private

Definition at line 68 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

bool SiStripQualityHotStripIdentifierRoot::UseInputDB_
private

Definition at line 63 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().