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