-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrackingOutputASCII.h
38 lines (31 loc) · 941 Bytes
/
TrackingOutputASCII.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _h_TrackingOutputASCII
#define _h_TrackingOutputASCII
#include "TrackingSimulation.h"
#include <fstream>
// If USE_BOOST_GZ then using a filename ending in ".gz" gives a gzipped file.
//#define USE_BOOST_GZ 1
#ifdef USE_BOOST_GZ
#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#endif
class TrackingOutputASCII : public SimulationOutput {
public:
TrackingOutputASCII(const std::string& filename);
~TrackingOutputASCII();
size_t turn_number;
void SuppressUnscattered(const int factor);
protected:
void Record(const ComponentFrame* frame, const Bunch* bunch);
void RecordInitialBunch(const Bunch* bunch);
void RecordFinalBunch(const Bunch* bunch);
private:
#ifdef USE_BOOST_GZ
ofstream* backing_file;
boost::iostreams::filtering_ostream* output_file;
#else
std::ofstream* output_file;
#endif
int suppress_factor;
};
#endif