CMS 3D CMS Logo

SiStripMonitorRawData.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripMonitorRawData
4 // Class: SiStripMonitorRawData
5 //
14 //
15 // Original Author: Suchandra Dutta
16 // Created: Fri June 1 17:00:00 CET 2007
17 //
18 //
19 
22 
24 
27 
30 
33 
35 
36 // std
37 #include <algorithm>
38 #include <cmath>
39 #include <cstdlib>
40 #include <numeric>
41 
43  : BadFedNumber(nullptr),
44  dqmStore_(edm::Service<DQMStore>().operator->()),
45  conf_(iConfig),
46  m_cacheID_(0)
47 
48 {
49  // retrieve producer name of input StripDigiCollection
51  std::string digiType = "VirginRaw";
52  digiToken_ = consumes<edm::DetSetVector<SiStripRawDigi>>(edm::InputTag(digiProducer, digiType));
53 
54  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData "
55  << " Constructing....... ";
56 }
57 
59  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData "
60  << " Destructing....... ";
61 }
62 //
63 // -- BeginRun
64 //
65 
66 void SiStripMonitorRawData::bookHistograms(DQMStore::IBooker &ibooker,
67  const edm::Run &run,
68  const edm::EventSetup &eSetup) {
69  unsigned long long cacheID = eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();
70 
71  if (BadFedNumber)
73  if (m_cacheID_ != cacheID) {
74  m_cacheID_ = cacheID;
76  SelectedDetIds.clear();
78 
79  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::bookHistograms: "
80  << " Creating MEs for new Cabling ";
81  ibooker.setCurrentFolder("Track/GlobalParameter");
82  if (!BadFedNumber) {
83  BadFedNumber =
84  ibooker.book1D("FaultyFedNumberAndChannel", "Faulty Fed Id and Channel and Numbers", 60000, 0.5, 600.5);
85  BadFedNumber->setAxisTitle("Fed Id and Channel numbers", 1);
86  }
87  }
88 }
89 
90 // ------------ method called to produce the data ------------
92  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::analyze: Run " << iEvent.id().run() << " Event "
93  << iEvent.id().event();
94 
96 
97  // get DigiCollection object from Event
99  iEvent.getByToken(digiToken_, digi_collection);
100 
101  for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin(), iEnd = SelectedDetIds.end();
102  idetid != iEnd;
103  ++idetid) {
104  std::vector<edm::DetSet<SiStripRawDigi>>::const_iterator digis = digi_collection->find((*idetid));
105  if (digis == digi_collection->end() || digis->data.empty() || digis->data.size() > 768) {
106  std::vector<const FedChannelConnection *> fed_conns = detcabling->getConnections((*idetid));
107  for (unsigned int k = 0; k < fed_conns.size(); k++) {
108  if (fed_conns[k] && fed_conns[k]->isConnected()) {
109  float fed_id = fed_conns[k]->fedId() + 0.01 * fed_conns[k]->fedCh();
110  BadFedNumber->Fill(fed_id);
111  }
112  }
113  continue;
114  }
115  }
116 }
117 //
118 // -- End Run
119 //
121  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
123  if (outputMEsInRootFile) {
125  }
126 }
127 //
128 // -- End Job
129 //
131  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::EndJob: "
132  << " Finishing!! ";
133 }
SiStripDetCabling::addActiveDetectorsRawIds
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
Definition: SiStripDetCabling.cc:134
Handle.h
SiStripMonitorRawData::digiToken_
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiToken_
Definition: SiStripMonitorRawData.h:59
SiStripMonitorRawData.h
MessageLogger.h
edm::Run
Definition: Run.h:45
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.digiProducer
digiProducer
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:43
edm
HLT enums.
Definition: AlignableModifier.h:19
SiStripRawDigi.h
edm::LogInfo
Definition: MessageLogger.h:254
DQMStore.h
SiStripMonitorRawData::m_cacheID_
unsigned long long m_cacheID_
Definition: SiStripMonitorRawData.h:68
SiStripMonitorRawData::~SiStripMonitorRawData
~SiStripMonitorRawData() override
Definition: SiStripMonitorRawData.cc:58
SiStripMonitorRawData::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: SiStripMonitorRawData.cc:91
edm::Handle
Definition: AssociativeIterator.h:50
SiStripMonitorRawData
Definition: SiStripMonitorRawData.h:48
Utilities.operator
operator
Definition: Utilities.py:24
SiStripMonitorRawData::SiStripMonitorRawData
SiStripMonitorRawData(const edm::ParameterSet &)
Definition: SiStripMonitorRawData.cc:42
SiStripDetCabling.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
dqm::legacy::DQMStore
Definition: DQMStore.h:727
Service.h
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
Service
reco_skim_cfg_mod.outputFileName
outputFileName
Definition: reco_skim_cfg_mod.py:15
SiStripMonitorRawData::detcabling
edm::ESHandle< SiStripDetCabling > detcabling
Definition: SiStripMonitorRawData.h:65
dqmdumpme.k
k
Definition: dqmdumpme.py:60
SiStripDetCablingRcd
Definition: SiStripDependentRecords.h:19
dqm::implementation::DQMStore::save
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:760
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
SiStripMonitorRawData::dqmEndRun
void dqmEndRun(edm::Run const &run, edm::EventSetup const &eSetup) override
Definition: SiStripMonitorRawData.cc:120
iEvent
int iEvent
Definition: GenABIO.cc:224
SiStripMonitorRawData::dqmStore_
DQMStore * dqmStore_
Definition: SiStripMonitorRawData.h:63
SiStripMonitorRawData::BadFedNumber
MonitorElement * BadFedNumber
Definition: SiStripMonitorRawData.h:61
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
get
#define get
SiStripMonitorRawData::conf_
edm::ParameterSet conf_
Definition: SiStripMonitorRawData.h:64
SiStripMonitorRawData::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: SiStripMonitorRawData.cc:66
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiStripMonitorRawData::SelectedDetIds
std::vector< uint32_t > SelectedDetIds
Definition: SiStripMonitorRawData.h:66
EventSetup.h
SiStripMonitorRawData::endJob
void endJob() override
Definition: SiStripMonitorRawData.cc:130
SiStripDetCablingRcd.h
edm::Event
Definition: Event.h:73
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
SiStripDetCabling::getConnections
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
Definition: SiStripDetCabling.cc:161