CFEL - ASG Software Suite  2.5.0
CASS
xtc_parser.cpp
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file xtc_parser.cpp contains the class to parse xtc files
5  *
6  * @author Lutz Foucar
7  */
8 
9 #include "xtc_parser.h"
10 
11 #include "cass_event.h"
12 #include "cass_settings.h"
13 #include "input_base.h"
14 
15 #include "pdsdata/xtc/Dgram.hh"
16 
17 using namespace cass;
18 using namespace std;
19 
21 {
22  ifstream &file(*(_readerpointerpair.second._filestream));
23  Pds::Dgram datagram;
24  while((!InputBase::reference().shouldQuit()) && (!file.eof()))
25  {
26  const streampos eventstartpos(file.tellg());
27  file.read(reinterpret_cast<char*>(&datagram), sizeof(Pds::Dgram));
28  file.seekg(datagram.xtc.sizeofPayload(), ios_base::cur);
29 
30  if (datagram.seq.service() == Pds::TransitionId::L1Accept)
31  {
32  uint64_t bunchId = datagram.seq.clock().seconds();
33  bunchId = (bunchId<<32) + static_cast<uint32_t>(datagram.seq.stamp().fiducials()<<8);
34  savePos(eventstartpos,bunchId);
35  }
36  }
37 }
contains class to parse xtc files
file contains declaration of the CASSEvent
STL namespace.
void runthis()
parse the frms6 file
Definition: xtc_parser.cpp:20
contains the base class for all input modules
file contains specialized class that do the settings for cass
static shared_pointer::element_type & reference()
get reference to the singelton instance
Definition: input_base.cpp:28