+
+//_____________________________________________________________________________
+Bool_t AliCentralTrigger::CheckTriggeredDetectors() const
+{
+ // Check the trigger mask, finds which trigger classes
+ // have been fired, load the corresponding trigger clusters and
+ // finally makes a list of the detectors that have been readout
+ // for each particular event. This list is then compared to the
+ // one stored in fClusterMask. Return value:
+ // true = two lists are equal
+ // false = two lists are not equal meaning wrong trigger config
+ // is loaded.
+
+ if (!fConfiguration) {
+ AliError("The trigger confiration has not yet been loaded! Cross-check is not possible!");
+ return kFALSE;
+ }
+ else {
+
+ // Make a cross-check so that to exclude wrong trigger configuration used
+ // Loop over the trigger classes
+ UInt_t clusterMask = 0;
+ const TObjArray& classesArray = fConfiguration->GetClasses();
+ Int_t nclasses = classesArray.GetEntriesFast();
+ for( Int_t j=0; j<nclasses; j++ ) {
+ AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At( j );
+ if (trclass->GetMask() & fClassMask) { // class was fired
+ AliTriggerCluster *trclust = trclass->GetCluster();
+ clusterMask |= AliDAQ::DetectorPattern(trclust->GetDetectorsInCluster());
+ }
+ }
+ // Compare the stored cluster mask with the one
+ // that we get from trigger classes
+ // To be enables after we store the cluster mask in the trigger tree
+ if (clusterMask != fClusterMask) {
+ AliError(Form("Wrong cluster mask from trigger classes (%x), expecting (%x)! Loaded trigger configuration is possibly wrong!",
+ (UInt_t)clusterMask,(UInt_t)fClusterMask));
+ return kFALSE;
+ }
+ }
+
+ return kTRUE;
+}