/[PAMELA software]/DarthVader/ToFLevel2/inc/ToFLevel2.h
ViewVC logotype

Diff of /DarthVader/ToFLevel2/inc/ToFLevel2.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.23