9 using namespace sistrip;
53 peds_[0].isProfile_ =
true;
63 peds_[0].histo(
dqm()->bookProfile(title, title,
nBins_, -0.5,
nBins_ * 1. - 0.5, 1025, 0., 1025.));
71 peds_[1].isProfile_ =
true;
82 peds_[1].histo(
dqm()->bookProfile(title, title,
nBins_, -0.5,
nBins_ * 1. - 0.5, 1025, 0., 1025.));
92 for (uint16_t iapv = 0; iapv < 2; iapv++) {
102 cm_[iapv].histo(
dqm()->book1D(title, title, nbins, -0.5, nbins * 1. - 0.5));
103 cm_[iapv].isProfile_ =
false;
105 cm_[iapv].vNumOfEntries_.resize(nbins, 0);
106 cm_[iapv].vNumOfEntries_.resize(nbins, 0);
167 <<
" Unexpected number of digis (" << digis.
data.size()
168 <<
") wrt number of histogram bins (" <<
nBins_ <<
")!";
173 for (uint16_t ibin = 0; ibin < bins; ibin++) {
179 uint16_t
nbins =
peds_[0].vNumOfEntries_.size();
181 nbins = digis.
data.size();
184 uint16_t napvs = nbins / 128;
185 std::vector<uint32_t> cm;
189 std::vector<uint16_t>
adc;
190 for (uint16_t iapv = 0; iapv < napvs; iapv++) {
194 for (uint16_t ibin = 0; ibin < 128; ibin++) {
195 if ((iapv * 128) + ibin < nbins) {
196 adc.push_back(digis.
data[(iapv * 128) + ibin].adc());
200 sort(adc.begin(), adc.end());
201 uint16_t
index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
203 cm[iapv] =
static_cast<uint32_t
>(adc[
index]);
207 for (uint16_t ibin = 0; ibin <
nbins; ibin++) {
208 float digiVal = digis.
data[ibin].adc();
210 float diff = digiVal -
static_cast<float>(cm[ibin / 128]);
214 if (cm.size() <
cm_.size()) {
216 <<
" Fewer CM values than expected: " << cm.size();
238 <<
" Unexpected number of digis (" << digis.
data.size()
239 <<
") wrt number of histogram bins (" <<
nBins_ <<
")!";
244 for (uint16_t ibin = 0; ibin < bins; ibin++) {
250 uint16_t
nbins =
peds_[0].vNumOfEntries_.size();
252 nbins = digis.
data.size();
255 uint16_t napvs = nbins / 128;
256 std::vector<uint32_t> cm;
260 std::vector<uint16_t>
adc;
261 for (uint16_t iapv = 0; iapv < napvs; iapv++) {
264 for (uint16_t ibin = 0; ibin < 128; ibin++) {
265 if ((iapv * 128) + ibin < nbins) {
266 adc.push_back(digis.
data[(iapv * 128) + ibin].adc());
269 sort(adc.begin(), adc.end());
270 uint16_t
index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
272 cm[iapv] =
static_cast<uint32_t
>(adc[
index]);
277 for (uint16_t ibin = 0; ibin <
nbins; ibin++) {
278 float digiVal = digis.
data[ibin].adc();
280 float diff = digiVal -
static_cast<float>(cm[ibin / 128]);
284 if (cm.size() <
cm_.size()) {
286 <<
" Fewer CM values than expected: " << cm.size();
293 for (uint16_t ibin = 0; ibin < bins; ibin++) {
298 std::vector<uint32_t> adcHeader_high;
299 std::vector<uint32_t> adcHeader_low;
301 float threshold_high = (digisAlt.
data[286].adc() + digisAlt.
data[287].adc()) / 4;
302 float threshold_low = 100;
303 int minNumberForHeader = 4;
304 bool goodHeaderFound =
false;
305 int nConsecutiveHigh = 0;
306 adcHeader_high.clear();
307 adcHeader_high.reserve(30);
308 adcHeader_low.clear();
309 adcHeader_low.reserve(30);
311 for (uint16_t ibin = 6; ibin < 11; ibin++) {
312 if (digisAlt.
data[ibin].adc() > threshold_high) {
317 if (nConsecutiveHigh > minNumberForHeader)
318 goodHeaderFound =
true;
319 if (goodHeaderFound ==
false)
321 for (uint16_t ibin = 0; ibin < 30; ibin++) {
322 if (digisAlt.
data[ibin].adc() > threshold_high &&
324 adcHeader_high.push_back(digisAlt.
data[ibin].adc());
326 if (digisAlt.
data[ibin].adc() < threshold_low && goodHeaderFound) {
327 adcHeader_low.push_back(digisAlt.
data[ibin].adc());
330 if (adcHeader_low.empty() || adcHeader_high.empty()) {
333 for (uint16_t
i = 0;
i < adcHeader_low.size();
i++) {
336 for (uint16_t
i = 0;
i < adcHeader_high.size();
i++) {
347 const std::vector<uint16_t>& stripOnCluster) {
357 <<
" Unexpected number of digis (" << digis.
data.size()
358 <<
") wrt number of histogram bins (" <<
nBins_ <<
")!";
363 for (uint16_t ibin = 0; ibin < bins; ibin++) {
368 uint16_t
nbins =
peds_[0].vNumOfEntries_.size();
370 nbins = digis.
data.size();
372 uint16_t napvs = nbins / 128;
373 std::vector<uint32_t> cm;
376 std::vector<uint16_t>
adc;
377 for (uint16_t iapv = 0; iapv < napvs; iapv++) {
380 for (uint16_t ibin = 0; ibin < 128; ibin++) {
381 if ((iapv * 128) + ibin < nbins) {
382 if (
std::find(stripOnCluster.begin(), stripOnCluster.end(), (iapv * 128) + ibin) ==
383 stripOnCluster.end())
384 adc.push_back(digis.
data[(iapv * 128) + ibin].adc());
387 sort(adc.begin(), adc.end());
388 uint16_t
index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
390 cm[iapv] =
static_cast<uint32_t
>(adc[
index]);
395 for (uint16_t ibin = 0; ibin <
nbins; ibin++) {
396 if (
std::find(stripOnCluster.begin(), stripOnCluster.end(), ibin) != stripOnCluster.end()) {
399 float digiVal = digis.
data[ibin].adc();
401 float diff = digiVal -
static_cast<float>(cm[ibin / 128]);
405 if (cm.size() <
cm_.size()) {
407 <<
" Fewer CM values than expected: " << cm.size();
414 for (uint16_t ibin = 0; ibin < bins; ibin++) {
418 std::vector<uint32_t> adcHeader_high;
419 std::vector<uint32_t> adcHeader_low;
421 float threshold_high = (digisAlt.
data[286].adc() + digisAlt.
data[287].adc()) / 4;
422 float threshold_low = 120;
423 int minNumberForHeader = 4;
424 bool goodHeaderFound =
false;
425 int nConsecutiveHigh = 0;
426 adcHeader_high.clear();
427 adcHeader_high.reserve(30);
428 adcHeader_low.clear();
429 adcHeader_low.reserve(30);
431 for (uint16_t ibin = 6; ibin < 11; ibin++) {
432 if (digisAlt.
data[ibin].adc() > threshold_high) {
437 if (nConsecutiveHigh > minNumberForHeader)
438 goodHeaderFound =
true;
439 if (goodHeaderFound ==
false)
441 for (uint16_t ibin = 0; ibin < 30; ibin++) {
442 if (digisAlt.
data[ibin].adc() > threshold_high &&
444 adcHeader_high.push_back(digisAlt.
data[ibin].adc());
446 if (digisAlt.
data[ibin].adc() < threshold_low && goodHeaderFound) {
447 adcHeader_low.push_back(digisAlt.
data[ibin].adc());
450 if (adcHeader_low.empty() || adcHeader_high.empty()) {
453 for (uint16_t
i = 0;
i < adcHeader_low.size();
i++) {
456 for (uint16_t
i = 0;
i < adcHeader_high.size();
i++) {
470 for (uint16_t
ii = 0;
ii <
peds_[1].vNumOfEntries_.size(); ++
ii) {
473 float entries =
peds_[1].vNumOfEntries_[
ii];
475 mean =
peds_[1].vSumOfContents_[
ii] / entries;
476 spread =
sqrt(
peds_[1].vSumOfSquares_[
ii] / entries - mean * mean);
479 float noise = spread;
std::vector< float > vNumOfEntries_
edm::ParameterSet parameters_
parameters useful for the spy
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Utility class that holds histogram title.
const std::string & title() const
DaqScopeModeTask(DQMStore *, const FedChannelConnection &, const edm::ParameterSet &)
static const char mlDqmSource_[]
std::vector< float > vSumOfContents_
const uint32_t & updateFreq() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
DQMStore *const dqm() const
Class containning control, module, detector and connection information, at the level of a FED channel...
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
static void setBinContent(TProfile *const profile, const uint32_t &bin, const double &entries, const double &mean, const double &spread)
std::vector< HistoSet > cm_
int extract(std::vector< int > *output, const std::string &dati)
~DaqScopeModeTask() override
const uint32_t & fillCntr() const
T getParameter(std::string const &) const
void histo(MonitorElement *)
const uint32_t & fedKey() const
std::vector< double > vSumOfSquares_
const FedChannelConnection & connection() const
Log< level::Warning, false > LogWarning
uint16_t *__restrict__ uint16_t const *__restrict__ adc