CMS 3D CMS Logo

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

Public Member Functions

 DTDAQInfo (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~DTDAQInfo ()
 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
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 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
 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 (const std::string &iProcessName, std::vector< const char * > &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 dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- 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

No description available.

Author
G. Cerminara - INFN Torino

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

Definition at line 26 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:43
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 198 of file DTDAQInfo.cc.

198 {}
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(), gather_cfg::cout, MonitorElement::Fill(), edm::EventSetup::find(), edm::typelookup::findType(), edm::EventSetup::get(), LogTrace, FEDNumbering::MAXDTFEDID, FEDNumbering::MINDTFEDID, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and hcal_dqm_sourceclient-file_cfg::streams.

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  cout << " totalDAQFraction done " << endl;
62 
63  // map
64  daqMap = ibooker.book2D("DAQSummaryMap","DT Certification Summary Map",12,1,13,5,-2,3);
65  daqMap->setAxisTitle("sector",1);
66  daqMap->setAxisTitle("wheel",2);
67  cout << " map done " << endl;
68 
69  // Wheel "fractions" -> will be 0 or 1
70 
71  ibooker.setCurrentFolder("DT/EventInfo/DAQContents");
72  for(int wheel = -2; wheel != 3; ++wheel) {
73  stringstream streams;
74  streams << "DT_Wheel" << wheel;
75 
76  daqFractions[wheel] = ibooker.bookFloat(streams.str());
77  daqFractions[wheel]->Fill(-1);
78  }
79 
80  //
81 
82  // create a record key for RunInfoRcd
84 
85  if(setup.find(recordKey) != 0) {
86 
87  //FR not sure that the lines below are still useful, we have just booked the histo!
88  // reset to 0
90  daqFractions[-2]->Fill(0.);
91  daqFractions[-1]->Fill(0.);
92  daqFractions[-0]->Fill(0.);
93  daqFractions[1]->Fill(0.);
94  daqFractions[2]->Fill(0.);
95 
96  daqMap->Reset();
97  //get fed summary information
98  ESHandle<RunInfo> sumFED;
99  setup.get<RunInfoRcd>().get(sumFED);
100  vector<int> fedInIDs = sumFED->m_fed_in;
101 
102  // the range of DT feds
103  static int FEDIDmin = FEDNumbering::MINDTFEDID;
104  static int FEDIDMax = FEDNumbering::MAXDTFEDID;
105 
106  // loop on all active feds
107  for(vector<int>::const_iterator fed = fedInIDs.begin();
108  fed != fedInIDs.end();
109  ++fed) {
110  // check if the fed is in the DT range
111  if(!(*fed >= FEDIDmin && *fed <= FEDIDMax)) continue;
112 
113  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
114  int wheel = -99;
115  int sector = -99;
116  int dummy = -99;
117 
118  for(int ros = 1; ros != 13; ++ros) {
119  if(!mapping->readOutToGeometry(*fed,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy)) {
120  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
121  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
122  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1./12.);
124  daqMap->Fill(sector,wheel);
125  }
126  }
127  }
128  } else {
129 
130  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
131  totalDAQFraction->Fill(-1);
132  for(int wheel = -2; wheel != 3; ++wheel) {
133  daqFractions[wheel]->Fill(-1);
134 
135  }
136  return;
137  }
138 
139  }
140  bookingdone = 1;
141 
142  // create a record key for RunInfoRcd
144 
145  if(setup.find(recordKey) != 0) {
146  // reset to 0
147  totalDAQFraction->Fill(0.);
148  daqFractions[-2]->Fill(0.);
149  daqFractions[-1]->Fill(0.);
150  daqFractions[-0]->Fill(0.);
151  daqFractions[1]->Fill(0.);
152  daqFractions[2]->Fill(0.);
153 
154 
155  daqMap->Reset();
156  //get fed summary information
157  ESHandle<RunInfo> sumFED;
158  setup.get<RunInfoRcd>().get(sumFED);
159  vector<int> fedInIDs = sumFED->m_fed_in;
160 
161  // the range of DT feds
162  static int FEDIDmin = FEDNumbering::MINDTFEDID;
163  static int FEDIDMax = FEDNumbering::MAXDTFEDID;
164 
165  // loop on all active feds
166  for(vector<int>::const_iterator fed = fedInIDs.begin();
167  fed != fedInIDs.end();
168  ++fed) {
169  // check if the fed is in the DT range
170  if(!(*fed >= FEDIDmin && *fed <= FEDIDMax)) continue;
171 
172  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
173  int wheel = -99;
174  int sector = -99;
175  int dummy = -99;
176  for(int ros = 1; ros != 13; ++ros) {
177  if(!mapping->readOutToGeometry(*fed,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy)) {
178  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
179  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
180  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1./12.);
182  daqMap->Fill(sector,wheel);
183  }
184  cout << " daqMap->Fill , ros = " << ros<<endl;
185  }
186  }
187  } else {
188  cout << " recordkey nehi "<<endl;
189  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
190  totalDAQFraction->Fill(-1);
191  for(int wheel = -2; wheel != 3; ++wheel) {
192  daqFractions[wheel]->Fill(-1);
193  }
194  return;
195  }
196 }
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:76
std::map< int, MonitorElement * > daqFractions
Definition: DTDAQInfo.h:47
void Fill(long long x)
edm::ESHandle< DTReadOutMapping > mapping
Definition: DTDAQInfo.h:48
MonitorElement * daqMap
Definition: DTDAQInfo.h:46
double getFloatValue(void) const
MonitorElement * totalDAQFraction
Definition: DTDAQInfo.h:45
#define LogTrace(id)
bool bookingdone
Definition: DTDAQInfo.h:43
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
tuple cout
Definition: gather_cfg.py:121
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)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")

Member Data Documentation

bool DTDAQInfo::bookingdone
private

Definition at line 43 of file DTDAQInfo.h.

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

Definition at line 47 of file DTDAQInfo.h.

MonitorElement* DTDAQInfo::daqMap
private

Definition at line 46 of file DTDAQInfo.h.

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

Definition at line 48 of file DTDAQInfo.h.

MonitorElement* DTDAQInfo::totalDAQFraction
private

Definition at line 45 of file DTDAQInfo.h.