CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiStripMonitorRawData Class Reference

#include <SiStripMonitorRawData.h>

Inheritance diagram for SiStripMonitorRawData:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
virtual void endJob ()
virtual void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 SiStripMonitorRawData (const edm::ParameterSet &)
 ~SiStripMonitorRawData ()

Private Attributes

MonitorElementBadFedNumber
edm::ParameterSet conf_
edm::ESHandle< SiStripDetCablingdetcabling
DQMStoredqmStore_
unsigned long long m_cacheID_
std::vector< uint32_t > SelectedDetIds

Detailed Description

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

Usage: <usage>

Definition at line 44 of file SiStripMonitorRawData.h.


Constructor & Destructor Documentation

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

Definition at line 43 of file SiStripMonitorRawData.cc.

                                                                          :
  BadFedNumber(0),
  dqmStore_(edm::Service<DQMStore>().operator->()),
  conf_(iConfig),
  m_cacheID_(0)


{
  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData  " 
                                          << " Constructing....... ";     
}
SiStripMonitorRawData::~SiStripMonitorRawData ( )

Definition at line 56 of file SiStripMonitorRawData.cc.

{
  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData  " 
                                          << " Destructing....... ";     
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 91 of file SiStripMonitorRawData.cc.

References BadFedNumber, conf_, detcabling, EcnaSystemPythonModuleInsert_2::digiProducer, edm::EventID::event(), MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByLabel(), edm::ParameterSet::getParameter(), edm::EventBase::id(), gen::k, edm::EventID::run(), and SelectedDetIds.

{

   edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData::analyze: Run "<< 
                              iEvent.id().run()  << " Event " << iEvent.id().event();

  
  iSetup.get<SiStripDetCablingRcd>().get( detcabling );

  // retrieve producer name of input StripDigiCollection
  std::string digiProducer = conf_.getParameter<std::string>("DigiProducer");
  // get DigiCollection object from Event
  edm::Handle< edm::DetSetVector<SiStripRawDigi> > digi_collection;
  std::string digiType = "VirginRaw";
  //you have a collection as there are all the digis for the event for every detector
  iEvent.getByLabel(digiProducer, digiType, digi_collection);

  for (std::vector<uint32_t>::const_iterator idetid=SelectedDetIds.begin(), 
                               iEnd=SelectedDetIds.end();idetid!=iEnd;++idetid){
    std::vector< edm::DetSet<SiStripRawDigi> >::const_iterator digis = digi_collection->find( (*idetid) );
    if (digis == digi_collection->end() ||
        digis->data.size() == 0 || 
        digis->data.size() > 768 )  {
      std::vector<const FedChannelConnection *> fed_conns = detcabling->getConnections((*idetid));
      for (unsigned int  k = 0; k < fed_conns.size() ; k++) {
        float fed_id = fed_conns[k]->fedId() + 0.01*fed_conns[k]->fedCh();
        BadFedNumber->Fill(fed_id);
      }
      continue;
    }
  }
}
void SiStripMonitorRawData::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file SiStripMonitorRawData.cc.

                                     {
}
void SiStripMonitorRawData::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file SiStripMonitorRawData.cc.

References BadFedNumber, DQMStore::book1D(), detcabling, dqmStore_, edm::EventSetup::get(), m_cacheID_, MonitorElement::Reset(), SelectedDetIds, MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().

                                                                                  {
  unsigned long long cacheID = eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();

  if (BadFedNumber) BadFedNumber->Reset();
  if (m_cacheID_ != cacheID) {
    m_cacheID_ = cacheID;       
    eSetup.get<SiStripDetCablingRcd>().get( detcabling );
    SelectedDetIds.clear();
    detcabling->addActiveDetectorsRawIds(SelectedDetIds);
    
    edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData::beginRun: " 
                                          << " Creating MEs for new Cabling ";     
    dqmStore_->setCurrentFolder("Track/GlobalParameter");
    if (!BadFedNumber) {
      BadFedNumber = dqmStore_->book1D("FaultyFedNumberAndChannel","Faulty Fed Id and Channel and Numbers", 60000, 0.5, 600.5);
      BadFedNumber->setAxisTitle("Fed Id and Channel numbers",1);
    }
  } 
}
void SiStripMonitorRawData::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file SiStripMonitorRawData.cc.

                                      {
  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData::EndJob: " 
                                          << " Finishing!! ";        
}
void SiStripMonitorRawData::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 126 of file SiStripMonitorRawData.cc.

References conf_, dqmStore_, edm::ParameterSet::getParameter(), dumpDBToFile_GT_ttrig_cfg::outputFileName, DQMStore::save(), and DQMStore::showDirStructure().

                                                                                 {
  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
  std::string outputFileName = conf_.getParameter<std::string>("OutputFileName");
  if (outputMEsInRootFile) {    
    dqmStore_->showDirStructure();
    dqmStore_->save(outputFileName);
  }
}

Member Data Documentation

Definition at line 57 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().

Definition at line 60 of file SiStripMonitorRawData.h.

Referenced by analyze(), and endRun().

Definition at line 61 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().

Definition at line 59 of file SiStripMonitorRawData.h.

Referenced by beginRun(), and endRun().

unsigned long long SiStripMonitorRawData::m_cacheID_ [private]

Definition at line 64 of file SiStripMonitorRawData.h.

Referenced by beginRun().

std::vector<uint32_t> SiStripMonitorRawData::SelectedDetIds [private]

Definition at line 62 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().