| 11 |
#include <TArrayF.h> |
#include <TArrayF.h> |
| 12 |
#include <TClonesArray.h> |
#include <TClonesArray.h> |
| 13 |
|
|
| 14 |
|
#include <math.h> // EMILIANO |
| 15 |
|
|
| 16 |
#include <ToFStruct.h> |
#include <ToFStruct.h> |
| 17 |
|
|
| 18 |
|
|
| 41 |
public: |
public: |
| 42 |
Int_t pmt_id; ///<the identification number of the PMT from 0 to 47 |
Int_t pmt_id; ///<the identification number of the PMT from 0 to 47 |
| 43 |
Float_t adc; ///<raw ADC value for this PMT |
Float_t adc; ///<raw ADC value for this PMT |
| 44 |
|
Float_t tdc; ///<raw TDC value for this PMT |
| 45 |
Float_t tdc_tw; ///<time-walk corrected TDC value for this PMT |
Float_t tdc_tw; ///<time-walk corrected TDC value for this PMT |
| 46 |
// |
// |
| 47 |
ToFPMT(); |
ToFPMT(); |
| 48 |
ToFPMT(const ToFPMT&); |
ToFPMT(const ToFPMT&); |
| 49 |
// |
// |
| 50 |
ToFPMT* GetToFPMT(){return this;}; |
ToFPMT* GetToFPMT(){return this;}; |
| 51 |
void Clear(); |
void Clear(Option_t *t=""); |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
ClassDef(ToFPMT,1); |
ClassDef(ToFPMT,2); |
| 56 |
}; |
}; |
| 57 |
|
|
| 58 |
|
|
| 84 |
TArrayI tdcflag; ///<flag for artificial TDC, "0" if normal TDC value |
TArrayI tdcflag; ///<flag for artificial TDC, "0" if normal TDC value |
| 85 |
|
|
| 86 |
/** |
/** |
| 87 |
* \brief beta, 12 measurements for the 12 combinations, beta[13] is weighted mean |
* \brief beta, 12 measurements for the 12 combinations, beta[13] is modified weighted mean |
| 88 |
* |
* |
| 89 |
* The 12 measurements are S11-S31, S11-S32, S12-S31, S12-S32, and then analogue for |
* The 12 measurements are S11-S31, S11-S32, S12-S31, S12-S32, and then analogue for |
| 90 |
* S2-S3 and S1-S2. |
* S2-S3 and S1-S2. |
| 91 |
* In the moment all measurements are taken and the weighted mean is calculated. |
* The calculation of beta[13] is now modified: |
| 92 |
* Note that the weights are just simple overall results for S1-S3, S2-S3, and S1-S2. |
* We check the individual weights for artificial TDC values, then calculate |
| 93 |
* Artificial measurments are not treated correct, (since there is only one real |
* am mean beta for the first time. In a second step we loop again through |
| 94 |
* measurment the weight should be different then for two meassurments). |
* the single measurements, checking for the residual from the mean |
| 95 |
* The beta calculation will be improved in the next release. |
* The cut on the residual reject measurements > "x"-sigma. A chi2 value is |
| 96 |
|
* calculated, furthermore a "quality" value by adding the weights which |
| 97 |
|
* are finally used. If all measurements are taken, "quality" will be = 505. |
| 98 |
|
* A chi2 cut around 3-4 and a quality-cut > 400 is needed for clean beta |
| 99 |
|
* The Level2 beta[12] which is derived in the fortran routines uses: 10.,200.,20. |
| 100 |
|
* This is not a very high quality measurement. One can re-calculate a new beta[13] |
| 101 |
|
* using the L2-method "CalcBeta" |
| 102 |
*/ |
*/ |
| 103 |
Float_t beta[13]; |
Float_t beta[13]; |
| 104 |
// |
// |
| 109 |
// |
// |
| 110 |
Float_t xtofpos[3]; ///<x-measurement using the TDC values and the calibration from S12, S21, S32 |
Float_t xtofpos[3]; ///<x-measurement using the TDC values and the calibration from S12, S21, S32 |
| 111 |
Float_t ytofpos[3]; ///<x-measurement using the TDC values and the calibration from S11, S22, S31 |
Float_t ytofpos[3]; ///<x-measurement using the TDC values and the calibration from S11, S22, S31 |
| 112 |
|
// |
| 113 |
|
Float_t xtr_tof[6]; ///<x-measurement in the ToF layers from tracker |
| 114 |
|
Float_t ytr_tof[6]; ///<x-measurement in the ToF layers from tracker |
| 115 |
// |
// |
| 116 |
ToFTrkVar(); |
ToFTrkVar(); |
| 117 |
ToFTrkVar(const ToFTrkVar&); |
ToFTrkVar(const ToFTrkVar&); |
| 118 |
|
|
| 119 |
ToFTrkVar* GetToFTrkVar(){return this;}; |
ToFTrkVar* GetToFTrkVar(){return this;}; |
| 120 |
void Clear(); |
void Clear(Option_t *t=""); |
| 121 |
|
|
| 122 |
ClassDef(ToFTrkVar,1); |
ClassDef(ToFTrkVar,1); |
| 123 |
// |
// |
| 136 |
TClonesArray *PMT; ///<class needed to store PMT hit informations |
TClonesArray *PMT; ///<class needed to store PMT hit informations |
| 137 |
TClonesArray *ToFTrk; ///<track related variable class |
TClonesArray *ToFTrk; ///<track related variable class |
| 138 |
Int_t tof_j_flag[6]; ///<number of hitted paddle(s) for each ToF layer: flag = flag + 2**(paddlenumber-1) |
Int_t tof_j_flag[6]; ///<number of hitted paddle(s) for each ToF layer: flag = flag + 2**(paddlenumber-1) |
| 139 |
|
// |
| 140 |
|
Int_t unpackError;///< zero if no error presente |
| 141 |
|
Int_t default_calib; ///< one if the default calibration has been used to process the data, zero otherwise |
| 142 |
|
// |
| 143 |
|
Float_t GetdEdx(Int_t notrack, Int_t plane, Int_t adcfl); // gf Apr 07 |
| 144 |
|
|
| 145 |
|
Float_t CalcBeta(Int_t notrack, Float_t resmax, Float_t qualitycut, Float_t chi2cut); // wm feb 08 |
| 146 |
|
|
|
Int_t unpackError; |
|
| 147 |
// |
// |
| 148 |
Float_t GetdEdx(Int_t notrack, Int_t plane); |
// Float_t CalcBeta(Int_t notrack, Float_t resmax, Float_t chi2cut, Float_t qualitycut); // wm feb 08 |
| 149 |
// |
// |
| 150 |
// 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 |
| 151 |
// |
// |
| 159 |
ToFPMT *GetToFPMT(Int_t nohit); |
ToFPMT *GetToFPMT(Int_t nohit); |
| 160 |
Int_t GetPMTid(Int_t gg, Int_t hh); |
Int_t GetPMTid(Int_t gg, Int_t hh); |
| 161 |
TString GetPMTName(Int_t ind); |
TString GetPMTName(Int_t ind); |
| 162 |
|
|
| 163 |
Int_t GetPlaneIndex(Int_t pmt_id); |
Int_t GetPlaneIndex(Int_t pmt_id); |
| 164 |
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]); |
| 165 |
void GetPMTIndex(Int_t pmt_id, Int_t &gg, Int_t &hh); |
void GetPMTIndex(Int_t pmt_id, Int_t &gg, Int_t &hh); |
| 166 |
|
|
| 167 |
|
// gf Apr 07 |
| 168 |
|
void GetdEdxPaddle(Int_t notrack, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning); // gf Apr 07 |
| 169 |
|
TString GetPMTName(Int_t ind, Int_t &iplane, Int_t &ipaddle,Int_t &ipmt); |
| 170 |
|
Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane); // gf Apr 07 |
| 171 |
|
void GetPMTPaddle(Int_t pmt_id, Int_t &plane, Int_t &paddle); // gf Apr 07 |
| 172 |
|
void GetPaddlePMT(Int_t paddle, Int_t &pmtleft, Int_t &pmtright); // gf Apr 07 |
| 173 |
|
void GetPaddleGeometry(Int_t plane, Int_t paddle, Float_t &xleft, Float_t &xright, Float_t &yleft, Float_t &yright); // gf Apr 07 |
| 174 |
|
Int_t GetPaddleid(Int_t plane, Int_t paddle); |
| 175 |
|
void GetPaddlePlane(Int_t padid, Int_t &plane, Int_t &paddle); |
| 176 |
|
Int_t GetNPaddle(Int_t plane); |
| 177 |
|
// |
| 178 |
|
// |
| 179 |
|
|
| 180 |
// |
// |
| 181 |
// constructor |
// constructor |
| 182 |
// |
// |
| 183 |
ToFLevel2(); |
ToFLevel2(); |
| 184 |
~ToFLevel2(){Delete();}; //ELENA |
~ToFLevel2(){Delete();}; //ELENA |
| 185 |
void Delete(); //ELENA |
void Delete(Option_t *t=""); //ELENA |
| 186 |
void Set();//ELENA |
void Set();//ELENA |
| 187 |
// |
// |
| 188 |
// |
// |
| 220 |
Int_t GetToFPlaneIndex(Int_t plane_id); |
Int_t GetToFPlaneIndex(Int_t plane_id); |
| 221 |
Bool_t HitPaddle(Int_t ,Int_t); |
Bool_t HitPaddle(Int_t ,Int_t); |
| 222 |
Int_t GetNHitPaddles(Int_t plane); |
Int_t GetNHitPaddles(Int_t plane); |
| 223 |
void Clear(); |
void Clear(Option_t *t=""); |
| 224 |
// |
// |
| 225 |
ClassDef(ToFLevel2,2); |
ClassDef(ToFLevel2,3); |
| 226 |
}; |
}; |
| 227 |
|
|
| 228 |
#endif |
#endif |