57 fAPAmin =
p.get<uint32_t>(
"APAMin",0);
58 fAPAmax =
p.get<uint32_t>(
"APAMax",150);
59 produces<std::vector<raw::RawDigit>>();
67 std::unique_ptr<std::vector<raw::RawDigit>> digcol(
new std::vector<raw::RawDigit>);
70 auto subrunno = e.
subRun();
71 auto eventno = e.
event();
76 rnst.Form(
"%08d",runno);
80 srnst.Form(
"%05d",subrunno);
84 est.Form(
"%08d",eventno);
86 gSystem->ExpandPathName(inputdir);
88 void* dirp = gSystem->OpenDirectory(inputdir);
93 TString fullfilename =
"";
94 while((entry = (
char*)gSystem->GetDirEntry(dirp)))
97 if (str.Contains(
"apa"))
99 fullfilename = inputdir;
101 fullfilename +=
entry;
103 FILE *
infile = fopen(fullfilename,
"r");
104 while (infile != NULL)
113 fread(&version,
sizeof(version),1,infile);
114 if (feof(infile))
break;
116 fread(&chan,
sizeof(chan),1,infile);
118 uint32_t apanum = chan/2560;
121 fread(&samples,
sizeof(samples),1,infile);
122 fread(&compression,
sizeof(compression),1,infile);
123 fread (&pedestal,
sizeof(pedestal),1,infile);
124 fread (&sigma,
sizeof(sigma),1,infile);
125 fread(&nadc,
sizeof(nadc),1,infile);
127 fread(adcs.data(),
sizeof(adcs.front()),adcs.size(),
infile);
128 digcol->emplace_back(chan,samples,adcs,compression);
129 digcol->back().SetPedestal(pedestal,sigma);
131 if (infile != NULL) fclose(infile);
134 gSystem->FreeDirectory(dirp);
EventNumber_t event() const
enum raw::_compress Compress_t
EDProducer(fhicl::ParameterSet const &pset)
void produce(art::Event &e) override
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition of basic raw digits.
#define DEFINE_ART_MODULE(klass)
SubRunNumber_t subRun() const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
std::string fInputDirBaseName
APAIORdReader(fhicl::ParameterSet const &p)
APAIORdReader & operator=(APAIORdReader const &)=delete