]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALTrigger.h
Included new data member to change patch size in calorimeters trigger (Gustavo)
[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 2x2 and 
12 //  nxn (n multiple of 4) crystal combinations per each TRU, adding the digits 
13 //  amplitude and finding the maximum. Maximums are transformed in adc time 
14 //  samples. 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  GetnxnMaxAmplitude()  const {return fnxnMaxAmp ; }
59   Int_t    Get2x2CellPhi()       const {return f2x2CellPhi ; }
60   Int_t    GetnxnCellPhi()       const {return fnxnCellPhi ; }
61   Int_t    Get2x2CellEta()       const {return f2x2CellEta ; }
62   Int_t    GetnxnCellEta()       const {return fnxnCellEta ; }
63   Int_t    Get2x2SuperModule()   const {return f2x2SM ; }
64   Int_t    GetnxnSuperModule()   const {return fnxnSM ; }
65
66   Int_t *  GetADCValuesLowGainMax2x2Sum()  {return fADCValuesLow2x2; }
67   Int_t *  GetADCValuesHighGainMax2x2Sum() {return fADCValuesHigh2x2; }
68   Int_t *  GetADCValuesLowGainMaxnxnSum()  {return fADCValuesLownxn; }
69   Int_t *  GetADCValuesHighGainMaxnxnSum() {return fADCValuesHighnxn; }
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   Float_t  GetPatchSize() const  {return fPatchSize ; }
77   Bool_t   IsSimulation() const {return fSimulation ; }
78   
79   //Setters
80   void     SetDigitsList(TClonesArray * digits)          
81    {fDigitsList  = digits ; }
82
83   void     SetL0Threshold(Int_t amp)     
84     {fL0Threshold            = amp; }
85   void     SetL1JetLowPtThreshold(Int_t amp) 
86     {fL1JetLowPtThreshold    = amp; } 
87   void     SetL1JetMediumPtThreshold(Int_t amp) 
88     {fL1JetMediumPtThreshold = amp; } 
89   void     SetL1JetHighPtThreshold(Int_t amp)
90     {fL1JetHighPtThreshold   = amp; }
91
92   void SetPatchSize(Int_t ps)                {fPatchSize = ps ; }
93   void SetSimulation(Bool_t sim )          {fSimulation = sim ; }
94
95  private:
96  
97   void MakeSlidingCell(const TClonesArray * amptrus, const TClonesArray * timeRtrus,const Int_t supermod, TMatrixD *ampmax2, TMatrixD *ampmaxn, AliEMCALGeometry * geom) ; 
98   
99
100   void SetTriggers(const Int_t iSM, const TMatrixD *ampmax2, const TMatrixD *ampmaxn, AliEMCALGeometry *geom) ;
101     
102  private: 
103
104   Float_t f2x2MaxAmp ;        //! Maximum 2x2 added amplitude (not overlapped) 
105   Int_t   f2x2CellPhi ;       //! upper right cell, row(phi)   
106   Int_t   f2x2CellEta ;       //! and column(eta)  
107   Int_t   f2x2SM ;            //! Super Module where maximum is found
108   Float_t fnxnMaxAmp ;        //! Maximum nxn added amplitude (overlapped)
109   Int_t   fnxnCellPhi ;       //! upper right cell, row(phi)   
110   Int_t   fnxnCellEta ;       //! and column(eta)
111   Int_t   fnxnSM ;            //! Super Module where maximum is found
112
113   Int_t*   fADCValuesHighnxn ; //! Sampled ADC high gain values for the nxn crystals amplitude sum
114   Int_t*   fADCValuesLownxn  ; //! " low gain  " 
115   Int_t*   fADCValuesHigh2x2 ; //! " high gain " 2x2 "
116   Int_t*   fADCValuesLow2x2  ; //! " low gaing " "
117
118   TClonesArray* fDigitsList ;  //Array of digits 
119
120   Float_t fL0Threshold ;            //! L0 trigger energy threshold
121   Float_t fL1JetLowPtThreshold ;    //! L1 Low pT trigger energy threshold
122   Float_t fL1JetMediumPtThreshold ; //! L1 Medium pT trigger energy threshold
123   Float_t fL1JetHighPtThreshold ;   //! L1 High pT trigger energy threshold
124
125   Int_t fPatchSize;                 //! Trigger patch factor, to be multiplied to 2x2 cells
126                                             // 0 means 2x2, 1 means nxn, 2 means 8x8 ...
127   Bool_t  fSimulation ;           //! Flag to do the trigger during simulation or reconstruction
128
129   ClassDef(AliEMCALTrigger,1)
130 } ;
131     
132     
133 #endif //ALIEMCALTrigger_H
134