4 #ifndef ALIHLTCTPDATA_H
5 #define ALIHLTCTPDATA_H
6 //* This file is property of and copyright by the ALICE HLT Project *
7 //* ALICE Experiment at CERN, All rights reserved. *
8 //* See cxx source for full Copyright notice *
10 /** @file AliHLTCTPData.h
11 @author Matthias Richter
13 @brief Container for CTP trigger classes and counters
17 #include "TClonesArray.h"
18 #include "TArrayL64.h"
19 #include "AliHLTLogging.h"
20 #include "AliHLTDataTypes.h"
23 * @class AliHLTCTPData
24 * This is a container for the CTP trigger classes, the mapping to the bit
25 * field, and counters.
27 * The class is initialized from CTP_TRIGGER_CLASSES part of the ECS parameters.
28 * and stores internally a list of trigger classes holding the information on bit
29 * position, class name and involved detectors. The general format og the parameter
32 * [bit position]:[Trigger class identifier string]:[detector-id-nr]-[detector-id-nr]-...,[bit position]:.....
35 * The list of participating detectors is converted into an AliHLTReadoutList
36 * object named after the trigger class name, and can be used as mask for the
37 * readout list generated by a component.
39 * The object is also stored as part of the HLTGlobalTriggerDecision
40 * @ingroup alihlt_trigger
42 class AliHLTCTPData: public TNamed, public AliHLTLogging
45 /// default constructor
47 /// standard constructor including initialization from CTP_TRIGGER_CLASS
48 AliHLTCTPData(const char* parameter);
50 AliHLTCTPData(const AliHLTCTPData&);
51 ///assignment operator
52 AliHLTCTPData& operator=(const AliHLTCTPData&);
54 virtual ~AliHLTCTPData();
57 AliHLTCTPData& operator += (const AliHLTCTPData&);
59 AliHLTCTPData operator + (const AliHLTCTPData&) const;
62 AliHLTCTPData& operator -= (const AliHLTCTPData&);
64 AliHLTCTPData operator - (const AliHLTCTPData&) const;
67 * Init the class ids and mapping from the CTP_TRIGGER_CLASS parameter.
68 * The general format of the parameter is as follows:
70 int InitCTPTriggerClasses(const char* ctpString);
72 /// etract the active trigger mask from the trigger data
73 static AliHLTUInt64_t ActiveTriggers(const AliHLTComponentTriggerData& trigData);
76 * Evaluate an expression of trigger class ids with respect to the trigger mask.
78 bool EvaluateCTPTriggerClass(const char* expression, AliHLTComponentTriggerData& trigData) const;
86 * Get index of a trigger class in the tigger pattern
88 int Index(const char* name) const;
91 * Increment counter for CTP trigger classes
92 * @param classIds comma separated list of class ids
94 void Increment(const char* classIds);
97 * Increment counter for CTP trigger classes
98 * @param triggerPattern corresponds to the 50bit trigger mask in the CDH
100 void Increment(AliHLTUInt64_t triggerPattern);
103 * Increment counter for a CTP trigger class
104 * @param classIdx index of the class in the 50bit trigger mask
106 void Increment(int classIdx);
109 * Increment counters according to the trigger data struct.
110 * First extract trigger pattern from the CDH and then
111 * increment from the trigger pattern.
113 int Increment(AliHLTComponentTriggerData& trigData);
116 * Return a readout list for the active trigger classes.
117 * The list is an 'OR' of the active trugger classes.
119 AliHLTEventDDL ReadoutList(const AliHLTComponentTriggerData& trigData) const;
122 * Inherited from TObject, this prints the contents of the trigger decision.
124 virtual void Print(Option_t* option = "") const;
126 AliHLTUInt64_t Mask() const { return fMask; }
127 const TArrayL64& Counters() const { return fCounters; }
128 AliHLTUInt64_t Counter(int index) const;
129 AliHLTUInt64_t Counter(const char* classId) const;
130 const char* Name(int index) const;
136 * Base methods for operators.
137 * @param src instance to add
138 * @param factor +1/-1 for addition/subtraction
139 * @skipped target to get the numner of not matching class names
141 int Add(const AliHLTCTPData& src, int factor, int &skipped);
143 AliHLTUInt64_t fMask; /// mask of initialized trigger classes
144 TClonesArray fClassIds; /// array of trigger class ids
145 TArrayL64 fCounters; /// trigger class counters
147 ClassDef(AliHLTCTPData, 0)