CMS 3D CMS Logo

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

List of all members.

Public Types

enum  { Module, Fiber, APV }

Public Member Functions

 SiStripQualityHistory (const edm::ParameterSet &)
 ~SiStripQualityHistory ()

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

Detailed Description

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

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

Definition at line 56 of file SiStripQualityHistory.cc.


Member Enumeration Documentation

anonymous enum
Enumerator:
Module 
Fiber 
APV 

Definition at line 61 of file SiStripQualityHistory.cc.


Constructor & Destructor Documentation

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

Definition at line 91 of file SiStripQualityHistory.cc.

References _history, _monitoredssq, and mergeVDriftHistosByStation::name.

                                                                          :
  _monitoredssq(iConfig.getParameter<std::vector<edm::ParameterSet> >("monitoredSiStripQuality")),
  _mode(iConfig.getUntrackedParameter<unsigned int>("granularityMode",Module)),
  _history()
{
   //now do what ever initialization is needed

  edm::Service<TFileService> tfserv;

  for(std::vector<edm::ParameterSet>::const_iterator ps=_monitoredssq.begin();ps!=_monitoredssq.end();++ps) {
    
    std::string name = ps->getParameter<std::string>("name");
    //    _history[name] = tfserv->make<TGraph>();
    //    _history[name]->SetName(name.c_str());     _history[name]->SetTitle(name.c_str()); 

    _history[name] = tfserv->make<TH1F>(name.c_str(),name.c_str(),10,0,10);

  }

}
SiStripQualityHistory::~SiStripQualityHistory ( )

Definition at line 113 of file SiStripQualityHistory.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

void SiStripQualityHistory::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 128 of file SiStripQualityHistory.cc.

{
  edm::LogInfo("EventProcessing") << "event being processed";
}
void SiStripQualityHistory::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 191 of file SiStripQualityHistory.cc.

{}
void SiStripQualityHistory::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file SiStripQualityHistory.cc.

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

{

  // loop on all the SiStripQuality objects to be monitored

  for(std::vector<edm::ParameterSet>::const_iterator ps=_monitoredssq.begin();ps!=_monitoredssq.end();++ps) {
    
    std::string name = ps->getParameter<std::string>("name");
    std::string label = ps->getParameter<std::string>("ssqLabel");

    
    edm::ESHandle<SiStripQuality> ssq;
    iSetup.get<SiStripQualityRcd>().get(label,ssq);

    std::vector<SiStripQuality::BadComponent> bads = ssq->getBadComponentList();

    edm::LogInfo("Debug") << bads.size() << " bad components found";

    int nbad=0;

    for(std::vector<SiStripQuality::BadComponent>::const_iterator bc=bads.begin();bc!=bads.end();++bc) {

      if(_mode==Module) {
       if(bc->BadModule) ++nbad;
      }
      else if(_mode == Fiber) {
      for(int fiber=1;fiber<5;fiber*=2) {
        if((bc->BadFibers & fiber)>0) ++nbad;
      }
    }
    else if(_mode ==APV) {
      for(int apv=1;apv<33;apv*=2) {
        if((bc->BadApvs & apv)>0) ++nbad;
      }
    }
  }


    //    _history[name]->SetPoint(_history[name]->GetN(),iRun.run(),nbad);
    char runname[100];
    sprintf(runname,"%d",iRun.run());
    edm::LogInfo("Debug") << name << " " << runname << " " << nbad;
    _history[name]->Fill(runname,nbad);

  }

  

}
void SiStripQualityHistory::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 196 of file SiStripQualityHistory.cc.

{
  /*
  for(std::vector<edm::ParameterSet>::const_iterator ps=_monitoredssq.begin();ps!=_monitoredssq.end();++ps) {
    
    std::string name = ps->getParameter<std::string>("name");
    _history[name]->Write();

  }
  */
}
void SiStripQualityHistory::endRun ( const edm::Run iRun,
const edm::EventSetup  
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 185 of file SiStripQualityHistory.cc.

{}

Member Data Documentation

std::map<std::string,TH1F*> SiStripQualityHistory::_history [private]

Definition at line 75 of file SiStripQualityHistory.cc.

Referenced by beginRun(), and SiStripQualityHistory().

const unsigned int SiStripQualityHistory::_mode [private]

Definition at line 73 of file SiStripQualityHistory.cc.

Referenced by beginRun().

Definition at line 72 of file SiStripQualityHistory.cc.

Referenced by beginRun(), and SiStripQualityHistory().