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 | Protected Attributes
hcaldqm::DQTask Class Referenceabstract

#include <DQTask.h>

Inheritance diagram for hcaldqm::DQTask:
DQMEDAnalyzer hcaldqm::DQModule edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase DigiTask LaserTask LEDTask PedestalTask RadDamTask RawTask RecHitTask TPTask

Public Member Functions

virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQTask (edm::ParameterSet const &)
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual ~DQTask ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 ()
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()
 

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

Protected Attributes

ContainerI _cEvsPerLS
 
ContainerI _cEvsTotal
 
ContainerS _cProcessingTypeName
 
ContainerS _cRunKeyName
 
ContainerI _cRunKeyVal
 
int _procLSs
 
edm::InputTag _tagRaw
 
edm::EDGetTokenT
< FEDRawDataCollection
_tokRaw
 
- Protected Attributes inherited from hcaldqm::DQModule
int _currentLS
 
int _debug
 
int _evsPerLS
 
int _evsTotal
 
Logger _logger
 
ModuleType _mtype
 
std::string _name
 
ProcessingType _ptype
 
std::string _runkeyName
 
int _runkeyVal
 
std::string _subsystem
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 27 of file DQTask.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file DQTask.cc.

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

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

Definition at line 31 of file DQTask.h.

31 {}

Member Function Documentation

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

Definition at line 107 of file DQTask.cc.

References hcaldqm::DQModule::_logger, _tagRaw, _tokRaw, diJetCalib::calibType, FEDRawData::data(), Logger::dqmthrow(), ztee::fd, 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, edm::Event::getByToken(), i, edm::InputTag::instance(), edm::InputTag::label(), bookConverter::max, FEDRawData::size(), and Logger::warn().

Referenced by RadDamTask::_isApplicable(), LaserTask::_isApplicable(), and PedestalTask::_isApplicable().

108  {
109  int calibType = 0;
110 
112  if (!e.getByToken(_tokRaw, craw))
114  "Collection FEDRawDataCollection isn't available "
115  + _tagRaw.label() + " " + _tagRaw.instance());
116 
117  int badFEDs=0;
118  std::vector<int> types(8,0);
119  for (int i=FED_VME_MIN; i<=FED_VME_MAX; i++)
120  {
121  FEDRawData const& fd = craw->FEDData(i);
122  if (fd.size()<24)
123  {
124  badFEDs++;
125  continue;
126  }
127  int cval = (int)((HcalDCCHeader const*)(fd.data()))->getCalibType();
128  if (cval>7)
129  _logger.warn("Unexpected Calib Type in FED " +
130  boost::lexical_cast<std::string>(i));
131  types[cval]++;
132  }
133  for (int i=FED_uTCA_MIN; i<=FED_uTCA_MAX; i++)
134  {
135  FEDRawData const& fd = craw->FEDData(i);
136  if (fd.size()<24)
137  {
138  badFEDs++;
139  continue;
140  }
141  int cval = (int)((HcalDCCHeader const*)(fd.data()))->getCalibType();
142  if (cval>7)
143  _logger.warn("Unexpected Calib Type in FED " +
144  boost::lexical_cast<std::string>(i));
145  types[cval]++;
146  }
147 
148  int max = 0;
149  for (unsigned int ic=0; ic<8; ic++)
150  {
151  if (types[ic]>max)
152  {
153  max = types[ic];
154  calibType = ic;
155  }
156  }
157  if (max!=(FED_VME_NUM+(FED_uTCA_MAX-FED_uTCA_MIN+1)-badFEDs))
158  _logger.warn("Conflicting Calibration Types found. Assigning " +
159  boost::lexical_cast<std::string>(calibType));
160 
161  return calibType;
162  }
int i
Definition: DBlmapReader.cc:9
void warn(std::string const &msg) const
Definition: Logger.h:20
edm::InputTag _tagRaw
Definition: DQTask.h:61
edm::EDGetTokenT< FEDRawDataCollection > _tokRaw
Definition: DQTask.h:62
tuple calibType
Definition: diJetCalib.py:20
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
int const FED_uTCA_MIN
Definition: Constants.h:31
int const FED_uTCA_MAX
Definition: Constants.h:32
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
int const FED_VME_MIN
Definition: Constants.h:26
tuple fd
Definition: ztee.py:136
Logger _logger
Definition: DQModule.h:62
int const FED_VME_NUM
Definition: Constants.h:29
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:27
std::string const & instance() const
Definition: InputTag.h:37
virtual bool hcaldqm::DQTask::_isApplicable ( edm::Event const &  )
inlineprotectedvirtual

Reimplemented in LaserTask, LEDTask, PedestalTask, and RadDamTask.

Definition at line 47 of file DQTask.h.

Referenced by analyze().

47 {return true;}
virtual void hcaldqm::DQTask::_process ( edm::Event const &  ,
edm::EventSetup const &   
)
protectedpure virtual

Implemented in DigiTask, TPTask, RawTask, RecHitTask, LaserTask, LEDTask, PedestalTask, and RadDamTask.

Referenced by analyze().

void hcaldqm::DQTask::_resetMonitors ( UpdateFreq  uf)
protectedvirtual

Reimplemented in DigiTask, TPTask, RawTask, RecHitTask, LaserTask, LEDTask, and PedestalTask.

Definition at line 86 of file DQTask.cc.

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

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

87  {
88  // reset per event
89  switch (uf)
90  {
91  case fEvent:
92  break;
93  case fLS:
94  _evsPerLS = 0;
95  break;
96  case f10LS:
97  break;
98  case f50LS:
99  break;
100  case f100LS:
101  break;
102  default:
103  break;
104  }
105  }
void hcaldqm::DQTask::analyze ( edm::Event const &  e,
edm::EventSetup const &  es 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 26 of file DQTask.cc.

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

28  {
29  this->_resetMonitors(fEvent);
30  _logger.debug(_name+" processing");
31  if (!this->_isApplicable(e))
32  return;
33 
36  _currentLS = e.luminosityBlock();
37  this->_process(e, es);
38  }
ContainerI _cEvsTotal
Definition: DQTask.h:51
void debug(STDTYPE const &msg) const
Definition: Logger.h:31
ContainerI _cEvsPerLS
Definition: DQTask.h:52
virtual bool _isApplicable(edm::Event const &)
Definition: DQTask.h:47
virtual void _process(edm::Event const &, edm::EventSetup const &)=0
virtual void fill(int x)
Definition: ContainerI.h:28
Logger _logger
Definition: DQModule.h:62
std::string _name
Definition: DQModule.h:50
virtual void _resetMonitors(UpdateFreq)
Definition: DQTask.cc:86
void hcaldqm::DQTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 66 of file DQTask.cc.

References _procLSs, _resetMonitors(), hcaldqm::f100LS, hcaldqm::f10LS, hcaldqm::f50LS, and hcaldqm::fLS.

69  {
70  this->_resetMonitors(fLS);
71  if (_procLSs%10==0)
72  this->_resetMonitors(f10LS);
73  if (_procLSs%50==0)
74  this->_resetMonitors(f50LS);
75  if (_procLSs%100==0)
76  this->_resetMonitors(f100LS);
77  }
int _procLSs
Definition: DQTask.h:58
virtual void _resetMonitors(UpdateFreq)
Definition: DQTask.cc:86
void hcaldqm::DQTask::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  r,
edm::EventSetup const &  es 
)
virtual

Implements DQMEDAnalyzer.

Reimplemented in DigiTask, RadDamTask, LaserTask, LEDTask, PedestalTask, RawTask, RecHitTask, and TPTask.

Definition at line 40 of file DQTask.cc.

References _cEvsPerLS, _cEvsTotal, _cProcessingTypeName, _cRunKeyName, _cRunKeyVal, hcaldqm::DQModule::_ptype, hcaldqm::DQModule::_runkeyName, hcaldqm::DQModule::_runkeyVal, hcaldqm::ContainerI::book(), hcaldqm::ContainerS::book(), hcaldqm::ContainerI::fill(), hcaldqm::ContainerS::fill(), and hcaldqm::pTypeNames.

43  {
44  _cEvsTotal.book(ib);
45  _cEvsPerLS.book(ib);
46  _cRunKeyVal.book(ib);
47  _cRunKeyName.book(ib);
49 
50  // fill what you can now
54  }
ContainerI _cEvsTotal
Definition: DQTask.h:51
ContainerS _cRunKeyName
Definition: DQTask.h:54
ContainerI _cEvsPerLS
Definition: DQTask.h:52
ProcessingType _ptype
Definition: DQModule.h:52
virtual void fill(std::string const &x)
Definition: ContainerS.h:29
virtual void book(DQMStore::IBooker &ib, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerI.h:33
virtual void fill(int x)
Definition: ContainerI.h:28
virtual void book(DQMStore::IBooker &ib, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerS.h:34
std::string _runkeyName
Definition: DQModule.h:56
ContainerS _cProcessingTypeName
Definition: DQTask.h:55
std::string const pTypeNames[nProcessingType]
Definition: DQModule.h:34
ContainerI _cRunKeyVal
Definition: DQTask.h:53
void hcaldqm::DQTask::dqmBeginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
virtual

Reimplemented from DQMEDAnalyzer.

Definition at line 56 of file DQTask.cc.

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

58  {
59  this->_resetMonitors(fEvent);
60  this->_resetMonitors(fLS);
61  this->_resetMonitors(f10LS);
62  this->_resetMonitors(f50LS);
63  this->_resetMonitors(f100LS);
64  }
virtual void _resetMonitors(UpdateFreq)
Definition: DQTask.cc:86
void hcaldqm::DQTask::endLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Reimplemented in DigiTask, RawTask, RecHitTask, and TPTask.

Definition at line 79 of file DQTask.cc.

References _procLSs.

82  {
83  _procLSs++;
84  }
int _procLSs
Definition: DQTask.h:58

Member Data Documentation

ContainerI hcaldqm::DQTask::_cEvsPerLS
protected

Definition at line 52 of file DQTask.h.

Referenced by analyze(), and bookHistograms().

ContainerI hcaldqm::DQTask::_cEvsTotal
protected

Definition at line 51 of file DQTask.h.

Referenced by analyze(), and bookHistograms().

ContainerS hcaldqm::DQTask::_cProcessingTypeName
protected

Definition at line 55 of file DQTask.h.

Referenced by bookHistograms().

ContainerS hcaldqm::DQTask::_cRunKeyName
protected

Definition at line 54 of file DQTask.h.

Referenced by bookHistograms().

ContainerI hcaldqm::DQTask::_cRunKeyVal
protected

Definition at line 53 of file DQTask.h.

Referenced by bookHistograms().

int hcaldqm::DQTask::_procLSs
protected

Definition at line 58 of file DQTask.h.

Referenced by beginLuminosityBlock(), DigiTask::endLuminosityBlock(), and endLuminosityBlock().

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

Definition at line 61 of file DQTask.h.

Referenced by _getCalibType(), and DQTask().

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

Definition at line 62 of file DQTask.h.

Referenced by _getCalibType(), and DQTask().