/[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.23 by carbone, Fri Nov 20 11:05:21 2009 UTC revision 1.36 by mocchiut, Thu Mar 26 14:55:40 2015 UTC
# Line 1  Line 1 
1  /**  /**
2   * \file ToFLevel2.h   * \file ToFLevel2.h
3   * \author Gianfranca DeRosa / Wolfgang Menn   * \author Gianfranca DeRosa / Wolfgang Menn / Rita Carbone with E. M. supervision
4   */   */
5    
6  #ifndef ToFLevel2_h  #ifndef ToFLevel2_h
# Line 35  extern "C" int tofl2com(); Line 35  extern "C" int tofl2com();
35  #define toftrk toftrk_  #define toftrk toftrk_
36  extern "C" int toftrk();  extern "C" int toftrk();
37  #define rdtofcal rdtofcal_  #define rdtofcal rdtofcal_
38  extern "C" int rdtofcal(char [], int *);  //extern "C" int rdtofcal(char [], int *);
39    extern "C" int rdtofcal(const char *, int *);
40    
41  //  //
42  // class which contains track related variables  // class which contains track related variables
# Line 90  class ToFPMT : public TObject { Line 91  class ToFPMT : public TObject {
91    
92   public:   public:
93      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
94      Float_t adc;      ///<raw ADC value for this PMT      Float_t adc;      ///<raw ADC value for this PMT
95      Float_t tdc;      ///<raw TDC value for this PMT      Float_t tdc;      ///<raw TDC value for this PMT
96      Float_t tdc_tw;   ///<time-walk corrected TDC value for this PMT      Float_t tdc_tw;   ///<time-walk corrected TDC value for this PMT
97        Float_t l0flag_adc; ///< warning flags from unpacking
98        Float_t l0flag_tdc; ///< warning flags from unpacking
99      //      //
100      ToFPMT();      ToFPMT();
101      ToFPMT(const ToFPMT&);      ToFPMT(const ToFPMT&);
# Line 100  class ToFPMT : public TObject { Line 103  class ToFPMT : public TObject {
103      ToFPMT* GetToFPMT(){return this;};      ToFPMT* GetToFPMT(){return this;};
104      void Clear(Option_t *t="");      void Clear(Option_t *t="");
105    
106        ClassDef(ToFPMT,3);
   
     ClassDef(ToFPMT,2);  
107  };  };
108    
109  /**  /**
# Line 114  class ToFdEdx : public TObject { Line 115  class ToFdEdx : public TObject {
115    
116   private:   private:
117      //      //
   
118      ToFGeom  eGeom;  // ToF geometry      ToFGeom  eGeom;  // ToF geometry
119      //      //
   
120      Float_t  adc_he;      Float_t  adc_he;
121            TArrayF *eDEDXpmt;  // 0-47  pmt dEdx
     TArrayF eDEDXpmt;  // 0-47  pmt dEdx  
     TArrayF eZpmt;     // 0-47  pmt charge  
     TArrayF eDEDXpad;  // 0-23  paddle dEdx  
     TArrayF eZpad;     // 0-23  paddle charge  
     TArrayF eDEDXlayer;  // 0-5 layer dEdx  
     TArrayF eZlayer;     // 0-5 layer charge  
     TArrayF eDEDXplane;  // 0-2 plane dEdx  
     TArrayF eZplane;     // 0-2 plane charge  
   
     TArrayF INFOpmt;  // 0-47 pmt status  
     TArrayF INFOlayer;  //0-5 layer status  
       
122      // parameters:      // parameters:
123      TArrayF PMTsat;  // 0-47  saturation parameters      TArrayF PMTsat;  // 0-47  saturation parameters
124        Float_t adc[48];
125      TArrayF TDx[48];  // 200 x 48  define an array of 200 elements per each pmt      //
     TArrayF TDy[48];  
126    
127      TArrayF parAtt[48];      // 48 x 6      TArrayF parAtt[48];      // 48 x 6
128      TArrayF parPos[48];      // 48 x 4      TArrayF parPos[48];      // 48 x 4
# Line 163  class ToFdEdx : public TObject { Line 149  class ToFdEdx : public TObject {
149            
150   public:   public:
151      ToFdEdx();   // class constructor      ToFdEdx();   // class constructor
152      ~ToFdEdx(){ Delete(); };  // class distructor      ~ToFdEdx();  // class distructor
153      //      //
154      void Clear(Option_t *option="");      void Clear(Option_t *option="");
155      void Delete(Option_t *option="") { Clear(); }      void Delete(Option_t *option="");
156    
157      //    void InitPar(const char *pardir);  // init parameters      void Init(pamela::tof::TofEvent *tofl0 );  // init parameters
158        void Init(Int_t i, Int_t j, Float_t adce);
159      void Define_PMTsat();      void Define_PMTsat();
     //void ReadParTD( Int_t ipmt, const char *fname  );  
160    
161      void ReadParAtt(            const char *fname  );      void ReadParAtt(            const char *fname  );
162      void ReadParPos(            const char *fname  );      void ReadParPos(            const char *fname  );
# Line 180  class ToFdEdx : public TObject { Line 166  class ToFdEdx : public TObject {
166    
167      void CheckConnectors(UInt_t atime, GL_PARAM *glparam, TSQLServer *dbc);      void CheckConnectors(UInt_t atime, GL_PARAM *glparam, TSQLServer *dbc);
168    
169      void Process( UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, pamela::tof::TofEvent *tofl0 ); //      void Process( UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat=-1); //
170      void Print(Option_t *option="");      void Print(Option_t *option="");
     void PrintTD();  
171    
172        //    Float_t GetdEdx_pmt(Int_t ipmt) { return (Float_t)eDEDXpmt[ipmt]; }  // 0-47 dEdx for each PMT for tracked events
173      Float_t GetdEdx_pmt(Int_t ipmt) { return eDEDXpmt[ipmt]; }  // 0-47 dEdx for each PMT for tracked events      Float_t GetdEdx_pmt(Int_t ipmt) { return eDEDXpmt->At(ipmt); }  // 0-47 dEdx for each PMT for tracked events
     Float_t GetCharge_pmt(Int_t ipmt) {return eZpmt[ipmt];}  // 0-47 Z for each PMT for tracked events  
     Float_t GetdEdx_pad(Int_t ipad) {return eDEDXpad[ipad];}  // 0-23 dEdx for each paddle for tracked events (no request of consistency between PMT's response when both on!)  
     Float_t GetCharge_pad(Int_t ipad) {return  eZpad[ipad];}  // 0-23 Z for each paddle for tracked events (no request of consistency)  
     Float_t GetdEdx_layer(Int_t ilay) {return eDEDXlayer[ilay];}  // 0-5 dEdx for each layer for tracked events  
     Float_t GetCharge_layer(Int_t ilay) {return eZlayer[ilay];}  // 0-5 Z for each layer for tracked events  
     Float_t GetdEdx_plane(Int_t ipl) {return eDEDXplane[ipl];}  // 0-2 dEdx for each plane for tracked events  
     Float_t GetCharge_plane(Int_t ipl) {return eZplane[ipl];}  // 0-2 Z for each plane for tracked events N.B.: here there is a soft request of consistency between the two layers...to be discussed!!  
       
     Float_t GetInfo_pmt(Int_t ipmt) {return INFOpmt[ipmt];} // 0-47 pmt status  
     Float_t GetInfo_layer(Int_t ilay) {return INFOlayer[ilay];}  // 0-5 layer status  
   
   
   
     //  
174      //      //
175      ToFdEdx* GetToFdEdx(){return this;};      ToFdEdx* GetToFdEdx(){return this;};
176        ClassDef(ToFdEdx,3);
   
   
   
     ClassDef(ToFdEdx,1);  
177  };  };
178    
179    
# Line 273  class ToFTrkVar : public TObject { Line 240  class ToFTrkVar : public TObject {
240    ToFTrkVar* GetToFTrkVar(){return this;};    ToFTrkVar* GetToFTrkVar(){return this;};
241    void Clear(Option_t *t="");    void Clear(Option_t *t="");
242    
243    ClassDef(ToFTrkVar,1);    Float_t CalcBeta(Float_t resmax, Float_t qualitycut, Float_t chi2cut);  //  Elena 2015
244    
245      ClassDef(ToFTrkVar,2);
246    //    //
247  };  };
248    
# Line 291  class ToFLevel2 : public TObject { Line 260  class ToFLevel2 : public TObject {
260    TClonesArray *ToFTrk; ///<track related variable class    TClonesArray *ToFTrk; ///<track related variable class
261    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)
262    //    //
263    Int_t unpackError;///< zero if no error presente    Int_t unpackError;///< zero if no errors
264      Int_t unpackWarning;///< zero if no warnings | bitwise: ... 3 2 1 0 --> bit 0 = discharging flag on at least one PMT (adc OR tdc), bit 1 = there is at least one PMT off (no tdc nor adc) which is included in the patterntrig,  bit 2 = PMTs hit are not enough to match trigger configuration, bit 3 = pattern trig does not match trigger configuration
265    Int_t default_calib; ///< one if the default calibration has been used to process the data, zero otherwise    Int_t default_calib; ///< one if the default calibration has been used to process the data, zero otherwise
266    //    //
267    Float_t GetdEdx(Int_t notrack, Int_t plane, Int_t adcfl); // gf Apr 07    Float_t GetdEdx(Int_t notrack, Int_t plane, Int_t adcfl); // gf Apr 07
268      Float_t GetdEdx(ToFTrkVar *trk, Int_t plane, Int_t adcfl); // gf Apr 07
269    
270    Float_t CalcBeta(Int_t notrack, Float_t resmax, Float_t qualitycut, Float_t chi2cut);  //  wm feb 08    Float_t CalcBeta(Int_t notrack, Float_t resmax, Float_t qualitycut, Float_t chi2cut);  //  wm feb 08
271    
# Line 310  class ToFLevel2 : public TObject { Line 281  class ToFLevel2 : public TObject {
281    void GetLevel2Struct(cToFLevel2 *) const;    void GetLevel2Struct(cToFLevel2 *) const;
282    //    //
283    ToFTrkVar *GetToFTrkVar(Int_t notrack);    ToFTrkVar *GetToFTrkVar(Int_t notrack);
284      ToFTrkVar* GetToFStoredTrack(Int_t seqno);///< returns pointer to the track set related to the seqno number
285    ToFPMT *GetToFPMT(Int_t nohit);    ToFPMT *GetToFPMT(Int_t nohit);
286    Int_t GetPMTid(Int_t gg, Int_t hh);    static Int_t GetPMTid(Int_t gg, Int_t hh);
287    TString GetPMTName(Int_t ind);    static TString GetPMTName(Int_t ind);
288        
289    Int_t GetPlaneIndex(Int_t pmt_id);    static Int_t GetPlaneIndex(Int_t pmt_id);
290    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]);
291    void GetPMTIndex(Int_t pmt_id, Int_t &gg, Int_t &hh);    static void GetPMTIndex(Int_t pmt_id, Int_t &gg, Int_t &hh);
292    
293    // gf Apr 07    // gf Apr 07
294    void GetdEdxPaddle(Int_t notrack, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning); // gf Apr 07    void GetdEdxPaddle(Int_t notrack, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning); // gf Apr 07
295    TString GetPMTName(Int_t ind, Int_t &iplane, Int_t &ipaddle,Int_t &ipmt);    void GetdEdxPaddle(ToFTrkVar *trk, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning); // gf Apr 07
296    Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane); // gf Apr 07    static TString GetPMTName(Int_t ind, Int_t &iplane, Int_t &ipaddle,Int_t &ipmt);
297      Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane); // gf Apr 07 //EMXX
298    Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane, Float_t margin); // wm jun 2008    Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane, Float_t margin); // wm jun 2008
299    void GetPMTPaddle(Int_t pmt_id, Int_t &plane, Int_t &paddle); // gf Apr 07    static void GetPMTPaddle(Int_t pmt_id, Int_t &plane, Int_t &paddle); // gf Apr 07
300    void GetPaddlePMT(Int_t paddle, Int_t &pmtleft, Int_t &pmtright); // gf Apr 07    void GetPaddlePMT(Int_t paddle, Int_t &pmtleft, Int_t &pmtright); // gf Apr 07
301    void GetPaddleGeometry(Int_t plane, Int_t paddle, Float_t &xleft, Float_t &xright, Float_t &yleft, Float_t &yright); // gf Apr 07    void GetPaddleGeometry(Int_t plane, Int_t paddle, Float_t &xleft, Float_t &xright, Float_t &yleft, Float_t &yright); // gf Apr 07
302    Int_t GetPaddleid(Int_t plane, Int_t paddle);    Int_t GetPaddleid(Int_t plane, Int_t paddle);
# Line 333  class ToFLevel2 : public TObject { Line 306  class ToFLevel2 : public TObject {
306    //    //
307    //    //
308    Int_t Process(TrkLevel2 *trk, TrigLevel2 *trg, GL_RUN *run, OrbitalInfo *orb, Bool_t force); // Emiliano    Int_t Process(TrkLevel2 *trk, TrigLevel2 *trg, GL_RUN *run, OrbitalInfo *orb, Bool_t force); // Emiliano
309      
310      //
311      //
312      bool bit(int decimal, char pos);
313      bool checkPMT(TString givenpmt);
314      bool checkPMTpatternPMThit(TrigLevel2 *trg, int &pmtpattern, int &pmtnosignal);
315      bool checkPMTpmttrig(TrigLevel2 *trg);
316      void printPMT();
317    
318    //    //
319    // constructor    // constructor
320    //    //
# Line 375  class ToFLevel2 : public TObject { Line 356  class ToFLevel2 : public TObject {
356    
357      Int_t  GetToFPlaneID(Int_t ip);      Int_t  GetToFPlaneID(Int_t ip);
358      Int_t  GetToFPlaneIndex(Int_t plane_id);      Int_t  GetToFPlaneIndex(Int_t plane_id);
359      Bool_t HitPaddle(Int_t ,Int_t);      Bool_t HitPaddle(Int_t ,Int_t); // EMXX
360      Int_t  GetNHitPaddles(Int_t plane);      Int_t  GetNHitPaddles(Int_t plane);
361        Int_t  GetTrueNHitPaddles(Int_t plane);
362      void Clear(Option_t *t="");      void Clear(Option_t *t="");
363    
364        //
365        TClonesArray *GetTrackArray(){return ToFTrk;} ///< returns a pointer to the track related variables array
366        TClonesArray** GetPointerToTrackArray(){return &ToFTrk;}///< returns pointer to pointer to the track array
367        void SetTrackArray(TClonesArray *track);///<set pointer to the track array
368    
369    
370      //      //
371      ClassDef(ToFLevel2,4);      ClassDef(ToFLevel2,7);
372  };  };
373    
374  #endif  #endif

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.23