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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 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 193 of file DTBlockedROChannelsTest.cc.

References LogTrace, offlineMode, and performClientDiagnostic().

193  {
194  if (offlineMode) {
195  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
196  << "[DTBlockedROChannelsTest] endRun called. Client called in offline mode, performing operations.";
197  performClientDiagnostic(igetter);
198  }
199 }
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) {
158  new DTTimeEvolutionHisto(ibooker, "EnabledROChannelsVsLS", "Fraction of RO channels", 500, 5, true, 3);
159  }
160  } // end attempt to make these bookings only once!
161 
162  //FR moved here from beginRun
163 
164  if (checkUros) {
165  if (chamberMapUros.empty())
166  fillChamberMap(igetter, context);
167  } else {
168  if (chamberMap.empty())
169  fillChamberMap(igetter, context);
170  }
171 
172  //FR moved here from beginLuminosityBlock
173  run = lumiSeg.run();
174 
175  //FR moved here from endLuminosityBlock
176  // counts number of lumiSegs
177  nLumiSegs = lumiSeg.id().luminosityBlock();
178 
179  // prescale factor
180  if (nLumiSegs % prescaleFactor != 0 || offlineMode)
181  return;
182 
183  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTBlockedROChannelsTest")
184  << "[DTBlockedROChannelsTest]: End of LS " << nLumiSegs
185  << ". Client called in online mode, performing client operations";
186 
187  performClientDiagnostic(igetter);
188 
189  // counts number of updats
190  nupdates++;
191 }
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:221
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, FCDTask_cfi::crate, LogTrace, mapping, FEDNumbering::MAXDTFEDID, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTFEDID, FEDNumbering::MINDTUROSFEDID, readOutToGeometry(), DTReadOutMapping::readOutToGeometry(), nano_mu_digi_cff::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 201 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(), l1tEGammaCrystalsEmulatorProducer_cfi::scale, DTChamberId::sector(), DTChamberId::station(), summaryHisto, DTTimeEvolutionHisto::updateTimeSlot(), DTChamberId::wheel(), makeMuonMisalignmentScenario::wheel, and wheelHistos.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

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

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

Referenced by fillChamberMap().

287  {
288  int dummy = 0;
289  return mapping->readOutToGeometry(dduId, ros, rob, 2, 2, wheel, station, sector, dummy, dummy, dummy);
290 }
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 449 of file DTBlockedROChannelsTest.cc.

References FCDTask_cfi::crate, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTUROSFEDID, FCDTask_cfi::slot, and theROS().

Referenced by fillChamberMap().

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

◆ theROB()

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

Definition at line 488 of file DTBlockedROChannelsTest.cc.

References FCDTask_cfi::slot.

Referenced by fillChamberMap().

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

◆ theROS()

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

Definition at line 480 of file DTBlockedROChannelsTest.cc.

References FCDTask_cfi::slot.

Referenced by fillChamberMap(), and theDDU().

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

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().