| 1 | #ifndef ToFLevel2_h | 
| 2 | #define ToFLevel2_h | 
| 3 | // | 
| 4 | #include <TObject.h> | 
| 5 | #include <TArrayI.h> | 
| 6 | #include <TArrayF.h> | 
| 7 | #include <TClonesArray.h> | 
| 8 |  | 
| 9 | #include <ToFStruct.h> | 
| 10 | // | 
| 11 | // class which contains track related variables | 
| 12 | // | 
| 13 | #define ZTOF11 53.74 | 
| 14 | #define ZTOF12 53.04 | 
| 15 | #define ZTOF21 23.94 | 
| 16 | #define ZTOF22 23.44 | 
| 17 | #define ZTOF31 -23.49 | 
| 18 | #define ZTOF32 -24.34 | 
| 19 |  | 
| 20 |  | 
| 21 | class ToFPMT : public TObject { | 
| 22 |  | 
| 23 | private: | 
| 24 |  | 
| 25 | public: | 
| 26 | Int_t pmt_id; | 
| 27 | Float_t adc; | 
| 28 | Float_t tdc_tw; | 
| 29 | // | 
| 30 | ToFPMT(); | 
| 31 | ToFPMT(const ToFPMT&); | 
| 32 | // | 
| 33 | ToFPMT* GetToFPMT(){return this;}; | 
| 34 | void Clear(); | 
| 35 |  | 
| 36 | ClassDef(ToFPMT,1); | 
| 37 | }; | 
| 38 |  | 
| 39 |  | 
| 40 | class ToFTrkVar : public TObject { | 
| 41 |  | 
| 42 | private: | 
| 43 |  | 
| 44 | public: | 
| 45 | // | 
| 46 | Int_t trkseqno; // tracker entry coming from tracker, 100 if image track is used, -100 if the track is not consistent with MyDetector2 one | 
| 47 | // | 
| 48 | Int_t npmttdc; | 
| 49 | TArrayI pmttdc; | 
| 50 | Float_t beta[13]; | 
| 51 | // | 
| 52 | Int_t npmtadc; | 
| 53 | TArrayI pmtadc; | 
| 54 | TArrayF dedx; | 
| 55 | // | 
| 56 | Float_t xtofpos[3]; | 
| 57 | Float_t ytofpos[3]; | 
| 58 | // | 
| 59 | ToFTrkVar(); | 
| 60 | ToFTrkVar(const ToFTrkVar&); | 
| 61 |  | 
| 62 | ToFTrkVar* GetToFTrkVar(){return this;}; | 
| 63 | void Clear(); | 
| 64 |  | 
| 65 | ClassDef(ToFTrkVar,1); | 
| 66 | // | 
| 67 | }; | 
| 68 |  | 
| 69 | class ToFLevel2 : public TObject { | 
| 70 | private: | 
| 71 |  | 
| 72 | public: | 
| 73 | // | 
| 74 | TClonesArray *PMT; // class needed to store PMT hit informations | 
| 75 | TClonesArray *ToFTrk; // track related variable class | 
| 76 | Int_t tof_j_flag[6]; | 
| 77 | Int_t unpackError; | 
| 78 | // | 
| 79 | Float_t GetdEdx(Int_t notrack, Int_t plane); | 
| 80 | // | 
| 81 | // methods to make life simplier during the analysis, returns a pointer to the ToFTrkVar class containing track related variables | 
| 82 | // | 
| 83 | Int_t ntrk(){return ToFTrk->GetEntries();}; | 
| 84 | Int_t npmt(){return PMT->GetEntries();}; | 
| 85 |  | 
| 86 | // | 
| 87 | void GetLevel2Struct(cToFLevel2 *) const; | 
| 88 | // | 
| 89 | ToFTrkVar *GetToFTrkVar(Int_t notrack); | 
| 90 | ToFPMT *GetToFPMT(Int_t nohit); | 
| 91 | Int_t GetPMTid(Int_t gg, Int_t hh); | 
| 92 | TString GetPMTName(Int_t ind); | 
| 93 | Int_t GetPlaneIndex(Int_t pmt_id); | 
| 94 | void GetMatrix(Int_t notrack, Float_t adc[4][12], Float_t tdc[4][12]); | 
| 95 | void GetPMTIndex(Int_t pmt_id, Int_t &gg, Int_t &hh); | 
| 96 | // | 
| 97 | // constructor | 
| 98 | // | 
| 99 | ToFLevel2(); | 
| 100 | // | 
| 101 | // | 
| 102 | ToFLevel2*   GetToFLevel2(){return this;}; | 
| 103 | Float_t      GetZTOF(Int_t plane_id){ | 
| 104 | switch(plane_id){ | 
| 105 | case 11: return ZTOF11; | 
| 106 | case 12: return ZTOF12; | 
| 107 | case 21: return ZTOF21; | 
| 108 | case 22: return ZTOF22; | 
| 109 | case 31: return ZTOF31; | 
| 110 | case 32: return ZTOF32; | 
| 111 | default: return 0.; | 
| 112 | }; | 
| 113 | }; | 
| 114 |  | 
| 115 | // | 
| 116 | // Paddles position | 
| 117 | // | 
| 118 | /* | 
| 119 | S11 8 paddles  33.0 x 5.1 cm | 
| 120 | S12 6 paddles  40.8 x 5.5 cm | 
| 121 | S21 2 paddles  18.0 x 7.5 cm | 
| 122 | S22 2 paddles  15.0 x 9.0 cm | 
| 123 | S31 3 paddles  15.0 x 6.0 cm | 
| 124 | S32 3 paddles  18.0 x 5.0 cm | 
| 125 | */ | 
| 126 |  | 
| 127 | Int_t  GetToFPlaneID(Int_t ip); | 
| 128 | Int_t  GetToFPlaneIndex(Int_t plane_id); | 
| 129 | Bool_t HitPaddle(Int_t ,Int_t); | 
| 130 | Int_t  GetNHitPaddles(Int_t plane); | 
| 131 | void Clear(); | 
| 132 | // | 
| 133 | ClassDef(ToFLevel2,2); | 
| 134 | }; | 
| 135 |  | 
| 136 | #endif |