New revision of the CTP configuration and simulation. For more details look in the...
[u/mrichter/AliRoot.git] / STEER / AliTriggerConfiguration.h
CommitLineData
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>
24class TString;
25
26class AliTriggerCluster;
27class AliTriggerDescriptor;
28class AliTriggerInput;
29class AliTriggerInteraction;
30class AliTriggerPFProtection;
31class AliTriggerBCMask;
32class AliTriggerDescriptor;
33class AliTriggerClass;
34
35class AliTriggerConfiguration : public TNamed {
36
37public:
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
72 // Getters
73 TString GetActiveDetectors() const;
74 TString GetTriggeringDetectors() const;
75 TString GetTriggeringModules() const;
76
77 const TObjArray& GetInputs() const { return fInputs; }
78 const TObjArray& GetInteractions() const { return fInteractions; }
79 const TObjArray& GetFunctions() const { return fFunctions; }
80 const TObjArray& GetPFProtections() const { return fPFProtections; }
81 const TObjArray& GetMasks() const { return fMasks; }
82 const TObjArray& GetClusters() const { return fClusters; }
83 const TObjArray& GetDescriptors() const { return fDescriptors; }
84 const TObjArray& GetClasses() const { return fClasses; }
85
86 // AliTriggerCluster* GetTriggerCluster(UInt_t index)
87 // { return (index < kNMaxClusters) ? (AliTriggerCluster*)fClusters[index] : NULL; }
88
89 //AliTriggerPFProtection* GetPFProtection(UInt_t index)
90 // { return (index < kNMaxPFProtections) ? (AliTriggerPFProtection*)fPFProtections[index] : NULL; }
91 Bool_t CheckConfiguration( TString & configfile );
92 void Print( const Option_t* opt ="" ) const;
93
94 // Configurations Database (root file)
95 void WriteConfiguration( const char* filename="" );
96 static TObjArray* GetAvailableConfigurations( const char* filename="" );
97 static
98 AliTriggerConfiguration* LoadConfiguration( TString & des);
99
100 enum {kNMaxInputs = 50}; // CTP handles up to 50 trigger detector inputs
101 enum {kNMaxInteractions = 2}; // CTP handles up to two different interactions
102 enum {kNMaxFunctions = 2}; // CTP handles up to two different logical functions
103 enum {kNMaxClasses = 50}; // Maximum number of trigger classes = 50
104 enum {kNMaxClusters = 6}; // Maximum number of different detector clusters that can be handled by CTP
105 enum {kNMaxPFProtections = 4}; // Maximum number of different past-future protections that can be handled by CTP
106 enum {kNMaxMasks = 4}; // CTP handles up to 4 different BC masks
107
108private:
109 TObjArray fInputs; // Array with active CTP inputs
110 TObjArray fInteractions; // Array with the trigger interactions
111 TObjArray fFunctions; // Array with the logical functions of the first 4 inputs
112 TObjArray fPFProtections; // Array of Past-Future Protections
113 TObjArray fMasks; // Array with BC masks
114 TObjArray fDescriptors; // Array with trigger descriptors
115 TObjArray fClusters; // Array of Detector Trigger Clusters
116 TObjArray fClasses; // Array of Trigger Classes
117
118 Bool_t IsSelected( TString detName, TString & detectors ) const;
119 static const TString fgkConfigurationFileName; //! name of default configurations file
120
121 AliTriggerConfiguration& operator=(const AliTriggerConfiguration& des);
122 AliTriggerConfiguration( const AliTriggerConfiguration& des );
123
124 ClassDef( AliTriggerConfiguration, 1 ) // Define a trigger configuration
125};
126
127#endif