CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::PresampleTask Class Reference

#include <PresampleTask.h>

Inheritance diagram for ecaldqm::PresampleTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

bool analyze (void const *, Collections) override
 
bool filterRunType (short const *) override
 
 PresampleTask ()
 
template<typename DigiCollection >
void runOnDigis (DigiCollection const &)
 
 ~PresampleTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
virtual void beginEvent (edm::Event const &, edm::EventSetup const &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
void recoverStats ()
 
virtual void setTokens (edm::ConsumesCollector &)
 
void softReset ()
 
virtual ~DQWorkerTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
std::string const & getName () const
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setTime (time_t _t)
 
virtual ~DQWorker ()
 

Private Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void setParams (edm::ParameterSet const &) override
 

Private Attributes

bool doPulseMaxCheck_
 
MESetmePedestalByLS
 
int nSamples_
 
int pulseMaxPosition_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef
EcalDCCHeaderBlock::EcalDCCEventSettings 
EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorkerTask
std::set< std::string > resettable_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 11 of file PresampleTask.h.

Constructor & Destructor Documentation

ecaldqm::PresampleTask::PresampleTask ( )

Definition at line 11 of file PresampleTask.cc.

ecaldqm::PresampleTask::~PresampleTask ( )
inline

Definition at line 14 of file PresampleTask.h.

14 {}

Member Function Documentation

bool ecaldqm::PresampleTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 32 of file PresampleTask.h.

References ecaldqm::kEBDigi, ecaldqm::kEEDigi, and runOnDigis().

32  {
33  switch(_collection){
34  case kEBDigi:
35  if(_p) runOnDigis(*static_cast<EBDigiCollection const*>(_p));
36  return true;
37  case kEEDigi:
38  if(_p) runOnDigis(*static_cast<EEDigiCollection const*>(_p));
39  return true;
40  break;
41  default:
42  break;
43  }
44 
45  return false;
46  }
void runOnDigis(DigiCollection const &)
void ecaldqm::PresampleTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 44 of file PresampleTask.cc.

References ecaldqm::DQWorker::Timestamp::iLumi, mePedestalByLS, ecaldqm::DQWorker::MEs_, ecaldqm::MESet::reset(), and ecaldqm::DQWorker::timestamp_.

45  {
46  // Fill separate MEs with only 10 LSs worth of stats
47  // Used to correctly fill Presample Trend plots:
48  // 1 pt:10 LS in Trend plots
49  mePedestalByLS = &MEs_.at("PedestalByLS");
50  if ( timestamp_.iLumi % 10 == 0 )
52  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
virtual void reset(double=0., double=0., double=0.)
Definition: MESet.cc:110
Timestamp timestamp_
Definition: DQWorker.h:78
MESetCollection MEs_
Definition: DQWorker.h:75
bool ecaldqm::PresampleTask::filterRunType ( short const *  _runType)
overridevirtual
template<typename DigiCollection >
void ecaldqm::PresampleTask::runOnDigis ( DigiCollection const &  _digis)

Definition at line 56 of file PresampleTask.cc.

References ecalMGPA::adc(), doPulseMaxCheck_, ecaldqm::MESet::fill(), EcalDataFrame::MAXSAMPLES, mePedestalByLS, ecaldqm::DQWorker::MEs_, nSamples_, and pulseMaxPosition_.

Referenced by analyze().

57  {
58  MESet& mePedestal(MEs_.at("Pedestal")); // contains cumulative run stats => not suitable for Trend plots
59 
60  for(typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
61  DetId id(digiItr->id());
62 
63  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame in the constructor
64  EcalDataFrame dataFrame(*digiItr);
65 
66  // Check that the digi pulse maximum occurs on the 6th sample
67  // For cosmics: disable this check to preserve statistics
68  if ( doPulseMaxCheck_ ) {
69  bool gainSwitch(false);
70  int iMax(-1);
71  int maxADC(0);
72  for(int iSample(0); iSample < EcalDataFrame::MAXSAMPLES; ++iSample){
73  int adc(dataFrame.sample(iSample).adc());
74  if(adc > maxADC){
75  iMax = iSample;
76  maxADC = adc;
77  }
78  if(iSample < nSamples_ && dataFrame.sample(iSample).gainId() != 1){
79  gainSwitch = true;
80  break;
81  }
82  } // iSample
83  if(iMax != pulseMaxPosition_ || gainSwitch) continue;
84  } // PulseMaxCheck
85 
86  for(int iSample(0); iSample < nSamples_; ++iSample) {
87  mePedestal.fill(id, double(dataFrame.sample(iSample).adc()));
88  mePedestalByLS->fill(id, double(dataFrame.sample(iSample).adc()));
89  }
90 
91  } // _digis loop
92  } // runOnDigis
int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: DetId.h:18
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:46
MESetCollection MEs_
Definition: DQWorker.h:75
static const int MAXSAMPLES
Definition: EcalDataFrame.h:48
void ecaldqm::PresampleTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 21 of file PresampleTask.cc.

References doPulseMaxCheck_, edm::ParameterSet::getUntrackedParameter(), nSamples_, and pulseMaxPosition_.

22  {
23  doPulseMaxCheck_ = _params.getUntrackedParameter<bool>("doPulseMaxCheck");
24  pulseMaxPosition_ = _params.getUntrackedParameter<int>("pulseMaxPosition");
25  nSamples_ = _params.getUntrackedParameter<int>("nSamples");
26  }

Member Data Documentation

bool ecaldqm::PresampleTask::doPulseMaxCheck_
private

Definition at line 26 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

MESet* ecaldqm::PresampleTask::mePedestalByLS
private

Definition at line 29 of file PresampleTask.h.

Referenced by beginLuminosityBlock(), and runOnDigis().

int ecaldqm::PresampleTask::nSamples_
private

Definition at line 28 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

int ecaldqm::PresampleTask::pulseMaxPosition_
private

Definition at line 27 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().