CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripMonitorRawData Class Reference

#include <SiStripMonitorRawData.h>

Inheritance diagram for SiStripMonitorRawData:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void endJob () override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
 SiStripMonitorRawData (const edm::ParameterSet &)
 
 ~SiStripMonitorRawData () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Attributes

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

Detailed Description

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

Usage: <usage>

Definition at line 49 of file SiStripMonitorRawData.h.

Constructor & Destructor Documentation

SiStripMonitorRawData::SiStripMonitorRawData ( const edm::ParameterSet )
explicit

Definition at line 43 of file SiStripMonitorRawData.cc.

References conf_, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::digiProducer, digiToken_, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

44  : BadFedNumber(nullptr),
46  conf_(iConfig),
47  m_cacheID_(0)
48 
49 {
50  // retrieve producer name of input StripDigiCollection
52  std::string digiType = "VirginRaw";
53  digiToken_ = consumes<edm::DetSetVector<SiStripRawDigi>>(edm::InputTag(digiProducer, digiType));
54 
55  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData "
56  << " Constructing....... ";
57 }
T getParameter(std::string const &) const
unsigned long long m_cacheID_
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiToken_
MonitorElement * BadFedNumber
SiStripMonitorRawData::~SiStripMonitorRawData ( )
override

Definition at line 59 of file SiStripMonitorRawData.cc.

59  {
60  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData "
61  << " Destructing....... ";
62 }

Member Function Documentation

void SiStripMonitorRawData::analyze ( const edm::Event ,
const edm::EventSetup  
)
override

Definition at line 92 of file SiStripMonitorRawData.cc.

References BadFedNumber, detcabling, digiToken_, edm::EventID::event(), MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), SiStripDetCabling::getConnections(), edm::EventBase::id(), gen::k, edm::EventID::run(), and SelectedDetIds.

92  {
93  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::analyze: Run " << iEvent.id().run() << " Event "
94  << iEvent.id().event();
95 
96  iSetup.get<SiStripDetCablingRcd>().get(detcabling);
97 
98  // get DigiCollection object from Event
100  iEvent.getByToken(digiToken_, digi_collection);
101 
102  for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin(), iEnd = SelectedDetIds.end();
103  idetid != iEnd;
104  ++idetid) {
105  std::vector<edm::DetSet<SiStripRawDigi>>::const_iterator digis = digi_collection->find((*idetid));
106  if (digis == digi_collection->end() || digis->data.empty() || digis->data.size() > 768) {
107  std::vector<const FedChannelConnection *> fed_conns = detcabling->getConnections((*idetid));
108  for (unsigned int k = 0; k < fed_conns.size(); k++) {
109  if (fed_conns[k] && fed_conns[k]->isConnected()) {
110  float fed_id = fed_conns[k]->fedId() + 0.01 * fed_conns[k]->fedCh();
111  BadFedNumber->Fill(fed_id);
112  }
113  }
114  continue;
115  }
116  }
117 }
void Fill(long long x)
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
int iEvent
Definition: GenABIO.cc:224
edm::ESHandle< SiStripDetCabling > detcabling
int k[5][pyjets_maxn]
std::vector< uint32_t > SelectedDetIds
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiToken_
MonitorElement * BadFedNumber
void SiStripMonitorRawData::bookHistograms ( DQMStore::IBooker ,
edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 67 of file SiStripMonitorRawData.cc.

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

69  {
70  unsigned long long cacheID = eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();
71 
72  if (BadFedNumber)
74  if (m_cacheID_ != cacheID) {
75  m_cacheID_ = cacheID;
76  eSetup.get<SiStripDetCablingRcd>().get(detcabling);
77  SelectedDetIds.clear();
79 
80  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::bookHistograms: "
81  << " Creating MEs for new Cabling ";
82  ibooker.setCurrentFolder("Track/GlobalParameter");
83  if (!BadFedNumber) {
84  BadFedNumber =
85  ibooker.book1D("FaultyFedNumberAndChannel", "Faulty Fed Id and Channel and Numbers", 60000, 0.5, 600.5);
86  BadFedNumber->setAxisTitle("Fed Id and Channel numbers", 1);
87  }
88  }
89 }
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
edm::ESHandle< SiStripDetCabling > detcabling
void Reset()
reset ME (ie. contents, errors, etc)
std::vector< uint32_t > SelectedDetIds
unsigned long long m_cacheID_
MonitorElement * BadFedNumber
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void SiStripMonitorRawData::endJob ( void  )
override

Definition at line 132 of file SiStripMonitorRawData.cc.

References DEFINE_FWK_MODULE.

132  {
133  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::EndJob: "
134  << " Finishing!! ";
135 }
void SiStripMonitorRawData::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
override

Definition at line 121 of file SiStripMonitorRawData.cc.

References conf_, dqmStore_, edm::ParameterSet::getParameter(), PostProcessorHGCAL_cfi::outputFileName, DQMStore::save(), and AlCaHLTBitMon_QueryRunRegistry::string.

121  {
122  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
124  if (outputMEsInRootFile) {
125  // dqmStore_->showDirStructure();
126  dqmStore_->save(outputFileName);
127  }
128 }
T getParameter(std::string const &) const
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
Definition: DQMStore.cc:2465

Member Data Documentation

MonitorElement* SiStripMonitorRawData::BadFedNumber
private

Definition at line 62 of file SiStripMonitorRawData.h.

Referenced by analyze(), and bookHistograms().

edm::ParameterSet SiStripMonitorRawData::conf_
private

Definition at line 65 of file SiStripMonitorRawData.h.

Referenced by endRun(), and SiStripMonitorRawData().

edm::ESHandle<SiStripDetCabling> SiStripMonitorRawData::detcabling
private

Definition at line 66 of file SiStripMonitorRawData.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > SiStripMonitorRawData::digiToken_
private

Definition at line 60 of file SiStripMonitorRawData.h.

Referenced by analyze(), and SiStripMonitorRawData().

DQMStore* SiStripMonitorRawData::dqmStore_
private

Definition at line 64 of file SiStripMonitorRawData.h.

Referenced by endRun().

unsigned long long SiStripMonitorRawData::m_cacheID_
private

Definition at line 69 of file SiStripMonitorRawData.h.

Referenced by bookHistograms().

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

Definition at line 67 of file SiStripMonitorRawData.h.

Referenced by analyze(), and bookHistograms().