]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDmcm.h
Updated TRD trigger code. Now the trigger code can run:
[u/mrichter/AliRoot.git] / TRD / AliTRDmcm.h
1 #ifndef ALITRDMCM_H
2 #define ALITRDMCM_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 //  Multi Chip Module object                         //
11 //                                                   //
12 ///////////////////////////////////////////////////////
13
14 #include <TObject.h>
15
16 class AliTRDtrigParam;
17
18 class AliTRDmcm : public TObject {
19
20  public:
21
22   enum { kMaxTrackletsPerMCM = 4, kMcmCol = 21, kMcmTBmax = 60, kSelClus = 6, kMaxClus = 4 };
23
24   AliTRDmcm();
25   AliTRDmcm(AliTRDtrigParam *trigp, const Int_t id);
26   virtual ~AliTRDmcm();
27   AliTRDmcm &operator=(const AliTRDmcm &m);
28   virtual void Copy(TObject &m) const;
29
30   Int_t   Ntrk()                                    const { return fNtrk; };
31   Int_t  *GetTrkIndex()                                   { return &fTrkIndex[0]; };
32   Int_t   GetRobId()                                const { return fRobId; };
33   Int_t   GetChaId()                                const { return fChaId; };
34   void    SetRobId(const Int_t id)                        { fRobId = id; };
35   void    SetChaId(const Int_t id)                        { fChaId = id; };
36   void    SetRow(const Int_t row)                         { fRow = row; };
37   Int_t   GetRow()                                  const { return fRow; };
38   void    SetColRange(const Int_t colf, const Int_t coll) { fColFirst = colf; fColLast = coll; };
39   void    GetColRange(Int_t &colf, Int_t &coll)     const { colf = fColFirst; coll = fColLast; };
40   void    AddTrk(const Int_t id);
41   void    SetADC(const Int_t icol, const Int_t itb, const Float_t adc) 
42     { fADC[icol][itb] = adc; };
43   Float_t GetADC(const Int_t icol, const Int_t itb) const { return fADC[icol][itb]; };
44   void    Reset();
45   Bool_t  Run();
46   void    SetCluster(const Int_t icol, const Int_t itb)      { fIsClus[icol][itb] = kTRUE; };
47   void    UnSetCluster(const Int_t icol, const Int_t itb)    { fIsClus[icol][itb] = kFALSE; };
48   Bool_t  IsCluster(Float_t amp[3]) const;
49   void    AddTimeBin(const Int_t itime);
50   Int_t   CreateSeeds();
51   void    Sort(const Int_t nel, Int_t *x1, Int_t *x2, Int_t dir);
52   Int_t   GetNtrkSeeds()                     const { return fNtrkSeeds; };
53   Int_t  *GetSeedCol()                             { return &fSeedCol[0]; };
54   Int_t  *GetPadHits()                             { return &fPadHits[0]; };
55   Bool_t  IsCluster(const Int_t icol, const Int_t itim) const { return fIsClus[icol][itim]; };
56
57   void Filter(Int_t nexp, Int_t ftype = 0);
58   void DeConvExpA(Double_t *source, Double_t *target, Int_t n, Int_t nexp);
59   void DeConvExpD(Double_t *source, Int_t    *target, Int_t n, Int_t nexp);
60   void DeConvExpMI(Double_t *source, Double_t *target, Int_t n);
61   void TailMakerSpline(Double_t *ampin, Double_t *ampout, Double_t lambda, Int_t n);
62   void TailCancelationMI(Double_t *ampin, Double_t *ampout, Double_t norm, Double_t lambda, Int_t n);
63
64   Int_t   Id() const { return fId; };
65
66  protected:
67
68   AliTRDtrigParam *fTrigParam;                //! pointer to the trigger parameters class
69
70   Int_t   fNtrk;                              //  number of found tracklets
71   Int_t   fTrkIndex[kMaxTrackletsPerMCM];     //  index of found tracklets
72   Int_t   fRobId;                             //  ROB id
73   Int_t   fChaId;                             //  Chamber id
74   Int_t   fRow;                               //  pad row number (0-11 or 0-15)
75   Int_t   fColFirst;                          //  first pad column
76   Int_t   fColLast;                           //  last pad column (<)
77   Float_t fADC[kMcmCol][kMcmTBmax];           //! array with MCM ADC values
78   Bool_t  fIsClus[kMcmCol][kMcmTBmax];        //! flag of a cluster maximum
79   Int_t   fTime1;                             //  first time bin for tracking (incl.)
80   Int_t   fTime2;                             //  last  time bin for tracking (incl.)
81   Float_t fClusThr;                           //  cluster threshold
82   Float_t fPadThr;                            //  pad threshold
83   Int_t   fPadHits[kMcmCol];                  //  hit counter in pads
84   Int_t   fNtrkSeeds;                         //  number of found seeds
85   Int_t   fSeedCol[kMaxTrackletsPerMCM];      //  column number of found tracklet seeds
86                                               //  filter parameters (1 = long, 2 = short component)
87   Float_t fR1;                                //  time constant [microseconds]
88   Float_t fR2;                                //  time constant [microseconds]
89   Float_t fC1;                                //  weight
90   Float_t fC2;                                //  weight
91   Float_t fPedestal;                          //  ADC baseline (pedestal)
92
93   Int_t fId;                                  //  dummy id
94
95   ClassDef(AliTRDmcm,2)                       // TRD MCM class
96
97 };
98
99 #endif