Set of modifications:
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrigger.h
CommitLineData
25354ff4 1#ifndef ALIPHOSTrigger_H
2#define ALIPHOSTrigger_H
59264fa6 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id $ */
7/* $Log $ */
25354ff4 8
9//____________________________________________________________
10// Class for trigger analysis.
59264fa6 11// Digits are grouped in TRU's (Trigger Units). A TRU consist of 16x28
12// crystals ordered fNTRUPhi x fNTRUZ. The algorithm searches all possible
13// 4x4 crystal combinations per each TRU, adding the digits amplitude and
14// finding the maximum. Maximums are transformed in ADC time samples.
15// Each time bin is compared to the trigger threshold until it is larger
16// and then, triggers are set. Thresholds need to be fixed.
bb38a8fc 17// Usage:
18//
19// //Inside the event loop
59264fa6 20// AliPHOSTrigger *tr = new AliPHOSTrigger();//Init Trigger
21// tr->SetL0Threshold(100);
bb38a8fc 22// tr->SetL1JetLowPtThreshold(1000);
bb38a8fc 23// tr->SetL1JetHighPtThreshold(20000);
24// tr->Trigger(); //Execute Trigger
59264fa6 25// tr->Print(""); //Print results
bb38a8fc 26//
25354ff4 27//*-- Author: Gustavo Conesa & Yves Schutz (IFIC, SUBATECH, CERN)
28
29// --- ROOT system ---
25354ff4 30
b165f59d 31class TClonesArray ;
59264fa6 32#include "TMatrixD.h"
b165f59d 33
25354ff4 34// --- AliRoot header files ---
b165f59d 35#include "AliTriggerDetector.h"
36
37class AliPHOSGeometry ;
25354ff4 38
b165f59d 39class AliPHOSTrigger : public AliTriggerDetector {
25354ff4 40
59264fa6 41 public:
42
25354ff4 43 AliPHOSTrigger() ; // ctor
44 AliPHOSTrigger(const AliPHOSTrigger & trig) ; // cpy ctor
45 virtual ~AliPHOSTrigger() {}; //virtual dtor
59264fa6 46 virtual void CreateInputs(); //Define trigger inputs for Central Trigger Processor
47 void Print(const Option_t * opt ="") const ;
b165f59d 48 virtual void Trigger(); //Make PHOS trigger
59264fa6 49
50 //Getters
51 Float_t Get2x2MaxAmplitude() const {return f4x4MaxAmp ; }
52 Float_t Get4x4MaxAmplitude() const {return f4x4MaxAmp ; }
53 Int_t Get2x2CrystalPhi() const {return f2x2CrystalPhi ; }
54 Int_t Get4x4CrystalPhi() const {return f4x4CrystalPhi ; }
55 Int_t Get2x2CrystalEta() const {return f2x2CrystalEta ; }
56 Int_t Get4x4CrystalEta() const {return f4x4CrystalEta ; }
57 Int_t Get2x2SuperModule() const {return f2x2SM ; }
58 Int_t Get4x4SuperModule() const {return f4x4SM ; }
59
60 Int_t * GetADCValuesLowGainMax2x2Sum() {return fADCValuesLow2x2; }
61 Int_t * GetADCValuesHighGainMax2x2Sum() {return fADCValuesHigh2x2; }
62 Int_t * GetADCValuesLowGainMax4x4Sum() {return fADCValuesLow4x4; }
63 Int_t * GetADCValuesHighGainMax4x4Sum() {return fADCValuesHigh4x4; }
64
65 void GetCrystalPhiEtaIndexInModuleFromTRUIndex(const Int_t itru,const Int_t iphitru,const Int_t ietatru,Int_t &ietaMod,Int_t &iphiMod, const AliPHOSGeometry *geom) const ;
66
67 Float_t GetL0Threshold() const {return fL0Threshold ; }
68 Float_t GetL1JetLowPtThreshold() const {return fL1JetLowPtThreshold ; }
69 Float_t GetL1JetHighPtThreshold() const {return fL1JetHighPtThreshold ; }
70
71 Int_t GetNTRU() const {return fNTRU ; }
72 Int_t GetNTRUZ() const {return fNTRUZ ; }
73 Int_t GetNTRUPhi() const {return fNTRUPhi ; }
74
75 Bool_t IsSimulation() const {return fSimulation ; }
76
77 //Setters
78
79 void SetDigitsList(TClonesArray * digits)
80 {fDigitsList = digits ; }
81
82
83 void SetNTRU(Int_t ntru) {fNTRU = ntru ; }
84 void SetNTRUZ(Int_t ntru) {fNTRUZ = ntru ; }
85 void SetNTRUPhi(Int_t ntru) {fNTRUPhi = ntru ; }
86
87 void SetL0Threshold(Int_t amp)
88 {fL0Threshold = amp ; }
89 void SetL1JetLowPtThreshold(Int_t amp)
90 {fL1JetLowPtThreshold = amp ; }
91 void SetL1JetHighPtThreshold(Int_t amp)
92 {fL1JetHighPtThreshold = amp ; }
93
94 void SetSimulation(Bool_t sim ) {fSimulation = sim ; }
25354ff4 95
96 private:
25354ff4 97
59264fa6 98 void FillTRU(const TClonesArray * digits, const AliPHOSGeometry * geom, TClonesArray * amptru, TClonesArray * timeRtru) const ;
99
100 void MakeSlidingCell(const TClonesArray * amptrus, const TClonesArray * timeRtrus, const Int_t mod, TMatrixD *ampmax2, TMatrixD *ampmax4, const AliPHOSGeometry *geom) ;
101
102 void SetTriggers(const Int_t iMod, const TMatrixD *ampmax2,const TMatrixD *ampmax4, const AliPHOSGeometry *geom) ;
25354ff4 103
104 private:
25354ff4 105
59264fa6 106 Float_t f2x2MaxAmp ; //! Maximum 2x2 added amplitude (not overlapped)
107 Int_t f2x2CrystalPhi ; //! upper right cell, row(phi)
108 Int_t f2x2CrystalEta ; //! and column(eta)
109 Int_t f2x2SM ; //! Module where maximum is found
110 Float_t f4x4MaxAmp ; //! Maximum 4x4 added amplitude (overlapped)
111 Int_t f4x4CrystalPhi ; //! upper right cell, row(phi)
112 Int_t f4x4CrystalEta ; //! and column(eta)
113 Int_t f4x4SM ; //! Module where maximum is found
114
115 Int_t* fADCValuesHigh4x4 ; // Sampled ADC high gain values for the 4x4 crystals amplitude sum
116 Int_t* fADCValuesLow4x4 ; //! " low gain "
117 Int_t* fADCValuesHigh2x2 ; //! " high gain " 2x2 "
118 Int_t* fADCValuesLow2x2 ; //! " low gaing " "
119
120 TClonesArray* fDigitsList ; //Array of digits
121
122 Float_t fL0Threshold ; //! L0 trigger energy threshold
123 Float_t fL1JetLowPtThreshold ; //! L1 Low pT trigger threshold
124 Float_t fL1JetHighPtThreshold ; //! L1 High pT trigger threshold
125
126 Int_t fNTRU ; //! Number of TRUs per module
127 Int_t fNTRUZ ; //! Number of crystal rows per Z in one TRU
128 Int_t fNTRUPhi ; //! Number of crystal rows per Phi in one TRU
25354ff4 129
59264fa6 130 Bool_t fSimulation ; //! Flag to do the trigger during simulation or reconstruction
131 ClassDef(AliPHOSTrigger,4)
25354ff4 132} ;
133
134
135#endif //ALIPHOSTrigger_H