StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtDaq2RootMaker.h
1 /***************************************************************************
2  *
3  * $Id: StFgtDaq2RootMaker.h,v 1.2 2012/03/05 20:35:46 sgliske Exp $
4  * Author: S. Gliske, Jan 2011
5  *
6  ***************************************************************************
7  *
8  * Description: Converts a sfs or daq file to a root file. All data
9  * is in a single branch, which is an array of adc values. The order
10  * of the adcs are: disc=quad, apv, channel, timebin, i.e. the first 7
11  * events are for quad 0, apv 0, channel 0, then next seven for quad 0,
12  * apv 0, channel 1, etc.
13  *
14  * Designed only for cosmic data!
15  *
16  ***************************************************************************
17  *
18  * $Log: StFgtDaq2RootMaker.h,v $
19  * Revision 1.2 2012/03/05 20:35:46 sgliske
20  * update to export DAQ data as well
21  *
22  * Revision 1.1 2012/01/28 09:29:26 sgliske
23  * creation
24  *
25  *
26  **************************************************************************/
27 
28 #ifndef _ST_FGT_DAQ_2_ROOT_MAKER_
29 #define _ST_FGT_DAQ_2_ROOT_MAKER_
30 
31 #include "StMaker.h"
32 class TFile;
33 class TTree;
34 
35 class StFgtDaq2RootMaker : public StMaker {
36  public:
37  // constructors
38  StFgtDaq2RootMaker( const Char_t* name = "fgtDaq2Root",
39  const Char_t* outputfile = "testout.txt" );
40  virtual ~StFgtDaq2RootMaker();
41 
42  // default OK
43  // StFgtDaq2RootMaker(const StFgtDaq2RootMaker&);
44  // StFgtDaq2RootMaker& operator=(const StFgtDaq2RootMaker&);
45 
46  void Clear(const Option_t* opts = "");
47  Int_t Init();
48  Int_t Make();
49  Int_t Finish();
50 
51  enum { kNumTimeBins = 7, kNumChans = 128, kNumApv = 10, kNumQuad = 3, kNumData = kNumTimeBins*kNumChans*kNumApv*kNumQuad };
52 
53  struct chan_t {
54  Int_t tb[kNumTimeBins];
55  };
56 
57  struct apv_t {
58  chan_t chan[kNumChans];
59  };
60 
61  struct quad_t {
62  apv_t apv[kNumApv];
63  };
64 
65  struct cosmicFgt_t {
66  quad_t quad[kNumQuad];
67  };
68 
69  protected:
70  // for output
71  std::string mFileName;
72  TFile *mTFile;
73  TTree *mTTree;
74 
75  cosmicFgt_t mData;
76 
77  private:
78  ClassDef(StFgtDaq2RootMaker,1);
79 };
80 
81 #endif