]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFTrigger.h
fix in TOF calibration to deal with L0-L1 orbit-crossing (negative values)
[u/mrichter/AliRoot.git] / TOF / AliTOFTrigger.h
1 #ifndef ALITOFTRIGGER_H
2 #define ALITOFTRIGGER_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8
9 /////////////////////////////////////////////////
10 //                                             //
11 //      TOF Trigger Detector Class             //
12 //                                             //
13 /////////////////////////////////////////////////
14
15 #include "AliTriggerDetector.h"
16
17 class AliTOFrawData;
18 class AliTOFTriggerMask;
19
20 class AliTOFTrigger : public AliTriggerDetector
21 {
22  public:
23   AliTOFTrigger();  // constructor
24   AliTOFTrigger(Int_t HighMultTh, Int_t ppMBTh, Int_t MultiMuonTh, Int_t UPTh, Float_t deltaminpsi, Float_t deltamaxpsi, Float_t deltaminro, Float_t deltamaxro, Int_t stripWindow); //constructor with parameters
25   virtual ~AliTOFTrigger();  // destructor
26   virtual void    CreateInputs();
27   virtual void    Trigger();
28   Int_t   GetHighMultTh() const {return fHighMultTh;}
29   Int_t   GetppMBTh() const {return fppMBTh;}
30   Int_t   GetMultiMuonTh() const {return fMultiMuonTh;}
31   Int_t   GetUPTh() const {return fUPTh;}
32   Float_t Getdeltaminpsi() const {return fdeltaminpsi;}
33   Float_t Getdeltamaxpsi() const {return fdeltamaxpsi;}
34   Float_t Getdeltaminro() const {return fdeltaminro;}
35   Float_t Getdeltamaxro() const {return fdeltamaxro;}
36   Int_t  GetstripWindow() const {return fstripWindow;}
37
38   void LoadActiveMask(); // Load active channel trigger mask
39   void GetMapMatrix(Bool_t map[][24]) const;
40   void GetMap(Bool_t **map) const;
41   //void PrintMap(); // to be checked because of warning problems
42   void GetTRDmapMatrix(Bool_t map[][8]) const;
43   void GetTRDmap(Bool_t **map) const;
44   Bool_t GetBit(Int_t nDDL, Int_t nTRM, Int_t iChain,Int_t iTDC, Int_t iCH);
45   Bool_t GetBit(Int_t *detind);
46   void SetBit(Int_t nDDL, Int_t nTRM, Int_t iChain,Int_t iTDC, Int_t iCH);
47   void SetBit(Int_t *detind);
48   void ResetBit(Int_t nDDL, Int_t nTRM, Int_t iChain,Int_t iTDC, Int_t iCH);
49   void ResetBit(Int_t *detind);
50
51
52   void   SetHighMultTh(Int_t HighMultTh){fHighMultTh = HighMultTh;}
53   void   SetppMBTh(Int_t ppMBTh){fppMBTh = ppMBTh;}
54   void   SetMultiMuonTh(Int_t MultiMuonTh){fMultiMuonTh = MultiMuonTh;}
55   void   SetUPTh(Int_t UPTh){fUPTh = UPTh;}
56   void   Setdeltaminpsi(Float_t deltaminpsi){fdeltaminpsi = deltaminpsi;}
57   void   Setdeltamaxpsi(Float_t deltamaxpsi){fdeltamaxpsi = deltamaxpsi;}
58   void   Setdeltaminro(Float_t deltaminro){fdeltaminro = deltaminro;}
59   void   Setdeltamaxro(Float_t deltamaxro){fdeltamaxro = deltamaxro;}
60   void   SetstripWindow(Int_t stripWindow){fstripWindow = stripWindow;}
61
62   Bool_t Return(Int_t i){if(i==0) return fSel1;
63                          else if(i==1) return fSel2;
64                          else if(i==2) return fSel3;
65                          else if(i==3) return fSel4;
66                          else { AliWarning(Form(" Index out of range: %d not in [0,3]",i)); return kFALSE; }
67                         };
68
69   Int_t GetNumberOfCrateOn(){return fNCrateOn;}; 
70   Int_t GetNumberOfMaxipadOn(){return fNMaxipadOn;}; 
71   Int_t GetNumberOfMaxipadOnAll(){return fNMaxipadOnAll;}; 
72   Bool_t *GetLTMarray(){return fLTMarray;};
73   void   CreateCTTMMatrix();
74   void   CreateLTMMatrix();
75   void   CreateLTMMatrixFromDigits();
76   void   CreateLTMMatrixFromRaw(AliRawReader *fRawReader);
77  private:
78
79   enum{
80     kNLTM = 72,          //Number of LTM
81     kNLTMchannels = 48,  //Number of channels in a LTM
82     kNCTTM = 36,         //Number of CTTM per TOF side
83     kNCTTMchannels = 24,  //Number of channels in a CTTM
84     kNLTMtoTRDchannels = 8  //Number of channels in a CTTM
85   };
86
87   AliTOFTrigger& operator=(const AliTOFTrigger &/*source*/); // ass. op.
88   AliTOFTrigger(const AliTOFTrigger & tr);
89
90   void    GetCTTMIndex(Int_t *detind, Int_t *indexCTTM);
91   void    GetLTMIndex(const Int_t * const detind, Int_t *LTMIndex);
92   Bool_t  fLTMmatrix[kNLTM][kNLTMchannels];         //LTM matrix 
93   Bool_t  fLTMarray[kNCTTM];        //LTM array for UPpurposes
94   Bool_t  fCTTMmatrixFront[kNCTTM][kNCTTMchannels];//CTTM matrix for TOP FPGA 
95   Bool_t  fCTTMmatrixBack[kNCTTM][kNCTTMchannels]; //CTTM matrix for BOTTOM FPGA
96   Int_t   fHighMultTh;             //threshold for High Multiplicity trigger
97   Int_t   fppMBTh;                 //threshold for pp Minimum Bias trigger
98   Int_t   fMultiMuonTh;            //threshold for Multi Muon trigger 
99   Int_t   fUPTh;                   //threshold for Ultra-Per coll trigger 
100   Float_t fdeltaminpsi;            //min delta phi for J/psi decay (UP trigger)
101   Float_t fdeltamaxpsi;            //max delta phi for J/psi decay (UP trigger)
102   Float_t fdeltaminro;             //min delta phi for ro decay (UP trigger)
103   Float_t fdeltamaxro;             //max delta phi for ro decay (UP trigger)
104   Int_t   fstripWindow;            //strip window for triggering
105
106   Bool_t fSel1,fSel2,fSel3,fSel4; // ppMB, PbPbMB2, PbPbMB3, PbPbUP
107
108   UInt_t fPowerMask[kNCTTMchannels+1];  // mask for 24 TDC channels
109
110   Int_t fNCrateOn; // number of crate fired
111   Int_t fNMaxipadOn; // number of Maxipad fired
112   Int_t fNMaxipadOnAll; // number of Maxipad fired w/o TDC dead mask
113   AliTOFTriggerMask *fTOFTrigMask; // class with the TOF trigger mask
114
115   ClassDef(AliTOFTrigger,1)  // TOF Trigger Detector class
116 };
117 #endif
118