71 art::ServiceHandle<evd::RawDrawingOptions const> rawOpt;
74 const art::Event*
event = evdb::EventHolder::Instance()->GetEvent();
80 fMinimum = std::numeric_limits<float>::max();
81 fMaximum = std::numeric_limits<float>::lowest();
84 for (
const auto& rawDataLabel : rawOpt->fRawDataLabels) {
85 art::Handle<std::vector<raw::RawDigit>> rawDigitVecHandle;
86 event->getByLabel(rawDataLabel, rawDigitVecHandle);
88 if (!rawDigitVecHandle.isValid())
continue;
90 for (
size_t rawDigitIdx = 0; rawDigitIdx < rawDigitVecHandle->size(); rawDigitIdx++) {
91 art::Ptr<raw::RawDigit> rawDigit(rawDigitVecHandle, rawDigitIdx);
93 if (rawDigit->Channel() != channel)
continue;
97 art::ServiceHandle<lariov::DetPedestalService const>()->GetPedestalProvider();
102 if (rawOpt->fPedestalOption == 0) { pedestal = pedestalRetrievalAlg.
PedMean(channel); }
103 else if (rawOpt->fPedestalOption == 1) {
104 pedestal = rawDigit->GetPedestal();
106 else if (rawOpt->fPedestalOption == 2) {
110 mf::LogWarning(
"DrawRawHist")
111 <<
" PedestalOption is not understood: " << rawOpt->fPedestalOption
112 <<
". Pedestals not subtracted.";
115 std::vector<short> uncompressed(rawDigit->Samples());
116 raw::Uncompress(rawDigit->ADCs(), uncompressed, rawDigit->Compression());
120 for (
size_t idx = 0; idx < uncompressed.size(); idx++) {
121 float signalVal = float(uncompressed[idx]) - pedestal;
123 histPtr->Fill(
float(idx) + 0.5, signalVal);
126 short minimumVal = *std::min_element(uncompressed.begin(), uncompressed.end());
127 short maximumVal = *std::max_element(uncompressed.begin(), uncompressed.end());
129 fMinimum = float(minimumVal) - pedestal;
130 fMaximum = float(maximumVal) - pedestal;
132 histPtr->SetLineColor(kBlack);
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.