CMS 3D CMS Logo

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

#include <DPGAnalysis/SiStripTools/plugins/SiStripQualityHistory.cc>

Inheritance diagram for SiStripQualityHistory:
edm::EDAnalyzer

Public Types

enum  { Module, Fiber, APV }
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 

Public Member Functions

 SiStripQualityHistory (const edm::ParameterSet &)
 
 ~SiStripQualityHistory ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 

Private Attributes

std::map< std::string, TH1F * > _history
 
const unsigned int _mode
 
const std::vector
< edm::ParameterSet
_monitoredssq
 

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 &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 56 of file SiStripQualityHistory.cc.

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

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

Definition at line 91 of file SiStripQualityHistory.cc.

References _history, _monitoredssq, TFileDirectory::make(), and mergeVDriftHistosByStation::name.

91  :
92  _monitoredssq(iConfig.getParameter<std::vector<edm::ParameterSet> >("monitoredSiStripQuality")),
93  _mode(iConfig.getUntrackedParameter<unsigned int>("granularityMode",Module)),
94  _history()
95 {
96  //now do what ever initialization is needed
97 
99 
100  for(std::vector<edm::ParameterSet>::const_iterator ps=_monitoredssq.begin();ps!=_monitoredssq.end();++ps) {
101 
102  std::string name = ps->getParameter<std::string>("name");
103  // _history[name] = tfserv->make<TGraph>();
104  // _history[name]->SetName(name.c_str()); _history[name]->SetTitle(name.c_str());
105 
106  _history[name] = tfserv->make<TH1F>(name.c_str(),name.c_str(),10,0,10);
107 
108  }
109 
110 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, TH1F * > _history
const std::vector< edm::ParameterSet > _monitoredssq
T * make() const
make new ROOT object
SiStripQualityHistory::~SiStripQualityHistory ( )

Definition at line 113 of file SiStripQualityHistory.cc.

114 {
115 
116  // do anything here that needs to be done at desctruction time
117  // (e.g. close files, deallocate resources etc.)
118 
119 }

Member Function Documentation

void SiStripQualityHistory::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 128 of file SiStripQualityHistory.cc.

129 {
130  edm::LogInfo("EventProcessing") << "event being processed";
131 }
void SiStripQualityHistory::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 191 of file SiStripQualityHistory.cc.

192 {}
void SiStripQualityHistory::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file SiStripQualityHistory.cc.

References _history, _mode, _monitoredssq, APV, Fiber, edm::EventSetup::get(), diffTwoXMLs::label, Module, mergeVDriftHistosByStation::name, and edm::RunBase::run().

135 {
136 
137  // loop on all the SiStripQuality objects to be monitored
138 
139  for(std::vector<edm::ParameterSet>::const_iterator ps=_monitoredssq.begin();ps!=_monitoredssq.end();++ps) {
140 
141  std::string name = ps->getParameter<std::string>("name");
142  std::string label = ps->getParameter<std::string>("ssqLabel");
143 
144 
146  iSetup.get<SiStripQualityRcd>().get(label,ssq);
147 
148  std::vector<SiStripQuality::BadComponent> bads = ssq->getBadComponentList();
149 
150  edm::LogInfo("Debug") << bads.size() << " bad components found";
151 
152  int nbad=0;
153 
154  for(std::vector<SiStripQuality::BadComponent>::const_iterator bc=bads.begin();bc!=bads.end();++bc) {
155 
156  if(_mode==Module) {
157  if(bc->BadModule) ++nbad;
158  }
159  else if(_mode == Fiber) {
160  for(int fiber=1;fiber<5;fiber*=2) {
161  if((bc->BadFibers & fiber)>0) ++nbad;
162  }
163  }
164  else if(_mode ==APV) {
165  for(int apv=1;apv<33;apv*=2) {
166  if((bc->BadApvs & apv)>0) ++nbad;
167  }
168  }
169  }
170 
171 
172  // _history[name]->SetPoint(_history[name]->GetN(),iRun.run(),nbad);
173  char runname[100];
174  sprintf(runname,"%d",iRun.run());
175  edm::LogInfo("Debug") << name << " " << runname << " " << nbad;
176  _history[name]->Fill(runname,nbad);
177 
178  }
179 
180 
181 
182 }
RunNumber_t run() const
Definition: RunBase.h:42
std::map< std::string, TH1F * > _history
const std::vector< edm::ParameterSet > _monitoredssq
const T & get() const
Definition: EventSetup.h:55
void SiStripQualityHistory::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 196 of file SiStripQualityHistory.cc.

197 {
198  /*
199  for(std::vector<edm::ParameterSet>::const_iterator ps=_monitoredssq.begin();ps!=_monitoredssq.end();++ps) {
200 
201  std::string name = ps->getParameter<std::string>("name");
202  _history[name]->Write();
203 
204  }
205  */
206 }
void SiStripQualityHistory::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 185 of file SiStripQualityHistory.cc.

186 {}

Member Data Documentation

std::map<std::string,TH1F*> SiStripQualityHistory::_history
private
const unsigned int SiStripQualityHistory::_mode
private
const std::vector<edm::ParameterSet> SiStripQualityHistory::_monitoredssq
private

Definition at line 72 of file SiStripQualityHistory.cc.

Referenced by beginRun(), and SiStripQualityHistory().