]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSTrigger.h
Removing semaphore .done files.
[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
0b2ec9f7 13// 2x2 and nxn (n multiple of 4) crystal combinations per each TRU, adding the
14// digits amplitude and finding the maximum. Maxima are transformed in ADC
15// time samples. Each time bin is compared to the trigger threshold until it is larger
59264fa6 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
3663622c 46
47
59264fa6 48 virtual void CreateInputs(); //Define trigger inputs for Central Trigger Processor
49 void Print(const Option_t * opt ="") const ;
b165f59d 50 virtual void Trigger(); //Make PHOS trigger
59264fa6 51
52 //Getters
0b2ec9f7 53 Float_t Get2x2MaxAmplitude() const {return f2x2MaxAmp ; }
54 Float_t GetnxnMaxAmplitude() const {return fnxnMaxAmp ; }
59264fa6 55 Int_t Get2x2CrystalPhi() const {return f2x2CrystalPhi ; }
0b2ec9f7 56 Int_t GetnxnCrystalPhi() const {return fnxnCrystalPhi ; }
59264fa6 57 Int_t Get2x2CrystalEta() const {return f2x2CrystalEta ; }
0b2ec9f7 58 Int_t GetnxnCrystalEta() const {return fnxnCrystalEta ; }
59264fa6 59 Int_t Get2x2SuperModule() const {return f2x2SM ; }
0b2ec9f7 60 Int_t GetnxnSuperModule() const {return fnxnSM ; }
59264fa6 61
62 Int_t * GetADCValuesLowGainMax2x2Sum() {return fADCValuesLow2x2; }
63 Int_t * GetADCValuesHighGainMax2x2Sum() {return fADCValuesHigh2x2; }
0b2ec9f7 64 Int_t * GetADCValuesLowGainMaxnxnSum() {return fADCValuesLownxn; }
65 Int_t * GetADCValuesHighGainMaxnxnSum() {return fADCValuesHighnxn; }
59264fa6 66
03ecfe88 67 void GetCrystalPhiEtaIndexInModuleFromTRUIndex(Int_t itru, Int_t iphitru, Int_t ietatru,Int_t &ietaMod,Int_t &iphiMod, const AliPHOSGeometry *geom) const ;
59264fa6 68
69 Float_t GetL0Threshold() const {return fL0Threshold ; }
70 Float_t GetL1JetLowPtThreshold() const {return fL1JetLowPtThreshold ; }
71 Float_t GetL1JetHighPtThreshold() const {return fL1JetHighPtThreshold ; }
72
73 Int_t GetNTRU() const {return fNTRU ; }
74 Int_t GetNTRUZ() const {return fNTRUZ ; }
75 Int_t GetNTRUPhi() const {return fNTRUPhi ; }
0b2ec9f7 76
77 Float_t GetPatchSize() const {return fPatchSize ; }
59264fa6 78 Bool_t IsSimulation() const {return fSimulation ; }
79
80 //Setters
81
82 void SetDigitsList(TClonesArray * digits)
83 {fDigitsList = digits ; }
84
85
86 void SetNTRU(Int_t ntru) {fNTRU = ntru ; }
87 void SetNTRUZ(Int_t ntru) {fNTRUZ = ntru ; }
88 void SetNTRUPhi(Int_t ntru) {fNTRUPhi = ntru ; }
89
90 void SetL0Threshold(Int_t amp)
91 {fL0Threshold = amp ; }
92 void SetL1JetLowPtThreshold(Int_t amp)
93 {fL1JetLowPtThreshold = amp ; }
94 void SetL1JetHighPtThreshold(Int_t amp)
95 {fL1JetHighPtThreshold = amp ; }
96
0b2ec9f7 97 void SetPatchSize(Int_t ps) {fPatchSize = ps ; }
59264fa6 98 void SetSimulation(Bool_t sim ) {fSimulation = sim ; }
25354ff4 99
100 private:
25354ff4 101
3663622c 102 AliPHOSTrigger & operator = (const AliPHOSTrigger & trig) ;//cpy assignment
103
59264fa6 104 void FillTRU(const TClonesArray * digits, const AliPHOSGeometry * geom, TClonesArray * amptru, TClonesArray * timeRtru) const ;
105
0b2ec9f7 106 void MakeSlidingCell(const TClonesArray * amptrus, const TClonesArray * timeRtrus, Int_t mod, TMatrixD *ampmax2, TMatrixD *ampmaxn, const AliPHOSGeometry *geom) ;
59264fa6 107
0b2ec9f7 108 void SetTriggers(Int_t iMod, const TMatrixD *ampmax2,const TMatrixD *ampmaxn, const AliPHOSGeometry *geom) ;
25354ff4 109
110 private:
25354ff4 111
59264fa6 112 Float_t f2x2MaxAmp ; //! Maximum 2x2 added amplitude (not overlapped)
113 Int_t f2x2CrystalPhi ; //! upper right cell, row(phi)
114 Int_t f2x2CrystalEta ; //! and column(eta)
115 Int_t f2x2SM ; //! Module where maximum is found
0b2ec9f7 116 Float_t fnxnMaxAmp ; //! Maximum nxn added amplitude (overlapped)
117 Int_t fnxnCrystalPhi ; //! upper right cell, row(phi)
118 Int_t fnxnCrystalEta ; //! and column(eta)
119 Int_t fnxnSM ; //! Module where maximum is found
59264fa6 120
0b2ec9f7 121 Int_t* fADCValuesHighnxn ; //! Sampled ADC high gain values for the nxn crystals amplitude sum
122 Int_t* fADCValuesLownxn ; //! " low gain "
59264fa6 123 Int_t* fADCValuesHigh2x2 ; //! " high gain " 2x2 "
124 Int_t* fADCValuesLow2x2 ; //! " low gaing " "
125
126 TClonesArray* fDigitsList ; //Array of digits
127
128 Float_t fL0Threshold ; //! L0 trigger energy threshold
129 Float_t fL1JetLowPtThreshold ; //! L1 Low pT trigger threshold
130 Float_t fL1JetHighPtThreshold ; //! L1 High pT trigger threshold
131
132 Int_t fNTRU ; //! Number of TRUs per module
133 Int_t fNTRUZ ; //! Number of crystal rows per Z in one TRU
134 Int_t fNTRUPhi ; //! Number of crystal rows per Phi in one TRU
0b2ec9f7 135 Int_t fPatchSize; //! Trigger patch factor, to be multiplied to 2x2 cells
136 // 0 means 2x2, 1 means nxn, 2 means 8x8 ...
59264fa6 137 Bool_t fSimulation ; //! Flag to do the trigger during simulation or reconstruction
138 ClassDef(AliPHOSTrigger,4)
25354ff4 139} ;
140
141
142#endif //ALIPHOSTrigger_H