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 Attributes
SiStripMonitorRawData Class Reference

#include <SiStripMonitorRawData.h>

Inheritance diagram for SiStripMonitorRawData:
edm::EDAnalyzer

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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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.

43  :
44  BadFedNumber(0),
46  conf_(iConfig),
47  m_cacheID_(0)
48 
49 
50 {
51  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData "
52  << " Constructing....... ";
53 }
unsigned long long m_cacheID_
MonitorElement * BadFedNumber
SiStripMonitorRawData::~SiStripMonitorRawData ( )

Definition at line 56 of file SiStripMonitorRawData.cc.

57 {
58  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData "
59  << " Destructing....... ";
60 }

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.

92 {
93 
94  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData::analyze: Run "<<
95  iEvent.id().run() << " Event " << iEvent.id().event();
96 
97 
98  iSetup.get<SiStripDetCablingRcd>().get( detcabling );
99 
100  // retrieve producer name of input StripDigiCollection
101  std::string digiProducer = conf_.getParameter<std::string>("DigiProducer");
102  // get DigiCollection object from Event
104  std::string digiType = "VirginRaw";
105  //you have a collection as there are all the digis for the event for every detector
106  iEvent.getByLabel(digiProducer, digiType, digi_collection);
107 
108  for (std::vector<uint32_t>::const_iterator idetid=SelectedDetIds.begin(),
109  iEnd=SelectedDetIds.end();idetid!=iEnd;++idetid){
110  std::vector< edm::DetSet<SiStripRawDigi> >::const_iterator digis = digi_collection->find( (*idetid) );
111  if (digis == digi_collection->end() ||
112  digis->data.size() == 0 ||
113  digis->data.size() > 768 ) {
114  std::vector<FedChannelConnection> fed_conns = detcabling->getConnections((*idetid));
115  for (unsigned int k = 0; k < fed_conns.size() ; k++) {
116  float fed_id = fed_conns[k].fedId() + 0.01*fed_conns[k].fedCh();
117  BadFedNumber->Fill(fed_id);
118  }
119  continue;
120  }
121  }
122 }
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
edm::ESHandle< SiStripDetCabling > detcabling
void Fill(long long x)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
int k[5][pyjets_maxn]
std::vector< uint32_t > SelectedDetIds
const T & get() const
Definition: EventSetup.h:55
edm::EventID id() const
Definition: EventBase.h:56
MonitorElement * BadFedNumber
void SiStripMonitorRawData::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file SiStripMonitorRawData.cc.

64  {
65 }
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().

69  {
70  unsigned long long cacheID = eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();
71 
73  if (m_cacheID_ != cacheID) {
74  m_cacheID_ = cacheID;
75  eSetup.get<SiStripDetCablingRcd>().get( detcabling );
76  SelectedDetIds.clear();
77  detcabling->addActiveDetectorsRawIds(SelectedDetIds);
78 
79  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData::beginRun: "
80  << " Creating MEs for new Cabling ";
81  dqmStore_->setCurrentFolder("Track/GlobalParameter");
82  if (!BadFedNumber) {
83  BadFedNumber = dqmStore_->book1D("FaultyFedNumberAndChannel","Faulty Fed Id and Channel and Numbers", 60000, 0.5, 600.5);
84  BadFedNumber->setAxisTitle("Fed Id and Channel numbers",1);
85  }
86  }
87 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
edm::ESHandle< SiStripDetCabling > detcabling
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 Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void SiStripMonitorRawData::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file SiStripMonitorRawData.cc.

137  {
138  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData::EndJob: "
139  << " Finishing!! ";
140 }
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().

126  {
127  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
128  std::string outputFileName = conf_.getParameter<std::string>("OutputFileName");
129  if (outputMEsInRootFile) {
131  dqmStore_->save(outputFileName);
132  }
133 }
T getParameter(std::string const &) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
void showDirStructure(void) const
Definition: DQMStore.cc:2554

Member Data Documentation

MonitorElement* SiStripMonitorRawData::BadFedNumber
private

Definition at line 57 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().

edm::ParameterSet SiStripMonitorRawData::conf_
private

Definition at line 60 of file SiStripMonitorRawData.h.

Referenced by analyze(), and endRun().

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

Definition at line 61 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().

DQMStore* SiStripMonitorRawData::dqmStore_
private

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().