]>
Commit | Line | Data |
---|---|---|
51f6d619 | 1 | #ifndef ALITRIGGERCONFIGURATION_H |
2 | #define ALITRIGGERCONFIGURATION_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /////////////////////////////////////////////////////////////////////////////// | |
8 | // // | |
9 | // This class represents the CTP configuration // | |
10 | // // | |
11 | // // | |
12 | // A Trigger Configuration define a trigger setup for particula run // | |
13 | // We have default one for different running modes // | |
14 | // (Pb-Pb, p-p, p-A, Calibration, etc). // | |
15 | // It keep: // | |
16 | // All the information contained in the real CTP configuration file // | |
17 | // used online during the data taking. // | |
18 | // // | |
19 | // // | |
20 | /////////////////////////////////////////////////////////////////////////////// | |
21 | ||
22 | #include <TNamed.h> | |
23 | #include <TObjArray.h> | |
24 | class TString; | |
25 | ||
26 | class AliTriggerCluster; | |
27 | class AliTriggerDescriptor; | |
28 | class AliTriggerInput; | |
29 | class AliTriggerInteraction; | |
30 | class AliTriggerPFProtection; | |
31 | class AliTriggerBCMask; | |
32 | class AliTriggerDescriptor; | |
33 | class AliTriggerClass; | |
34 | ||
35 | class AliTriggerConfiguration : public TNamed { | |
36 | ||
37 | public: | |
38 | AliTriggerConfiguration(); | |
39 | AliTriggerConfiguration( TString & name, TString & description ); | |
40 | virtual ~AliTriggerConfiguration(); | |
41 | // Setters | |
42 | AliTriggerInput* AddInput(TString &name, TString &det, UChar_t level, UInt_t signature, UChar_t number); | |
43 | Bool_t AddInput(AliTriggerInput *input); | |
44 | ||
45 | AliTriggerInteraction* AddInteraction(TString &name, TString &logic); | |
46 | Bool_t AddInteraction(AliTriggerInteraction *interact); | |
47 | ||
48 | AliTriggerInteraction* AddFunction(TString &name, TString &logic); | |
49 | Bool_t AddFunction(AliTriggerInteraction *func); | |
50 | ||
51 | Bool_t AddPFProtection( AliTriggerPFProtection* pf ); | |
52 | ||
53 | AliTriggerBCMask* AddMask( TString &name, TString &mask ); | |
54 | Bool_t AddMask( AliTriggerBCMask* mask ); | |
55 | ||
56 | AliTriggerCluster* AddCluster( TString &name, UChar_t index, TString &detectors ); | |
57 | Bool_t AddCluster( AliTriggerCluster* cluster ); | |
58 | ||
59 | AliTriggerDescriptor* AddDescriptor( TString & name, TString & cond); | |
60 | Bool_t AddDescriptor( AliTriggerDescriptor* desc ); | |
61 | ||
62 | AliTriggerClass* AddClass( TString &name, UChar_t index, | |
63 | AliTriggerDescriptor *desc, AliTriggerCluster *clus, | |
64 | AliTriggerPFProtection *pfp, AliTriggerBCMask *mask, | |
65 | UInt_t prescaler, Bool_t allrare); | |
66 | AliTriggerClass* AddClass( TString &name, UChar_t index, | |
67 | TString &desc, TString &clus, | |
68 | TString &pfp, TString &mask, | |
69 | UInt_t prescaler, Bool_t allrare); | |
70 | Bool_t AddClass( AliTriggerClass *trclass); | |
71 | ||
895affe8 | 72 | void Reset(); |
73 | ||
51f6d619 | 74 | // Getters |
75 | TString GetActiveDetectors() const; | |
76 | TString GetTriggeringDetectors() const; | |
77 | TString GetTriggeringModules() const; | |
78 | ||
79 | const TObjArray& GetInputs() const { return fInputs; } | |
80 | const TObjArray& GetInteractions() const { return fInteractions; } | |
81 | const TObjArray& GetFunctions() const { return fFunctions; } | |
82 | const TObjArray& GetPFProtections() const { return fPFProtections; } | |
83 | const TObjArray& GetMasks() const { return fMasks; } | |
84 | const TObjArray& GetClusters() const { return fClusters; } | |
85 | const TObjArray& GetDescriptors() const { return fDescriptors; } | |
86 | const TObjArray& GetClasses() const { return fClasses; } | |
87 | ||
88 | // AliTriggerCluster* GetTriggerCluster(UInt_t index) | |
89 | // { return (index < kNMaxClusters) ? (AliTriggerCluster*)fClusters[index] : NULL; } | |
90 | ||
91 | //AliTriggerPFProtection* GetPFProtection(UInt_t index) | |
92 | // { return (index < kNMaxPFProtections) ? (AliTriggerPFProtection*)fPFProtections[index] : NULL; } | |
93 | Bool_t CheckConfiguration( TString & configfile ); | |
94 | void Print( const Option_t* opt ="" ) const; | |
95 | ||
96 | // Configurations Database (root file) | |
97 | void WriteConfiguration( const char* filename="" ); | |
98 | static TObjArray* GetAvailableConfigurations( const char* filename="" ); | |
99 | static | |
100 | AliTriggerConfiguration* LoadConfiguration( TString & des); | |
101 | ||
102 | enum {kNMaxInputs = 50}; // CTP handles up to 50 trigger detector inputs | |
103 | enum {kNMaxInteractions = 2}; // CTP handles up to two different interactions | |
104 | enum {kNMaxFunctions = 2}; // CTP handles up to two different logical functions | |
105 | enum {kNMaxClasses = 50}; // Maximum number of trigger classes = 50 | |
106 | enum {kNMaxClusters = 6}; // Maximum number of different detector clusters that can be handled by CTP | |
107 | enum {kNMaxPFProtections = 4}; // Maximum number of different past-future protections that can be handled by CTP | |
108 | enum {kNMaxMasks = 4}; // CTP handles up to 4 different BC masks | |
109 | ||
110 | private: | |
111 | TObjArray fInputs; // Array with active CTP inputs | |
112 | TObjArray fInteractions; // Array with the trigger interactions | |
113 | TObjArray fFunctions; // Array with the logical functions of the first 4 inputs | |
114 | TObjArray fPFProtections; // Array of Past-Future Protections | |
115 | TObjArray fMasks; // Array with BC masks | |
116 | TObjArray fDescriptors; // Array with trigger descriptors | |
117 | TObjArray fClusters; // Array of Detector Trigger Clusters | |
118 | TObjArray fClasses; // Array of Trigger Classes | |
119 | ||
120 | Bool_t IsSelected( TString detName, TString & detectors ) const; | |
121 | static const TString fgkConfigurationFileName; //! name of default configurations file | |
122 | ||
123 | AliTriggerConfiguration& operator=(const AliTriggerConfiguration& des); | |
124 | AliTriggerConfiguration( const AliTriggerConfiguration& des ); | |
125 | ||
126 | ClassDef( AliTriggerConfiguration, 1 ) // Define a trigger configuration | |
127 | }; | |
128 | ||
129 | #endif |