]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALTrigger.h
AddAlignableVolumes() method added for EMCAL
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTrigger.h
1 #ifndef ALIEMCALTrigger_H
2 #define ALIEMCALTrigger_H
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 $ */
8 //___________________________________________________________
9 //  Class for trigger analysis.
10 //  Digits are grouped in TRU's (Trigger Units). A TRU consist of 384 cells 
11 //  ordered fNTRUPhi x fNTRUZ. The algorithm searches all possible 
12 //  4x4 crystal combinations per each TRU, adding the digits amplitude and 
13 //  finding the maximum. Maximums are transformed in adc time samples. 
14 //  Each time bin is compared to the trigger threshold until it is larger 
15 //  and then, triggers are set. Thresholds need to be fixed. 
16 //  Last 2 modules are half size in Phi, I considered that the number 
17 //  of TRU is maintained for the last modules but final decision has not 
18 //  been taken. If different, then this must to be changed. 
19 //  Usage:
20 //
21 //  //Inside the event loop
22 //  AliEMCALTrigger *tr = new AliEMCALTrigger();//Init Trigger
23 //  tr->SetL0Threshold(100);
24 //  tr->SetL1JetLowPtThreshold(1000);
25 //  tr->SetL1JetMediumPtThreshold(10000);
26 //  tr->SetL1JetHighPtThreshold(20000);
27 //  tr->Trigger(); //Execute Trigger
28 //  tr->Print(""); //Print results
29 //
30 //*-- Author: Gustavo Conesa & Yves Schutz (IFIC, SUBATECH, CERN)
31      
32 // --- ROOT system ---
33
34 class TClonesArray ;
35 #include "TMatrixD.h"
36
37 // --- AliRoot header files ---
38 #include "AliTriggerDetector.h"
39
40 class AliEMCALGeometry ;
41
42 class AliEMCALTrigger : public AliTriggerDetector {
43   
44  public:   
45
46   AliEMCALTrigger() ; //  ctor
47   AliEMCALTrigger(const AliEMCALTrigger & trig) ; // cpy ctor
48   virtual ~AliEMCALTrigger() {}; //virtual dtor
49   virtual void    CreateInputs(); //Define trigger inputs for Central Trigger Processor
50   void            Print(const Option_t * opt ="") const ;  
51   virtual void    Trigger();  //Make EMCAL trigger
52
53   //assignment operator for coding convention
54   const AliEMCALTrigger & operator = (const AliEMCALTrigger & ) {return *this;}
55
56   //Getters
57   Float_t  Get2x2MaxAmplitude()  const {return f2x2MaxAmp ; }
58   Float_t  Get4x4MaxAmplitude()  const {return f4x4MaxAmp ; }
59   Int_t    Get2x2CellPhi()       const {return f2x2CellPhi ; }
60   Int_t    Get4x4CellPhi()       const {return f4x4CellPhi ; }
61   Int_t    Get2x2CellEta()       const {return f2x2CellEta ; }
62   Int_t    Get4x4CellEta()       const {return f4x4CellEta ; }
63   Int_t    Get2x2SuperModule()   const {return f2x2SM ; }
64   Int_t    Get4x4SuperModule()   const {return f4x4SM ; }
65
66   Int_t *  GetADCValuesLowGainMax2x2Sum()  {return fADCValuesLow2x2; }
67   Int_t *  GetADCValuesHighGainMax2x2Sum() {return fADCValuesHigh2x2; }
68   Int_t *  GetADCValuesLowGainMax4x4Sum()  {return fADCValuesLow4x4; }
69   Int_t *  GetADCValuesHighGainMax4x4Sum() {return fADCValuesHigh4x4; }
70
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 ; }
75   
76   Bool_t   IsSimulation() const {return fSimulation ; }
77   
78   //Setters
79   void     SetDigitsList(TClonesArray * digits)          
80    {fDigitsList  = digits ; }
81
82   void     SetL0Threshold(Int_t amp)     
83     {fL0Threshold            = amp; }
84   void     SetL1JetLowPtThreshold(Int_t amp) 
85     {fL1JetLowPtThreshold    = amp; } 
86   void     SetL1JetMediumPtThreshold(Int_t amp) 
87     {fL1JetMediumPtThreshold = amp; } 
88   void     SetL1JetHighPtThreshold(Int_t amp)
89     {fL1JetHighPtThreshold   = amp; }
90
91   void SetSimulation(Bool_t sim )          {fSimulation = sim ; }
92
93  private:
94  
95   void MakeSlidingCell(const TClonesArray * amptrus, const TClonesArray * timeRtrus,const Int_t supermod, TMatrixD *ampmax2, TMatrixD *ampmax4, AliEMCALGeometry * geom) ; 
96   
97
98   void SetTriggers(const Int_t iSM, const TMatrixD *ampmax2, const TMatrixD *ampmax4, AliEMCALGeometry *geom) ;
99     
100  private: 
101
102   Float_t f2x2MaxAmp ;        //! Maximum 2x2 added amplitude (not overlapped) 
103   Int_t   f2x2CellPhi ;       //! upper right cell, row(phi)   
104   Int_t   f2x2CellEta ;       //! and column(eta)  
105   Int_t   f2x2SM ;            //! Super Module where maximum is found
106   Float_t f4x4MaxAmp ;        //! Maximum 4x4 added amplitude (overlapped)
107   Int_t   f4x4CellPhi ;       //! upper right cell, row(phi)   
108   Int_t   f4x4CellEta ;       //! and column(eta)
109   Int_t   f4x4SM ;            //! Super Module where maximum is found
110
111   Int_t*   fADCValuesHigh4x4 ; //! Sampled ADC high gain values for the 4x4 crystals amplitude sum
112   Int_t*   fADCValuesLow4x4  ; //! " low gain  " 
113   Int_t*   fADCValuesHigh2x2 ; //! " high gain " 2x2 "
114   Int_t*   fADCValuesLow2x2  ; //! " low gaing " "
115
116   TClonesArray* fDigitsList ;  //Array of digits 
117
118   Float_t fL0Threshold ;            //! L0 trigger energy threshold
119   Float_t fL1JetLowPtThreshold ;    //! L1 Low pT trigger energy threshold
120   Float_t fL1JetMediumPtThreshold ; //! L1 Medium pT trigger energy threshold
121   Float_t fL1JetHighPtThreshold ;   //! L1 High pT trigger energy threshold
122
123   Bool_t  fSimulation ;           //! Flag to do the trigger during simulation or reconstruction
124
125   ClassDef(AliEMCALTrigger,1)
126 } ;
127     
128     
129 #endif //ALIEMCALTrigger_H
130