16 #include "art_root_io/TFileService.h" 74 fDiffs = tfs->make<TH1F>(
"One timestamp diffs",
";#Delta ADC;", 40, -19.5, 20.5);
75 fCompressErr = tfs->make<TH1F>(
"compressErr",
";Raw-Compressed;", 1000, -495.5, 500.5);
76 fCompressFactor = tfs->make<TH1F>(
"compressFactor",
";Compression;", 500, 0., 1.);
78 fCompressErr2D = tfs->make<TH2F>(
"compressErr2D",
";Raw;Raw-Compressed", 100, -50., 50., 1000, -495.5, 500.5);
79 fRawVsCompress = 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));
119 if(uncompressed.size() != rdvec[rd]->Samples()){
121 <<
"uncompression does not produce same size vector as original: " 122 <<
"original = " << rdvec[rd]->Samples() <<
" uncompress = " 123 << uncompressed.size() <<
"\n";
126 for(
unsigned int t = 0;
t < uncompressed.size(); ++
t){
128 if(uncompressed[
t]-rdvec[rd]->ADC(
t) > 1)
130 <<
" time " <<
t <<
" ADC " << rdvec[rd]->ADC(
t)
131 <<
" uncompress " << uncompressed[
t]
132 <<
" channel " << rdvec[rd]->Channel();
Detector simulation of raw signals on wires.
EDAnalyzer(fhicl::ParameterSet const &pset)
TH1F * fDiffs
histogram of Raw tdc to tdc differences
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
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
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