CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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 Member Functions

 SiStripQualityHotStripIdentifierRoot (const edm::ParameterSet &)
 
 ~SiStripQualityHotStripIdentifierRoot ()
 
- Public Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
 ConditionDBWriter (const edm::ParameterSet &iConfig)
 
virtual ~ConditionDBWriter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

const TrackerGeometry_tracker
 
uint32_t calibrationthreshold
 
SiStrip::QualityHistosMap ClusterPositionHistoMap
 
const edm::ParameterSet conf_
 
std::string dataLabel_
 
std::string dirpath
 
DQMStoredqmStore_
 
TFile * file0
 
std::string filename
 
edm::FileInPath fp_
 
unsigned long long m_cacheID_
 
unsigned short MaxClusterWidth_
 
double MeanNumberOfCluster
 
unsigned short MinClusterWidth_
 
SiStripDetInfoFileReaderreader
 
edm::ESHandle< SiStripQualitySiStripQuality_
 
SiStripHotStripAlgorithmFromClusterOccupancytheIdentifier
 
SiStripBadAPVAlgorithmFromClusterOccupancytheIdentifier2
 
SiStripBadAPVandHotStripAlgorithmFromClusterOccupancytheIdentifier3
 
edm::ESHandle< TrackerGeometrytheTrackerGeom
 
double TotNumberOfEvents
 
const TrackerTopologytTopo
 
bool UseInputDB_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 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 48 of file SiStripQualityHotStripIdentifierRoot.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file SiStripQualityHotStripIdentifierRoot.cc.

References dqmStore_, filename, fp_, edm::FileInPath::fullPath(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, reader, and OfflineSiStripConfigDb_cff::SiStripDetInfoFileReader.

23  m_cacheID_(0),
24  dataLabel_(iConfig.getUntrackedParameter<std::string>("dataLabel","")),
25  UseInputDB_(iConfig.getUntrackedParameter<bool>("UseInputDB",false)),
26  conf_(iConfig),
27  fp_(iConfig.getUntrackedParameter<edm::FileInPath>("file",edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
28  _tracker(nullptr),
29  tTopo(nullptr),
30  filename(iConfig.getUntrackedParameter<std::string>("rootFilename","CondDB_TKCC_20X_v3_hlt_50822.root")),
31  dirpath(iConfig.getUntrackedParameter<std::string>("rootDirPath","")),
34  calibrationthreshold(iConfig.getUntrackedParameter<uint32_t>("CalibrationThreshold",10000))
35 {
37 
39  dqmStore_->setVerbose(iConfig.getUntrackedParameter<uint32_t>("verbosity",0));
40 
41  if(filename!=""){
42  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " before opening file " << filename.c_str();
43  dqmStore_->open(filename.c_str(), false);
44  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") << " after opening file ";
45  }
46 }
T getUntrackedParameter(std::string const &, T const &) const
void setVerbose(unsigned level)
Definition: DQMStore.cc:652
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2921
std::string fullPath() const
Definition: FileInPath.cc:165
SiStripQualityHotStripIdentifierRoot::~SiStripQualityHotStripIdentifierRoot ( )

Definition at line 49 of file SiStripQualityHotStripIdentifierRoot.cc.

49  {
50 }

Member Function Documentation

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

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 66 of file SiStripQualityHotStripIdentifierRoot.h.

66 {};
void SiStripQualityHotStripIdentifierRoot::algoBeginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
inlineprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 60 of file SiStripQualityHotStripIdentifierRoot.h.

60 { }
void SiStripQualityHotStripIdentifierRoot::algoBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 191 of file SiStripQualityHotStripIdentifierRoot.cc.

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

191  {
192  //Retrieve tracker topology from geometry
193  edm::ESHandle<TrackerTopology> tTopoHandle;
194  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
195  tTopo = tTopoHandle.product();
196 
198  _tracker=&(* theTrackerGeom);
199 
200  if(UseInputDB_){
201  unsigned long long cacheID = iSetup.get<SiStripQualityRcd>().cacheIdentifier();
202 
203  if (m_cacheID_ == cacheID)
204  return;
205 
206  m_cacheID_ = cacheID;
207 
209  }
210 }
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityHotStripIdentifierRoot::algoEndJob ( )
privatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 212 of file SiStripQualityHotStripIdentifierRoot.cc.

References ClusterPositionHistoMap.

212  {
213  //Clear map
214  ClusterPositionHistoMap.clear();
215 }
void SiStripQualityHotStripIdentifierRoot::bookHistos ( )
private

Definition at line 218 of file SiStripQualityHotStripIdentifierRoot.cc.

References EnergyCorrector::c, ClusterPositionHistoMap, conf_, cond::rpcobgas::detid, dirpath, dqmStore_, DQMStore::getAllContents(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), getDQMSummary::iter, LogDebug, MeanNumberOfCluster, NULL, Parameters::parameters, AlCaHLTBitMon_QueryRunRegistry::string, indexGen::title, and TotNumberOfEvents.

Referenced by getNewObject().

218  {
219  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::bookHistos] " << dirpath << std::endl;
220  std::vector<MonitorElement*> MEs = dqmStore_->getAllContents(dirpath);
221  //"DQMData/Run 50908/SiStrip/MechanicalView");
222  // "/DQMData/Run 50908/SiStrip/Run summary/MechanicalView/TID/side_2/wheel_3/ring_2/mono_modules/module_402676874");
223  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::bookHistos] vector size " << MEs.size()<< std::endl;
224 
225  std::vector<MonitorElement*>::const_iterator iter=MEs.begin();
226  std::vector<MonitorElement*>::const_iterator iterEnd=MEs.end();
227 
229  bool gotNentries=true;
230  if( parameters.getUntrackedParameter<uint32_t>("NumberOfEvents",0)==0 && parameters.getUntrackedParameter<double>("OccupancyThreshold",0)!=0)
231  gotNentries=false;
232  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")<< "[SiStripQualityHotStripIdentifierRoot::bookHistos] gotNentries flag " << gotNentries
233  << " number of " << parameters.getUntrackedParameter<uint32_t>("NumberOfEvents",0)
234  << " occup " << parameters.getUntrackedParameter<double>("OccupancyThreshold",0)
235  << " OccupancyHisto" << parameters.getUntrackedParameter<std::string>("OccupancyHisto") << std::endl;
236 
237  for (; iter!=iterEnd;++iter) {
238  std::string me_name = (*iter)->getName();
239 
240  if (!gotNentries && strstr(me_name.c_str(),"TotalNumberOfCluster__T")!=NULL && strstr(me_name.c_str(),"Profile")==NULL ){
241 
242  TotNumberOfEvents = ((TH1F*)(*iter)->getTH1F())->GetEntries();
243  MeanNumberOfCluster = ((TH1F*)(*iter)->getTH1F())->GetMean();
244  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")<< "Total Number of Events: " << TotNumberOfEvents << std::endl;
245 
246  gotNentries=true;
247  edm::LogInfo("SiStripQualityHotStripIdentifierRoot")<< "[SiStripQualityHotStripIdentifierRoot::bookHistos] gotNentries flag " << gotNentries << std::endl;
248  }
249 
250  if (strstr(me_name.c_str(),(parameters.getUntrackedParameter<std::string>("OccupancyHisto")).c_str())==NULL)
251  continue;
252 
253  unsigned int detid=0;
254  char title[128];
255  sprintf(title,"%s",me_name.c_str());
256  char *ptr=strtok(title,"__");
257  int c=0;
258  while (ptr!=NULL){
259  if (c==2){
260  detid=atol(ptr);
261  break;
262  }
263  ptr=strtok(NULL,"_");
264  c++;
265  }
266  LogDebug("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::bookHistos] detid " << detid<< std::endl;
267 
268  ClusterPositionHistoMap[detid]=boost::shared_ptr<TH1F>(new TH1F(*(*iter)->getTH1F()));
269 
270  }
271  if(!gotNentries) edm::LogWarning("MissingNumberOfEvents") <<"Missing histogram to get the number of events";
272 
273 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
dictionary parameters
Definition: Parameters.py:2
#define NULL
Definition: scimark2.h:8
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1942
SiStripBadStrip * SiStripQualityHotStripIdentifierRoot::getNewObject ( )
privatevirtual

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 52 of file SiStripQualityHotStripIdentifierRoot.cc.

References _tracker, a, HLT_25ns14e33_v1_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, Parameters::parameters, SiStripBadStrip::put(), 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(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::setTrackerGeometry(), SiStripHotStripAlgorithmFromClusterOccupancy::setTrackerGeometry(), AlCaHarvesting_cff::SiStripQuality, SiStripQuality_, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, theIdentifier, theIdentifier2, theIdentifier3, TotNumberOfEvents, and tTopo.

52  {
53 
54  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<"SiStripQualityHotStripIdentifierRoot::getNewObject called"<<std::endl;
55 
57 
59  std::string AlgoName = parameters.getParameter<std::string>("AlgoName");
60 
61  bookHistos();
62 
64  {
65  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] Total number of events is " << TotNumberOfEvents << ". Calibration is launched." <<std::endl;
66 
67  if (AlgoName=="SiStripHotStripAlgorithmFromClusterOccupancy")
68  {
69 
70  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] call to SiStripHotStripAlgorithmFromClusterOccupancy"<<std::endl;
71 
73  theIdentifier->setProbabilityThreshold(parameters.getUntrackedParameter<double>("ProbabilityThreshold",1.E-7));
74  theIdentifier->setMinNumEntries(parameters.getUntrackedParameter<uint32_t>("MinNumEntries",100));
75  theIdentifier->setMinNumEntriesPerStrip(parameters.getUntrackedParameter<uint32_t>("MinNumEntriesPerStrip",5));
76  theIdentifier->setOccupancyThreshold(parameters.getUntrackedParameter<double>("OccupancyThreshold",1.E-5));
78  theIdentifier->setOutputFileName(conf_.getUntrackedParameter<std::string>("OccupancyRootFile","Occupancy.root"),conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile",false));
80 
81  SiStripQuality* qobj = new SiStripQuality();
82  theIdentifier->extractBadStrips(qobj,ClusterPositionHistoMap,SiStripQuality_);//here I insert SiStripQuality as input and get qobj as output
83 
84  //----------
85 
86  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"<<std::endl;
87 
88  std::stringstream ss;
89 
92  for(;rIter!=rIterEnd;++rIter){
93  SiStripBadStrip::Range range(qobj->getDataVectorBegin()+rIter->ibegin,qobj->getDataVectorBegin()+rIter->iend);
94  if ( ! obj->put(rIter->detid,range) )
95  edm::LogError("SiStripQualityHotStripIdentifierRoot")<<"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists"<<std::endl;
96  }
97  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
98  }
99  else if (AlgoName=="SiStripBadAPVAlgorithmFromClusterOccupancy")
100  {
101 
102  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] call to SiStripBadAPVAlgorithmFromClusterOccupancy"<<std::endl;
103 
105  theIdentifier2->setLowOccupancyThreshold(parameters.getUntrackedParameter<double>("LowOccupancyThreshold",5));
106  theIdentifier2->setHighOccupancyThreshold(parameters.getUntrackedParameter<double>("HighOccupancyThreshold",10));
107  theIdentifier2->setAbsoluteLowThreshold(parameters.getUntrackedParameter<double>("AbsoluteLowThreshold",0));
108  theIdentifier2->setNumberIterations(parameters.getUntrackedParameter<uint32_t>("NumberIterations",2));
109  theIdentifier2->setAbsoluteOccupancyThreshold(parameters.getUntrackedParameter<double>("OccupancyThreshold",1.E-5));
112  theIdentifier2->setOutputFileName(conf_.getUntrackedParameter<std::string>("OccupancyRootFile","Occupancy.root"),conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile",false));
114 
115  SiStripQuality* qobj = new SiStripQuality();
117 
118  //----------
119 
120  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"<<std::endl;
121 
122  std::stringstream ss;
123 
126  for(;rIter!=rIterEnd;++rIter){
127  SiStripBadStrip::Range range(qobj->getDataVectorBegin()+rIter->ibegin,qobj->getDataVectorBegin()+rIter->iend);
128  if ( ! obj->put(rIter->detid,range) )
129  edm::LogError("SiStripQualityHotStripIdentifierRoot")<<"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists"<<std::endl;
130  }
131  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
132 
133 
134  }
135  else if (AlgoName=="SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy")
136  {
137 
138  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] call to SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy"<<std::endl;
139 
141  theIdentifier3->setProbabilityThreshold(parameters.getUntrackedParameter<double>("ProbabilityThreshold",1.E-7));
142  theIdentifier3->setMinNumEntries(parameters.getUntrackedParameter<uint32_t>("MinNumEntries",100));
143  theIdentifier3->setMinNumEntriesPerStrip(parameters.getUntrackedParameter<uint32_t>("MinNumEntriesPerStrip",5));
145  theIdentifier3->setOutputFileName(conf_.getUntrackedParameter<std::string>("OccupancyRootFile","Occupancy.root"),conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile",false),conf_.getUntrackedParameter<std::string>("DQMHistoOutputFile","DQMHistos.root"),conf_.getUntrackedParameter<bool>("WriteDQMHistoOutputFile",false));
147  theIdentifier3->setLowOccupancyThreshold(parameters.getUntrackedParameter<double>("LowOccupancyThreshold",5));
148  theIdentifier3->setHighOccupancyThreshold(parameters.getUntrackedParameter<double>("HighOccupancyThreshold",10));
149  theIdentifier3->setAbsoluteLowThreshold(parameters.getUntrackedParameter<double>("AbsoluteLowThreshold",0));
150  theIdentifier3->setNumberIterations(parameters.getUntrackedParameter<uint32_t>("NumberIterations",2));
151  theIdentifier3->setAbsoluteOccupancyThreshold(parameters.getUntrackedParameter<double>("OccupancyThreshold",1.E-5));
153 
154  SiStripQuality* qobj = new SiStripQuality();
155  theIdentifier3->extractBadAPVSandStrips(qobj,ClusterPositionHistoMap,SiStripQuality_);//here I insert SiStripQuality as input and get qobj as output
156 
157  //----------
158 
159  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] copy SiStripObject in SiStripBadStrip"<<std::endl;
160 
161  std::stringstream ss;
162 
165  for(;rIter!=rIterEnd;++rIter){
166  SiStripBadStrip::Range range(qobj->getDataVectorBegin()+rIter->ibegin,qobj->getDataVectorBegin()+rIter->iend);
167  if ( ! obj->put(rIter->detid,range) )
168  edm::LogError("SiStripQualityHotStripIdentifierRoot")<<"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists"<<std::endl;
169  }
170  edm::LogInfo("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] " << ss.str() << std::endl;
171  }
172  else
173  {
174  edm::LogError("SiStripQualityHotStripIdentifierRoot") <<" [SiStripQualityHotStripIdentifierRoot::getNewObject] call for a unknow HotStrip identification algoritm"<<std::endl;
175 
176  std::vector<uint32_t> a;
177  SiStripBadStrip::Range range(a.begin(),a.end());
178  if ( ! obj->put(0xFFFFFFFF,range) )
179  edm::LogError("SiStripQualityHotStripIdentifierRoot")<<"[SiStripQualityHotStripIdentifierRoot::getNewObject] detid already exists"<<std::endl;
180  }
181  }
182  else
183  {
184  edm::LogWarning("NotEnoughEvents") <<"Total number of events is " << TotNumberOfEvents << ", which is below the threshold (" << calibrationthreshold << "). Calibration will NOT be launched.";
185  setDoStore(false); // Don't put anything in the sqlite-file!
186  }
187 
188  return obj;
189 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
dictionary parameters
Definition: Parameters.py:2
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:121
std::pair< ContainerIterator, ContainerIterator > Range
void extractBadAPVs(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)
SiStripBadAPVAlgorithmFromClusterOccupancy * theIdentifier2
void extractBadAPVSandStrips(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)
bool put(const uint32_t &detID, const InputVector &vect)

Member Data Documentation

const TrackerGeometry* SiStripQualityHotStripIdentifierRoot::_tracker
private

Definition at line 82 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

uint32_t SiStripQualityHotStripIdentifierRoot::calibrationthreshold
private

Definition at line 92 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStrip::QualityHistosMap SiStripQualityHotStripIdentifierRoot::ClusterPositionHistoMap
private

Definition at line 94 of file SiStripQualityHotStripIdentifierRoot.h.

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

const edm::ParameterSet SiStripQualityHotStripIdentifierRoot::conf_
private

Definition at line 77 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

std::string SiStripQualityHotStripIdentifierRoot::dataLabel_
private

Definition at line 74 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

std::string SiStripQualityHotStripIdentifierRoot::dirpath
private

Definition at line 88 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos().

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

Definition at line 87 of file SiStripQualityHotStripIdentifierRoot.h.

std::string SiStripQualityHotStripIdentifierRoot::filename
private
edm::FileInPath SiStripQualityHotStripIdentifierRoot::fp_
private
unsigned long long SiStripQualityHotStripIdentifierRoot::m_cacheID_
private

Definition at line 73 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

unsigned short SiStripQualityHotStripIdentifierRoot::MaxClusterWidth_
private

Definition at line 89 of file SiStripQualityHotStripIdentifierRoot.h.

double SiStripQualityHotStripIdentifierRoot::MeanNumberOfCluster
private

Definition at line 91 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

unsigned short SiStripQualityHotStripIdentifierRoot::MinClusterWidth_
private

Definition at line 89 of file SiStripQualityHotStripIdentifierRoot.h.

SiStripDetInfoFileReader* SiStripQualityHotStripIdentifierRoot::reader
private
edm::ESHandle<SiStripQuality> SiStripQualityHotStripIdentifierRoot::SiStripQuality_
private

Definition at line 75 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

SiStripHotStripAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier
private

Definition at line 95 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStripBadAPVAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier2
private

Definition at line 96 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy* SiStripQualityHotStripIdentifierRoot::theIdentifier3
private

Definition at line 97 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by getNewObject().

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

Definition at line 81 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().

double SiStripQualityHotStripIdentifierRoot::TotNumberOfEvents
private

Definition at line 90 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by bookHistos(), and getNewObject().

const TrackerTopology* SiStripQualityHotStripIdentifierRoot::tTopo
private

Definition at line 83 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun(), and getNewObject().

bool SiStripQualityHotStripIdentifierRoot::UseInputDB_
private

Definition at line 76 of file SiStripQualityHotStripIdentifierRoot.h.

Referenced by algoBeginRun().