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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
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 setParams (edm::ParameterSet const &) override
 

Private Attributes

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.

11  :
12  DQWorkerTask(),
14  nSamples_(0)
15  {
16  }
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 29 of file PresampleTask.h.

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

29  {
30  switch(_collection){
31  case kEBDigi:
32  if(_p) runOnDigis(*static_cast<EBDigiCollection const*>(_p));
33  return true;
34  case kEEDigi:
35  if(_p) runOnDigis(*static_cast<EEDigiCollection const*>(_p));
36  return true;
37  break;
38  default:
39  break;
40  }
41 
42  return false;
43  }
void runOnDigis(DigiCollection const &)
bool ecaldqm::PresampleTask::filterRunType ( short const *  _runType)
overridevirtual
template<typename DigiCollection >
void ecaldqm::PresampleTask::runOnDigis ( DigiCollection const &  _digis)

Definition at line 42 of file PresampleTask.cc.

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

Referenced by analyze().

43  {
44  MESet& mePedestal(MEs_.at("Pedestal"));
45 
46  for(typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
47  DetId id(digiItr->id());
48 
49  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame in the constructor
50  EcalDataFrame dataFrame(*digiItr);
51 
52  bool gainSwitch(false);
53  int iMax(-1);
54  int maxADC(0);
55  for(int iSample(0); iSample < EcalDataFrame::MAXSAMPLES; ++iSample){
56  int adc(dataFrame.sample(iSample).adc());
57  if(adc > maxADC){
58  iMax = iSample;
59  maxADC = adc;
60  }
61  if(iSample < nSamples_ && dataFrame.sample(iSample).gainId() != 1){
62  gainSwitch = true;
63  break;
64  }
65  }
66  if(iMax != pulseMaxPosition_ || gainSwitch) continue;
67 
68  for(int iSample(0); iSample < nSamples_; ++iSample)
69  mePedestal.fill(id, double(dataFrame.sample(iSample).adc()));
70  }
71  }
int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: DetId.h:18
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 19 of file PresampleTask.cc.

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

20  {
21  pulseMaxPosition_ = _params.getUntrackedParameter<int>("pulseMaxPosition");
22  nSamples_ = _params.getUntrackedParameter<int>("nSamples");
23  }

Member Data Documentation

int ecaldqm::PresampleTask::nSamples_
private

Definition at line 26 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

int ecaldqm::PresampleTask::pulseMaxPosition_
private

Definition at line 25 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().