Corrected protection.
[u/mrichter/AliRoot.git] / STEER / AliTriggerInput.h
CommitLineData
a5a091ce 1#ifndef ALITRIGGERINPUT_H
2#define ALITRIGGERINPUT_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9///////////////////////////////////////////////////////////////////////////////
10//
11// Class to define a Trigger Input from an specific detector //
12//
13//
14// name description id mask
15// Ej:
16// AliTriggerInput( "V0_MB_L0", "VO minimum bias", 0x01 );
17// AliTriggerInput( "V0_SC_L0", "VO semi central", 0x02 );
18// AliTriggerInput( "V0_C_L0", "VO central", 0x04 );
19
20// The name must be globaly unique. Spaces are not allowed.
21// As convention should start with detector name then an id
22// and the trigger level (L0, L1, L2)
23//
24// A maximun of 60 inputs trigger are allow.
25// So, the id mask should set only bit from the position 1 to 60.
26//
27///////////////////////////////////////////////////////////////////////////////
28
29#ifndef ROOT_TNamed
30#include <TNamed.h>
31#endif
32
51f6d619 33#include "AliDAQ.h"
34
a5a091ce 35class AliTriggerInput : public TNamed {
36
37public:
75e3794b 38 AliTriggerInput(): TNamed(),
51f6d619 39 fMask( 0 ),
40 fValue( 0 ),
41 fSignature( -1),
42 fLevel(0),
43 fDetectorId(-1),
44 fIsActive(kFALSE)
45 {}
46 AliTriggerInput( TString name, TString det, UChar_t level, Int_t signature = -1, Char_t number = -1);
bacbe0fd 47 AliTriggerInput( AliTriggerInput & inp )
51f6d619 48 : TNamed( inp ),
49 fMask( inp.fMask ),
50 fValue( inp.fValue ),
51 fSignature( inp.fSignature ),
52 fLevel( inp.fLevel),
53 fDetectorId( inp.fDetectorId),
54 fIsActive(kFALSE)
55 {}
a5a091ce 56 virtual ~AliTriggerInput() {}
57
58 // Setters
51f6d619 59 void Set() { if (fIsActive) fValue = fMask; }
60 void Reset() { fValue = 0; }
61 void Enable() { fIsActive = kTRUE; }
a5a091ce 62
63 // Getters
64 Bool_t Status() const { return (Bool_t)fValue; }
51f6d619 65 ULong64_t GetValue() const { return fValue; }
66 ULong64_t GetMask() const { return fMask; }
67 Int_t GetSignature() const { return fSignature; }
68 TString GetInputName() const { return GetName(); }
69 TString GetDetector() const { return GetTitle(); }
70 TString GetModule() const;
71 Char_t GetDetectorId() const { return fDetectorId; }
72 UChar_t GetLevel() const { return fLevel; }
73 Bool_t IsActive() const { return fIsActive; }
a5a091ce 74
51f6d619 75 virtual void Print( const Option_t* opt ="" ) const;
a5a091ce 76
51f6d619 77 static Bool_t fgkIsTriggerDetector[AliDAQ::kNDetectors]; // List of trigger detectors
78 static const char* fgkCTPDetectorName[AliDAQ::kNDetectors];
a5a091ce 79protected:
51f6d619 80 ULong64_t fMask; // Trigger ID mask (1 bit)
81 ULong64_t fValue; // Trigger Signal (0 = false, > 1 = true = fMask )
82 Int_t fSignature; // 8 bit signature (internal CTP inputs can have longer signature)
83 UChar_t fLevel; // L0, L1 or L2
84 Char_t fDetectorId; // Alice-wide detector id, see AliDAQ class for details
85 Bool_t fIsActive; // Is trigger input active (during simulation)
86// void fDectParameterTable; //-> link to detector parameter table????
a5a091ce 87
7e88424f 88 ClassDef( AliTriggerInput, 4 ) // Define a Trigger Input
a5a091ce 89};
90
91
92#endif