// --- ROOT system ---
-
+#include "TMatrixD.h"
// --- ALIROOT system ---
#include "AliPHOSTrigger.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSGetter.h"
+#include "AliTriggerInput.h"
ClassImp(AliPHOSTrigger)
-//____________________________________________________________________________
- AliPHOSTrigger::AliPHOSTrigger() : TObject(),
- fL0(kFALSE), fL1Low(kFALSE), fL1Medium(kFALSE),
- fL1High(kFALSE), fL0Threshold(50), fL1LowThreshold(1200),
- fL1MediumThreshold(12000), fL1HighThreshold(30000)
+//______________________________________________________________________
+AliPHOSTrigger::AliPHOSTrigger()
+ : AliTriggerDetector(), fL0Threshold(50), fL1LowThreshold(1200),
+ fL1MediumThreshold(12000), fL1HighThreshold(30000)
{
- // default ctor
- Print("") ;
+ //ctor
+
+ SetName("PHOS");
+ CreateInputs();
+
+ Print("") ;
}
+
+
//____________________________________________________________________________
-AliPHOSTrigger::AliPHOSTrigger(const AliPHOSTrigger & trig) : TObject(trig)
+AliPHOSTrigger::AliPHOSTrigger(const AliPHOSTrigger & trig)
+ : AliTriggerDetector(trig)
{
// cpy ctor
- fL0 = trig.fL0 ;
- fL1Low = trig.fL1Low ;
- fL1Medium = trig.fL1Medium ;
- fL1High = trig.fL1High ;
fL0Threshold = trig.fL0Threshold ;
fL1LowThreshold = trig.fL1LowThreshold ;
fL1MediumThreshold = trig.fL1MediumThreshold ;
}
+//----------------------------------------------------------------------
+void AliPHOSTrigger::CreateInputs()
+{
+ // inputs
+
+ // Do not create inputs again!!
+ if( fInputs.GetEntriesFast() > 0 ) return;
+
+ fInputs.AddLast( new AliTriggerInput( "PHOS_MB_L0", "PHOS Minimum Bias L0", 0x01 ) );
+
+ fInputs.AddLast( new AliTriggerInput( "PHOS_HPt_L1", "PHOS High Pt L1", 0x02 ) );
+ fInputs.AddLast( new AliTriggerInput( "PHOS_MPt_L1", "PHOS Medium Pt L1", 0x04 ) );
+ fInputs.AddLast( new AliTriggerInput( "PHOS_LPt_L1", "PHOS Low Pt L1", 0x08 ) );
+
+}
+
//____________________________________________________________________________
TClonesArray * AliPHOSTrigger::FillTRU(const TClonesArray * digits){
return matrix;
}
-//____________________________________________________________________________
-void AliPHOSTrigger::InitTriggers()
-{
- //Initialize Boolean variables per each event
-
- fL0 = kFALSE ;
- fL1Low = kFALSE ;
- fL1Medium = kFALSE ;
- fL1High = kFALSE ;
-
-}
//____________________________________________________________________________
void AliPHOSTrigger::MakeSlidingCell(const TClonesArray * trus, const Int_t mod,
Float_t *ampmax){
}
//____________________________________________________________________________
-void AliPHOSTrigger::MakeTrigger()
+void AliPHOSTrigger::Trigger()
{
//Main Method to select triggers.
- InitTriggers() ; //Initialize triggers to kFALSE
+ //InitTriggers() ; //Initialize triggers to kFALSE
AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
if(! opt)
return;
+ AliTriggerInput* in = 0x0 ;
- AliInfo("PHOS trigger information:") ;
- printf( " Threshold for LO %d\n", fL0Threshold) ;
- printf( " Low Threshold for L1 %d\n", fL1LowThreshold) ;
- printf( " Medium Threshold for L1 %d\n", fL1MediumThreshold) ;
- printf( " High Threshold for L1 %d\n", fL1HighThreshold) ;
- if ( IsL0Set() )
- printf(" LO is set\n") ;
- else
- printf(" LO is not set\n") ;
- if ( IsL1LowSet() )
- printf(" L1 Low is set\n") ;
- else
- printf(" L1 Low is not set\n") ;
- if ( IsL1MediumSet() )
- printf(" L1 Medium is set\n") ;
- else
- printf(" L1 Medium is not set\n") ;
- if ( IsL1HighSet() )
- printf(" L1 High is set\n") ;
- else
- printf(" L1 High is not set\n") ;
-
+ AliInfo("PHOS trigger information:") ;
+ printf( " Threshold for LO %d\n", fL0Threshold) ;
+ in = (AliTriggerInput*)fInputs.FindObject( "PHOS_MB_L0" );
+ if(in->GetValue())
+ printf( " PHOS MB LO is set\n") ;
+
+ printf( " Low Threshold for L1 %d\n", fL1LowThreshold) ;
+ in = (AliTriggerInput*)fInputs.FindObject( "PHOS_LPt_L1" );
+ if(in->GetValue())
+ printf( " PHOS Low Pt L1 is set\n") ;
+
+ printf( " Medium Threshold for L1 %d\n", fL1MediumThreshold) ;
+ in = (AliTriggerInput*) fInputs.FindObject( "PHOS_MPt_L1" );
+ if(in->GetValue())
+ printf( " PHOS Medium Pt L1 is set\n") ;
+
+ printf( " High Threshold for L1 %d\n", fL1HighThreshold) ;
+ in = (AliTriggerInput*) fInputs.FindObject( "PHOS_HPt_L1" );
+ if(in->GetValue())
+ printf( " PHOS High Pt L1 is set\n") ;
+
}
//____________________________________________________________________________
if(max < amp[i] )
max = amp[i] ;
}
-
if(max >= fL0Threshold){
- SetL0();
+ SetInput("PHOS_MB_L0");
if(max >= fL1LowThreshold){
- SetL1Low();
+ SetInput("PHOS_LPt_L1");
if(max >= fL1MediumThreshold){
- SetL1Medium();
+ SetInput("PHOS_MPt_L1");
if(max >= fL1HighThreshold){
- SetL1High();
+ SetInput("PHOS_HPt_L1");
}
}
}
// all possible 4x4 crystal combinations and per each TRU, adding the
// digits amplitude and finding the maximum. Maximums are compared to
// triggers threshold and they are set.
-// FIRST ATTEMPT TO MAKE A TRIGGER CLASS. IT WILL CHANGE WHEN CENTRAL TRIGGER CLASS FIXES
-// THINGS
+
//*-- Author: Gustavo Conesa & Yves Schutz (IFIC, SUBATECH, CERN)
// --- ROOT system ---
-#include "TTask.h"
-#include "TClonesArray.h"
-#include "TMatrixD.h"
-class AliPHOSGeometry ;
+class TMatrixD ;
+class TClonesArray ;
+
// --- AliRoot header files ---
+#include "AliTriggerDetector.h"
+
+class AliPHOSGeometry ;
-class AliPHOSTrigger : public TObject {
+class AliPHOSTrigger : public AliTriggerDetector {
public:
AliPHOSTrigger() ; // ctor
AliPHOSTrigger(const AliPHOSTrigger & trig) ; // cpy ctor
virtual ~AliPHOSTrigger() {}; //virtual dtor
+ virtual void CreateInputs();
+ virtual void Trigger(); //Make PHOS trigger
- void MakeTrigger() ; //Make PHOS trigger
-
- const Bool_t IsL0Set() const {return fL0 ;} // Is L0 trigger set?
- const Bool_t IsL1LowSet() const {return fL1Low ;} // Is L1 trigger set?
- const Bool_t IsL1MediumSet() const {return fL1Medium ;}
- const Bool_t IsL1HighSet() const {return fL1High ;}
const Int_t GetL0Threshold() const {return fL0Threshold ; }
const Int_t GetL1LowThreshold() const {return fL1LowThreshold ; }
void MakeSlidingCell(const TClonesArray * trus, const Int_t mod,
Float_t *ampmax) ;
void SetTriggers(const Float_t * ampmax) ;
- void InitTriggers() ;
-
- void SetL0() { fL0 = kTRUE ; }
- void SetL1Low() { fL1Low = kTRUE ; }
- void SetL1Medium() { fL1Medium = kTRUE ; }
- void SetL1High() { fL1High = kTRUE ; }
private:
-
- Bool_t fL0 ; //! Minimum Bias Trigger
- Bool_t fL1Low ; //! High pT triggers
- Bool_t fL1Medium ; //!
- Bool_t fL1High ; //!
Int_t fL0Threshold ; //! L0 trigger energy threshold
Int_t fL1LowThreshold ; //! High pT trigger energy threshold
Int_t fL1MediumThreshold ; //!
Int_t fL1HighThreshold ; //!
- ClassDef(AliPHOSTrigger,0)
+ ClassDef(AliPHOSTrigger,1)
} ;