CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
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 // -----------------------------------------------------------------------------
std::vector< float > vNumOfEntries_
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
static const char rawNoise_[]
Utility class that holds histogram title.
void getPedestal(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &peds)
static const char mlDqmSource_[]
std::vector< float > vSumOfContents_
sistrip classes
void update() override
#define LogTrace(id)
void getRawNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
void updatePair(uint32_t det_id, size_t apvPair, const edm::DetSet< SiStripRawDigi > &in)
Class containning control, module, detector and connection information, at the level of a FED channel...
bool instantiateApvs(uint32_t det_id, int numberOfApvs)
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)
void book() override
Definition: PedsOnlyTask.cc:41
const uint32_t & fedKey() const
DQMStore *const dqm() const
~PedsOnlyTask() override
Definition: PedsOnlyTask.cc:28
int extract(std::vector< int > *output, const std::string &dati)
static const char pedestals_[]
uint16_t apvPairNumber() const
ApvAnalysisFactory * pApvFactory_
Definition: PedsOnlyTask.h:31
void histo(MonitorElement *)
PedsOnlyTask(DQMStore *, const FedChannelConnection &)
Definition: PedsOnlyTask.cc:17
std::vector< double > vSumOfSquares_
const std::string & title() const
const FedChannelConnection & connection() const
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
Definition: PedsOnlyTask.cc:97
Definition: DQMStore.h:18