CMS 3D CMS Logo

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

#include <PedsOnlyTask.h>

Inheritance diagram for PedsOnlyTask:
CommissioningTask

Public Member Functions

 PedsOnlyTask (DQMStore *, const FedChannelConnection &)
 
 ~PedsOnlyTask () override
 
- Public Member Functions inherited from CommissioningTask
void bookHistograms ()
 
 CommissioningTask (DQMStore *, const FedChannelConnection &, const std::string &my_name)
 
void eventSetup (const edm::EventSetup *)
 
const uint32_t & fillCntr () const
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &, const std::vector< uint16_t > &)
 
void fillHistograms (const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch)
 
const std::string & myName () const
 
const uint32_t & updateFreq () const
 
void updateFreq (const uint32_t &)
 
void updateHistograms ()
 
virtual ~CommissioningTask ()
 

Private Member Functions

void book () override
 
void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
 
void update () override
 

Private Attributes

ApvAnalysisFactorypApvFactory_
 
std::vector< HistoSetpeds_
 

Additional Inherited Members

- Public Types inherited from CommissioningTask
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CommissioningTask
const FedChannelConnectionconnection () const
 
DQMStore *const dqm () const
 
const edm::EventSetup *const eventSetup () const
 
const uint32_t & fecKey () const
 
const uint32_t & fedKey () const
 
void updateHistoSet (CompactHistoSet &)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin, const short &value)
 
void updateHistoSet (HistoSet &)
 
void updateHistoSet (HistoSet &, const float &value)
 
void updateHistoSet (HistoSet &, const uint32_t &bin)
 
void updateHistoSet (HistoSet &, const uint32_t &bin, const float &value)
 

Detailed Description

Definition at line 19 of file PedsOnlyTask.h.

Constructor & Destructor Documentation

◆ PedsOnlyTask()

PedsOnlyTask::PedsOnlyTask ( DQMStore dqm,
const FedChannelConnection rCONN 
)

Definition at line 17 of file PedsOnlyTask.cc.

18  : CommissioningTask(dqm, rCONN, "PedsOnlyTask") {
19  //@@ NOT GUARANTEED TO BE THREAD SAFE!
20  pApvFactory_ = edm::Service<ApvFactoryService>().operator->()->getApvFactory();
21 
22  LogTrace(mlDqmSource_) << "[PedsOnlyTask::" << __func__ << "]"
23  << " Constructing object...";
24 }

References LogTrace, sistrip::mlDqmSource_, and pApvFactory_.

◆ ~PedsOnlyTask()

PedsOnlyTask::~PedsOnlyTask ( )
override

Definition at line 28 of file PedsOnlyTask.cc.

28  {
29  LogTrace(mlDqmSource_) << "[PedsOnlyTask::" << __func__ << "]"
30  << " Destructing object...";
31 
32  // Have to delete pApvFactory_ manually even though we didn't create it
33  // ourself. :(
34  if (pApvFactory_) {
35  delete pApvFactory_;
36  }
37 }

References LogTrace, sistrip::mlDqmSource_, and pApvFactory_.

Member Function Documentation

◆ book()

void PedsOnlyTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 41 of file PedsOnlyTask.cc.

41  {
42  LogTrace(mlDqmSource_) << "[PedsOnlyTask::" << __func__ << "]";
43 
44  const uint16_t nBINS = 256;
45 
46  {
47  // Pedestals
51  fedKey(),
53  connection().lldChannel(),
55  .title();
56 
57  HistoSet oHSet;
58  oHSet.isProfile_ = true;
59 
60  oHSet.vNumOfEntries_.resize(nBINS, 0);
61  oHSet.vSumOfContents_.resize(nBINS, 0);
62  oHSet.vSumOfSquares_.resize(nBINS, 0);
63 
64  oHSet.histo(dqm()->bookProfile(title, title, nBINS, -0.5, nBINS * 1. - 0.5, 1025, 0., 1025.));
65 
66  peds_.push_back(oHSet);
67  }
68 
69  {
70  // Raw Noise
74  fedKey(),
76  connection().lldChannel(),
78  .title();
79 
80  HistoSet oHSet;
81  oHSet.isProfile_ = true;
82 
83  oHSet.vNumOfEntries_.resize(nBINS, 0);
84  oHSet.vSumOfContents_.resize(nBINS, 0);
85  oHSet.vSumOfSquares_.resize(nBINS, 0);
86 
87  oHSet.histo(dqm()->bookProfile(title, title, nBINS, -0.5, nBINS * 1. - 0.5, 1025, 0., 1025.));
88 
89  peds_.push_back(oHSet);
90  }
91 
92  pApvFactory_->instantiateApvs(connection().detId(), connection().nApvs());
93 }

References CommissioningTask::connection(), CommissioningTask::dqm(), sistrip::EXPERT_HISTO, sistrip::FED_KEY, CommissioningTask::fedKey(), CommissioningTask::HistoSet::histo(), ApvAnalysisFactory::instantiateApvs(), CommissioningTask::HistoSet::isProfile_, sistrip::LLD_CHAN, LogTrace, sistrip::mlDqmSource_, pApvFactory_, sistrip::extrainfo::pedestals_, peds_, sistrip::PEDS_ONLY, sistrip::extrainfo::rawNoise_, AlCaHLTBitMon_QueryRunRegistry::string, SiStripHistoTitle::title(), runGCPTkAlMap::title, CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

◆ fill()

void PedsOnlyTask::fill ( const SiStripEventSummary rSummary,
const edm::DetSet< SiStripRawDigi > &  rDigis 
)
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 97 of file PedsOnlyTask.cc.

97  {
98  pApvFactory_->updatePair(connection().detId(), connection().apvPairNumber(), rDigis);
99 }

References CommissioningTask::connection(), pApvFactory_, and ApvAnalysisFactory::updatePair().

◆ update()

void PedsOnlyTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 103 of file PedsOnlyTask.cc.

103  {
104  static UpdateTProfile updateTProfile;
105 
106  TProfile *pedsProf = ExtractTObject<TProfile>().extract(peds_[0].histo());
107  TProfile *noiseProf = ExtractTObject<TProfile>().extract(peds_[1].histo());
108 
109  for (uint16_t nLclApv = 2 * connection().apvPairNumber(), nMaxLclApv = nLclApv + 2; nMaxLclApv > nLclApv; ++nLclApv) {
110  ApvAnalysis::PedestalType lclPedestals;
111  ApvAnalysis::PedestalType lclNoises;
112 
113  pApvFactory_->getPedestal(connection().detId(), nLclApv, lclPedestals);
114  pApvFactory_->getRawNoise(connection().detId(), nLclApv, lclNoises);
115 
116  const uint16_t nSTART_BIN = 128 * (nLclApv % 2);
117 
118  for (uint16_t nBin = 0, nAbsBin = nSTART_BIN + nBin + 1; 128 > nBin; ++nBin, ++nAbsBin) {
119  updateTProfile.setBinContent(pedsProf, nAbsBin, 5, lclPedestals[nBin], lclNoises[nBin]);
120  updateTProfile.setBinContent(noiseProf, nAbsBin, 5, lclNoises[nBin], 0);
121  } // End loop over BINs
122  } // End loop over Local Apvs
123 }

References CommissioningTask::connection(), ExtractTObject< T >::extract(), ApvAnalysisFactory::getPedestal(), ApvAnalysisFactory::getRawNoise(), timingPdfMaker::histo, PFElectronDQMAnalyzer_cfi::nBin, pApvFactory_, peds_, and UpdateTProfile::setBinContent().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

Member Data Documentation

◆ pApvFactory_

ApvAnalysisFactory* PedsOnlyTask::pApvFactory_
private

Definition at line 31 of file PedsOnlyTask.h.

Referenced by book(), fill(), PedsOnlyTask(), update(), and ~PedsOnlyTask().

◆ peds_

std::vector<HistoSet> PedsOnlyTask::peds_
private

Definition at line 29 of file PedsOnlyTask.h.

Referenced by book(), and update().

sistrip::mlDqmSource_
static const char mlDqmSource_[]
Definition: ConstantsForLogger.h:20
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
UpdateTProfile
Definition: UpdateTProfile.h:8
CommissioningTask::connection
const FedChannelConnection & connection() const
Definition: CommissioningTask.h:189
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
ApvAnalysisFactory::getPedestal
void getPedestal(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &peds)
Definition: ApvAnalysisFactory.cc:198
ExtractTObject
Definition: ExtractTObject.h:9
PFElectronDQMAnalyzer_cfi.nBin
nBin
Definition: PFElectronDQMAnalyzer_cfi.py:25
CommissioningTask::fedKey
const uint32_t & fedKey() const
Definition: CommissioningTask.h:192
ApvAnalysisFactory::updatePair
void updatePair(uint32_t det_id, size_t apvPair, const edm::DetSet< SiStripRawDigi > &in)
Definition: ApvAnalysisFactory.cc:136
ApvAnalysisFactory::instantiateApvs
bool instantiateApvs(uint32_t det_id, int numberOfApvs)
Definition: ApvAnalysisFactory.cc:57
PedsOnlyTask::peds_
std::vector< HistoSet > peds_
Definition: PedsOnlyTask.h:29
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
sistrip::extrainfo::pedestals_
static const char pedestals_[]
Definition: ConstantsForDqm.h:45
CommissioningTask::CommissioningTask
CommissioningTask()
Definition: CommissioningTask.h:143
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ApvAnalysisFactory::getRawNoise
void getRawNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
Definition: ApvAnalysisFactory.cc:265
edm::Service
Definition: Service.h:30
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
sistrip::PEDS_ONLY
Definition: ConstantsForRunType.h:90
CommissioningTask::dqm
DQMStore *const dqm() const
Definition: CommissioningTask.h:188
SiStripHistoTitle::title
const std::string & title() const
Definition: SiStripHistoTitle.h:109
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
sistrip::extrainfo::rawNoise_
static const char rawNoise_[]
Definition: ConstantsForDqm.h:46
dqm
Definition: DQMStore.h:18
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
sistrip::FED_KEY
Definition: ConstantsForKeyType.h:30
ApvAnalysis::PedestalType
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
UpdateTProfile::setBinContent
static void setBinContent(TProfile *const profile, const uint32_t &bin, const double &entries, const double &mean, const double &spread)
Definition: UpdateTProfile.cc:80
PedsOnlyTask::pApvFactory_
ApvAnalysisFactory * pApvFactory_
Definition: PedsOnlyTask.h:31
sistrip::LLD_CHAN
Definition: ConstantsForGranularity.h:78