66 auto subrunno = e.
subRun();
67 auto eventno = e.
event();
70 if (rdighandle->size()==0)
return;
75 rnst.Form(
"%08d",runno);
79 srnst.Form(
"%05d",subrunno);
83 est.Form(
"%08d",eventno);
87 cmd =
"touch " + outdir;
89 cmd =
"rm -rf " + outdir;
91 cmd =
"mkdir " + outdir;
96 size_t nchans_per_apa = 2560;
103 for (uint32_t iapaindex = 0; iapaindex < napas; ++iapaindex)
107 TString ofilename=outdir;
110 apast.Form(
"%03d",iapaindex);
112 for (
auto const& rawdigit : *rdighandle)
114 uint32_t chan = rawdigit.Channel();
115 uint32_t
apa = chan / nchans_per_apa;
116 if (apa == iapaindex)
120 ofile = fopen(ofilename,
"w");
122 fwrite(&version,
sizeof(version),1,ofile);
123 fwrite(&chan,
sizeof(chan),1,ofile);
124 uint32_t samples = rawdigit.Samples();
125 fwrite(&samples,
sizeof(samples),1,ofile);
127 fwrite(&compression,
sizeof(compression),1,ofile);
128 float pedestal = rawdigit.GetPedestal();
129 float sigma = rawdigit.GetSigma();
130 fwrite (&pedestal,
sizeof(pedestal),1,ofile);
131 fwrite (&sigma,
sizeof(sigma),1,ofile);
134 auto adcs = rawdigit.ADCs();
135 uint32_t nadc = adcs.size();
136 fwrite(&nadc,
sizeof(nadc),1,ofile);
138 fwrite(adcs.data(),
sizeof(adcs.front()),adcs.size(),ofile);
141 if (ofile != NULL) fclose(ofile);
EventNumber_t event() const
enum raw::_compress Compress_t
Definition of basic raw digits.
EDAnalyzer(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
std::string fOutputDirBaseName
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
SubRunNumber_t subRun() const
std::string fRawDigitLabel
void analyze(art::Event const &e) override
APAIORdWriter & operator=(APAIORdWriter const &)=delete
APAIORdWriter(fhicl::ParameterSet const &p)