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