]> git.uio.no Git - u/mrichter/AliRoot.git/blob - OADB/AliOADBPhysicsSelection.h
Fix for install in EMCAL
[u/mrichter/AliRoot.git] / OADB / AliOADBPhysicsSelection.h
1 #ifndef AliOADBPhysicsSelection_H
2 #define AliOADBPhysicsSelection_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //     OADB interface for the physics selection
10 //     Author: Michele Floris, CERN
11 //    
12 // This class contains the parameters needed to configure the physics
13 // selection. The online trigger class must be associated to an
14 // offline trigger mask, as defined in
15 // AliVEvent::EOfflineTriggerTypes.  The offline condition, even for
16 // the same trigger mask, can be different for every different online
17 // trigger, so it must be given as a parameter in the Add...Class
18 // methods.  It's up to the user to set the appropriate offline
19 // conditions when filling the class.
20 // -------------------------------------------------------------------------
21
22 #include <TNamed.h>
23 #include "AliVEvent.h"
24 #include "TList.h"
25 #include "TMap.h"
26
27 class TObjArray;
28 class TArrayI;
29
30
31 #define NTRIGGERBITS   32
32 #define NTRIGGERLOGICS 64
33
34 class AliOADBPhysicsSelection : public TNamed {
35
36  public :
37   AliOADBPhysicsSelection();
38   AliOADBPhysicsSelection(const char* name);
39   virtual ~AliOADBPhysicsSelection();
40   AliOADBPhysicsSelection(const AliOADBPhysicsSelection& cont); 
41   AliOADBPhysicsSelection& operator=(const AliOADBPhysicsSelection& cont);
42   void Init();
43   // Getters
44   // These take a mask of trigger bits, because you can activate several triggers at once
45   // TList * GetCollTrigClass(AliVEvent::EOfflineTriggerTypes trig) const; 
46   // TList * GetBGTrigClass(AliVEvent::EOfflineTriggerTypes trig) const;    
47   // TList * GetTrigClass(AliVEvent::EOfflineTriggerTypes trig, TList ** listClasses) const ; 
48
49   TList * GetCollTrigClass(UInt_t triggerBit) { return fCollTrigClasses[triggerBit];}
50   TList * GetBGTrigClass(UInt_t triggerBit)   { return fBGTrigClasses[triggerBit];  }
51   const TString GetBeamSide (const char * trigger) ;
52   TMap * Debug() { return fBeamSide; }
53   // Thess take a single trigger bit, as the HW/offline conditions are mapped 1 <-> 1 to a single EOfflineTriggerTypes bit
54   const TString  GetHardwareTrigger(UInt_t triggerLogic) const { return triggerLogic >= NTRIGGERLOGICS ? "" : fHardwareTrigger[triggerLogic].String(); }
55   const TString  GetOfflineTrigger (UInt_t triggerLogic) const { return triggerLogic >= NTRIGGERLOGICS ? "" : fOfflineTrigger [triggerLogic].String(); }
56   UInt_t GetNTriggerBits()  const { return fNtriggerBits; }
57   // Setters 
58   void AddCollisionTriggerClass(AliVEvent::EOfflineTriggerTypes triggerMask, const char* className,const char * beamSide, UInt_t triggerLogic);
59   void AddBGTriggerClass       (AliVEvent::EOfflineTriggerTypes triggerMask, const char* className,const char * beamSide, UInt_t triggerLogic);
60
61
62   void SetHardwareTrigger      (UInt_t triggerLogic, const char * trigger)  { fHardwareTrigger [triggerLogic].SetString(trigger);     }
63   void SetOfflineTrigger       (UInt_t triggerLogic, const char * trigger)  { fOfflineTrigger  [triggerLogic].SetString(trigger);     }
64   void SetBeamSide             (const char * className, const char * side);
65   // MISC
66   virtual Bool_t        IsFolder() const { return kTRUE; }
67   void Browse(TBrowser *b);
68   virtual void  Print(Option_t* option = "") const;
69
70   static UInt_t GetActiveBit(UInt_t mask) ;
71
72 protected:
73   void CleanKey(TString & str) ;
74   const char* ExpandTriggerString(const char* className);
75   
76  private :
77   
78   UInt_t fNtriggerBits; // Size of the arrays below. Initialized using NTRIGGERBITS
79   UInt_t fNtriggerLogics; // number of possible trigger logics, initialized using NTRIGGERLOGICS. To be increased if needed.
80
81   TList ** fCollTrigClasses  ; //[fNtriggerBits] Array of collision trigger classes, corresponding to the different trigger bits defined in AliVEvent
82   TList ** fBGTrigClasses    ; //[fNtriggerBits] Array of background trigger classes, corresponding to the different trigger bits defined in AliVEvent
83   TObjString * fHardwareTrigger ; //[fNtriggerLogics] Array of online trigger condition, corresponding to the different trigger logics set in Add...TriggerClass
84   TObjString * fOfflineTrigger  ; //[fNtriggerLogics] Array of offline trigger condition, corresponding to the different trigger logics set in Add...TriggerClass
85   TMap * fBeamSide;             // Map from the trigger classname to the beam side ("B", "A", "C", "E", "AC")
86   ClassDef(AliOADBPhysicsSelection, 1);
87 };
88
89 #endif