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::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  DTLinkBinsMap
 
class  DTRobBinsMap
 

Public Member Functions

 DTBlockedROChannelsTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTBlockedROChannelsTest () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 BeginRun. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 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::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Member Functions

int readOutToGeometry (int dduId, int rosNumber, int robNumber, int &wheel, int &station, int &sector)
 
int theDDU (int crate, int slot, int link, bool tenDDU)
 
int theROB (int slot, int link)
 
int theROS (int slot, int link)
 

Private Attributes

std::map< DTChamberId, DTRobBinsMapchamberMap
 
std::map< DTChamberId, DTLinkBinsMapchamberMapUros
 
bool checkUros
 
DTTimeEvolutionHistohSystFractionVsLS
 
const DTReadOutMappingmapping
 
edm::ESGetToken< DTReadOutMapping, DTReadOutMappingRcdmappingToken_
 
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 * > wheelHistos
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
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)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 24 of file DTBlockedROChannelsTest.h.

Constructor & Destructor Documentation

◆ DTBlockedROChannelsTest()

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

Constructor.

Definition at line 23 of file DTBlockedROChannelsTest.cc.

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

24  : nevents(0),
25  neventsPrev(0),
26  prevNLumiSegs(0),
27  prevTotalPerc(0),
28  mappingToken_(esConsumes<edm::Transition::BeginRun>()),
29  hSystFractionVsLS(nullptr) {
30  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest") << "[DTBlockedROChannelsTest]: Constructor";
31 
32  // prescale on the # of LS to update the test
33  prescaleFactor = ps.getUntrackedParameter<int>("diagnosticPrescale", 1);
34 
35  offlineMode = ps.getUntrackedParameter<bool>("offlineMode", true);
36 
37  checkUros = ps.getUntrackedParameter<bool>("checkUros", true);
38 }
DTTimeEvolutionHisto * hSystFractionVsLS
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< DTReadOutMapping, DTReadOutMappingRcd > mappingToken_

◆ ~DTBlockedROChannelsTest()

DTBlockedROChannelsTest::~DTBlockedROChannelsTest ( )
override

Destructor.

Definition at line 40 of file DTBlockedROChannelsTest.cc.

References LogTrace, and nupdates.

40  {
41  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
42  << "DataIntegrityTest: analyzed " << nupdates << " updates";
43 }
#define LogTrace(id)

Member Function Documentation

◆ beginRun()

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

BeginRun.

Definition at line 45 of file DTBlockedROChannelsTest.cc.

References mapping, mappingToken_, nupdates, and singleTopDQM_cfi::setup.

45  {
46  // get the RO mapping
47  mapping = &setup.getData(mappingToken_);
48  nupdates = 0;
49  return;
50 }
edm::ESGetToken< DTReadOutMapping, DTReadOutMappingRcd > mappingToken_
const DTReadOutMapping * mapping

◆ dqmEndJob()

void DTBlockedROChannelsTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 192 of file DTBlockedROChannelsTest.cc.

References LogTrace, offlineMode, and performClientDiagnostic().

192  {
193  if (offlineMode) {
194  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
195  << "[DTBlockedROChannelsTest] endRun called. Client called in offline mode, performing operations.";
196  performClientDiagnostic(igetter);
197  }
198 }
void performClientDiagnostic(DQMStore::IGetter &igetter)
DQM Client operations.
#define LogTrace(id)

◆ dqmEndLuminosityBlock()

void DTBlockedROChannelsTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

DQM Client Diagnostic in online mode.

Reimplemented from DQMEDHarvester.

Definition at line 128 of file DTBlockedROChannelsTest.cc.

References dqm::implementation::IBooker::book2D(), chamberMap, chamberMapUros, checkUros, visDQMUpload::context, fillChamberMap(), hSystFractionVsLS, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), nLumiSegs, nupdates, offlineMode, performClientDiagnostic(), prescaleFactor, edm::LuminosityBlockBase::run(), run, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), summaryHisto, makeMuonMisalignmentScenario::wheel, and wheelHistos.

131  {
132  //FR moved the following from beginJob!
133 
134  // book the summary histogram
135 
136  if (wheelHistos.empty()) { // this is an attempt to make these bookings only once!
137 
138  ibooker.setCurrentFolder("DT/00-ROChannels");
139  summaryHisto = ibooker.book2D("ROChannelSummary", "Summary Blocked RO Channels", 12, 1, 13, 5, -2, 3);
140  summaryHisto->setAxisTitle("Sector", 1);
141  summaryHisto->setAxisTitle("Wheel", 2);
142 
143  for (int wheel = -2; wheel != 3; ++wheel) {
144  stringstream namestream;
145  namestream << "ROChannelSummary_W" << wheel;
146  stringstream titlestream;
147  titlestream << "Blocked RO Channels (Wh " << wheel << ")";
148  wheelHistos[wheel] = ibooker.book2D(namestream.str().c_str(), titlestream.str().c_str(), 12, 1, 13, 4, 1, 5);
149  wheelHistos[wheel]->setAxisTitle("Sector", 1);
150  wheelHistos[wheel]->setBinLabel(1, "MB1", 2);
151  wheelHistos[wheel]->setBinLabel(2, "MB2", 2);
152  wheelHistos[wheel]->setBinLabel(3, "MB3", 2);
153  wheelHistos[wheel]->setBinLabel(4, "MB4", 2);
154  }
155 
156  if (!offlineMode) {
157  hSystFractionVsLS = new DTTimeEvolutionHisto(ibooker, "EnabledROChannelsVsLS", "% RO channels", 500, 5, true, 3);
158  }
159  } // end attempt to make these bookings only once!
160 
161  //FR moved here from beginRun
162 
163  if (checkUros) {
164  if (chamberMapUros.empty())
165  fillChamberMap(igetter, context);
166  } else {
167  if (chamberMap.empty())
168  fillChamberMap(igetter, context);
169  }
170 
171  //FR moved here from beginLuminosityBlock
172  run = lumiSeg.run();
173 
174  //FR moved here from endLuminosityBlock
175  // counts number of lumiSegs
176  nLumiSegs = lumiSeg.id().luminosityBlock();
177 
178  // prescale factor
179  if (nLumiSegs % prescaleFactor != 0 || offlineMode)
180  return;
181 
182  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
183  << "[DTBlockedROChannelsTest]: End of LS " << nLumiSegs
184  << ". Client called in online mode, performing client operations";
185 
186  performClientDiagnostic(igetter);
187 
188  // counts number of updats
189  nupdates++;
190 }
DTTimeEvolutionHisto * hSystFractionVsLS
std::map< DTChamberId, DTLinkBinsMap > chamberMapUros
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< int, MonitorElement * > wheelHistos
void performClientDiagnostic(DQMStore::IGetter &igetter)
DQM Client operations.
std::map< DTChamberId, DTRobBinsMap > chamberMap
void fillChamberMap(DQMStore::IGetter &igetter, const edm::EventSetup &c)
#define LogTrace(id)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ fillChamberMap()

void DTBlockedROChannelsTest::fillChamberMap ( DQMStore::IGetter igetter,
const edm::EventSetup c 
)
protected

Definition at line 52 of file DTBlockedROChannelsTest.cc.

References chamberMap, chamberMapUros, checkUros, MainPageGenerator::link, LogTrace, mapping, FEDNumbering::MAXDTFEDID, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTFEDID, FEDNumbering::MINDTUROSFEDID, readOutToGeometry(), DTReadOutMapping::readOutToGeometry(), hgcalTBTopologyTester_cfi::sector, relativeConstraints::station, theDDU(), theROB(), theROS(), and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndLuminosityBlock().

52  {
53  int dummy = 0;
54  bool tenDDU = !mapping->readOutToGeometry(779, 7, 1, 1, 1, dummy, dummy, dummy, dummy, dummy, dummy);
55 
56  if (checkUros) {
57  for (int crate = FEDNumbering::MINDTUROSFEDID; crate <= FEDNumbering::MAXDTUROSFEDID; ++crate) { //loop over FEDs
58  for (int mapSlot = 1; mapSlot != 13; ++mapSlot) { //loop over mapSlot
59  for (int link = 0; link != 72; ++link) { //loop over links
60  //skip non existing links
61  if (mapSlot == 6)
62  continue;
63  if (crate == 1370 && mapSlot > 5)
64  continue;
65  if ((mapSlot == 5 || mapSlot == 11) && link > 11)
66  continue;
67 
68  int wheel = 0;
69  int station = 0;
70  int sector = 0;
71 
72  int dduId = theDDU(crate, mapSlot, link, tenDDU);
73  int ros = theROS(mapSlot, link);
74  int rob = theROB(mapSlot, link);
75 
76  // mapping->readOutToGeometry(dduId,ros,rob,2,2,wheel,station,sector,dummy,dummy,dummy);
77  readOutToGeometry(dduId, ros, rob, wheel, station, sector);
78  if (station > 0) {
79  //std::cout<<" FED "<<crate<<" mapSlot "<< mapSlot<<" Link "<<link<<" Wh "<<wheel<<" station "<<station<<" sector "<<sector <<endl;
81  if (chamberMapUros.find(chId) == chamberMapUros.end()) {
82  chamberMapUros[chId] = DTLinkBinsMap(igetter, dduId, ros);
83  chamberMapUros[chId].addLinkBin(link % 24);
84  }
85  chamberMapUros[chId].addLinkBin(link % 24);
86  } else {
87  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
88  << "[DTLinkBinsMap] FED: " << crate << "mapSlot: " << mapSlot << " Link: " << link
89  << " not in the mapping!" << endl;
90  }
91  } //loop on links
92  } //loop on mapSlots
93  } //loop on crates
94  } //checkUros
95  else {
96  // fill the map of the robs per chamber
97  // //FIXME: monitoring only real used FEDs
98  for (int dduId = FEDNumbering::MINDTFEDID; dduId <= FEDNumbering::MAXDTFEDID; ++dduId) { //loop over DDUs
99  for (int ros = 1; ros != 13; ++ros) { // loop over ROSs
100  for (int rob = 1; rob != 26; ++rob) { // loop over ROBs
101  int wheel = 0;
102  int station = 0;
103  int sector = 0;
104  if (!mapping->readOutToGeometry(dduId, ros, rob - 1, 0, 2, wheel, station, sector, dummy, dummy, dummy) ||
105  !mapping->readOutToGeometry(dduId, ros, rob - 1, 0, 16, wheel, station, sector, dummy, dummy, dummy)) {
107  if (chamberMap.find(chId) == chamberMap.end()) {
108  chamberMap[chId] = DTRobBinsMap(igetter, dduId, ros);
109  chamberMap[chId].addRobBin(rob);
110  }
111  chamberMap[chId].addRobBin(rob);
112  } else {
113  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
114  << "[DTRobBinsMap] FED: " << dduId << " ROS " << ros << " ROB: " << rob - 1 << " not in the mapping!"
115  << endl;
116  }
117  }
118  }
119  }
120  // loop over all chambers and remove the init flag
121  for (map<DTChamberId, DTRobBinsMap>::iterator chAndRobs = chamberMap.begin(); chAndRobs != chamberMap.end();
122  ++chAndRobs) {
123  chAndRobs->second.init(false);
124  }
125  } //Legacy
126 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
int theROB(int slot, int link)
std::map< DTChamberId, DTLinkBinsMap > chamberMapUros
std::map< DTChamberId, DTRobBinsMap > chamberMap
int theROS(int slot, int link)
#define LogTrace(id)
const DTReadOutMapping * mapping
int theDDU(int crate, int slot, int link, bool tenDDU)
int readOutToGeometry(int dduId, int rosNumber, int robNumber, int &wheel, int &station, int &sector)

◆ performClientDiagnostic()

void DTBlockedROChannelsTest::performClientDiagnostic ( DQMStore::IGetter igetter)
protected

DQM Client operations.

Definition at line 200 of file DTBlockedROChannelsTest.cc.

References DTTimeEvolutionHisto::accumulateValueTimeSlot(), chamberMap, chamberMapUros, checkUros, dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getIntValue(), hSystFractionVsLS, nevents, neventsPrev, nLumiSegs, offlineMode, prevTotalPerc, dqm::impl::MonitorElement::Reset(), L1EGammaClusterEmuProducer_cfi::scale, DTChamberId::sector(), DTChamberId::station(), summaryHisto, DTTimeEvolutionHisto::updateTimeSlot(), DTChamberId::wheel(), makeMuonMisalignmentScenario::wheel, and wheelHistos.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

200  {
201  //FR: I've commented the if below. Either in online mode or in offline mode, when the diagnostic is called
202  // compute first the number of events. It will be: event/lumisection in the online case, it will be: total number
203  // of events (neventsPrev=0) in the offline case, when the diagnostic is called only once from the dqmEndJob
204 
205  //if(nevents == 0) { // hack to work also in offline DQM
206  MonitorElement* procEvt = igetter.get("DT/EventInfo/processedEvents");
207  if (procEvt != nullptr) {
208  int procEvents = procEvt->getIntValue();
209  nevents = procEvents - neventsPrev;
210  neventsPrev = procEvents;
211  }
212  //}
213 
214  double totalPerc = prevTotalPerc;
215  // check again!
216  if (nevents != 0) { // skip the computation if no events in the last LS
217 
218  // reset the histos
219  summaryHisto->Reset();
220  for (int wheel = -2; wheel != 3; ++wheel) {
221  wheelHistos[wheel]->Reset();
222  }
223 
224  totalPerc = 0.;
225 
226  if (checkUros) {
227  // loop over all chambers and fill the wheel plots
228  for (map<DTChamberId, DTLinkBinsMap>::iterator chAndLinks = chamberMapUros.begin();
229  chAndLinks != chamberMapUros.end();
230  ++chAndLinks) {
231  DTChamberId chId = (*chAndLinks).first;
232  double scale = 1.;
233  int sectorForPlot = chId.sector();
234  if (sectorForPlot == 13 || (sectorForPlot == 4 && chId.station() == 4)) {
235  sectorForPlot = 4;
236  scale = 0.5;
237  } else if (sectorForPlot == 14 || (sectorForPlot == 10 && chId.station() == 4)) {
238  sectorForPlot = 10;
239  scale = 0.5;
240  }
241 
242  // NOTE: can be called only ONCE per event per each chamber
243  double chPercent = (*chAndLinks).second.getChamberPercentage(igetter);
244  wheelHistos[chId.wheel()]->Fill(sectorForPlot, chId.station(), scale * chPercent);
245  totalPerc += chPercent * scale * 1. /
246  240.; // CB has to be 240 as double stations are taken into account by scale factor
247 
248  // Fill the summary
249  summaryHisto->Fill(sectorForPlot, chId.wheel(), 0.25 * scale * chPercent);
250  }
251  } //Uros case
252  else { //Legacy case
253  // loop over all chambers and fill the wheel plots
254  for (map<DTChamberId, DTRobBinsMap>::iterator chAndRobs = chamberMap.begin(); chAndRobs != chamberMap.end();
255  ++chAndRobs) {
256  DTChamberId chId = (*chAndRobs).first;
257  double scale = 1.;
258  int sectorForPlot = chId.sector();
259  if (sectorForPlot == 13 || (sectorForPlot == 4 && chId.station() == 4)) {
260  sectorForPlot = 4;
261  scale = 0.5;
262  } else if (sectorForPlot == 14 || (sectorForPlot == 10 && chId.station() == 4)) {
263  sectorForPlot = 10;
264  scale = 0.5;
265  }
266 
267  // NOTE: can be called only ONCE per event per each chamber
268  double chPercent = (*chAndRobs).second.getChamberPercentage(igetter);
269  wheelHistos[chId.wheel()]->Fill(sectorForPlot, chId.station(), scale * chPercent);
270  totalPerc += chPercent * scale * 1. /
271  240.; // CB has to be 240 as double stations are taken into account by scale factor
272 
273  // Fill the summary
274  summaryHisto->Fill(sectorForPlot, chId.wheel(), 0.25 * scale * chPercent);
275  }
276  } //Legacy case
277  } //nevents != 0
278 
279  if (!offlineMode) { // fill trend histo only in online
282  prevTotalPerc = totalPerc;
283  }
284 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
DTTimeEvolutionHisto * hSystFractionVsLS
void accumulateValueTimeSlot(float value)
std::map< DTChamberId, DTLinkBinsMap > chamberMapUros
std::map< int, MonitorElement * > wheelHistos
std::map< DTChamberId, DTRobBinsMap > chamberMap
void Fill(long long x)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void updateTimeSlot(int ls, int nEventsInLS)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:697
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
virtual int64_t getIntValue() const

◆ readOutToGeometry()

int DTBlockedROChannelsTest::readOutToGeometry ( int  dduId,
int  rosNumber,
int  robNumber,
int &  wheel,
int &  station,
int &  sector 
)
private

Definition at line 286 of file DTBlockedROChannelsTest.cc.

References mapping, DTReadOutMapping::readOutToGeometry(), hgcalTBTopologyTester_cfi::sector, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by fillChamberMap().

286  {
287  int dummy = 0;
288  return mapping->readOutToGeometry(dduId, ros, rob, 2, 2, wheel, station, sector, dummy, dummy, dummy);
289 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
const DTReadOutMapping * mapping

◆ theDDU()

int DTBlockedROChannelsTest::theDDU ( int  crate,
int  slot,
int  link,
bool  tenDDU 
)
private

Definition at line 448 of file DTBlockedROChannelsTest.cc.

References MainPageGenerator::link, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTUROSFEDID, and theROS().

Referenced by fillChamberMap().

448  {
449  int ros = theROS(slot, link);
450 
451  int ddu = 772;
452  //if (crate == 1368) { ddu = 775; }
453  //Needed just in case this FED should be used due to fibers lenght
454 
455  if (crate == FEDNumbering::MINDTUROSFEDID) {
456  if (slot < 7)
457  ddu = 770;
458  else
459  ddu = 771;
460  }
461 
462  if (crate == (FEDNumbering::MINDTUROSFEDID + 1)) {
463  ddu = 772;
464  }
465 
466  if (crate == FEDNumbering::MAXDTUROSFEDID) {
467  if (slot < 7)
468  ddu = 773;
469  else
470  ddu = 774;
471  }
472 
473  if (ros > 6 && tenDDU && ddu < 775)
474  ddu += 5;
475 
476  return ddu;
477 }
int theROS(int slot, int link)

◆ theROB()

int DTBlockedROChannelsTest::theROB ( int  slot,
int  link 
)
private

Definition at line 487 of file DTBlockedROChannelsTest.cc.

References MainPageGenerator::link.

Referenced by fillChamberMap().

487  {
488  if (slot % 6 == 5)
489  return 23;
490 
491  int rob = link % 24;
492  if (rob < 15)
493  return rob;
494  if (rob == 15)
495  return 24;
496  return rob - 1;
497 }

◆ theROS()

int DTBlockedROChannelsTest::theROS ( int  slot,
int  link 
)
private

Definition at line 479 of file DTBlockedROChannelsTest.cc.

References MainPageGenerator::link.

Referenced by fillChamberMap(), and theDDU().

479  {
480  if (slot % 6 == 5)
481  return link + 1;
482 
483  int ros = (link / 24) + 3 * (slot % 6) - 2;
484  return ros;
485 }

Member Data Documentation

◆ chamberMap

std::map<DTChamberId, DTRobBinsMap> DTBlockedROChannelsTest::chamberMap
private

◆ chamberMapUros

std::map<DTChamberId, DTLinkBinsMap> DTBlockedROChannelsTest::chamberMapUros
private

◆ checkUros

bool DTBlockedROChannelsTest::checkUros
private

◆ hSystFractionVsLS

DTTimeEvolutionHisto* DTBlockedROChannelsTest::hSystFractionVsLS
private

Definition at line 78 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().

◆ mapping

const DTReadOutMapping* DTBlockedROChannelsTest::mapping
private

◆ mappingToken_

edm::ESGetToken<DTReadOutMapping, DTReadOutMappingRcd> DTBlockedROChannelsTest::mappingToken_
private

Definition at line 70 of file DTBlockedROChannelsTest.h.

Referenced by beginRun().

◆ nevents

int DTBlockedROChannelsTest::nevents
private

Definition at line 62 of file DTBlockedROChannelsTest.h.

Referenced by performClientDiagnostic().

◆ neventsPrev

int DTBlockedROChannelsTest::neventsPrev
private

Definition at line 63 of file DTBlockedROChannelsTest.h.

Referenced by performClientDiagnostic().

◆ nLumiSegs

unsigned int DTBlockedROChannelsTest::nLumiSegs
private

Definition at line 64 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().

◆ nupdates

int DTBlockedROChannelsTest::nupdates
private

◆ offlineMode

bool DTBlockedROChannelsTest::offlineMode
private

◆ prescaleFactor

int DTBlockedROChannelsTest::prescaleFactor
private

Definition at line 59 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and DTBlockedROChannelsTest().

◆ prevNLumiSegs

unsigned int DTBlockedROChannelsTest::prevNLumiSegs
private

Definition at line 65 of file DTBlockedROChannelsTest.h.

◆ prevTotalPerc

double DTBlockedROChannelsTest::prevTotalPerc
private

Definition at line 66 of file DTBlockedROChannelsTest.h.

Referenced by performClientDiagnostic().

◆ resultsPerLumi

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

Definition at line 77 of file DTBlockedROChannelsTest.h.

◆ run

int DTBlockedROChannelsTest::run
private

◆ summaryHisto

MonitorElement* DTBlockedROChannelsTest::summaryHisto
private

Definition at line 75 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().

◆ wheelHistos

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

Definition at line 74 of file DTBlockedROChannelsTest.h.

Referenced by dqmEndLuminosityBlock(), and performClientDiagnostic().