CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTBlockedROChannelsTest Class Reference

#include <DTBlockedROChannelsTest.h>

Inheritance diagram for DTBlockedROChannelsTest:
DQMEDHarvester edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  DTRobBinsMap
 

Public Member Functions

 DTBlockedROChannelsTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTBlockedROChannelsTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester (void)
 
virtual void endJob () override final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void produce (edm::Event &, edm::EventSetup const &) override final
 
virtual ~DQMEDHarvester ()=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &)
 BeginRun. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 DQM Client Diagnostic in online mode. More...
 
void fillChamberMap (DQMStore::IGetter &igetter, const edm::EventSetup &c)
 
void performClientDiagnostic (DQMStore::IGetter &igetter)
 DQM Client operations. More...
 
- 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)
 

Private Member Functions

int readOutToGeometry (int dduId, int rosNumber, int &wheel, int &sector)
 

Private Attributes

std::map< DTChamberId, DTRobBinsMapchamberMap
 
DTTimeEvolutionHistohSystFractionVsLS
 
edm::ESHandle< DTReadOutMappingmapping
 
int nevents
 
int neventsPrev
 
unsigned int nLumiSegs
 
int nupdates
 
bool offlineMode
 
int prescaleFactor
 
unsigned int prevNLumiSegs
 
double prevTotalPerc
 
std::map< int, double > resultsPerLumi
 
int run
 
MonitorElementsummaryHisto
 
std::map< int, MonitorElement * > wheelHitos
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 25 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

DTBlockedROChannelsTest::DTBlockedROChannelsTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file DTBlockedROChannelsTest.cc.

References edm::ParameterSet::getUntrackedParameter(), LogTrace, offlineMode, and prescaleFactor.

27  : nevents(0),
28  neventsPrev(0),
29  prevNLumiSegs(0),
30  prevTotalPerc(0),
32 {
33  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
34  << "[DTBlockedROChannelsTest]: Constructor";
35 
36  // prescale on the # of LS to update the test
37  prescaleFactor = ps.getUntrackedParameter<int>("diagnosticPrescale", 1);
38 
39  offlineMode = ps.getUntrackedParameter<bool>("offlineMode", true);
40 }
T getUntrackedParameter(std::string const &, T const &) const
DTTimeEvolutionHisto * hSystFractionVsLS
#define LogTrace(id)
DTBlockedROChannelsTest::~DTBlockedROChannelsTest ( )

Destructor.

Definition at line 44 of file DTBlockedROChannelsTest.cc.

References LogTrace, and nupdates.

44  {
45  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
46  << "DataIntegrityTest: analyzed " << nupdates << " updates";
47 }
#define LogTrace(id)

Member Function Documentation

void DTBlockedROChannelsTest::beginRun ( const edm::Run run,
const edm::EventSetup setup 
)
protected

BeginRun.

Definition at line 50 of file DTBlockedROChannelsTest.cc.

References nupdates.

51 {
52 
53  nupdates = 0;
54  return;
55 }
void DTBlockedROChannelsTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protectedvirtual

Implements DQMEDHarvester.

Definition at line 151 of file DTBlockedROChannelsTest.cc.

References LogTrace, offlineMode, and performClientDiagnostic().

151  {
152 
153  if (offlineMode) {
154  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
155  <<"[DTBlockedROChannelsTest] endRun called. Client called in offline mode, performing operations.";
156  performClientDiagnostic(igetter);
157  }
158 }
void performClientDiagnostic(DQMStore::IGetter &igetter)
DQM Client operations.
#define LogTrace(id)
void DTBlockedROChannelsTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

DQM Client Diagnostic in online mode.

Reimplemented from DQMEDHarvester.

Definition at line 95 of file DTBlockedROChannelsTest.cc.

References DQMStore::IBooker::book2D(), chamberMap, fillChamberMap(), hSystFractionVsLS, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), nLumiSegs, nupdates, offlineMode, performClientDiagnostic(), prescaleFactor, edm::LuminosityBlockBase::run(), run, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), summaryHisto, makeMuonMisalignmentScenario::wheel, and wheelHitos.

96  {
97 
98  //FR moved the following from beginJob!
99 
100  // book the summary histogram
101 
102  if (wheelHitos.size()==0) { // this is an attempt to make these bookings only once!
103 
104  ibooker.setCurrentFolder("DT/00-ROChannels");
105  summaryHisto = ibooker.book2D("ROChannelSummary","Summary Blocked RO Channels",12,1,13,5,-2,3);
106  summaryHisto->setAxisTitle("Sector",1);
107  summaryHisto->setAxisTitle("Wheel",2);
108 
109  for(int wheel = -2; wheel != 3; ++wheel) {
110  stringstream namestream; namestream << "ROChannelSummary_W" << wheel;
111  stringstream titlestream; titlestream << "Blocked RO Channels (Wh " << wheel << ")";
112  wheelHitos[wheel] = ibooker.book2D(namestream.str().c_str(),titlestream.str().c_str(),12,1,13,4,1,5);
113  wheelHitos[wheel]->setAxisTitle("Sector",1);
114  wheelHitos[wheel]->setBinLabel(1,"MB1",2);
115  wheelHitos[wheel]->setBinLabel(2,"MB2",2);
116  wheelHitos[wheel]->setBinLabel(3,"MB3",2);
117  wheelHitos[wheel]->setBinLabel(4,"MB4",2);
118  }
119 
120  if(!offlineMode) {
121  hSystFractionVsLS = new DTTimeEvolutionHisto(ibooker, "EnabledROChannelsVsLS", "% RO channels",
122  500, 5, true, 3);
123  }
124  } // end attempt to make these bookings only once!
125 
126 
127  //FR moved here from beginRun
128 
129  if (chamberMap.size() == 0) fillChamberMap(igetter, context);
130 
131  //FR moved here from beginLuminosityBlock
132  run = lumiSeg.run();
133 
134  //FR moved here from endLuminosityBlock
135  // counts number of lumiSegs
136  nLumiSegs = lumiSeg.id().luminosityBlock();
137 
138  // prescale factor
139  if (nLumiSegs%prescaleFactor != 0 || offlineMode) return;
140 
141  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
142  <<"[DTBlockedROChannelsTest]: End of LS " << nLumiSegs << ". Client called in online mode, performing client operations";
143 
144  performClientDiagnostic(igetter);
145 
146  // counts number of updats
147  nupdates++;
148 
149 }
DTTimeEvolutionHisto * hSystFractionVsLS
void performClientDiagnostic(DQMStore::IGetter &igetter)
DQM Client operations.
std::map< DTChamberId, DTRobBinsMap > chamberMap
void fillChamberMap(DQMStore::IGetter &igetter, const edm::EventSetup &c)
std::map< int, MonitorElement * > wheelHitos
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DTBlockedROChannelsTest::fillChamberMap ( DQMStore::IGetter igetter,
const edm::EventSetup c 
)
protected

Definition at line 58 of file DTBlockedROChannelsTest.cc.

References chamberMap, edm::EventSetup::get(), LogTrace, mapping, FEDNumbering::MINDTFEDID, DTReadOutMapping::readOutToGeometry(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndLuminosityBlock().

58  {
59  // get the RO mapping
60  context.get<DTReadOutMappingRcd>().get(mapping);
61 
62  // fill the map of the robs per chamber
63  // //FIXME: monitoring only real used FEDs
64  for(int dduId = FEDNumbering::MINDTFEDID; dduId<=774; ++dduId) { //loop over DDUs
65  for(int ros = 1; ros != 13; ++ros) { // loop over ROSs
66  for(int rob = 1; rob != 26; ++rob) { // loop over ROBs
67  int wheel = 0;
68  int station = 0;
69  int sector = 0;
70  int dummy = 0;
71  if(!mapping->readOutToGeometry(dduId,ros,rob-1,0,2,wheel,station,sector,dummy,dummy,dummy) ||
72  !mapping->readOutToGeometry(dduId,ros,rob-1,0,16,wheel,station,sector,dummy,dummy,dummy)) {
73  DTChamberId chId(wheel, station, sector);
74  if(chamberMap.find(chId) == chamberMap.end()) {
75  chamberMap[chId] = DTRobBinsMap(igetter, dduId, ros);
76  chamberMap[chId].addRobBin(rob);
77  }
78  chamberMap[chId].addRobBin(rob);
79  } else {
80  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
81  << "[DTRobBinsMap] FED: " << dduId << " ROS " << ros << " ROB: " << rob-1
82  << " not in the mapping!" << endl;
83  }
84  }
85  }
86  }
87  // loop over all chambers and remove the init flag
88  for(map<DTChamberId, DTRobBinsMap>::iterator chAndRobs = chamberMap.begin();
89  chAndRobs != chamberMap.end(); ++chAndRobs) {
90  chAndRobs->second.init(false);
91  }
92 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
std::map< DTChamberId, DTRobBinsMap > chamberMap
edm::ESHandle< DTReadOutMapping > mapping
#define LogTrace(id)
void DTBlockedROChannelsTest::performClientDiagnostic ( DQMStore::IGetter igetter)
protected

DQM Client operations.

Definition at line 160 of file DTBlockedROChannelsTest.cc.

References DTTimeEvolutionHisto::accumulateValueTimeSlot(), chamberMap, MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getIntValue(), hSystFractionVsLS, nevents, neventsPrev, nLumiSegs, offlineMode, prevTotalPerc, MonitorElement::Reset(), Scenarios_cff::scale, DTChamberId::sector(), DTChamberId::station(), summaryHisto, DTTimeEvolutionHisto::updateTimeSlot(), DTChamberId::wheel(), makeMuonMisalignmentScenario::wheel, and wheelHitos.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

160  {
161 
162  //FR: I've commented the if below. Either in online mode or in offline mode, when the diagnostic is called
163  // compute first the number of events. It will be: event/lumisection in the online case, it will be: total number
164  // of events (neventsPrev=0) in the offline case, when the diagnostic is called only once from the dqmEndJob
165 
166  //if(nevents == 0) { // hack to work also in offline DQM
167  MonitorElement *procEvt = igetter.get("DT/EventInfo/processedEvents");
168  if(procEvt != 0) {
169  int procEvents = procEvt->getIntValue();
170  nevents = procEvents - neventsPrev;
171  neventsPrev = procEvents;
172  }
173  //}
174 
175  double totalPerc = prevTotalPerc;
176  // check again!
177  if(nevents != 0) { // skip the computation if no events in the last LS
178 
179  // reset the histos
180  summaryHisto->Reset();
181  for(int wheel = -2; wheel != 3; ++wheel) {
182  wheelHitos[wheel]->Reset();
183  }
184 
185  totalPerc = 0.;
186 
187  // loop over all chambers and fill the wheel plots
188  for(map<DTChamberId, DTRobBinsMap>::iterator chAndRobs = chamberMap.begin();
189  chAndRobs != chamberMap.end(); ++chAndRobs) {
190  DTChamberId chId = (*chAndRobs).first;
191  double scale = 1.;
192  int sectorForPlot = chId.sector();
193  if(sectorForPlot == 13 || (sectorForPlot == 4 && chId.station() ==4)) {
194  sectorForPlot = 4;
195  scale = 0.5;
196  } else if(sectorForPlot == 14 || (sectorForPlot == 10 && chId.station() ==4)) {
197  sectorForPlot = 10;
198  scale = 0.5;
199  }
200 
201  // NOTE: can be called only ONCE per event per each chamber
202  double chPercent = (*chAndRobs).second.getChamberPercentage(igetter);
203  wheelHitos[chId.wheel()]->Fill(sectorForPlot, chId.station(),
204  scale*chPercent);
205  totalPerc += chPercent*scale*1./240.; // CB has to be 240 as double stations are taken into account by scale factor
206 
207  // Fill the summary
208  summaryHisto->Fill(sectorForPlot, chId.wheel(), 0.25*scale*chPercent);
209  }
210  }
211 
212  if(!offlineMode) { // fill trend histo only in online
215  prevTotalPerc = totalPerc;
216  }
217 
218 }
DTTimeEvolutionHisto * hSystFractionVsLS
void accumulateValueTimeSlot(float value)
std::map< DTChamberId, DTRobBinsMap > chamberMap
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
void Fill(long long x)
std::map< int, MonitorElement * > wheelHitos
int64_t getIntValue(void) const
void updateTimeSlot(int ls, int nEventsInLS)
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void Reset(void)
reset ME (ie. contents, errors, etc)
int DTBlockedROChannelsTest::readOutToGeometry ( int  dduId,
int  rosNumber,
int &  wheel,
int &  sector 
)
private

Definition at line 220 of file DTBlockedROChannelsTest.cc.

References mapping, and DTReadOutMapping::readOutToGeometry().

220  {
221 
222  int dummy;
223  return mapping->readOutToGeometry(dduId,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy);
224 
225 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
edm::ESHandle< DTReadOutMapping > mapping

Member Data Documentation

std::map<DTChamberId, DTRobBinsMap> DTBlockedROChannelsTest::chamberMap
private
DTTimeEvolutionHisto* DTBlockedROChannelsTest::hSystFractionVsLS
private

Definition at line 77 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().

edm::ESHandle<DTReadOutMapping> DTBlockedROChannelsTest::mapping
private

Definition at line 69 of file DTBlockedROChannelsTest.h.

Referenced by fillChamberMap(), and readOutToGeometry().

int DTBlockedROChannelsTest::nevents
private

Definition at line 61 of file DTBlockedROChannelsTest.h.

Referenced by performClientDiagnostic().

int DTBlockedROChannelsTest::neventsPrev
private

Definition at line 62 of file DTBlockedROChannelsTest.h.

Referenced by performClientDiagnostic().

unsigned int DTBlockedROChannelsTest::nLumiSegs
private

Definition at line 63 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().

int DTBlockedROChannelsTest::nupdates
private
bool DTBlockedROChannelsTest::offlineMode
private
int DTBlockedROChannelsTest::prescaleFactor
private

Definition at line 59 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and DTBlockedROChannelsTest().

unsigned int DTBlockedROChannelsTest::prevNLumiSegs
private

Definition at line 64 of file DTBlockedROChannelsTest.h.

double DTBlockedROChannelsTest::prevTotalPerc
private

Definition at line 65 of file DTBlockedROChannelsTest.h.

Referenced by performClientDiagnostic().

std::map<int, double> DTBlockedROChannelsTest::resultsPerLumi
private

Definition at line 76 of file DTBlockedROChannelsTest.h.

int DTBlockedROChannelsTest::run
private
MonitorElement* DTBlockedROChannelsTest::summaryHisto
private

Definition at line 74 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().

std::map<int, MonitorElement*> DTBlockedROChannelsTest::wheelHitos
private

Definition at line 73 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().