16 #include "art_root_io/TFileService.h" 73 fDiffs = tfs->make<TH1F>(
"One timestamp diffs",
";#Delta ADC;", 40, -19.5, 20.5);
74 fCompressErr = tfs->make<TH1F>(
"compressErr",
";Raw-Compressed;", 1000, -495.5, 500.5);
75 fCompressFactor = tfs->make<TH1F>(
"compressFactor",
";Compression;", 500, 0., 1.);
78 tfs->make<TH2F>(
"compressErr2D",
";Raw;Raw-Compressed", 100, -50., 50., 1000, -495.5, 500.5);
80 tfs->make<TH2F>(
"rawVsCompress",
";Raw;Compressed", 100, -50., 50., 100, -50., 50.);
95 for (
unsigned int i = 0; i < rdHandle->size(); ++i) {
101 for (
unsigned int rd = 0; rd < rdvec.
size(); ++rd) {
103 std::vector<short> adc;
104 std::vector<short> uncompressed(rdvec[rd]->Samples());
105 for (
unsigned int t = 1; t < rdvec[rd]->Samples(); ++t) {
106 fDiffs->Fill(rdvec[rd]->ADC(t) - rdvec[rd]->ADC(t - 1));
107 adc.push_back(rdvec[rd]->ADC(t - 1));
111 adc.push_back(rdvec[rd]->ADC(rdvec[rd]->Samples() - 1));
115 fCompressFactor->Fill((1. * adc.size()) / (1. * rdvec[rd]->Samples()));
119 if (uncompressed.size() != rdvec[rd]->Samples()) {
121 <<
"uncompression does not produce same size vector as original: " 122 <<
"original = " << rdvec[rd]->Samples() <<
" uncompress = " << uncompressed.size()
126 for (
unsigned int t = 0; t < uncompressed.size(); ++t) {
128 if (uncompressed[t] - rdvec[rd]->ADC(t) > 1)
130 <<
"problem with event " 131 <<
" time " << t <<
" ADC " << rdvec[rd]->ADC(t) <<
" uncompress " << uncompressed[t]
132 <<
" channel " << rdvec[rd]->Channel();
134 fCompressErr->Fill(uncompressed[t] - rdvec[rd]->ADC(t));
135 fCompressErr2D->Fill(rdvec[rd]->ADC(t), uncompressed[t] - rdvec[rd]->ADC(t));
Detector simulation of raw signals on wires.
Definition of basic raw digits.
EDAnalyzer(fhicl::ParameterSet const &pset)
TH1F * fDiffs
histogram of Raw tdc to tdc differences
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
Collect all the RawData header files together.
T get(std::string const &key) const
std::string fDetSimModuleLabel
name of module that produced the digits
void analyze(const art::Event &evt)
read/write access to event
TH1F * fCompressFactor
compression factor
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
TH2F * fRawVsCompress
histogram of original tdc value vs compressesed value
SimWireAna(fhicl::ParameterSet const &pset)
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
Base class for creation of raw signals on wires.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
TH2F * fCompressErr2D
histogram of original tdc value vs compressesed value
cet::coded_exception< error, detail::translate > exception