CMS 3D CMS Logo

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

#include <DTDAQInfo.h>

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

Public Member Functions

 DTDAQInfo (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTDAQInfo () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
 ~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
 
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
 
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 dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 Attributes

bool bookingdone
 
bool checkUros
 
std::map< int, MonitorElement * > daqFractions
 
MonitorElementdaqMap
 
edm::ESHandle< DTReadOutMappingmapping
 
MonitorElementtotalDAQFraction
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

No description available.

Author
G. Cerminara - INFN Torino

threadsafe version (//-) oct/nov 2014 - WATWanAbdullah ncpp-um-my

Definition at line 25 of file DTDAQInfo.h.

Constructor & Destructor Documentation

DTDAQInfo::DTDAQInfo ( const edm::ParameterSet pset)

Constructor.

Definition at line 38 of file DTDAQInfo.cc.

References edm::ParameterSet::getUntrackedParameter().

38  {
39 
40  bookingdone = false;
41  checkUros = pset.getUntrackedParameter<bool>("checkUros",true);
42 }
T getUntrackedParameter(std::string const &, T const &) const
bool checkUros
Definition: DTDAQInfo.h:45
bool bookingdone
Definition: DTDAQInfo.h:42
DTDAQInfo::~DTDAQInfo ( )
override

Destructor.

Definition at line 44 of file DTDAQInfo.cc.

44 {}

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 134 of file DTDAQInfo.cc.

134 {}
void DTDAQInfo::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  setup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 46 of file DTDAQInfo.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), MonitorElement::Fill(), edm::EventSetup::get(), LogTrace, RunInfo::m_fed_in, taus_updatedMVAIds_cff::mapping, FEDNumbering::MAXDTFEDID, FEDNumbering::MINDTFEDID, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), edm::EventSetup::tryToGet(), and makeMuonMisalignmentScenario::wheel.

47  {
48 
49  if (!bookingdone) {
50  // retrieve the mapping
51  setup.get<DTReadOutMappingRcd>().get(mapping);
52 
53  // book the ME
54  // global fraction
55 
56  ibooker.setCurrentFolder("DT/EventInfo");
57 
58  totalDAQFraction = ibooker.bookFloat("DAQSummary");
60 
61  // map
62  daqMap = ibooker.book2D("DAQSummaryMap","DT Certification Summary Map",12,1,13,5,-2,3);
63  daqMap->setAxisTitle("sector",1);
64  daqMap->setAxisTitle("wheel",2);
65 
66  // Wheel "fractions" -> will be 0 or 1
67 
68  ibooker.setCurrentFolder("DT/EventInfo/DAQContents");
69  for(int wheel = -2; wheel != 3; ++wheel) {
70  stringstream streams;
71  streams << "DT_Wheel" << wheel;
72 
73  daqFractions[wheel] = ibooker.bookFloat(streams.str());
74  daqFractions[wheel]->Fill(-1);
75  }
76  bookingdone = true;
77  } //booking done
78 
79  if(auto runInfoRec = setup.tryToGet<RunInfoRcd>()) {
80  // reset to 0
82  daqFractions[-2]->Fill(0.);
83  daqFractions[-1]->Fill(0.);
84  daqFractions[-0]->Fill(0.);
85  daqFractions[1]->Fill(0.);
86  daqFractions[2]->Fill(0.);
87 
88 
89  daqMap->Reset();
90  //get fed summary information
91  ESHandle<RunInfo> sumFED;
92  runInfoRec->get(sumFED);
93  vector<int> fedInIDs = sumFED->m_fed_in;
94 
95  // the range of DT feds
96  static const int FEDIDmin = FEDNumbering::MINDTFEDID;
97  static const int FEDIDMax = FEDNumbering::MAXDTFEDID;
98 
99  //FIXME for uROS FEDIDs once mapping has been defined
100  if (checkUros) { LogTrace("DQM|DTMonitorClient|DTDAQInfo")
101  << "Checking uROS FEDs as Legacy FEDs"<< endl;}
102 
103  // loop on all active feds
104  for(vector<int>::const_iterator fed = fedInIDs.begin();
105  fed != fedInIDs.end();
106  ++fed) {
107  // check if the fed is in the DT range
108  if(!(*fed >= FEDIDmin && *fed <= FEDIDMax)) continue;
109 
110  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
111  int wheel = -99;
112  int sector = -99;
113  int dummy = -99;
114  for(int ros = 1; ros != 13; ++ros) {
115  if(!mapping->readOutToGeometry(*fed,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy)) {
116  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
117  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
118  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1./12.);
120  daqMap->Fill(sector,wheel);
121  }
122  }
123  }
124  } else {
125  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
126  totalDAQFraction->Fill(-1);
127  for(int wheel = -2; wheel != 3; ++wheel) {
128  daqFractions[wheel]->Fill(-1);
129  }
130  return;
131  }
132 }
std::map< int, MonitorElement * > daqFractions
Definition: DTDAQInfo.h:49
double getFloatValue() const
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
bool checkUros
Definition: DTDAQInfo.h:45
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
void Fill(long long x)
edm::ESHandle< DTReadOutMapping > mapping
Definition: DTDAQInfo.h:50
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::vector< int > m_fed_in
Definition: RunInfo.h:26
MonitorElement * daqMap
Definition: DTDAQInfo.h:48
void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * totalDAQFraction
Definition: DTDAQInfo.h:47
#define LogTrace(id)
bool bookingdone
Definition: DTDAQInfo.h:42
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

bool DTDAQInfo::bookingdone
private

Definition at line 42 of file DTDAQInfo.h.

bool DTDAQInfo::checkUros
private

Definition at line 45 of file DTDAQInfo.h.

std::map<int, MonitorElement*> DTDAQInfo::daqFractions
private

Definition at line 49 of file DTDAQInfo.h.

MonitorElement* DTDAQInfo::daqMap
private

Definition at line 48 of file DTDAQInfo.h.

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

Definition at line 50 of file DTDAQInfo.h.

MonitorElement* DTDAQInfo::totalDAQFraction
private

Definition at line 47 of file DTDAQInfo.h.