CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
hcaldqm::DQTask Class Referenceabstract

#include <DQTask.h>

Inheritance diagram for hcaldqm::DQTask:
one::DQMEDAnalyzer< one::DQMLuminosityBlockElements > hcaldqm::DQModule one::dqmimplementation::DQMBaseClass< T... > DigiComparisonTask DigiPhase1Task DigiTask HFRaddamTask LaserTask LEDTask NoCQTask PedestalTask QIE10Task QIE11Task RawTask RecHitTask TestTask TPComparisonTask TPTask UMNioTask

Public Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQTask (edm::ParameterSet const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ~DQTask () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< one::DQMLuminosityBlockElements >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()(false)
 

Protected Member Functions

virtual int _getCalibType (edm::Event const &)
 
virtual bool _isApplicable (edm::Event const &)
 
virtual void _process (edm::Event const &, edm::EventSetup const &)=0
 
virtual void _resetMonitors (UpdateFreq)
 

Protected Attributes

ContainerI _cEvsPerLS
 
ContainerI _cEvsTotal
 
ContainerS _cProcessingTypeName
 
ContainerS _cRunKeyName
 
ContainerI _cRunKeyVal
 
edm::ESHandle< HcalDbService_dbService
 
HcalElectronicsMap const * _emap
 
int _procLSs
 
edm::InputTag _tagRaw
 
edm::EDGetTokenT< FEDRawDataCollection_tokRaw
 
std::vector< uint32_t > _vcdaqEids
 
ContainerXXX< uint32_t > _xQuality
 
- Protected Attributes inherited from hcaldqm::DQModule
int _currentLS
 
int _debug
 
int _evsPerLS
 
int _evsTotal
 
Logger _logger
 
int _maxLS
 
ModuleType _mtype
 
std::string _name
 
ProcessingType _ptype
 
std::string _runkeyName
 
int _runkeyVal
 
std::string _subsystem
 

Detailed Description

Definition at line 26 of file DQTask.h.

Constructor & Destructor Documentation

hcaldqm::DQTask::DQTask ( edm::ParameterSet const &  ps)

Definition at line 6 of file DQTask.cc.

References _tagRaw, _tokRaw, and edm::ParameterSet::getUntrackedParameter().

6  :
7  DQModule(ps),
8  _cEvsTotal(_name, "EventsTotal"),
9  _cEvsPerLS(_name, "EventsPerLS"),
10  _cRunKeyVal(_name, "RunKeyValue"),
11  _cRunKeyName(_name, "RunKeyName"),
12  _cProcessingTypeName(_name, "ProcessingType"),
13  _procLSs(0)
14  {
15  // tags and Tokens
16  _tagRaw = ps.getUntrackedParameter<edm::InputTag>("tagRaw",
17  edm::InputTag("rawDataCollector"));
18  _tokRaw = consumes<FEDRawDataCollection>(_tagRaw);
19  }
ContainerI _cEvsTotal
Definition: DQTask.h:52
ContainerS _cRunKeyName
Definition: DQTask.h:55
edm::InputTag _tagRaw
Definition: DQTask.h:68
edm::EDGetTokenT< FEDRawDataCollection > _tokRaw
Definition: DQTask.h:69
ContainerI _cEvsPerLS
Definition: DQTask.h:53
int _procLSs
Definition: DQTask.h:59
std::string _name
Definition: DQModule.h:57
ContainerS _cProcessingTypeName
Definition: DQTask.h:56
ContainerI _cRunKeyVal
Definition: DQTask.h:54
DQModule(edm::ParameterSet const &)
Definition: DQModule.cc:6
hcaldqm::DQTask::~DQTask ( )
inlineoverride

Member Function Documentation

int hcaldqm::DQTask::_getCalibType ( edm::Event const &  e)
protectedvirtual

Definition at line 167 of file DQTask.cc.

References hcaldqm::DQModule::_logger, _tagRaw, _tokRaw, FEDRawData::data(), Logger::dqmthrow(), hcaldqm::constants::FED_uTCA_MAX, hcaldqm::constants::FED_uTCA_MIN, hcaldqm::constants::FED_VME_MAX, hcaldqm::constants::FED_VME_MIN, hcaldqm::constants::FED_VME_NUM, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), mps_fire::i, edm::InputTag::instance(), createfilelist::int, edm::InputTag::label(), SiStripPI::max, FEDRawData::size(), and Logger::warn().

Referenced by _isApplicable().

168  {
169  int calibType = 0;
170 
172  if (!e.getByToken(_tokRaw, craw))
174  "Collection FEDRawDataCollection isn't available "
175  + _tagRaw.label() + " " + _tagRaw.instance());
176 
177  int badFEDs=0;
178  std::vector<int> types(8,0);
179  for (int i=FED_VME_MIN; i<=FED_VME_MAX; i++)
180  {
181  FEDRawData const& fd = craw->FEDData(i);
182  if (fd.size()<24)
183  {
184  badFEDs++;
185  continue;
186  }
187  int cval = (int)((HcalDCCHeader const*)(fd.data()))->getCalibType();
188  if (cval>7)
189  _logger.warn("Unexpected Calib Type in FED " +
190  std::to_string(i));
191  types[cval]++;
192  }
193  for (int i=FED_uTCA_MIN; i<=FED_uTCA_MAX; i++)
194  {
195  FEDRawData const& fd = craw->FEDData(i);
196  if (fd.size()<24)
197  {
198  badFEDs++;
199  continue;
200  }
201  int cval = (int)((HcalDCCHeader const*)(fd.data()))->getCalibType();
202  if (cval>7)
203  _logger.warn("Unexpected Calib Type in FED " +
204  std::to_string(i));
205  types[cval]++;
206  }
207 
208  int max = 0;
209  for (unsigned int ic=0; ic<8; ic++)
210  {
211  if (types[ic]>max)
212  {
213  max = types[ic];
214  calibType = ic;
215  }
216  }
217  if (max!=(FED_VME_NUM+(FED_uTCA_MAX-FED_uTCA_MIN+1)-badFEDs))
218  _logger.warn("Conflicting Calibration Types found. Assigning " +
219  std::to_string(calibType));
220 
221  return calibType;
222  }
void warn(std::string const &msg) const
Definition: Logger.h:20
edm::InputTag _tagRaw
Definition: DQTask.h:68
edm::EDGetTokenT< FEDRawDataCollection > _tokRaw
Definition: DQTask.h:69
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
int const FED_uTCA_MIN
Definition: Constants.h:103
int const FED_uTCA_MAX
Definition: Constants.h:105
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
int const FED_VME_MIN
Definition: Constants.h:98
Logger _logger
Definition: DQModule.h:70
int const FED_VME_NUM
Definition: Constants.h:101
std::string const & label() const
Definition: InputTag.h:36
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
int const FED_VME_MAX
Definition: Constants.h:99
std::string const & instance() const
Definition: InputTag.h:37
virtual bool hcaldqm::DQTask::_isApplicable ( edm::Event const &  )
inlineprotectedvirtual

Reimplemented in LaserTask, LEDTask, PedestalTask, QIE11Task, and HFRaddamTask.

Definition at line 48 of file DQTask.h.

References _getCalibType().

Referenced by analyze().

48 {return true;}
virtual void hcaldqm::DQTask::_process ( edm::Event const &  ,
edm::EventSetup const &   
)
protectedpure virtual
void hcaldqm::DQTask::_resetMonitors ( UpdateFreq  uf)
protectedvirtual

Reimplemented in LaserTask, DigiPhase1Task, DigiTask, LEDTask, RecHitTask, PedestalTask, RawTask, TPTask, QIE10Task, QIE11Task, TPComparisonTask, DigiComparisonTask, NoCQTask, and TestTask.

Definition at line 146 of file DQTask.cc.

References hcaldqm::DQModule::_evsPerLS, hcaldqm::f100LS, hcaldqm::f10LS, hcaldqm::f1LS, hcaldqm::f50LS, and hcaldqm::fEvent.

Referenced by analyze(), beginLuminosityBlock(), dqmBeginRun(), and ~DQTask().

147  {
148  // reset per event
149  switch (uf)
150  {
151  case fEvent:
152  break;
153  case f1LS:
154  _evsPerLS = 0;
155  break;
156  case f10LS:
157  break;
158  case f50LS:
159  break;
160  case f100LS:
161  break;
162  default:
163  break;
164  }
165  }
void hcaldqm::DQTask::analyze ( edm::Event const &  e,
edm::EventSetup const &  es 
)
override

Definition at line 25 of file DQTask.cc.

References _cEvsPerLS, _cEvsTotal, hcaldqm::DQModule::_evsPerLS, hcaldqm::DQModule::_evsTotal, _isApplicable(), hcaldqm::DQModule::_logger, hcaldqm::DQModule::_name, _process(), _resetMonitors(), Logger::debug(), hcaldqm::fEvent, and hcaldqm::ContainerI::fill().

Referenced by ~DQTask().

27  {
28  this->_resetMonitors(fEvent);
29  _logger.debug(_name+" processing");
30  if (!this->_isApplicable(e))
31  return;
32 
35  this->_process(e, es);
36  }
ContainerI _cEvsTotal
Definition: DQTask.h:52
void debug(STDTYPE const &msg) const
Definition: Logger.h:31
ContainerI _cEvsPerLS
Definition: DQTask.h:53
virtual bool _isApplicable(edm::Event const &)
Definition: DQTask.h:48
virtual void _process(edm::Event const &, edm::EventSetup const &)=0
virtual void fill(int x)
Definition: ContainerI.h:27
Logger _logger
Definition: DQModule.h:70
std::string _name
Definition: DQModule.h:57
virtual void _resetMonitors(UpdateFreq)
Definition: DQTask.cc:146
void hcaldqm::DQTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
override

Definition at line 99 of file DQTask.cc.

References hcaldqm::DQModule::_currentLS, _procLSs, _resetMonitors(), _xQuality, hcaldqm::f100LS, hcaldqm::f10LS, hcaldqm::f1LS, hcaldqm::f50LS, HcalGenericDetId::genericSubdet(), edm::EventSetup::get(), HcalCondObjectContainer< Item >::getAllChannels(), reco::JetExtendedAssociation::getValue(), HcalCondObjectContainer< Item >::getValues(), HcalGenericDetId::HcalGenUnknown, HcalGenericDetId::isHcalDetId(), edm::LuminosityBlockBase::luminosityBlock(), RecoTauDiscriminantConfiguration::mask, edm::ESHandle< T >::product(), hcaldqm::ContainerXXX< STDTYPE >::push(), and hcaldqm::ContainerXXX< STDTYPE >::reset().

Referenced by ~DQTask().

102  {
103  _currentLS = lb.luminosityBlock();
104  this->_resetMonitors(f1LS);
105 
106  if (_procLSs%10==0)
107  this->_resetMonitors(f10LS);
108  if (_procLSs%50==0)
109  this->_resetMonitors(f50LS);
110  if (_procLSs%100==0)
111  this->_resetMonitors(f100LS);
112 
113  // get the Channel Quality Status for all the channels
114  _xQuality.reset();
116  es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
117  const HcalChannelQuality *cq = hcq.product();
118  std::vector<DetId> detids = cq->getAllChannels();
119  for (std::vector<DetId>::const_iterator it=detids.begin();
120  it!=detids.end(); ++it)
121  {
122  // if unknown skip
123  if (HcalGenericDetId(*it).genericSubdet()==
125  continue;
126 
127  if (HcalGenericDetId(*it).isHcalDetId())
128  {
129  HcalDetId did(*it);
130  uint32_t mask = (cq->getValues(did))->getValue();
131  if (mask!=0)
132  {
133  _xQuality.push(did, mask);
134  }
135  }
136  }
137  }
virtual void push(HcalDetId const &, STDTYPE)
Definition: ContainerXXX.h:283
int _procLSs
Definition: DQTask.h:59
const Item * getValues(DetId fId, bool throwOnFail=true) const
virtual void reset()
Definition: ContainerXXX.h:364
ContainerXXX< uint32_t > _xQuality
Definition: DQTask.h:62
std::vector< DetId > getAllChannels() const
bool isHcalDetId() const
virtual void _resetMonitors(UpdateFreq)
Definition: DQTask.cc:146
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
HcalGenericSubdetector genericSubdet() const
T const * product() const
Definition: ESHandle.h:84
void hcaldqm::DQTask::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 38 of file DQTask.cc.

References _cEvsPerLS, _cEvsTotal, _cProcessingTypeName, _cRunKeyName, _cRunKeyVal, _dbService, _emap, hcaldqm::DQModule::_ptype, hcaldqm::DQModule::_runkeyName, hcaldqm::DQModule::_runkeyVal, hcaldqm::DQModule::_subsystem, _vcdaqEids, _xQuality, hcaldqm::ContainerS::book(), hcaldqm::ContainerI::book(), hcaldqm::hashfunctions::fDChannel, hcaldqm::utilities::fed2crate(), hcaldqm::constants::FED_uTCA_MIN, hcaldqm::constants::FED_VME_MAX, hcaldqm::constants::FED_VME_MIN, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBER_VME_MIN, hcaldqm::constants::FIBERCH_MIN, hcaldqm::ContainerS::fill(), hcaldqm::ContainerI::fill(), edm::EventSetup::get(), HcalDbService::getHcalMapping(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), RunInfo::m_fed_in, FEDNumbering::MAXHCALuTCAFEDID, hcaldqm::pTypeNames, HcalElectronicsId::rawId(), hcaldqm::constants::SPIGOT_MIN, and edm::EventSetup::tryToGet().

Referenced by ~DQTask().

41  {
42  // initialize some containers to be used by all modules
44 
45  // get the run info FEDs - FEDs registered at cDAQ
46  // and determine if there are any HCAL FEDs in.
47  // push them as ElectronicsIds into the vector
48  if (auto runInfoRec = es.tryToGet<RunInfoRcd>())
49  {
51  runInfoRec->get(ri);
52  std::vector<int> vfeds= ri->m_fed_in;
53  for (std::vector<int>::const_iterator it=vfeds.begin();
54  it!=vfeds.end(); ++it)
55  {
56  if (*it>=constants::FED_VME_MIN && *it<=FED_VME_MAX)
57  _vcdaqEids.push_back(HcalElectronicsId(
60  (*it)-FED_VME_MIN).rawId());
61  else if (*it>=constants::FED_uTCA_MIN &&
63  {
64  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
65  _vcdaqEids.push_back(HcalElectronicsId(
66  cspair.first, cspair.second,
67  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
68  }
69  }
70  }
71 
72  // book some base guys
78 
79  // fill what you can now
83 
84  // Load conditions and emap
85  es.get<HcalDbRecord>().get(_dbService);
87  }
constexpr uint32_t rawId() const
ContainerI _cEvsTotal
Definition: DQTask.h:52
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:12
ContainerS _cRunKeyName
Definition: DQTask.h:55
ContainerI _cEvsPerLS
Definition: DQTask.h:53
int const SPIGOT_MIN
Definition: Constants.h:136
int const FIBER_VME_MIN
Definition: Constants.h:141
int const FED_uTCA_MIN
Definition: Constants.h:103
int const FIBERCH_MIN
Definition: Constants.h:151
ProcessingType _ptype
Definition: DQModule.h:59
virtual void fill(std::string const &x)
Definition: ContainerS.h:26
ContainerXXX< uint32_t > _xQuality
Definition: DQTask.h:62
int const FED_VME_MIN
Definition: Constants.h:98
std::vector< int > m_fed_in
Definition: RunInfo.h:26
virtual void book(DQMStore::IBooker &ib, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerI.h:32
int const FIBER_uTCA_MIN1
Definition: Constants.h:144
virtual void fill(int x)
Definition: ContainerI.h:27
virtual void book(DQMStore::IBooker &ib, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerS.h:31
HcalElectronicsMap const * _emap
Definition: DQTask.h:73
edm::ESHandle< HcalDbService > _dbService
Definition: DQTask.h:72
const HcalElectronicsMap * getHcalMapping() const
std::string _subsystem
Definition: DQModule.h:64
std::string _runkeyName
Definition: DQModule.h:63
ContainerS _cProcessingTypeName
Definition: DQTask.h:56
std::vector< uint32_t > _vcdaqEids
Definition: DQTask.h:65
std::string const pTypeNames[nProcessingType]
Definition: DQModule.h:41
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:89
int const FED_VME_MAX
Definition: Constants.h:99
ContainerI _cRunKeyVal
Definition: DQTask.h:54
Readout chain identification for Hcal.
void hcaldqm::DQTask::dqmBeginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 89 of file DQTask.cc.

References _resetMonitors(), hcaldqm::f100LS, hcaldqm::f10LS, hcaldqm::f1LS, hcaldqm::f50LS, and hcaldqm::fEvent.

Referenced by ~DQTask().

91  {
92  this->_resetMonitors(fEvent);
93  this->_resetMonitors(f1LS);
94  this->_resetMonitors(f10LS);
95  this->_resetMonitors(f50LS);
96  this->_resetMonitors(f100LS);
97  }
virtual void _resetMonitors(UpdateFreq)
Definition: DQTask.cc:146
void hcaldqm::DQTask::endLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
override

Definition at line 139 of file DQTask.cc.

References _procLSs.

Referenced by ~DQTask().

142  {
143  _procLSs++;
144  }
int _procLSs
Definition: DQTask.h:59

Member Data Documentation

ContainerI hcaldqm::DQTask::_cEvsPerLS
protected

Definition at line 53 of file DQTask.h.

Referenced by analyze(), and bookHistograms().

ContainerI hcaldqm::DQTask::_cEvsTotal
protected

Definition at line 52 of file DQTask.h.

Referenced by analyze(), and bookHistograms().

ContainerS hcaldqm::DQTask::_cProcessingTypeName
protected

Definition at line 56 of file DQTask.h.

Referenced by bookHistograms().

ContainerS hcaldqm::DQTask::_cRunKeyName
protected

Definition at line 55 of file DQTask.h.

Referenced by bookHistograms().

ContainerI hcaldqm::DQTask::_cRunKeyVal
protected

Definition at line 54 of file DQTask.h.

Referenced by bookHistograms().

edm::ESHandle<HcalDbService> hcaldqm::DQTask::_dbService
protected
HcalElectronicsMap const* hcaldqm::DQTask::_emap
protected
int hcaldqm::DQTask::_procLSs
protected

Definition at line 59 of file DQTask.h.

Referenced by beginLuminosityBlock(), and endLuminosityBlock().

edm::InputTag hcaldqm::DQTask::_tagRaw
protected

Definition at line 68 of file DQTask.h.

Referenced by _getCalibType(), and DQTask().

edm::EDGetTokenT<FEDRawDataCollection> hcaldqm::DQTask::_tokRaw
protected

Definition at line 69 of file DQTask.h.

Referenced by _getCalibType(), and DQTask().

std::vector<uint32_t> hcaldqm::DQTask::_vcdaqEids
protected
ContainerXXX<uint32_t> hcaldqm::DQTask::_xQuality
protected