CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 (HistoSet &, const uint32_t &bin, const float &value)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin, const short &value)
 
void updateHistoSet (HistoSet &, const uint32_t &bin)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin)
 
void updateHistoSet (HistoSet &, const float &value)
 
void updateHistoSet (CompactHistoSet &)
 
void updateHistoSet (HistoSet &)
 

Detailed Description

Definition at line 19 of file PedsOnlyTask.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file PedsOnlyTask.cc.

References LogTrace, sistrip::mlDqmSource_, Utilities::operator, and pApvFactory_.

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 }
static const char mlDqmSource_[]
#define LogTrace(id)
ApvAnalysisFactory * pApvFactory_
Definition: PedsOnlyTask.h:31
PedsOnlyTask::~PedsOnlyTask ( )
override

Definition at line 28 of file PedsOnlyTask.cc.

References LogTrace, sistrip::mlDqmSource_, and pApvFactory_.

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 }
static const char mlDqmSource_[]
#define LogTrace(id)
ApvAnalysisFactory * pApvFactory_
Definition: PedsOnlyTask.h:31

Member Function Documentation

void PedsOnlyTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 41 of file PedsOnlyTask.cc.

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_.

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 }
static const char rawNoise_[]
Utility class that holds histogram title.
const std::string & title() const
static const char mlDqmSource_[]
#define LogTrace(id)
DQMStore *const dqm() const
bool instantiateApvs(uint32_t det_id, int numberOfApvs)
std::vector< HistoSet > peds_
Definition: PedsOnlyTask.h:29
static const char pedestals_[]
ApvAnalysisFactory * pApvFactory_
Definition: PedsOnlyTask.h:31
const uint32_t & fedKey() const
const FedChannelConnection & connection() const
void PedsOnlyTask::fill ( const SiStripEventSummary rSummary,
const edm::DetSet< SiStripRawDigi > &  rDigis 
)
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 97 of file PedsOnlyTask.cc.

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

97  {
98  pApvFactory_->updatePair(connection().detId(), connection().apvPairNumber(), rDigis);
99 }
void updatePair(uint32_t det_id, size_t apvPair, const edm::DetSet< SiStripRawDigi > &in)
ApvAnalysisFactory * pApvFactory_
Definition: PedsOnlyTask.h:31
const FedChannelConnection & connection() const
void PedsOnlyTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 103 of file PedsOnlyTask.cc.

References FedChannelConnection::apvPairNumber(), CommissioningTask::connection(), extract(), ApvAnalysisFactory::getPedestal(), ApvAnalysisFactory::getRawNoise(), timingPdfMaker::histo, 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().

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 }
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
void getPedestal(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &peds)
uint16_t apvPairNumber() const
void getRawNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
std::vector< HistoSet > peds_
Definition: PedsOnlyTask.h:29
static void setBinContent(TProfile *const profile, const uint32_t &bin, const double &entries, const double &mean, const double &spread)
int extract(std::vector< int > *output, const std::string &dati)
ApvAnalysisFactory * pApvFactory_
Definition: PedsOnlyTask.h:31
const FedChannelConnection & connection() const

Member Data Documentation

ApvAnalysisFactory* PedsOnlyTask::pApvFactory_
private

Definition at line 31 of file PedsOnlyTask.h.

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

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

Definition at line 29 of file PedsOnlyTask.h.

Referenced by book(), and update().