CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Classes

class  DTRobBinsMap
 

Public Member Functions

 DTBlockedROChannelsTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTBlockedROChannelsTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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,
DTRobBinsMap
chamberMap
 
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::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
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 
)
protectedvirtual

BeginRun.

Reimplemented from DQMEDHarvester.

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 150 of file DTBlockedROChannelsTest.cc.

References LogTrace, offlineMode, and performClientDiagnostic().

150  {
151 
152  if (offlineMode) {
153  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
154  <<"[DTBlockedROChannelsTest] endRun called. Client called in offline mode, performing operations.";
155  performClientDiagnostic(igetter);
156  }
157 }
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 94 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, and wheelHitos.

95  {
96 
97  //FR moved the following from beginJob!
98 
99  // book the summary histogram
100 
101  if (wheelHitos.size()==0) { // this is an attempt to make these bookings only once!
102 
103  ibooker.setCurrentFolder("DT/00-ROChannels");
104  summaryHisto = ibooker.book2D("ROChannelSummary","Summary Blocked RO Channels",12,1,13,5,-2,3);
105  summaryHisto->setAxisTitle("Sector",1);
106  summaryHisto->setAxisTitle("Wheel",2);
107 
108  for(int wheel = -2; wheel != 3; ++wheel) {
109  stringstream namestream; namestream << "ROChannelSummary_W" << wheel;
110  stringstream titlestream; titlestream << "Blocked RO Channels (Wh " << wheel << ")";
111  wheelHitos[wheel] = ibooker.book2D(namestream.str().c_str(),titlestream.str().c_str(),12,1,13,4,1,5);
112  wheelHitos[wheel]->setAxisTitle("Sector",1);
113  wheelHitos[wheel]->setBinLabel(1,"MB1",2);
114  wheelHitos[wheel]->setBinLabel(2,"MB2",2);
115  wheelHitos[wheel]->setBinLabel(3,"MB3",2);
116  wheelHitos[wheel]->setBinLabel(4,"MB4",2);
117  }
118 
119  if(!offlineMode) {
120  hSystFractionVsLS = new DTTimeEvolutionHisto(ibooker, "EnabledROChannelsVsLS", "% RO channels",
121  500, 5, true, 3);
122  }
123  } // end attempt to make these bookings only once!
124 
125 
126  //FR moved here from beginRun
127 
128  if (chamberMap.size() == 0) fillChamberMap(igetter, context);
129 
130  //FR moved here from beginLuminosityBlock
131  run = lumiSeg.run();
132 
133  //FR moved here from endLuminosityBlock
134  // counts number of lumiSegs
135  nLumiSegs = lumiSeg.id().luminosityBlock();
136 
137  // prescale factor
138  if (nLumiSegs%prescaleFactor != 0 || offlineMode) return;
139 
140  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
141  <<"[DTBlockedROChannelsTest]: End of LS " << nLumiSegs << ". Client called in online mode, performing client operations";
142 
143  performClientDiagnostic(igetter);
144 
145  // counts number of updats
146  nupdates++;
147 
148 }
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:276
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::MAXDTFEDID, FEDNumbering::MINDTFEDID, and relativeConstraints::station.

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  for(int dduId = FEDNumbering::MINDTFEDID; dduId<=FEDNumbering::MAXDTFEDID; ++dduId) { //loop over DDUs
64  for(int ros = 1; ros != 13; ++ros) { // loop over ROSs
65  for(int rob = 1; rob != 26; ++rob) { // loop over ROBs
66  int wheel = 0;
67  int station = 0;
68  int sector = 0;
69  int dummy = 0;
70  if(!mapping->readOutToGeometry(dduId,ros,rob-1,0,2,wheel,station,sector,dummy,dummy,dummy) ||
71  !mapping->readOutToGeometry(dduId,ros,rob-1,0,16,wheel,station,sector,dummy,dummy,dummy)) {
72  DTChamberId chId(wheel, station, sector);
73  if(chamberMap.find(chId) == chamberMap.end()) {
74  chamberMap[chId] = DTRobBinsMap(igetter, dduId, ros);
75  chamberMap[chId].addRobBin(rob);
76  }
77  chamberMap[chId].addRobBin(rob);
78  } else {
79  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
80  << "[DTRobBinsMap] FED: " << dduId << " ROS " << ros << " ROB: " << rob-1
81  << " not in the mapping!" << endl;
82  }
83  }
84  }
85  }
86  // loop over all chambers and remove the init flag
87  for(map<DTChamberId, DTRobBinsMap>::iterator chAndRobs = chamberMap.begin();
88  chAndRobs != chamberMap.end(); ++chAndRobs) {
89  chAndRobs->second.init(false);
90  }
91 }
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 159 of file DTBlockedROChannelsTest.cc.

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

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

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

References mapping.

219  {
220 
221  int dummy;
222  return mapping->readOutToGeometry(dduId,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy);
223 
224 }
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().