Fixing memory leak (L.Gaudichet)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTrigger.h
CommitLineData
f0377b23 1#ifndef ALIEMCALTrigger_H
2#define ALIEMCALTrigger_H
59264fa6 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
f0377b23 5
59264fa6 6/* $Id $ */
7/* $Log $ */
f0377b23 8//___________________________________________________________
9// Class for trigger analysis.
59264fa6 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.
f0377b23 19// Usage:
20//
21// //Inside the event loop
22// AliEMCALTrigger *tr = new AliEMCALTrigger();//Init Trigger
59264fa6 23// tr->SetL0Threshold(100);
f0377b23 24// tr->SetL1JetLowPtThreshold(1000);
25// tr->SetL1JetMediumPtThreshold(10000);
26// tr->SetL1JetHighPtThreshold(20000);
27// tr->Trigger(); //Execute Trigger
28// tr->Print(""); //Print results
f0377b23 29//
30//*-- Author: Gustavo Conesa & Yves Schutz (IFIC, SUBATECH, CERN)
31
32// --- ROOT system ---
33
34class TClonesArray ;
59264fa6 35#include "TMatrixD.h"
f0377b23 36
37// --- AliRoot header files ---
38#include "AliTriggerDetector.h"
39
40class AliEMCALGeometry ;
41
42class AliEMCALTrigger : public AliTriggerDetector {
43
44 public:
59264fa6 45
f0377b23 46 AliEMCALTrigger() ; // ctor
47 AliEMCALTrigger(const AliEMCALTrigger & trig) ; // cpy ctor
48 virtual ~AliEMCALTrigger() {}; //virtual dtor
59264fa6 49 virtual void CreateInputs(); //Define trigger inputs for Central Trigger Processor
50 void Print(const Option_t * opt ="") const ;
f0377b23 51 virtual void Trigger(); //Make EMCAL trigger
59264fa6 52
53 //Getters
54 Float_t Get2x2MaxAmplitude() const {return f2x2MaxAmp ; }
55 Float_t Get4x4MaxAmplitude() const {return f4x4MaxAmp ; }
56 Int_t Get2x2CellPhi() const {return f2x2CellPhi ; }
57 Int_t Get4x4CellPhi() const {return f4x4CellPhi ; }
58 Int_t Get2x2CellEta() const {return f2x2CellEta ; }
59 Int_t Get4x4CellEta() const {return f4x4CellEta ; }
60 Int_t Get2x2SuperModule() const {return f2x2SM ; }
61 Int_t Get4x4SuperModule() const {return f4x4SM ; }
62
63 Int_t * GetADCValuesLowGainMax2x2Sum() {return fADCValuesLow2x2; }
64 Int_t * GetADCValuesHighGainMax2x2Sum() {return fADCValuesHigh2x2; }
65 Int_t * GetADCValuesLowGainMax4x4Sum() {return fADCValuesLow4x4; }
66 Int_t * GetADCValuesHighGainMax4x4Sum() {return fADCValuesHigh4x4; }
67
68 Float_t GetL0Threshold() const {return fL0Threshold ; }
69 Float_t GetL1JetLowPtThreshold() const {return fL1JetLowPtThreshold ; }
70 Float_t GetL1JetMediumPtThreshold()const {return fL1JetMediumPtThreshold ; }
71 Float_t GetL1JetHighPtThreshold() const {return fL1JetHighPtThreshold ; }
f0377b23 72
59264fa6 73 Bool_t IsSimulation() const {return fSimulation ; }
74
75 //Setters
76 void SetDigitsList(TClonesArray * digits)
77 {fDigitsList = digits ; }
78
79 void SetL0Threshold(Int_t amp)
80 {fL0Threshold = amp; }
81 void SetL1JetLowPtThreshold(Int_t amp)
82 {fL1JetLowPtThreshold = amp; }
83 void SetL1JetMediumPtThreshold(Int_t amp)
84 {fL1JetMediumPtThreshold = amp; }
85 void SetL1JetHighPtThreshold(Int_t amp)
86 {fL1JetHighPtThreshold = amp; }
87
88 void SetSimulation(Bool_t sim ) {fSimulation = sim ; }
89
f0377b23 90 private:
91
59264fa6 92 void MakeSlidingCell(const TClonesArray * amptrus, const TClonesArray * timeRtrus,const Int_t supermod, TMatrixD *ampmax2, TMatrixD *ampmax4, AliEMCALGeometry * geom) ;
f0377b23 93
94
59264fa6 95 void SetTriggers(const Int_t iSM, const TMatrixD *ampmax2, const TMatrixD *ampmax4, AliEMCALGeometry *geom) ;
96
f0377b23 97 private:
f0377b23 98
59264fa6 99 Float_t f2x2MaxAmp ; //! Maximum 2x2 added amplitude (not overlapped)
100 Int_t f2x2CellPhi ; //! upper right cell, row(phi)
101 Int_t f2x2CellEta ; //! and column(eta)
102 Int_t f2x2SM ; //! Super Module where maximum is found
103 Float_t f4x4MaxAmp ; //! Maximum 4x4 added amplitude (overlapped)
104 Int_t f4x4CellPhi ; //! upper right cell, row(phi)
105 Int_t f4x4CellEta ; //! and column(eta)
106 Int_t f4x4SM ; //! Super Module where maximum is found
f0377b23 107
59264fa6 108 Int_t* fADCValuesHigh4x4 ; //! Sampled ADC high gain values for the 4x4 crystals amplitude sum
109 Int_t* fADCValuesLow4x4 ; //! " low gain "
110 Int_t* fADCValuesHigh2x2 ; //! " high gain " 2x2 "
111 Int_t* fADCValuesLow2x2 ; //! " low gaing " "
f0377b23 112
59264fa6 113 TClonesArray* fDigitsList ; //Array of digits
114
115 Float_t fL0Threshold ; //! L0 trigger energy threshold
116 Float_t fL1JetLowPtThreshold ; //! L1 Low pT trigger energy threshold
117 Float_t fL1JetMediumPtThreshold ; //! L1 Medium pT trigger energy threshold
118 Float_t fL1JetHighPtThreshold ; //! L1 High pT trigger energy threshold
119
120 Bool_t fSimulation ; //! Flag to do the trigger during simulation or reconstruction
121
122 ClassDef(AliEMCALTrigger,1)
123} ;
124
125
f0377b23 126#endif //ALIEMCALTrigger_H
59264fa6 127