#ifndef ALIPHOSTrigger_H
#define ALIPHOSTrigger_H
class TClonesArray ;
#include "TMatrixD.h"
#include "AliTriggerDetector.h"
class AliPHOSGeometry ;
class AliPHOSTrigger : public AliTriggerDetector {
public:
AliPHOSTrigger() ;
AliPHOSTrigger(const AliPHOSTrigger & trig) ;
virtual ~AliPHOSTrigger();
virtual void CreateInputs();
void Print(const Option_t * opt ="") const ;
virtual void Trigger() {}
void Trigger(TClonesArray *digits);
Float_t Get2x2MaxAmplitude() const {return f2x2MaxAmp ; }
Float_t GetnxnMaxAmplitude() const {return fnxnMaxAmp ; }
Int_t Get2x2CrystalPhi() const {return f2x2CrystalPhi ; }
Int_t GetnxnCrystalPhi() const {return fnxnCrystalPhi ; }
Int_t Get2x2CrystalEta() const {return f2x2CrystalEta ; }
Int_t GetnxnCrystalEta() const {return fnxnCrystalEta ; }
Int_t Get2x2SuperModule() const {return f2x2SM ; }
Int_t GetnxnSuperModule() const {return fnxnSM ; }
Int_t * GetADCValuesLowGainMax2x2Sum() {return fADCValuesLow2x2; }
Int_t * GetADCValuesHighGainMax2x2Sum() {return fADCValuesHigh2x2; }
Int_t * GetADCValuesLowGainMaxnxnSum() {return fADCValuesLownxn; }
Int_t * GetADCValuesHighGainMaxnxnSum() {return fADCValuesHighnxn; }
void GetCrystalPhiEtaIndexInModuleFromTRUIndex(Int_t itru, Int_t iphitru, Int_t ietatru,Int_t &ietaMod,Int_t &iphiMod) const ;
Float_t GetL0Threshold() const {return fL0Threshold ; }
Float_t GetL1JetLowPtThreshold() const {return fL1JetLowPtThreshold ; }
Float_t GetL1JetMediumPtThreshold() const {return fL1JetMediumPtThreshold ; }
Float_t GetL1JetHighPtThreshold() const {return fL1JetHighPtThreshold ; }
Int_t GetNTRU() const {return fNTRU ; }
Int_t GetNTRUZ() const {return fNTRUZ ; }
Int_t GetNTRUPhi() const {return fNTRUPhi ; }
Int_t GetPatchSize() const {return fPatchSize ; }
Int_t GetIsolPatchSize() const {return fIsolPatchSize ; }
Float_t Get2x2AmpOutOfPatch() const {return f2x2AmpOutOfPatch; }
Float_t GetnxnAmpOutOfPatch() const {return fnxnAmpOutOfPatch; }
Float_t Get2x2AmpOutOfPatchThres() const {return f2x2AmpOutOfPatchThres; }
Float_t GetnxnAmpOutOfPatchThres() const {return fnxnAmpOutOfPatchThres; }
Bool_t Is2x2Isol() const {return fIs2x2Isol; }
Bool_t IsnxnIsol() const {return fIsnxnIsol; }
Bool_t IsSimulation() const {return fSimulation ; }
Bool_t IsIsolatedInModule() const {return fIsolateInModule ; }
void SetDigitsList(TClonesArray * digits)
{fDigitsList = digits ; }
void SetNTRU(Int_t ntru) {fNTRU = ntru ; }
void SetNTRUZ(Int_t ntru) {fNTRUZ = ntru ; }
void SetNTRUPhi(Int_t ntru) {fNTRUPhi = ntru ; }
void SetL0Threshold(Int_t amp)
{fL0Threshold = amp ; }
void SetL1JetLowPtThreshold(Int_t amp)
{fL1JetLowPtThreshold = amp ; }
void SetL1JetMediumPtThreshold(Int_t amp)
{fL1JetMediumPtThreshold = amp; }
void SetL1JetHighPtThreshold(Int_t amp)
{fL1JetHighPtThreshold = amp ; }
void SetPatchSize(Int_t ps) { fPatchSize = ps ; }
void SetIsolPatchSize(Int_t ps) { fIsolPatchSize = ps ; }
void Set2x2AmpOutOfPatchThres(Float_t th) { f2x2AmpOutOfPatchThres = th; }
void SetnxnAmpOutOfPatchThres(Float_t th) { fnxnAmpOutOfPatchThres = th; }
void SetSimulation(Bool_t sim ) { fSimulation = sim ; }
void SetIsolateInModule(Bool_t isol ) { fIsolateInModule = isol ; }
private:
AliPHOSTrigger & operator = (const AliPHOSTrigger & trig) ;
void FillTRU(const TClonesArray * digits, const AliPHOSGeometry * geom) const ;
Bool_t IsPatchIsolated(Int_t iPatchType, const Int_t imod, const Int_t mtru, const Float_t maxamp, const Int_t maxphi, const Int_t maxeta) ;
void MakeSlidingCell(Int_t mod, TMatrixD &max2, TMatrixD &maxn) ;
void SetTriggers(Int_t iMod, const TMatrixD &max2,const TMatrixD &maxn) ;
void DoIt() ;
private:
Float_t f2x2MaxAmp ;
Int_t f2x2CrystalPhi ;
Int_t f2x2CrystalEta ;
Int_t f2x2SM ;
Float_t fnxnMaxAmp ;
Int_t fnxnCrystalPhi ;
Int_t fnxnCrystalEta ;
Int_t fnxnSM ;
Int_t* fADCValuesHighnxn ;
Int_t* fADCValuesLownxn ;
Int_t* fADCValuesHigh2x2 ;
Int_t* fADCValuesLow2x2 ;
TClonesArray* fDigitsList ;
TClonesArray* fAmptrus ;
TClonesArray* fAmpmods ;
TClonesArray* fTimeRtrus ;
Float_t fL0Threshold ;
Float_t fL1JetLowPtThreshold ;
Float_t fL1JetMediumPtThreshold ;
Float_t fL1JetHighPtThreshold ;
Int_t fNTRU ;
Int_t fNTRUZ ;
Int_t fNTRUPhi ;
Int_t fNCrystalsPhi;
Int_t fNCrystalsZ;
Int_t fPatchSize;
Int_t fIsolPatchSize ;
Float_t f2x2AmpOutOfPatch;
Float_t fnxnAmpOutOfPatch;
Float_t f2x2AmpOutOfPatchThres;
Float_t fnxnAmpOutOfPatchThres;
Float_t fIs2x2Isol;
Float_t fIsnxnIsol ;
Bool_t fSimulation ;
Bool_t fIsolateInModule;
ClassDef(AliPHOSTrigger,5)
} ;
#endif //ALIPHOSTrigger_H