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

bool doPulseMaxCheck_
 
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(),
13  doPulseMaxCheck_(true),
15  nSamples_(0)
16  {
17  }
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 30 of file PresampleTask.h.

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

30  {
31  switch(_collection){
32  case kEBDigi:
33  if(_p) runOnDigis(*static_cast<EBDigiCollection const*>(_p));
34  return true;
35  case kEEDigi:
36  if(_p) runOnDigis(*static_cast<EEDigiCollection const*>(_p));
37  return true;
38  break;
39  default:
40  break;
41  }
42 
43  return false;
44  }
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 44 of file PresampleTask.cc.

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

Referenced by analyze().

45  {
46  MESet& mePedestal(MEs_.at("Pedestal"));
47 
48  for(typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
49  DetId id(digiItr->id());
50 
51  // EcalDataFrame is not a derived class of edm::DataFrame, but can take edm::DataFrame in the constructor
52  EcalDataFrame dataFrame(*digiItr);
53 
54  // Check that the digi pulse maximum occurs on the 6th sample
55  // For cosmics: disable this check to preserve statistics
56  if ( doPulseMaxCheck_ ) {
57  bool gainSwitch(false);
58  int iMax(-1);
59  int maxADC(0);
60  for(int iSample(0); iSample < EcalDataFrame::MAXSAMPLES; ++iSample){
61  int adc(dataFrame.sample(iSample).adc());
62  if(adc > maxADC){
63  iMax = iSample;
64  maxADC = adc;
65  }
66  if(iSample < nSamples_ && dataFrame.sample(iSample).gainId() != 1){
67  gainSwitch = true;
68  break;
69  }
70  } // iSample
71  if(iMax != pulseMaxPosition_ || gainSwitch) continue;
72  } // PulseMaxCheck
73 
74  for(int iSample(0); iSample < nSamples_; ++iSample)
75  mePedestal.fill(id, double(dataFrame.sample(iSample).adc()));
76 
77  } // _digis loop
78  } // runOnDigis
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 20 of file PresampleTask.cc.

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

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

Member Data Documentation

bool ecaldqm::PresampleTask::doPulseMaxCheck_
private

Definition at line 25 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

int ecaldqm::PresampleTask::nSamples_
private

Definition at line 27 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().

int ecaldqm::PresampleTask::pulseMaxPosition_
private

Definition at line 26 of file PresampleTask.h.

Referenced by runOnDigis(), and setParams().