Add the number of local boards
[u/mrichter/AliRoot.git] / TRD / AliTRDtrigger.h
1 #ifndef ALITRDTRIGGER_H
2 #define ALITRDTRIGGER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 //  TRD trigger class                                                        //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include <TNamed.h>
15
16 class TTree;
17 class TClonesArray;
18 class TObjArray;
19
20 class AliRunLoader;
21 class AliRawReader;
22
23 class AliTRDmcmTracklet;
24 class AliTRDgtuTrack;
25 class AliTRDmcm;
26 class AliTRDmodule;
27 class AliTRDtrigParam;
28 class AliTRDdigitsManager;
29 class AliTRDdataArrayI;
30 class AliTRDgeometry;
31 class AliTRDcalibDB;
32 class AliTRDCommonParam;
33
34 class AliTRDtrigger : public TNamed {
35
36  public:  
37
38   enum { kNMCM = 16, kMaxTrackletsPerMCM = 4, kMcmCol = 21 };
39
40   AliTRDtrigger();
41   AliTRDtrigger(const Text_t* name, const Text_t* title);
42   AliTRDtrigger(const AliTRDtrigger &p);   
43   virtual         ~AliTRDtrigger();
44   AliTRDtrigger   &operator=(const AliTRDtrigger &p); 
45
46   virtual void     Copy(TObject &p) const;
47
48           void     Init();
49
50           Bool_t   Open(const Char_t *name, Int_t nEvent = 0);
51           Bool_t   ReadDigits();
52           Bool_t   ReadDigits(AliRawReader* rawReader);
53           Bool_t   MakeTracklets(Bool_t makeTracks = kFALSE);
54           void     MakeTracks(Int_t det);
55           Bool_t   WriteTracklets(Int_t det);
56           Bool_t   ReadTracklets(AliRunLoader *rl);
57
58           void     AddTracklet(Int_t det, Int_t row, Int_t seed, Int_t n);
59           void     AddTrack(const AliTRDgtuTrack *t, Int_t det);
60           Bool_t   TestTracklet(Int_t det, Int_t row, Int_t seed, Int_t n);
61           TObjArray *Tracklets();
62           void     ResetTracklets();
63
64           Int_t    GetNumberOfTracks() const;
65           Int_t    GetNPrimary() const                           { return fNPrimary;   };
66           AliTRDtrigParam *GetParameter() const                  { return fTrigParam;  };
67           AliTRDgtuTrack  *GetTrack(Int_t i) const;
68
69           void     SetRunLoader(AliRunLoader *rl)                { fRunLoader = rl;    };
70           void     SetMCMcoordinates(Int_t imcm);
71           void     SetParameter(AliTRDtrigParam *trigp)          { fTrigParam = trigp; };
72
73
74  protected:
75
76           Float_t                fField;                       //! Magnetic field
77           AliTRDgeometry        *fGeo;                         //! TRD geometry
78           AliTRDcalibDB         *fCalib;                       //! Calibration DB
79           AliTRDCommonParam     *fCParam;                      //! Common parameters
80
81           AliTRDtrigParam       *fTrigParam;                   //! Trigger class parameters
82           AliRunLoader          *fRunLoader;                   //! Run Loader
83           AliTRDdigitsManager   *fDigitsManager;               //! TRD digits manager
84           TTree                 *fTrackletTree;                //! Tree with tracklets
85           TObjArray             *fTracklets;                   //! Array of tracklets
86
87           Int_t                  fNROB;                        //! Number of ROBs in the current chamber
88           AliTRDmcm             *fMCM;                         //! Current MCM
89           AliTRDmcmTracklet     *fTrk;                         //! Current tracklet
90           AliTRDmcmTracklet     *fTrkTest;                     //! Test tracklet
91           AliTRDmodule          *fModule;                      //! Current module
92           AliTRDgtuTrack        *fGTUtrk;                      //! Current GTU track
93
94           Int_t                  fNtracklets;                  //! Tracklets counter
95
96           AliTRDdataArrayI      *fDigits;                      //! Array with digits
97           AliTRDdataArrayI      *fTrack0;                      //! Track dictionary 0
98           AliTRDdataArrayI      *fTrack1;                      //! Track dictionary 1
99           AliTRDdataArrayI      *fTrack2;                      //! Track dictionary 2
100
101           Int_t fNPrimary;                                     //! Number of primary tracks
102
103           TClonesArray          *fTracks;                      //! Array of GTU tracks
104
105   ClassDef(AliTRDtrigger,3)                                    //  TRD trigger class
106
107 };
108
109 #endif