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  detCablingToken_(esConsumes<edm::Transition::BeginRun>())
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 
67  const edm::Run &run,
68  const edm::EventSetup &eSetup) {
69  if (BadFedNumber)
71 
72  if (detCablingWatcher_.check(eSetup)) {
73  SelectedDetIds.clear();
74  const auto &detcabling = eSetup.getData(detCablingToken_);
75  detcabling.addActiveDetectorsRawIds(SelectedDetIds);
76 
77  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::bookHistograms: "
78  << " Creating MEs for new Cabling ";
79  ibooker.setCurrentFolder("Track/GlobalParameter");
80  if (!BadFedNumber) {
81  BadFedNumber =
82  ibooker.book1D("FaultyFedNumberAndChannel", "Faulty Fed Id and Channel and Numbers", 60000, 0.5, 600.5);
83  BadFedNumber->setAxisTitle("Fed Id and Channel numbers", 1);
84  }
85  }
86 }
87 
88 // ------------ method called to produce the data ------------
90  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::analyze: Run " << iEvent.id().run() << " Event "
91  << iEvent.id().event();
92 
93  const auto &detcabling = iSetup.getData(detCablingToken_);
94 
95  // get DigiCollection object from Event
97  iEvent.getByToken(digiToken_, digi_collection);
98 
99  for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin(), iEnd = SelectedDetIds.end();
100  idetid != iEnd;
101  ++idetid) {
102  std::vector<edm::DetSet<SiStripRawDigi>>::const_iterator digis = digi_collection->find((*idetid));
103  if (digis == digi_collection->end() || digis->data.empty() || digis->data.size() > 768) {
104  std::vector<const FedChannelConnection *> fed_conns = detcabling.getConnections((*idetid));
105  for (unsigned int k = 0; k < fed_conns.size(); k++) {
106  if (fed_conns[k] && fed_conns[k]->isConnected()) {
107  float fed_id = fed_conns[k]->fedId() + 0.01 * fed_conns[k]->fedCh();
108  BadFedNumber->Fill(fed_id);
109  }
110  }
111  continue;
112  }
113  }
114 }
115 //
116 // -- End Run
117 //
119  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
121  if (outputMEsInRootFile) {
123  }
124 }
125 //
126 // -- End Job
127 //
129  edm::LogInfo("SiStripMonitorRawData") << "SiStripMonitorRawData::EndJob: "
130  << " Finishing!! ";
131 }
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
SiStripMonitorRawData::detCablingWatcher_
edm::ESWatcher< SiStripDetCablingRcd > detCablingWatcher_
Definition: SiStripMonitorRawData.h:68
Handle.h
SiStripMonitorRawData::digiToken_
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiToken_
Definition: SiStripMonitorRawData.h:59
SiStripMonitorRawData.h
MessageLogger.h
SiStripMonitorRawData::detCablingToken_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
Definition: SiStripMonitorRawData.h:67
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:50
edm
HLT enums.
Definition: AlignableModifier.h:19
SiStripRawDigi.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
SiStripMonitorRawData::~SiStripMonitorRawData
~SiStripMonitorRawData() override
Definition: SiStripMonitorRawData.cc:58
SiStripMonitorRawData::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: SiStripMonitorRawData.cc:89
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
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
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
dqmdumpme.k
k
Definition: dqmdumpme.py:60
dqm::implementation::DQMStore::save
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:761
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
SiStripMonitorRawData::dqmEndRun
void dqmEndRun(edm::Run const &run, edm::EventSetup const &eSetup) override
Definition: SiStripMonitorRawData.cc:118
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:58
DetSetVector.h
SiStripMonitorRawData::conf_
edm::ParameterSet conf_
Definition: SiStripMonitorRawData.h:64
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
SiStripMonitorRawData::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: SiStripMonitorRawData.cc:66
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiStripMonitorRawData::SelectedDetIds
std::vector< uint32_t > SelectedDetIds
Definition: SiStripMonitorRawData.h:65
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
SiStripMonitorRawData::endJob
void endJob() override
Definition: SiStripMonitorRawData.cc:128
SiStripDetCablingRcd.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
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
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98