19 #include "cetlib_except/coded_exception.h" 48 unsigned short software;
60 unsigned short samples;
73 size_t p1 = s1.find(
"R");
74 size_t p2 = s1.find(
"_E");
76 int run = atoi((s1.substr(p1+1,p2-p1-1)).c_str());
84 size_t p1 = s1.find(
"E");
85 size_t p2 = s1.find(
"_T");
87 int event = atoi((s1.substr(p1+1,p2-p1-1)).c_str());
100 return r1 == r2 ? e1 < e2
110 <<
"Vacuous directory name" <<
std::endl;
112 std::vector<std::string>
files;
115 if( (dp = opendir(dir.c_str())) == NULL ) {
117 <<
"Error opening directory " << dir <<
std::endl;
120 dirent * dirp = NULL;
121 while( (dirp = readdir(dp)) != NULL ) {
123 if(
filename.find(
"bin") != std::string::npos ) {
129 sort( files.begin(), files.end(),
compare );
134 struct EventFileSentry {
137 :
infile(filepath.c_str(),
std::ios_base::in |
std::ios_base::binary)
139 ~EventFileSentry() {
infile.close(); }
147 std::vector<raw::RawDigit>& digitList,
154 EventFileSentry efs(dir+
"/"+filename);
155 std::ifstream &
infile = efs.infile;
157 if( !infile.is_open() ) {
159 <<
"failed to open input file " << filename <<
std::endl;
162 unsigned int wiresPerPlane = 240;
163 unsigned int planes = 2;
170 infile.read((
char *) &h1,
sizeof h1);
172 time_t mytime = h1.time;
173 mytime = mytime << 32;
198 digitList.resize(wiresPerPlane*planes);
200 for(
int i = 0; i != h1.nchan; ++i ) {
201 infile.read((
char *) &c1,
sizeof c1);
203 std::vector<short> adclist(c1.samples);
204 infile.read((
char*)&adclist[0],
sizeof(
short)*c1.samples);
209 digitList[i] =
raw::RawDigit((c1.ch-1), c1.samples, adclist);
212 digitList[i].SetPedestal(400.);
215 infile.read((
char *) &f1,
sizeof f1);
232 , nextfile_ ( inputfiles_.
begin() )
233 , filesdone_ ( inputfiles_.
end() )
234 , currentSubRunID_ ( )
270 std::unique_ptr<std::vector<raw::RawDigit> > rdcol (
new std::vector<raw::RawDigit> );
276 std::unique_ptr<raw::DAQHeader> daqcol(
new raw::DAQHeader(daqHeader) );
281 if (firstEventInRun){
282 std::unique_ptr<sumdata::RunData> rundata(
new sumdata::RunData(
"argoneut") );
292 <<
"Encountered run #" << rn
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
Collection of charge vs time digitized from a single readout channel.
int compare(unsigned *r, sha1::digest_t const &d)
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
SubRunPrincipal * makeSubRunPrincipal(SubRunAuxiliary const &subRunAux) const
RunPrincipal * makeRunPrincipal(RunAuxiliary const &runAux) const
TypeLabel const & reconstitutes(std::string const &modLabel, std::string const &instanceName={})
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::enable_if_t<!detail::range_sets_supported(P::branch_type)> put_product_in_principal(std::unique_ptr< T > &&product, P &principal, std::string const &module_label, std::string const &instance_name={})
Conversion of binary data to root files.
EventPrincipal * makeEventPrincipal(EventAuxiliary const &eventAux, std::unique_ptr< History > &&history) const
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
SubRunNumber_t subRun() const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
IDNumber_t< Level::Run > RunNumber_t