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