fixed error of pseudo cluster and time cut
[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.
64df000d 11
12//
13//*-- Author: Gustavo Conesa & Yves Schutz (IFIC, SUBATECH, CERN)
59264fa6 14// Digits are grouped in TRU's (Trigger Units). A TRU consist of 16x28
15// crystals ordered fNTRUPhi x fNTRUZ. The algorithm searches all possible
64df000d 16// 2x2 and nxn (n multiple of 4) crystal combinations per each TRU, adding the
17// digits amplitude and finding the maximum. Iti is found is maximum is isolated.
18// Maxima are transformed in ADC time samples. Each time bin is compared to the trigger
19// threshold until it is larger and then, triggers are set. Thresholds need to be fixed.
bb38a8fc 20// Usage:
21//
22// //Inside the event loop
64df000d 23// AliEMCALTrigger *tr = new AliEMCALTrigger();//Init Trigger
59264fa6 24// tr->SetL0Threshold(100);
bb38a8fc 25// tr->SetL1JetLowPtThreshold(1000);
bb38a8fc 26// tr->SetL1JetHighPtThreshold(20000);
64df000d 27// ....
bb38a8fc 28// tr->Trigger(); //Execute Trigger
64df000d 29// tr->Print(""); //Print data members after calculation.
30//
25354ff4 31// --- ROOT system ---
25354ff4 32
b165f59d 33class TClonesArray ;
59264fa6 34#include "TMatrixD.h"
b165f59d 35
25354ff4 36// --- AliRoot header files ---
b165f59d 37#include "AliTriggerDetector.h"
38
39class AliPHOSGeometry ;
25354ff4 40
b165f59d 41class AliPHOSTrigger : public AliTriggerDetector {
25354ff4 42
59264fa6 43 public:
44
25354ff4 45 AliPHOSTrigger() ; // ctor
46 AliPHOSTrigger(const AliPHOSTrigger & trig) ; // cpy ctor
47 virtual ~AliPHOSTrigger() {}; //virtual dtor
3663622c 48
49
59264fa6 50 virtual void CreateInputs(); //Define trigger inputs for Central Trigger Processor
51 void Print(const Option_t * opt ="") const ;
b165f59d 52 virtual void Trigger(); //Make PHOS trigger
59264fa6 53
54 //Getters
0b2ec9f7 55 Float_t Get2x2MaxAmplitude() const {return f2x2MaxAmp ; }
56 Float_t GetnxnMaxAmplitude() const {return fnxnMaxAmp ; }
59264fa6 57 Int_t Get2x2CrystalPhi() const {return f2x2CrystalPhi ; }
0b2ec9f7 58 Int_t GetnxnCrystalPhi() const {return fnxnCrystalPhi ; }
59264fa6 59 Int_t Get2x2CrystalEta() const {return f2x2CrystalEta ; }
0b2ec9f7 60 Int_t GetnxnCrystalEta() const {return fnxnCrystalEta ; }
59264fa6 61 Int_t Get2x2SuperModule() const {return f2x2SM ; }
0b2ec9f7 62 Int_t GetnxnSuperModule() const {return fnxnSM ; }
59264fa6 63
64 Int_t * GetADCValuesLowGainMax2x2Sum() {return fADCValuesLow2x2; }
65 Int_t * GetADCValuesHighGainMax2x2Sum() {return fADCValuesHigh2x2; }
0b2ec9f7 66 Int_t * GetADCValuesLowGainMaxnxnSum() {return fADCValuesLownxn; }
67 Int_t * GetADCValuesHighGainMaxnxnSum() {return fADCValuesHighnxn; }
59264fa6 68
64df000d 69 void GetCrystalPhiEtaIndexInModuleFromTRUIndex(Int_t itru, Int_t iphitru, Int_t ietatru,Int_t &ietaMod,Int_t &iphiMod) const ;
59264fa6 70
71 Float_t GetL0Threshold() const {return fL0Threshold ; }
72 Float_t GetL1JetLowPtThreshold() const {return fL1JetLowPtThreshold ; }
73 Float_t GetL1JetHighPtThreshold() const {return fL1JetHighPtThreshold ; }
74
75 Int_t GetNTRU() const {return fNTRU ; }
76 Int_t GetNTRUZ() const {return fNTRUZ ; }
77 Int_t GetNTRUPhi() const {return fNTRUPhi ; }
0b2ec9f7 78
64df000d 79 Int_t GetPatchSize() const {return fPatchSize ; }
80 Int_t GetIsolPatchSize() const {return fIsolPatchSize ; }
81
82 Float_t Get2x2AmpOutOfPatch() const {return f2x2AmpOutOfPatch; }
83 Float_t GetnxnAmpOutOfPatch() const {return fnxnAmpOutOfPatch; }
84 Float_t Get2x2AmpOutOfPatchThres() const {return f2x2AmpOutOfPatchThres; }
85 Float_t GetnxnAmpOutOfPatchThres() const {return fnxnAmpOutOfPatchThres; }
86 Bool_t Is2x2Isol() const {return fIs2x2Isol; }
87 Bool_t IsnxnIsol() const {return fIsnxnIsol; }
88
59264fa6 89 Bool_t IsSimulation() const {return fSimulation ; }
552c2d0e 90 Bool_t IsIsolatedInModule() const {return fIsolateInModule ; }
59264fa6 91
92 //Setters
93
94 void SetDigitsList(TClonesArray * digits)
95 {fDigitsList = digits ; }
96
97
98 void SetNTRU(Int_t ntru) {fNTRU = ntru ; }
99 void SetNTRUZ(Int_t ntru) {fNTRUZ = ntru ; }
100 void SetNTRUPhi(Int_t ntru) {fNTRUPhi = ntru ; }
101
102 void SetL0Threshold(Int_t amp)
103 {fL0Threshold = amp ; }
104 void SetL1JetLowPtThreshold(Int_t amp)
105 {fL1JetLowPtThreshold = amp ; }
106 void SetL1JetHighPtThreshold(Int_t amp)
107 {fL1JetHighPtThreshold = amp ; }
108
0b2ec9f7 109 void SetPatchSize(Int_t ps) {fPatchSize = ps ; }
64df000d 110 void SetIsolPatchSize(Int_t ps) {fIsolPatchSize = ps ; }
111 void Set2x2AmpOutOfPatchThres(Float_t th) { f2x2AmpOutOfPatchThres = th; }
112 void SetnxnAmpOutOfPatchThres(Float_t th) { fnxnAmpOutOfPatchThres = th; }
59264fa6 113 void SetSimulation(Bool_t sim ) {fSimulation = sim ; }
552c2d0e 114 void SetIsolateInModule(Bool_t isol ) {fIsolateInModule = isol ; }
25354ff4 115
116 private:
25354ff4 117
3663622c 118 AliPHOSTrigger & operator = (const AliPHOSTrigger & trig) ;//cpy assignment
119
552c2d0e 120 void FillTRU(const TClonesArray * digits, const AliPHOSGeometry * geom, TClonesArray * amptru, TClonesArray * ampmod, TClonesArray * timeRtru) const ;
59264fa6 121
552c2d0e 122 Bool_t IsPatchIsolated(Int_t iPatchType, const TClonesArray * ampmods, const Int_t imod, const Int_t mtru, const Float_t maxamp, const Int_t maxphi, const Int_t maxeta) ;
64df000d 123
124 void MakeSlidingCell(const TClonesArray * amptrus, const TClonesArray * timeRtrus, Int_t mod, TMatrixD *ampmax2, TMatrixD *ampmaxn) ;
59264fa6 125
64df000d 126 void SetTriggers(const TClonesArray * amptrus, Int_t iMod, const TMatrixD *ampmax2,const TMatrixD *ampmaxn) ;
25354ff4 127
128 private:
25354ff4 129
59264fa6 130 Float_t f2x2MaxAmp ; //! Maximum 2x2 added amplitude (not overlapped)
131 Int_t f2x2CrystalPhi ; //! upper right cell, row(phi)
132 Int_t f2x2CrystalEta ; //! and column(eta)
133 Int_t f2x2SM ; //! Module where maximum is found
0b2ec9f7 134 Float_t fnxnMaxAmp ; //! Maximum nxn added amplitude (overlapped)
135 Int_t fnxnCrystalPhi ; //! upper right cell, row(phi)
136 Int_t fnxnCrystalEta ; //! and column(eta)
137 Int_t fnxnSM ; //! Module where maximum is found
59264fa6 138
0b2ec9f7 139 Int_t* fADCValuesHighnxn ; //! Sampled ADC high gain values for the nxn crystals amplitude sum
140 Int_t* fADCValuesLownxn ; //! " low gain "
59264fa6 141 Int_t* fADCValuesHigh2x2 ; //! " high gain " 2x2 "
142 Int_t* fADCValuesLow2x2 ; //! " low gaing " "
143
144 TClonesArray* fDigitsList ; //Array of digits
145
146 Float_t fL0Threshold ; //! L0 trigger energy threshold
147 Float_t fL1JetLowPtThreshold ; //! L1 Low pT trigger threshold
148 Float_t fL1JetHighPtThreshold ; //! L1 High pT trigger threshold
149
64df000d 150 Int_t fNTRU ; //! Number of TRUs per module
59264fa6 151 Int_t fNTRUZ ; //! Number of crystal rows per Z in one TRU
64df000d 152 Int_t fNTRUPhi ; //! Number of crystal rows per Phi in one TRU
153 Int_t fNCrystalsPhi; //!Number of rows in a TRU
154 Int_t fNCrystalsZ; //!Number of columns in a TRU
155
0b2ec9f7 156 Int_t fPatchSize; //! Trigger patch factor, to be multiplied to 2x2 cells
64df000d 157 // 0 means 2x2, 1 means 4x4, 2 means 6x6 ...
158 Int_t fIsolPatchSize ; //Isolation patch size, number of rows or columns to add to
159 //the 2x2 or nxn maximum amplitude patch.
160 //1 means a patch around max amplitude of 2x2 of 4x4 and around
161 //max ampl patch of 4x4 of 8x8
162
163 Float_t f2x2AmpOutOfPatch; //Amplitude in isolation cone minus maximum amplitude of the reference patch
164 Float_t fnxnAmpOutOfPatch;
165 Float_t f2x2AmpOutOfPatchThres; //Threshold to select a trigger as isolated on f2x2AmpOutOfPatch value
166 Float_t fnxnAmpOutOfPatchThres;
167 Float_t fIs2x2Isol; //Patch is isolated if f2x2AmpOutOfPatchThres threshold is passed
168 Float_t fIsnxnIsol ;
169
59264fa6 170 Bool_t fSimulation ; //! Flag to do the trigger during simulation or reconstruction
552c2d0e 171 Bool_t fIsolateInModule; //! Flag to isolate trigger patch in Module or in TRU acceptance
172
59264fa6 173 ClassDef(AliPHOSTrigger,4)
25354ff4 174} ;
175
176
177#endif //ALIPHOSTrigger_H