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

Public Member Functions

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

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
- 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 Attributes

bool bookingdone
 
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
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

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 39 of file DTDAQInfo.cc.

39  {
40 
41  bookingdone = 0;
42 
43 }
bool bookingdone
Definition: DTDAQInfo.h:42
DTDAQInfo::~DTDAQInfo ( )
virtual

Destructor.

Definition at line 45 of file DTDAQInfo.cc.

45 {}

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 194 of file DTDAQInfo.cc.

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

Reimplemented from DQMEDHarvester.

Definition at line 47 of file DTDAQInfo.cc.

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

48  {
49 
50  if (!bookingdone) {
51  // retrieve the mapping
52  setup.get<DTReadOutMappingRcd>().get(mapping);
53 
54  // book the ME
55  // global fraction
56 
57  ibooker.setCurrentFolder("DT/EventInfo");
58 
59  totalDAQFraction = ibooker.bookFloat("DAQSummary");
61 
62  // map
63  daqMap = ibooker.book2D("DAQSummaryMap","DT Certification Summary Map",12,1,13,5,-2,3);
64  daqMap->setAxisTitle("sector",1);
65  daqMap->setAxisTitle("wheel",2);
66 
67  // Wheel "fractions" -> will be 0 or 1
68 
69  ibooker.setCurrentFolder("DT/EventInfo/DAQContents");
70  for(int wheel = -2; wheel != 3; ++wheel) {
71  stringstream streams;
72  streams << "DT_Wheel" << wheel;
73 
74  daqFractions[wheel] = ibooker.bookFloat(streams.str());
75  daqFractions[wheel]->Fill(-1);
76  }
77 
78  //
79 
80  // create a record key for RunInfoRcd
82 
83  if(setup.find(recordKey) != 0) {
84 
85  //FR not sure that the lines below are still useful, we have just booked the histo!
86  // reset to 0
88  daqFractions[-2]->Fill(0.);
89  daqFractions[-1]->Fill(0.);
90  daqFractions[-0]->Fill(0.);
91  daqFractions[1]->Fill(0.);
92  daqFractions[2]->Fill(0.);
93 
94  daqMap->Reset();
95  //get fed summary information
96  ESHandle<RunInfo> sumFED;
97  setup.get<RunInfoRcd>().get(sumFED);
98  vector<int> fedInIDs = sumFED->m_fed_in;
99 
100  // the range of DT feds
101  const int FEDIDmin = FEDNumbering::MINDTFEDID;
102  const int FEDIDMax = 774; //FEDNumbering::MAXDTFEDID; Monitoring only real used FEDs
103 
104  // loop on all active feds
105  for(vector<int>::const_iterator fed = fedInIDs.begin();
106  fed != fedInIDs.end();
107  ++fed) {
108  // check if the fed is in the DT range
109  if(!(*fed >= FEDIDmin && *fed <= FEDIDMax)) continue;
110 
111  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
112  int wheel = -99;
113  int sector = -99;
114  int dummy = -99;
115 
116  for(int ros = 1; ros != 13; ++ros) {
117  if(!mapping->readOutToGeometry(*fed,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy)) {
118  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
119  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
120  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1./12.);
122  daqMap->Fill(sector,wheel);
123  }
124  }
125  }
126  } else {
127 
128  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
129  totalDAQFraction->Fill(-1);
130  for(int wheel = -2; wheel != 3; ++wheel) {
131  daqFractions[wheel]->Fill(-1);
132 
133  }
134  return;
135  }
136 
137  }
138  bookingdone = 1;
139 
140  // create a record key for RunInfoRcd
142 
143  if(setup.find(recordKey) != 0) {
144  // reset to 0
145  totalDAQFraction->Fill(0.);
146  daqFractions[-2]->Fill(0.);
147  daqFractions[-1]->Fill(0.);
148  daqFractions[-0]->Fill(0.);
149  daqFractions[1]->Fill(0.);
150  daqFractions[2]->Fill(0.);
151 
152 
153  daqMap->Reset();
154  //get fed summary information
155  ESHandle<RunInfo> sumFED;
156  setup.get<RunInfoRcd>().get(sumFED);
157  vector<int> fedInIDs = sumFED->m_fed_in;
158 
159  // the range of DT feds
160  static int FEDIDmin = FEDNumbering::MINDTFEDID;
161  static int FEDIDMax = FEDNumbering::MAXDTFEDID;
162 
163  // loop on all active feds
164  for(vector<int>::const_iterator fed = fedInIDs.begin();
165  fed != fedInIDs.end();
166  ++fed) {
167  // check if the fed is in the DT range
168  if(!(*fed >= FEDIDmin && *fed <= FEDIDMax)) continue;
169 
170  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
171  int wheel = -99;
172  int sector = -99;
173  int dummy = -99;
174  for(int ros = 1; ros != 13; ++ros) {
175  if(!mapping->readOutToGeometry(*fed,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy)) {
176  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
177  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
178  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1./12.);
180  daqMap->Fill(sector,wheel);
181  }
182  }
183  }
184  } else {
185  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
186  totalDAQFraction->Fill(-1);
187  for(int wheel = -2; wheel != 3; ++wheel) {
188  daqFractions[wheel]->Fill(-1);
189  }
190  return;
191  }
192 }
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:76
std::map< int, MonitorElement * > daqFractions
Definition: DTDAQInfo.h:46
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
void Fill(long long x)
edm::ESHandle< DTReadOutMapping > mapping
Definition: DTDAQInfo.h:47
std::vector< int > m_fed_in
Definition: RunInfo.h:26
MonitorElement * daqMap
Definition: DTDAQInfo.h:45
double getFloatValue(void) const
MonitorElement * totalDAQFraction
Definition: DTDAQInfo.h:44
#define LogTrace(id)
bool bookingdone
Definition: DTDAQInfo.h:42
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

bool DTDAQInfo::bookingdone
private

Definition at line 42 of file DTDAQInfo.h.

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

Definition at line 46 of file DTDAQInfo.h.

MonitorElement* DTDAQInfo::daqMap
private

Definition at line 45 of file DTDAQInfo.h.

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

Definition at line 47 of file DTDAQInfo.h.

MonitorElement* DTDAQInfo::totalDAQFraction
private

Definition at line 44 of file DTDAQInfo.h.