Belle II Software  release-06-02-00
arichBtestModule.h
1 
2 /**************************************************************************
3  * basf2 (Belle II Analysis Software Framework) *
4  * Author: The Belle II Collaboration *
5  * *
6  * See git log for contributors and copyright holders. *
7  * This file is licensed under LGPL-3.0, see LICENSE.md. *
8  **************************************************************************/
9 
10 #ifndef ARICHBTESTMODULE_H
11 #define ARICHBTESTMODULE_H
12 
13 #include <framework/core/Module.h>
14 
15 #include <string>
16 #include <vector>
17 #include <time.h>
18 #include <zlib.h>
19 
20 class TFile;
21 class TVector3;
22 
23 namespace Belle2 {
29  //class MCParticle;
30  class ARICHTracking;
31 
36  class arichBtestModule : public Module {
37 
38  public:
39 
45 
47  virtual ~arichBtestModule() {}
48 
50 
53  virtual void initialize() override;
54 
56 
58  virtual void beginRun() override;
59 
61 
64  virtual void event() override;
65 
67 
69  virtual void endRun() override;
70 
72 
75  virtual void terminate() override;
76 
77  protected:
78 
79 
81  int skipdata(gzFile fp);
83  void readmwpc(unsigned int* dbuf, unsigned int len, int print = 0);
85  int readhapd(unsigned int len, unsigned int* data);
87  int readdata(gzFile fp, int rec_id, int print);
89  gzFile m_fp;
91  int m_end;
93  int m_events;
95  TFile* m_file;
96 
97  std::vector<std::string> m_runList;
98  std::vector<int> m_eveList;
100  std::vector<std::string>::iterator m_runCurrent;
102  std::string m_outFile;
104  std::vector<int> m_MwpcTrackMask;
106  time_t m_timestart;
110  int m_tdc[32];
112  int getTrack(int mask, TVector3& r, TVector3& dir);
113 
114  private:
115 
118  };
119 
121 } // end namespace Belle2
122 
123 #endif // ARICHBTESTMODULE_H
Beamtest ARICH Geometry Tracking Class.
Base class for Modules.
Definition: Module.h:72
The UserTutorial module.
std::string m_outFile
output file name
time_t m_timestart
time of the first processed event
ARICHTracking * m_mwpc
Pointer to the tracking chambers.
int m_tdc[32]
raw MWPC TDC buffer
std::vector< std::string >::iterator m_runCurrent
current run
TFile * m_file
pointer to the root file
double m_beamMomentum
Momentum of the particles in the beam [GeV].
std::vector< std::string > m_runList
The filenames of the runs.
int m_events
number of events
virtual ~arichBtestModule()
Destructor.
std::vector< int > m_MwpcTrackMask
Bit mask of the MWPC tracking chambers used for the track creation.
gzFile m_fp
file desriptor of the data file
std::vector< int > m_eveList
The eventnumbers for each of the runs.
int skipdata(gzFile fp)
Skip the data part of the record.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Running over all events.
virtual void endRun() override
Is called after processing the last event of a run.
virtual void terminate() override
Is called at the end of your Module.
int getTrack(int mask, TVector3 &r, TVector3 &dir)
Beamtest Track reconstruction.
virtual void beginRun() override
Called when entering a new run.
void readmwpc(unsigned int *dbuf, unsigned int len, int print=0)
Read the MWPC information from the data buffer.
int readdata(gzFile fp, int rec_id, int print)
Read the data from the file (can be compressed)
int readhapd(unsigned int len, unsigned int *data)
Read the HAPD hits from the data buffer.
Abstract base class for different kinds of events.