| 1 |
pam-de |
1.14 |
/** |
| 2 |
|
|
* \file ToFLevel2.h |
| 3 |
|
|
* \author Gianfranca DeRosa / Wolfgang Menn |
| 4 |
|
|
*/ |
| 5 |
|
|
|
| 6 |
mocchiut |
1.1 |
#ifndef ToFLevel2_h |
| 7 |
|
|
#define ToFLevel2_h |
| 8 |
|
|
// |
| 9 |
|
|
#include <TObject.h> |
| 10 |
mocchiut |
1.4 |
#include <TArrayI.h> |
| 11 |
|
|
#include <TArrayF.h> |
| 12 |
mocchiut |
1.1 |
#include <TClonesArray.h> |
| 13 |
pam-fi |
1.6 |
|
| 14 |
|
|
#include <ToFStruct.h> |
| 15 |
pam-de |
1.14 |
|
| 16 |
|
|
|
| 17 |
mocchiut |
1.1 |
// |
| 18 |
|
|
// class which contains track related variables |
| 19 |
|
|
// |
| 20 |
|
|
#define ZTOF11 53.74 |
| 21 |
|
|
#define ZTOF12 53.04 |
| 22 |
|
|
#define ZTOF21 23.94 |
| 23 |
|
|
#define ZTOF22 23.44 |
| 24 |
|
|
#define ZTOF31 -23.49 |
| 25 |
|
|
#define ZTOF32 -24.34 |
| 26 |
|
|
|
| 27 |
mocchiut |
1.4 |
|
| 28 |
pam-de |
1.14 |
/** |
| 29 |
|
|
* \brief Class which contains the PMT data |
| 30 |
|
|
* |
| 31 |
pam-de |
1.15 |
* If there is a valid ADC or a TDC value (value<4095) for a PMT, both ADC and TDC data |
| 32 |
|
|
* are stored in the PMT class. |
| 33 |
|
|
* Look in the ToFLevel2Ex.cxx example in the repository how to read the PMT class. |
| 34 |
pam-de |
1.14 |
*/ |
| 35 |
mocchiut |
1.4 |
class ToFPMT : public TObject { |
| 36 |
pam-de |
1.14 |
|
| 37 |
mocchiut |
1.4 |
private: |
| 38 |
|
|
|
| 39 |
|
|
public: |
| 40 |
pam-de |
1.14 |
Int_t pmt_id; ///<the identification number of the PMT from 0 to 47 |
| 41 |
pam-de |
1.15 |
Float_t adc; ///<raw ADC value for this PMT |
| 42 |
|
|
Float_t tdc_tw; ///<time-walk corrected TDC value for this PMT |
| 43 |
mocchiut |
1.4 |
// |
| 44 |
|
|
ToFPMT(); |
| 45 |
|
|
ToFPMT(const ToFPMT&); |
| 46 |
|
|
// |
| 47 |
|
|
ToFPMT* GetToFPMT(){return this;}; |
| 48 |
|
|
void Clear(); |
| 49 |
|
|
|
| 50 |
pam-de |
1.14 |
|
| 51 |
mocchiut |
1.13 |
|
| 52 |
mocchiut |
1.4 |
ClassDef(ToFPMT,1); |
| 53 |
|
|
}; |
| 54 |
|
|
|
| 55 |
|
|
|
| 56 |
pam-de |
1.14 |
/** |
| 57 |
pam-de |
1.15 |
* \brief Class which contains the tracker related variables |
| 58 |
pam-de |
1.14 |
* |
| 59 |
pam-de |
1.15 |
* We can use the ToF standalone to find hitted paddles, calculate beta, etc.. |
| 60 |
|
|
* These results are then stored with the "trkseqno" = -1. |
| 61 |
|
|
* If we use the track from the tracker, then the penetration points in the |
| 62 |
|
|
* scintillators are calculated, which defines the hitted paddles. For these paddles |
| 63 |
|
|
* we calculate then all the output. |
| 64 |
|
|
* Note: The artificial ADC values are stored as dEdx in the output, the dEdx will be |
| 65 |
|
|
* by definition = 1. However, the artificial TDC values are just used internally |
| 66 |
|
|
* and not stored in the output. But one can see in both cases which PMT has artificial |
| 67 |
|
|
* values using "adcflag" and "tdcflag". |
| 68 |
|
|
* Look in the ToFLevel2Ex.cxx example in the repository how to read the tracker related |
| 69 |
|
|
* variables. |
| 70 |
pam-de |
1.14 |
*/ |
| 71 |
mocchiut |
1.1 |
class ToFTrkVar : public TObject { |
| 72 |
pam-de |
1.14 |
|
| 73 |
mocchiut |
1.1 |
private: |
| 74 |
|
|
|
| 75 |
|
|
public: |
| 76 |
mocchiut |
1.13 |
// |
| 77 |
pam-de |
1.14 |
Int_t trkseqno; ///< tracker sequ. number: -1=ToF standalone, 0=first Tracker track, ... |
| 78 |
mocchiut |
1.1 |
// |
| 79 |
pam-de |
1.15 |
Int_t npmttdc; ///<number of the TDC measurements used to evaluate beta |
| 80 |
|
|
TArrayI pmttdc; ///<contains the ID (0..47) for the PMT used to evaluate beta |
| 81 |
|
|
TArrayI tdcflag; ///<flag for artificial TDC, "0" if normal TDC value |
| 82 |
|
|
|
| 83 |
|
|
/** |
| 84 |
|
|
* \brief beta, 12 measurements for the 12 combinations, beta[13] is weighted mean |
| 85 |
|
|
* |
| 86 |
|
|
* The 12 measurements are S11-S31, S11-S32, S12-S31, S12-S32, and then analogue for |
| 87 |
|
|
* S2-S3 and S1-S2. |
| 88 |
|
|
* In the moment all measurements are taken and the weighted mean is calculated. |
| 89 |
|
|
* Note that the weights are just simple overall results for S1-S3, S2-S3, and S1-S2. |
| 90 |
|
|
* Artificial measurments are not treated correct, (since there is only one real |
| 91 |
|
|
* measurment the weight should be different then for two meassurments). |
| 92 |
|
|
* The beta calculation will be improved in the next release. |
| 93 |
|
|
*/ |
| 94 |
|
|
Float_t beta[13]; |
| 95 |
|
|
// |
| 96 |
|
|
Int_t npmtadc; ///<number of the ADC measurements used for dEdx evaluation |
| 97 |
|
|
TArrayI pmtadc; ///<contains the ID (0..47) for the PMT used to evaluate dEdx |
| 98 |
|
|
TArrayI adcflag; ///<flag for artificial ADCs, "0" if normal ADC value |
| 99 |
|
|
TArrayF dedx; ///<energy loss for this PMT in mip |
| 100 |
mocchiut |
1.4 |
// |
| 101 |
pam-de |
1.15 |
Float_t xtofpos[3]; ///<x-measurement using the TDC values and the calibration from S12, S21, S32 |
| 102 |
|
|
Float_t ytofpos[3]; ///<x-measurement using the TDC values and the calibration from S11, S22, S31 |
| 103 |
pam-de |
1.14 |
|
| 104 |
mocchiut |
1.1 |
// |
| 105 |
|
|
ToFTrkVar(); |
| 106 |
|
|
ToFTrkVar(const ToFTrkVar&); |
| 107 |
pam-de |
1.14 |
|
| 108 |
mocchiut |
1.1 |
ToFTrkVar* GetToFTrkVar(){return this;}; |
| 109 |
mocchiut |
1.4 |
void Clear(); |
| 110 |
|
|
|
| 111 |
mocchiut |
1.1 |
ClassDef(ToFTrkVar,1); |
| 112 |
|
|
// |
| 113 |
|
|
}; |
| 114 |
|
|
|
| 115 |
pam-de |
1.14 |
/** |
| 116 |
|
|
* \brief Class to describe ToF LEVEL2 data |
| 117 |
|
|
* |
| 118 |
|
|
*/ |
| 119 |
|
|
|
| 120 |
mocchiut |
1.1 |
class ToFLevel2 : public TObject { |
| 121 |
|
|
private: |
| 122 |
pam-de |
1.14 |
|
| 123 |
mocchiut |
1.1 |
public: |
| 124 |
mocchiut |
1.4 |
// |
| 125 |
pam-de |
1.14 |
TClonesArray *PMT; ///<class needed to store PMT hit informations |
| 126 |
|
|
TClonesArray *ToFTrk; ///<track related variable class |
| 127 |
|
|
Int_t tof_j_flag[6]; ///<number of hitted paddle(s) for each ToF layer: flag = flag + 2**(paddlenumber-1) |
| 128 |
|
|
|
| 129 |
mocchiut |
1.7 |
Int_t unpackError; |
| 130 |
mocchiut |
1.1 |
// |
| 131 |
mocchiut |
1.4 |
Float_t GetdEdx(Int_t notrack, Int_t plane); |
| 132 |
mocchiut |
1.1 |
// |
| 133 |
|
|
// methods to make life simplier during the analysis, returns a pointer to the ToFTrkVar class containing track related variables |
| 134 |
|
|
// |
| 135 |
|
|
Int_t ntrk(){return ToFTrk->GetEntries();}; |
| 136 |
mocchiut |
1.4 |
Int_t npmt(){return PMT->GetEntries();}; |
| 137 |
pam-de |
1.14 |
|
| 138 |
mocchiut |
1.1 |
// |
| 139 |
pam-fi |
1.6 |
void GetLevel2Struct(cToFLevel2 *) const; |
| 140 |
|
|
// |
| 141 |
pam-de |
1.14 |
ToFTrkVar *GetToFTrkVar(Int_t notrack); |
| 142 |
|
|
ToFPMT *GetToFPMT(Int_t nohit); |
| 143 |
mocchiut |
1.4 |
Int_t GetPMTid(Int_t gg, Int_t hh); |
| 144 |
|
|
TString GetPMTName(Int_t ind); |
| 145 |
|
|
Int_t GetPlaneIndex(Int_t pmt_id); |
| 146 |
|
|
void GetMatrix(Int_t notrack, Float_t adc[4][12], Float_t tdc[4][12]); |
| 147 |
mocchiut |
1.5 |
void GetPMTIndex(Int_t pmt_id, Int_t &gg, Int_t &hh); |
| 148 |
mocchiut |
1.1 |
// |
| 149 |
|
|
// constructor |
| 150 |
|
|
// |
| 151 |
|
|
ToFLevel2(); |
| 152 |
mocchiut |
1.13 |
~ToFLevel2(){Delete();}; //ELENA |
| 153 |
|
|
void Delete(); //ELENA |
| 154 |
|
|
void Set();//ELENA |
| 155 |
mocchiut |
1.1 |
// |
| 156 |
|
|
// |
| 157 |
|
|
ToFLevel2* GetToFLevel2(){return this;}; |
| 158 |
pam-de |
1.14 |
|
| 159 |
|
|
/** |
| 160 |
pam-de |
1.15 |
* Method to get the z-position of the 6 TOF layers from the plane ID |
| 161 |
pam-de |
1.14 |
* @param plane_id Plane ID (11 12 21 22 31 32) |
| 162 |
|
|
*/ |
| 163 |
mocchiut |
1.4 |
Float_t GetZTOF(Int_t plane_id){ |
| 164 |
mocchiut |
1.1 |
switch(plane_id){ |
| 165 |
|
|
case 11: return ZTOF11; |
| 166 |
|
|
case 12: return ZTOF12; |
| 167 |
|
|
case 21: return ZTOF21; |
| 168 |
|
|
case 22: return ZTOF22; |
| 169 |
|
|
case 31: return ZTOF31; |
| 170 |
|
|
case 32: return ZTOF32; |
| 171 |
|
|
default: return 0.; |
| 172 |
|
|
}; |
| 173 |
mocchiut |
1.4 |
}; |
| 174 |
pam-de |
1.14 |
|
| 175 |
mocchiut |
1.1 |
// |
| 176 |
|
|
// Paddles position |
| 177 |
|
|
// |
| 178 |
|
|
/* |
| 179 |
|
|
S11 8 paddles 33.0 x 5.1 cm |
| 180 |
|
|
S12 6 paddles 40.8 x 5.5 cm |
| 181 |
|
|
S21 2 paddles 18.0 x 7.5 cm |
| 182 |
|
|
S22 2 paddles 15.0 x 9.0 cm |
| 183 |
|
|
S31 3 paddles 15.0 x 6.0 cm |
| 184 |
|
|
S32 3 paddles 18.0 x 5.0 cm |
| 185 |
|
|
*/ |
| 186 |
pam-de |
1.14 |
|
| 187 |
mocchiut |
1.1 |
Int_t GetToFPlaneID(Int_t ip); |
| 188 |
|
|
Int_t GetToFPlaneIndex(Int_t plane_id); |
| 189 |
|
|
Bool_t HitPaddle(Int_t ,Int_t); |
| 190 |
|
|
Int_t GetNHitPaddles(Int_t plane); |
| 191 |
mocchiut |
1.3 |
void Clear(); |
| 192 |
mocchiut |
1.1 |
// |
| 193 |
mocchiut |
1.7 |
ClassDef(ToFLevel2,2); |
| 194 |
mocchiut |
1.1 |
}; |
| 195 |
|
|
|
| 196 |
|
|
#endif |
| 197 |
pam-de |
1.14 |
|