TObject(),
fClassMask(0),
fClusterMask(0),
+ fL0TriggerInputs(0),
+ fL1TriggerInputs(0),
+ fL2TriggerInputs(0),
fConfiguration(NULL)
{
// Default constructor
TObject(),
fClassMask(0),
fClusterMask(0),
+ fL0TriggerInputs(0),
+ fL1TriggerInputs(0),
+ fL2TriggerInputs(0),
fConfiguration(NULL)
{
// Default constructor
// Delete the active configuration
fClassMask = 0;
fClusterMask = 0;
+ fL0TriggerInputs = 0;
+ fL1TriggerInputs = 0;
+ fL2TriggerInputs = 0;
if (fConfiguration) {
if (IsOwner()) delete fConfiguration;
fConfiguration = 0x0;
// Reset Class Mask and classes
fClassMask = 0;
fClusterMask = 0;
+ fL0TriggerInputs = 0;
+ fL1TriggerInputs = 0;
+ fL2TriggerInputs = 0;
if (fConfiguration) {
const TObjArray& classesArray = fConfiguration->GetClasses();
TBranch* branch = tree->GetBranch( name );
if( branch == 0x0 ) {
AliDebug( 1, "Creating new branch" );
- branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l:fClusterMask/i" );
+ branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l:fClusterMask/i:fL0TriggerInputs/i:fL1TriggerInputs/i:fL2TriggerInputs/s" );
branch->SetAutoDelete( kFALSE );
}
else {
TStopwatch stopwatch;
stopwatch.Start();
+ AliInfo( Form(" Triggering Detectors: %s \n", GetDetectors().Data() ) );
+ AliInfo( Form(" Detectors with digits: %s \n", detectors ) );
+
// Process each event
for( Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++ ) {
- AliInfo( Form(" ***** Processing event %d *****\n", iEvent) );
runLoader->GetEvent( iEvent );
// Get detectors involve
TString detStr = GetDetectors();
- AliInfo( Form(" Triggering Detectors: %s \n", detStr.Data() ) );
TString detWithDigits = detectors;
- AliInfo( Form(" Detectors with digits: %s \n", detWithDigits.Data() ) );
TObjArray* detArray = runLoader->GetAliRun()->Detectors();
// Reset Mask
fClassMask = 0;
if( IsSelected(det->GetName(), detStr) &&
IsSelected(det->GetName(), detWithDigits) ) {
- AliInfo( Form("Triggering from digits for %s", det->GetName() ) );
+ AliDebug(1,Form("Triggering from digits for %s", det->GetName() ) );
AliTriggerDetector* trgdet = det->CreateTriggerDetector();
- trgdet->CreateInputs(fConfiguration->GetInputs());
+ trgdet->AssignInputs(fConfiguration->GetInputs());
TStopwatch stopwatchDet;
stopwatchDet.Start();
trgdet->Trigger();
- AliInfo( Form("Execution time for %s: R:%.2fs C:%.2fs",
+ AliDebug(1, Form("Execution time for %s: R:%.2fs C:%.2fs",
det->GetName(), stopwatchDet.RealTime(), stopwatchDet.CpuTime() ) );
trgdetArray.AddLast( trgdet );
// Check trigger conditions and create the trigger class mask
TriggerClasses();
+ // Calculate trigger Input pattern
+ TriggerInputs();
// Clear trigger detectors
trgdetArray.SetOwner();
// Save trigger mask
tree->Fill();
- AliInfo( Form("**************** Central Trigger Class Mask:0x%X", fClassMask ) );
+ AliDebug(1, Form("Event:%d Class Mask:0x%llX", iEvent,fClassMask ) );
} // end event loop
Reset();
return kTRUE;
}
-
+//----------------------------------------------------------------------------
+void AliCentralTrigger::TriggerInputs()
+{
+ // Find which inputs are in configuration
+ // and calculate input pattern
+ fL0TriggerInputs=0;
+ fL1TriggerInputs=0;
+ fL2TriggerInputs=0;
+ if(fConfiguration){
+ const TObjArray& inputsArray = fConfiguration->GetInputs();
+ Int_t ninputs = inputsArray.GetEntriesFast();
+ for( Int_t j=0; j<ninputs; j++ ) {
+ AliTriggerInput* input = (AliTriggerInput*)inputsArray.At( j );
+ if(input->GetValue()){
+ UChar_t level=input->GetLevel();
+ if(level == 0) fL0TriggerInputs |= (input->GetMask());
+ else if(level == 1) fL1TriggerInputs |= (input->GetMask());
+ else if(level == 2) fL2TriggerInputs |= (input->GetMask());
+ else{
+ AliError(Form("Unknown input level:%c:",level));
+ }
+ }
+ }
+ }
+}
//_____________________________________________________________________________
ULong64_t AliCentralTrigger::TriggerClasses()
{
}
// 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;
+ if ((clusterMask & fClusterMask) == clusterMask) {
+ AliInfo(Form("Cluster mask from trigger classes (%x) and from data (%x) differ. Concurrent DAQ run(s) could be the reason.",
+ (UInt_t)clusterMask,(UInt_t)fClusterMask));
+ return kTRUE;
+ }
+ else {
+ 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;
+ }
}
}