}
+AliHLTTriggerDecision::AliHLTTriggerDecision(const AliHLTTriggerDecision& obj) :
+ TObject(obj),
+ fName(obj.fName),
+ fDescription(obj.fDescription),
+ fTriggerDomain(obj.fTriggerDomain)
+{
+ // Copy constructor performs a deep copy.
+
+ // The following is a backward compatibility fix to be able to read trigger
+ // decisions recorded before the fix in AliRoot trunk rev. 35998 correctly.
+ if (obj.TestBits(15) == 15)
+ {
+ ResetBit(15); // We can clear 'this' objects bit because we performed a deep copy.
+ SetBit(BIT(15));
+ }
+}
+
+
AliHLTTriggerDecision::AliHLTTriggerDecision(bool result, const char* name) :
TObject(),
fName(name),
}
+bool AliHLTTriggerDecision::Result() const
+{
+ // Returns the result of the trigger decision.
+
+ // The following is a backward compatibility fix to be able to read trigger
+ // decisions recorded before the fix in AliRoot trunk rev. 35998 correctly.
+ if (TestBits(15) == 15) return true;
+
+ return TestBit(BIT(15)) == 1;
+}
+
+
+void AliHLTTriggerDecision::Result(bool value)
+{
+ // Sets the result of the trigger decision.
+ SetBit(BIT(15), value);
+
+ // The following is a backward compatibility fix to be able to read trigger
+ // decisions recorded before the fix in AliRoot trunk rev. 35998 correctly.
+ // It looks like bit 1 and 2 of fBits are not used in the case of the
+ // AliHLTTriggerDecision class, so reset those to prevent "TestBits(15) == 15"
+ // from succeeding in the "Result() const" method above.
+ // We do not touch the other two bits because they could affect memory handling
+ // and cleanup.
+ if (TestBits(15) == 15) ResetBit(6);
+}
+
+
void AliHLTTriggerDecision::ReadoutList(const AliHLTReadoutList& value)
{
// Replaces the readout list in the trigger domain with the new value.
if (Result()) return "1";
return "0";
}
+
+
+AliHLTTriggerDecision& AliHLTTriggerDecision::operator = (const AliHLTTriggerDecision& obj)
+{
+ // Assignment operator performs a deep copy.
+
+ if (this == &obj) return *this;
+
+ TObject::operator = (obj);
+ // The following is a backward compatibility fix to be able to read trigger
+ // decisions recorded before the fix in AliRoot trunk rev. 35998 correctly.
+ if (obj.TestBits(15) == 15)
+ {
+ ResetBit(15); // We can clear 'this' objects bit because we performed a deep copy.
+ SetBit(BIT(15));
+ }
+
+ fName = obj.fName;
+ fDescription = obj.fDescription;
+ fTriggerDomain = obj.fTriggerDomain;
+ return *this;
+}
*/
AliHLTTriggerDecision();
+ /**
+ * Copy constructor performs a deep copy.
+ */
+ AliHLTTriggerDecision(const AliHLTTriggerDecision& obj);
+
/**
* Constructor specifying the result and trigger name.
* \param result The result of the trigger decision.
* The decision is stored in bit 15 of the fBits field.
* \returns true if the event was triggered and should be readout.
*/
- bool Result() const { return TestBit(BIT(15)) == 1; }
+ bool Result() const;
/**
* Sets the result of the trigger decision.
* \param value The value to set; true if the event triggered and should be
* readout and false otherwise.
*/
- void Result(bool value) { SetBit(BIT(15), value); }
+ void Result(bool value);
/**
* Returns the name of the trigger decision.
*/
void TriggerDomain(const AliHLTTriggerDomain& value) { fTriggerDomain = value; }
+ /**
+ * Assignment operator performs a deep copy.
+ */
+ AliHLTTriggerDecision& operator = (const AliHLTTriggerDecision& obj);
+
private:
TString fName; /// The name of the trigger decision. Should be the name of the trigger component that generated it.
TString fDescription; /// Optional descriptive text giving the reason for the trigger.
AliHLTTriggerDomain fTriggerDomain; /// The trigger domain associated with this trigger. i.e. the HLT data blocks to read out.
- ClassDef(AliHLTTriggerDecision, 1) // HLT trigger decision object storing information about the readout list, trigger domain and result.
+ ClassDef(AliHLTTriggerDecision, 2) // HLT trigger decision object storing information about the readout list, trigger domain and result.
};
#endif // ALIHLTTRIGGERDECISION_H