CMS 3D CMS Logo

PedsOnlyTask.cc
Go to the documentation of this file.
10 
12 
13 using namespace sistrip;
14 
15 // -----------------------------------------------------------------------------
16 //
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 }
25 
26 // -----------------------------------------------------------------------------
27 //
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 }
38 
39 // -----------------------------------------------------------------------------
40 //
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 }
94 
95 // -----------------------------------------------------------------------------
96 //
98  pApvFactory_->updatePair(connection().detId(), connection().apvPairNumber(), rDigis);
99 }
100 
101 // -----------------------------------------------------------------------------
102 //
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 }
124 // -----------------------------------------------------------------------------
CommissioningTask::HistoSet::vSumOfSquares_
std::vector< double > vSumOfSquares_
Definition: CommissioningTask.h:46
sistrip::mlDqmSource_
static const char mlDqmSource_[]
Definition: ConstantsForLogger.h:20
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
UpdateTProfile
Definition: UpdateTProfile.h:8
MessageLogger.h
CommissioningTask::HistoSet::vSumOfContents_
std::vector< float > vSumOfContents_
Definition: CommissioningTask.h:45
edm::DetSet
Definition: DetSet.h:23
CommissioningTask::connection
const FedChannelConnection & connection() const
Definition: CommissioningTask.h:189
PedsOnlyTask::update
void update() override
Definition: PedsOnlyTask.cc:103
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
DQMStore.h
ExtractTObject.h
CommissioningTask
Definition: CommissioningTask.h:24
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::HistoSet
Definition: CommissioningTask.h:38
CommissioningTask::HistoSet::vNumOfEntries_
std::vector< float > vNumOfEntries_
Definition: CommissioningTask.h:44
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
dqm::legacy::DQMStore
Definition: DQMStore.h:727
Service.h
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
sistrip::extrainfo::pedestals_
static const char pedestals_[]
Definition: ConstantsForDqm.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CommissioningTask::HistoSet::isProfile_
bool isProfile_
Definition: CommissioningTask.h:47
ApvAnalysisFactory.h
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
SiStripConstants.h
CommissioningTask::HistoSet::histo
void histo(MonitorElement *)
Definition: CommissioningTask.cc:89
ApvAnalysisFactory::getRawNoise
void getRawNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
Definition: ApvAnalysisFactory.cc:265
edm::Service
Definition: Service.h:30
UpdateTProfile.h
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
sistrip::PEDS_ONLY
Definition: ConstantsForRunType.h:90
PedsOnlyTask::PedsOnlyTask
PedsOnlyTask(DQMStore *, const FedChannelConnection &)
Definition: PedsOnlyTask.cc:17
PedsOnlyTask::book
void book() override
Definition: PedsOnlyTask.cc:41
PedsOnlyTask::fill
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
Definition: PedsOnlyTask.cc:97
CommissioningTask::dqm
DQMStore *const dqm() const
Definition: CommissioningTask.h:188
PedsOnlyTask.h
SiStripHistoTitle.h
ApvFactoryService.h
SiStripHistoTitle::title
const std::string & title() const
Definition: SiStripHistoTitle.h:109
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
PedsOnlyTask::~PedsOnlyTask
~PedsOnlyTask() override
Definition: PedsOnlyTask.cc:28
sistrip::extrainfo::rawNoise_
static const char rawNoise_[]
Definition: ConstantsForDqm.h:46
dqm
Definition: DQMStore.h:18
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
sistrip::FED_KEY
Definition: ConstantsForKeyType.h:30
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
ApvAnalysis::PedestalType
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
SiStripEventSummary
Definition: SiStripEventSummary.h:22
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