CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ESPedestalTask Class Reference

#include <ESPedestalTask.h>

Inheritance diagram for ESPedestalTask:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 ESPedestalTask (const edm::ParameterSet &ps)
 
 ~ESPedestalTask () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

int dac_
 
edm::EDGetTokenT< ESDigiCollectiondigitoken_
 
int firstDAC_
 
int gain_
 
int ievt_
 
int isPed_
 
edm::FileInPath lookup_
 
MonitorElementmeADC_ [4288][32]
 
int nDAC_
 
int nLines_
 
std::string outputFile_
 
int precision_
 
std::string prefixME_
 
int runNum_
 
int runtype_
 
int senCount_ [2][2][40][40]
 
int seqtype_
 
int vDAC_ [5]
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 13 of file ESPedestalTask.h.

Constructor & Destructor Documentation

◆ ESPedestalTask()

ESPedestalTask::ESPedestalTask ( const edm::ParameterSet ps)

Definition at line 25 of file ESPedestalTask.cc.

25  {
26  digitoken_ = consumes<ESDigiCollection>(ps.getParameter<InputTag>("DigiLabel"));
27  lookup_ = ps.getUntrackedParameter<FileInPath>("LookupTable");
28  outputFile_ = ps.getUntrackedParameter<string>("OutputFile", "");
29  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "EcalPreshower");
30 
31  for (int i = 0; i < 2; ++i)
32  for (int j = 0; j < 2; ++j)
33  for (int k = 0; k < 40; ++k)
34  for (int l = 0; l < 40; ++l)
35  senCount_[i][j][k][l] = -1;
36 
37  ievt_ = 0;
38 }

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, and cmsLHEtoEOSManager::l.

◆ ~ESPedestalTask()

ESPedestalTask::~ESPedestalTask ( )
inlineoverride

Definition at line 16 of file ESPedestalTask.h.

16 {}

Member Function Documentation

◆ analyze()

void ESPedestalTask::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 75 of file ESPedestalTask.cc.

75  {
76  ievt_++;
77  runNum_ = e.id().run();
78 
80  e.getByToken(digitoken_, digis);
81 
82  runtype_ = 1; // Let runtype_ = 1
83 
84  // Digis
85  int zside, plane, ix, iy, strip, iz;
86  if (digis.isValid()) {
87  for (ESDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr) {
88  ESDataFrame dataframe = (*digiItr);
89  ESDetId id = dataframe.id();
90 
91  zside = id.zside();
92  plane = id.plane();
93  ix = id.six();
94  iy = id.siy();
95  strip = id.strip();
96  iz = (zside == 1) ? 0 : 1;
97 
98  if (meADC_[senCount_[iz][plane - 1][ix - 1][iy - 1]][strip - 1]) {
99  if (runtype_ == 1) {
100  meADC_[senCount_[iz][plane - 1][ix - 1][iy - 1]][strip - 1]->Fill(dataframe.sample(0).adc());
101  meADC_[senCount_[iz][plane - 1][ix - 1][iy - 1]][strip - 1]->Fill(dataframe.sample(1).adc());
102  meADC_[senCount_[iz][plane - 1][ix - 1][iy - 1]][strip - 1]->Fill(dataframe.sample(2).adc());
103  } else if (runtype_ == 3) {
104  meADC_[senCount_[iz][plane - 1][ix - 1][iy - 1]][strip - 1]->Fill(dataframe.sample(1).adc());
105  }
106  }
107  }
108  }
109 }

References ESSample::adc(), edm::DataFrameContainer::begin(), MillePedeFileConverter_cfg::e, edm::DataFrameContainer::end(), ESDataFrame::id(), edm::HandleBase::isValid(), ESDataFrame::sample(), digitizers_cfi::strip, and ecaldqm::zside().

◆ bookHistograms()

void ESPedestalTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 40 of file ESPedestalTask.cc.

40  {
41  int iz, ip, ix, iy, fed, kchip, pace, bundle, fiber, optorx;
42  int senZ_[4288], senP_[4288], senX_[4288], senY_[4288];
43 
44  // read in look-up table
45  ifstream file(lookup_.fullPath().c_str());
46  if (!file.is_open())
47  throw cms::Exception("FileNotFound") << lookup_.fullPath();
48 
49  file >> nLines_;
50 
51  for (int i = 0; i < nLines_; ++i) {
52  file >> iz >> ip >> ix >> iy >> fed >> kchip >> pace >> bundle >> fiber >> optorx;
53 
54  senZ_[i] = iz;
55  senP_[i] = ip;
56  senX_[i] = ix;
57  senY_[i] = iy;
58 
59  iz = (senZ_[i] == 1) ? 0 : 1;
60  senCount_[iz][senP_[i] - 1][senX_[i] - 1][senY_[i] - 1] = i;
61  }
62 
63  char hname[300];
64 
65  iBooker.setCurrentFolder(prefixME_ + "/ESPedestalTask");
66 
67  for (int i = 0; i < nLines_; ++i) {
68  for (int is = 0; is < 32; ++is) {
69  sprintf(hname, "ADC Z %d P %d X %d Y %d Str %d", senZ_[i], senP_[i], senX_[i], senY_[i], is + 1);
70  meADC_[i][is] = iBooker.book1D(hname, hname, 1000, 899.5, 1899.5);
71  }
72  }
73 }

References dqm::implementation::IBooker::book1D(), FrontierConditions_GlobalTag_cff::file, mps_fire::i, and dqm::implementation::NavigatorBase::setCurrentFolder().

Member Data Documentation

◆ dac_

int ESPedestalTask::dac_
private

Definition at line 30 of file ESPedestalTask.h.

◆ digitoken_

edm::EDGetTokenT<ESDigiCollection> ESPedestalTask::digitoken_
private

Definition at line 22 of file ESPedestalTask.h.

◆ firstDAC_

int ESPedestalTask::firstDAC_
private

Definition at line 31 of file ESPedestalTask.h.

◆ gain_

int ESPedestalTask::gain_
private

Definition at line 30 of file ESPedestalTask.h.

◆ ievt_

int ESPedestalTask::ievt_
private

Definition at line 29 of file ESPedestalTask.h.

◆ isPed_

int ESPedestalTask::isPed_
private

Definition at line 31 of file ESPedestalTask.h.

◆ lookup_

edm::FileInPath ESPedestalTask::lookup_
private

Definition at line 23 of file ESPedestalTask.h.

◆ meADC_

MonitorElement* ESPedestalTask::meADC_[4288][32]
private

Definition at line 27 of file ESPedestalTask.h.

◆ nDAC_

int ESPedestalTask::nDAC_
private

Definition at line 31 of file ESPedestalTask.h.

◆ nLines_

int ESPedestalTask::nLines_
private

Definition at line 29 of file ESPedestalTask.h.

◆ outputFile_

std::string ESPedestalTask::outputFile_
private

Definition at line 24 of file ESPedestalTask.h.

◆ precision_

int ESPedestalTask::precision_
private

Definition at line 30 of file ESPedestalTask.h.

◆ prefixME_

std::string ESPedestalTask::prefixME_
private

Definition at line 25 of file ESPedestalTask.h.

◆ runNum_

int ESPedestalTask::runNum_
private

Definition at line 29 of file ESPedestalTask.h.

◆ runtype_

int ESPedestalTask::runtype_
private

Definition at line 30 of file ESPedestalTask.h.

◆ senCount_

int ESPedestalTask::senCount_[2][2][40][40]
private

Definition at line 29 of file ESPedestalTask.h.

◆ seqtype_

int ESPedestalTask::seqtype_
private

Definition at line 30 of file ESPedestalTask.h.

◆ vDAC_

int ESPedestalTask::vDAC_[5]
private

Definition at line 31 of file ESPedestalTask.h.

mps_fire.i
i
Definition: mps_fire.py:355
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
ESSample::adc
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:16
ESPedestalTask::outputFile_
std::string outputFile_
Definition: ESPedestalTask.h:24
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
ESPedestalTask::runtype_
int runtype_
Definition: ESPedestalTask.h:30
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESDetId
Definition: ESDetId.h:15
edm::Handle
Definition: AssociativeIterator.h:50
ESDataFrame
Definition: ESDataFrame.h:10
ESDataFrame::sample
const ESSample & sample(int i) const
Definition: ESDataFrame.h:24
ESPedestalTask::nLines_
int nLines_
Definition: ESPedestalTask.h:29
edm::FileInPath
Definition: FileInPath.h:64
ESPedestalTask::ievt_
int ievt_
Definition: ESPedestalTask.h:29
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
ESPedestalTask::digitoken_
edm::EDGetTokenT< ESDigiCollection > digitoken_
Definition: ESPedestalTask.h:22
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ESPedestalTask::prefixME_
std::string prefixME_
Definition: ESPedestalTask.h:25
ESPedestalTask::runNum_
int runNum_
Definition: ESPedestalTask.h:29
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ESPedestalTask::senCount_
int senCount_[2][2][40][40]
Definition: ESPedestalTask.h:29
cms::Exception
Definition: Exception.h:70
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::InputTag
Definition: InputTag.h:15
ESPedestalTask::meADC_
MonitorElement * meADC_[4288][32]
Definition: ESPedestalTask.h:27
ESDataFrame::id
const ESDetId & id() const
Definition: ESDataFrame.h:19
ESPedestalTask::lookup_
edm::FileInPath lookup_
Definition: ESPedestalTask.h:23
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37