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 edm::EDConsumerBase

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 42 of file SiStripMonitorRawData.cc.

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

42  :
43  BadFedNumber(0),
45  conf_(iConfig),
46  m_cacheID_(0)
47 
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 ( )

Definition at line 60 of file SiStripMonitorRawData.cc.

61 {
62  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData "
63  << " Destructing....... ";
64 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 95 of file SiStripMonitorRawData.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file SiStripMonitorRawData.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file SiStripMonitorRawData.cc.

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

73  {
74  unsigned long long cacheID = eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();
75 
77  if (m_cacheID_ != cacheID) {
78  m_cacheID_ = cacheID;
79  eSetup.get<SiStripDetCablingRcd>().get( detcabling );
80  SelectedDetIds.clear();
81  detcabling->addActiveDetectorsRawIds(SelectedDetIds);
82 
83  edm::LogInfo("SiStripMonitorRawData") <<"SiStripMonitorRawData::beginRun: "
84  << " Creating MEs for new Cabling ";
85  dqmStore_->setCurrentFolder("Track/GlobalParameter");
86  if (!BadFedNumber) {
87  BadFedNumber = dqmStore_->book1D("FaultyFedNumberAndChannel","Faulty Fed Id and Channel and Numbers", 60000, 0.5, 600.5);
88  BadFedNumber->setAxisTitle("Fed Id and Channel numbers",1);
89  }
90  }
91 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
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:584
void SiStripMonitorRawData::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 144 of file SiStripMonitorRawData.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file SiStripMonitorRawData.cc.

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

133  {
134  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
136  if (outputMEsInRootFile) {
138  dqmStore_->save(outputFileName);
139  }
140 }
T getParameter(std::string const &) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
void showDirStructure(void) const
Definition: DQMStore.cc:2961

Member Data Documentation

MonitorElement* SiStripMonitorRawData::BadFedNumber
private

Definition at line 59 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().

edm::ParameterSet SiStripMonitorRawData::conf_
private

Definition at line 62 of file SiStripMonitorRawData.h.

Referenced by endRun(), and SiStripMonitorRawData().

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

Definition at line 63 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().

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

Definition at line 57 of file SiStripMonitorRawData.h.

Referenced by analyze(), and SiStripMonitorRawData().

DQMStore* SiStripMonitorRawData::dqmStore_
private

Definition at line 61 of file SiStripMonitorRawData.h.

Referenced by beginRun(), and endRun().

unsigned long long SiStripMonitorRawData::m_cacheID_
private

Definition at line 66 of file SiStripMonitorRawData.h.

Referenced by beginRun().

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

Definition at line 64 of file SiStripMonitorRawData.h.

Referenced by analyze(), and beginRun().