AliCentralTrigger updated to 100 classes
authorrlietava <rl@eprex16.ph.bham.ac.uk>
Wed, 26 Mar 2014 11:52:07 +0000 (11:52 +0000)
committerhristov <Peter.Hristov@cern.ch>
Thu, 27 Mar 2014 15:27:29 +0000 (16:27 +0100)
STEER/STEER/AliCentralTrigger.cxx
STEER/STEER/AliCentralTrigger.h

index 44b87cd..372949a 100644 (file)
@@ -68,6 +68,7 @@ ClassImp( AliCentralTrigger )
 AliCentralTrigger::AliCentralTrigger() :
    TObject(),
    fClassMask(0),
+   fClassMaskNext50(0),
    fClusterMask(0),
    fL0TriggerInputs(0),
    fL1TriggerInputs(0),
@@ -82,6 +83,7 @@ AliCentralTrigger::AliCentralTrigger() :
 AliCentralTrigger::AliCentralTrigger( TString & config ) :
    TObject(),
    fClassMask(0),
+   fClassMaskNext50(0),
    fClusterMask(0),
    fL0TriggerInputs(0),
    fL1TriggerInputs(0),
@@ -104,6 +106,7 @@ void AliCentralTrigger::DeleteConfiguration()
 {
   // Delete the active configuration
   fClassMask = 0;
+  fClassMaskNext50 = 0;
   fClusterMask = 0;
   fL0TriggerInputs = 0;
   fL1TriggerInputs = 0;
@@ -119,6 +122,7 @@ void AliCentralTrigger::Reset()
 {
    // Reset Class Mask and classes
    fClassMask = 0;
+   fClassMaskNext50 = 0;
    fClusterMask = 0;
    fL0TriggerInputs = 0;
    fL1TriggerInputs = 0;
@@ -133,18 +137,19 @@ void AliCentralTrigger::Reset()
      }
    }
 }
-
 //_____________________________________________________________________________
 void AliCentralTrigger::MakeBranch( TString name, TTree * tree )
 {
    // Make a branch to store only trigger class mask event by event
+   // Run2 payload
 
    if( tree )  {
       AliDebug( 1, "Got Tree from folder." );
       TBranch* branch = tree->GetBranch( name );
       if( branch == 0x0 ) {
+         //branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l:fClusterMask/i:fL0TriggerInputs/i:fL1TriggerInputs/i:fL2TriggerInputs/s" );
          AliDebug( 1, "Creating new branch" );
-         branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l:fClusterMask/i:fL0TriggerInputs/i:fL1TriggerInputs/i:fL2TriggerInputs/s" );
+         branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l:fClassMaskNext50/l:fClusterMask/i:fL0TriggerInputs/i:fL1TriggerInputs/i:fL2TriggerInputs/s" );
          branch->SetAutoDelete( kFALSE );
       }
       else {
@@ -153,7 +158,6 @@ void AliCentralTrigger::MakeBranch( TString name, TTree * tree )
       }
    }
 }
-
 //_____________________________________________________________________________
 Bool_t AliCentralTrigger::LoadConfiguration( TString & config )
 {
@@ -239,6 +243,7 @@ Bool_t AliCentralTrigger::RunTrigger( AliRunLoader* runLoader, const char *detec
       TObjArray* detArray = runLoader->GetAliRun()->Detectors();
       // Reset Mask
       fClassMask = 0;
+      fClassMaskNext50 = 0;
       fClusterMask = 0;
       // Reset configuration object (inputs and classes)
       fConfiguration->Reset();
@@ -300,7 +305,7 @@ Bool_t AliCentralTrigger::RunTrigger( AliRunLoader* runLoader, const char *detec
 
       // Save trigger mask
       tree->Fill();
-      AliDebug(1, Form("Event:%d  Class Mask:0x%llX", iEvent,fClassMask ) );
+      AliDebug(1, Form("Event:%d  Class Mask:0x%llX 0x%llX", iEvent,fClassMask,fClassMaskNext50 ) );
    } // end event loop
 
    Reset();
@@ -338,11 +343,14 @@ void AliCentralTrigger::TriggerInputs()
  }
 }
 //_____________________________________________________________________________
-ULong64_t AliCentralTrigger::TriggerClasses()
+ULong64_t  AliCentralTrigger::TriggerClasses()
 {
   // Check trigger conditions and create the trigger class
   // and trigger cluster masks
+  // Updated to 100 classes
+  // It seems nobody uses return value
   fClassMask = 0;
+  fClassMaskNext50 = 0;
   fClusterMask = 0;
   if (fConfiguration) {
     const TObjArray& classesArray = fConfiguration->GetClasses();
@@ -351,13 +359,14 @@ ULong64_t AliCentralTrigger::TriggerClasses()
       AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At( j );
       trclass->Trigger( fConfiguration->GetInputs(), fConfiguration->GetFunctions() );
       fClassMask |= trclass->GetValue();
+      fClassMaskNext50 |= trclass->GetValueNext50();
       if (trclass->GetStatus()) {
        AliTriggerCluster *trclust = trclass->GetCluster();
        fClusterMask |= AliDAQ::DetectorPattern(trclust->GetDetectorsInCluster());
       }
     }
   }
-  return fClassMask;
+  return 0;
 }
 //_____________________________________________________________________________
 TObjArray* AliCentralTrigger::GetFiredClasses() const
@@ -383,7 +392,7 @@ void AliCentralTrigger::Print( const Option_t*  ) const
 {
    // Print
    cout << "Central Trigger: " << endl;
-   cout << "  Trigger Class Mask: 0x" << hex << fClassMask << dec << endl;
+   cout << "  Trigger Class Mask: 1..50 0x" << hex << fClassMask << " 51-100 0x"<< fClassMaskNext50 << dec << endl;
    if (fConfiguration) fConfiguration->Print();
    cout << endl;
 }
@@ -454,6 +463,10 @@ Bool_t AliCentralTrigger::CheckTriggeredDetectors() const
        AliTriggerCluster *trclust = trclass->GetCluster();
        clusterMask |= AliDAQ::DetectorPattern(trclust->GetDetectorsInCluster());
       }
+      if (trclass->GetMaskNext50() & fClassMaskNext50) { // 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
index 5b240ec..29116a1 100644 (file)
@@ -46,6 +46,7 @@ public:
   //  Getters
                TString    GetDetectors();
              ULong64_t    GetClassMask() const { return fClassMask; }
+             ULong64_t    GetClassMaskNext50() const { return fClassMaskNext50; }
                UInt_t    GetClusterMask() const { return fClusterMask; }
                UInt_t    GetL0TriggerInputs() const { return fL0TriggerInputs; }
                UInt_t    GetL1TriggerInputs() const { return fL1TriggerInputs; }
@@ -58,12 +59,14 @@ public:
               // Setters to be used in case raw data when the trigger information
               // is read from the event header
               void       SetClassMask(ULong64_t mask) { fClassMask = mask; }
+              void       SetClassMaskNext50(ULong64_t mask) { fClassMaskNext50 = mask; }
               void       SetClusterMask(UInt_t mask)  { fClusterMask = mask; }
               void       SetL0TriggerInputs(UInt_t mask)  { fL0TriggerInputs = mask; }
               void       SetL1TriggerInputs(UInt_t mask)  { fL1TriggerInputs = mask; }
               void       SetL2TriggerInputs(UShort_t mask)  { fL2TriggerInputs = mask; }
 protected:
              ULong64_t    fClassMask;          // UID ( bitwise OR of conditions mask )
+             ULong64_t    fClassMaskNext50;    // UID ( bitwise OR of conditions mask )  high 50 bits for run2
                 UInt_t    fClusterMask;        // UID ( bitwise OR of clusters mask - detector pattern)
                UInt_t    fL0TriggerInputs;    // L0 trigger inputs (24 bits)
                 UInt_t    fL1TriggerInputs;    // L1 trigger inputs (24 bits)
@@ -78,7 +81,7 @@ private:
                AliCentralTrigger( const AliCentralTrigger& ctp ); // Implemented
                AliCentralTrigger& operator=( const AliCentralTrigger& ctp ); // Not implemented
 
-   ClassDef( AliCentralTrigger, 5 )  // class for running the Central Trigger Processor
+   ClassDef( AliCentralTrigger, 6 )  // class for running the Central Trigger Processor
 };