Bug fix. Removed delete statement
[u/mrichter/AliRoot.git] / STEER / AliCentralTrigger.h
1 #ifndef ALICENTRALTRIGGER_H
2 #define ALICENTRALTRIGGER_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 // This class for running the Central Trigger Processor                      //
12 //                                                                           //
13 //                                                                           //
14 //    Load Configuration                                                     //
15 //    Make a list the trigger detectors involved ( from the configuration)   //
16 //    For the each event                                                     //
17 //           Run the Trigger for the each detector                           //
18 //           Get the inputs                                                  //
19 //           Check the trigger classes                                       //
20 //           Create the class mask                                           //
21 //           Save result                                                     //
22 //                                                                           //
23 ///////////////////////////////////////////////////////////////////////////////
24
25 #include <TObject.h>
26 #include <TObjArray.h>
27
28 class TTree;
29 class AliRunLoader;
30 class AliTriggerConfiguration;
31
32 class AliCentralTrigger : public TObject {
33
34 public:
35                           AliCentralTrigger();
36                           AliCentralTrigger( TString & config );
37                virtual   ~AliCentralTrigger();
38
39                 Bool_t    LoadConfiguration( TString & config );
40                 Bool_t    RunTrigger( AliRunLoader * runloader , const char* detectors);
41              ULong64_t    TriggerClasses();
42                   void    TriggerInputs();
43                   void    Reset();
44                   void    DeleteConfiguration();
45                   void    MakeBranch( TString name, TTree * tree );
46   //  Getters
47                TString    GetDetectors();
48              ULong64_t    GetClassMask() const { return fClassMask; }
49                 UInt_t    GetClusterMask() const { return fClusterMask; }
50                 UInt_t    GetL0TriggerInputs() const { return fL0TriggerInputs; }
51                 UInt_t    GetL1TriggerInputs() const { return fL1TriggerInputs; }
52               UShort_t    GetL2TriggerInputs() const { return fL2TriggerInputs; }
53  AliTriggerConfiguration* GetConfiguration() { return fConfiguration; }
54              TObjArray*   GetFiredClasses() const;
55                   void    Print( const Option_t* opt ="" ) const;
56                 Bool_t    CheckTriggeredDetectors() const;
57
58                // Setters to be used in case raw data when the trigger information
59                // is read from the event header
60                void       SetClassMask(ULong64_t mask) { fClassMask = mask; }
61                void       SetClusterMask(UInt_t mask)  { fClusterMask = mask; }
62                void       SetL0TriggerInputs(UInt_t mask)  { fL0TriggerInputs = mask; }
63                void       SetL1TriggerInputs(UInt_t mask)  { fL1TriggerInputs = mask; }
64                void       SetL2TriggerInputs(UShort_t mask)  { fL2TriggerInputs = mask; }
65 protected:
66              ULong64_t    fClassMask;          // UID ( bitwise OR of conditions mask )
67                 UInt_t    fClusterMask;        // UID ( bitwise OR of clusters mask - detector pattern)
68                 UInt_t    fL0TriggerInputs;    // L0 trigger inputs (24 bits)
69                 UInt_t    fL1TriggerInputs;    // L1 trigger inputs (24 bits)
70               UShort_t    fL2TriggerInputs;    // L2 trigger inputs (12 bits)
71
72  AliTriggerConfiguration* fConfiguration;      // Trigger Configuration used
73
74 private:
75                 void      SetOwner(Bool_t x=kTRUE){SetBit(22,x);} // Bit 22 indicates that the object owns fConfiguration
76                 Bool_t    IsOwner() const {return TestBit(22);} // Test bit 22 to check that the object owns fConfiguration
77                 Bool_t    IsSelected( TString detName, TString& detectors ) const;
78                 AliCentralTrigger( const AliCentralTrigger& ctp ); // Implemented
79                 AliCentralTrigger& operator=( const AliCentralTrigger& ctp ); // Not implemented
80
81    ClassDef( AliCentralTrigger, 5 )  // class for running the Central Trigger Processor
82 };
83
84
85 #endif