Belle II Software  release-05-02-19
arichBtestModule.h
1 
2 /**************************************************************************
3  * BASF2 (Belle Analysis Framework 2) *
4  * Copyright(C) 2010 - Belle II Collaboration *
5  * *
6  * Author: The Belle II Collaboration *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef ARICHBTESTMODULE_H
12 #define ARICHBTESTMODULE_H
13 
14 #include <framework/core/Module.h>
15 
16 #include <string>
17 #include <vector>
18 #include <time.h>
19 #include <zlib.h>
20 
21 class TFile;
22 class TVector3;
23 
24 namespace Belle2 {
30  //class MCParticle;
31  class ARICHTracking;
32 
37  class arichBtestModule : public Module {
38 
39  public:
40 
46 
48  virtual ~arichBtestModule() {}
49 
51 
54  virtual void initialize() override;
55 
57 
59  virtual void beginRun() override;
60 
62 
65  virtual void event() override;
66 
68 
70  virtual void endRun() override;
71 
73 
76  virtual void terminate() override;
77 
78  protected:
79 
80 
82  int skipdata(gzFile fp);
84  void readmwpc(unsigned int* dbuf, unsigned int len, int print = 0);
86  int readhapd(unsigned int len, unsigned int* data);
88  int readdata(gzFile fp, int rec_id, int print);
90  gzFile m_fp;
92  int m_end;
94  int m_events;
96  TFile* m_file;
97 
98  std::vector<std::string> m_runList;
99  std::vector<int> m_eveList;
100  std::vector<std::string>::iterator m_runCurrent;
103  std::string m_outFile;
105  std::vector<int> m_MwpcTrackMask;
107  time_t m_timestart;
111  int m_tdc[32];
113  int getTrack(int mask, TVector3& r, TVector3& dir);
114 
115  private:
116 
119  };
120 
122 } // end namespace Belle2
123 
124 #endif // ARICHBTESTMODULE_H
Belle2::arichBtestModule::m_end
int m_end
EOF flag.
Definition: arichBtestModule.h:92
Belle2::arichBtestModule::terminate
virtual void terminate() override
Is called at the end of your Module.
Definition: arichBtestModule.cc:572
Belle2::arichBtestModule::arichBtestModule
arichBtestModule()
Constructor.
Definition: arichBtestModule.cc:67
Belle2::arichBtestModule
The UserTutorial module.
Definition: arichBtestModule.h:37
Belle2::arichBtestModule::m_fp
gzFile m_fp
file desriptor of the data file
Definition: arichBtestModule.h:90
Belle2::arichBtestModule::event
virtual void event() override
Running over all events.
Definition: arichBtestModule.cc:470
Belle2::arichBtestModule::readdata
int readdata(gzFile fp, int rec_id, int print)
Read the data from the file (can be compressed)
Definition: arichBtestModule.cc:402
Belle2::arichBtestModule::m_runCurrent
std::vector< std::string >::iterator m_runCurrent
current run
Definition: arichBtestModule.h:101
Belle2::arichBtestModule::m_file
TFile * m_file
pointer to the root file
Definition: arichBtestModule.h:96
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::arichBtestModule::skipdata
int skipdata(gzFile fp)
Skip the data part of the record.
Definition: arichBtestModule.cc:194
Belle2::arichBtestModule::m_mwpc
ARICHTracking * m_mwpc
Pointer to the tracking chambers.
Definition: arichBtestModule.h:109
Belle2::arichBtestModule::m_tdc
int m_tdc[32]
raw MWPC TDC buffer
Definition: arichBtestModule.h:111
Belle2::arichBtestModule::endRun
virtual void endRun() override
Is called after processing the last event of a run.
Definition: arichBtestModule.cc:559
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::arichBtestModule::m_eveList
std::vector< int > m_eveList
The eventnumbers for each of the runs.
Definition: arichBtestModule.h:99
Belle2::arichBtestModule::m_events
int m_events
number of events
Definition: arichBtestModule.h:94
Belle2::arichBtestModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: arichBtestModule.cc:97
Belle2::arichBtestModule::getTrack
int getTrack(int mask, TVector3 &r, TVector3 &dir)
Beamtest Track reconstruction.
Definition: arichBtestModule.cc:322
Belle2::ARICHTracking
Beamtest ARICH Geometry Tracking Class.
Definition: ARICHBtestGeometryPar.h:36
Belle2::arichBtestModule::readhapd
int readhapd(unsigned int len, unsigned int *data)
Read the HAPD hits from the data buffer.
Definition: arichBtestModule.cc:272
Belle2::arichBtestModule::m_beamMomentum
double m_beamMomentum
Momentum of the particles in the beam [GeV].
Definition: arichBtestModule.h:118
Belle2::arichBtestModule::~arichBtestModule
virtual ~arichBtestModule()
Destructor.
Definition: arichBtestModule.h:48
Belle2::arichBtestModule::m_runList
std::vector< std::string > m_runList
The filenames of the runs.
Definition: arichBtestModule.h:98
Belle2::arichBtestModule::m_MwpcTrackMask
std::vector< int > m_MwpcTrackMask
Bit mask of the MWPC tracking chambers used for the track creation.
Definition: arichBtestModule.h:105
Belle2::arichBtestModule::readmwpc
void readmwpc(unsigned int *dbuf, unsigned int len, int print=0)
Read the MWPC information from the data buffer.
Definition: arichBtestModule.cc:202
Belle2::arichBtestModule::m_outFile
std::string m_outFile
output file name
Definition: arichBtestModule.h:103
Belle2::arichBtestModule::m_timestart
time_t m_timestart
time of the first processed event
Definition: arichBtestModule.h:107
Belle2::arichBtestModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: arichBtestModule.cc:153