]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDarcHeader.cxx
Make the Scan method public
[u/mrichter/AliRoot.git] / MUON / AliMUONDarcHeader.cxx
index 259927beccabaedbf6be17043873fa8e8dc60294..529f67b85eebcf00cbe86cf7629385f87f0a44b9 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
  
+/* $Id$ */
+
 #include "AliMUONDarcHeader.h"
 #include "AliMUONRegHeader.h"
 
-/// 
+//-----------------------------------------------------------------------------
+/// \class AliMUONDarcHeader
 /// Darc structure for trigger raw data.
 /// Each DDL contains one Darc structure
 /// The structure includes the information of the Darc boards
 /// The structure containes the information of the 8 (at most) 
 /// regional structures.
 ///
+/// \author Christian Finck
+//-----------------------------------------------------------------------------
 
+/// \cond CLASSIMP
 ClassImp(AliMUONDarcHeader)
- const Int_t AliMUONDarcHeader::fgkHeaderLength = 8;
- const Int_t AliMUONDarcHeader::fgkDarcScalerLength   = 6;
- const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
+/// \endcond
+
+ const Int_t AliMUONDarcHeader::fgkDarcHeaderLength   =  1;
+ const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength =  5;
+ const Int_t AliMUONDarcHeader::fgkDarcScalerLength   =  8;
+ const Int_t AliMUONDarcHeader::fgkGlobalScalerLength =  10;
 
  const UInt_t AliMUONDarcHeader::fgkEndOfDarc   = 0xDEADFACE;
  const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
+ const UInt_t AliMUONDarcHeader::fgkDarcVadorhType    = 4;
+ const UInt_t AliMUONDarcHeader::fgkDarcDefaultType   = 6;
 
+//___________________________________________
+AliMUONDarcHeader::AliMUONDarcHeader(TRootIOCtor* /*dummy*/)
+:  TObject(),
+fWord(0),
+fGlobalOutput(0),
+fGlobalL0(0), 
+fGlobalClk(0),
+fGlobalHold(0),      
+fGlobalSpare(0),     
+fDarcL0R(0),
+fDarcL1P(0),
+fDarcL1S(0),
+fDarcL2A(0),
+fDarcL2R(0),
+fDarcClk(0),
+fDarcHold(0),
+fDarcSpare(0),
+fRegHeaderArray(0x0)
+{
+  /// ctor
+  for (Int_t i = 0; i < 4; i++)
+    fGlobalInput[i] = 0;
+  
+  for (Int_t i = 0; i < 6; i++)
+    fGlobalScaler[i] = 0;
+  
+}
 
 //___________________________________________
 AliMUONDarcHeader::AliMUONDarcHeader()
@@ -47,45 +84,51 @@ AliMUONDarcHeader::AliMUONDarcHeader()
      fGlobalSpare(0),     
 
      fDarcL0R(0),
-     fDarcL0U(0),
-     fDarcL0P(0),
-     fDarcL0S(0),
+     fDarcL1P(0),
+     fDarcL1S(0),
+     fDarcL2A(0),
+     fDarcL2R(0),
      fDarcClk(0),
-     fDarcHold(0)
+     fDarcHold(0),
+     fDarcSpare(0),
+     fRegHeaderArray(new TClonesArray("AliMUONRegHeader",8))
+  
+
 {
-  //
-  // ctor
-  //
+  /// ctor
+   
   for (Int_t i = 0; i < 4; i++)
     fGlobalInput[i] = 0;
 
   for (Int_t i = 0; i < 6; i++)
     fGlobalScaler[i] = 0;
 
-  fRegHeaderArray = new TClonesArray("AliMUONRegHeader",8);
 }
 
 //___________________________________________
 AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
-  :  TObject(event)
-{
-  //
-  // copy ctor
-  //
-  fWord         = event.fWord;
-  fGlobalOutput = event.fGlobalOutput;
-  fGlobalL0     = event.fGlobalL0;
-  fGlobalClk    = event.fGlobalClk;
-  fGlobalHold   = event.fGlobalHold;   
-  fGlobalSpare  = event.fGlobalSpare;
-
-  fDarcL0R  = event.fDarcL0R;
-  fDarcL0U  = event.fDarcL0U;
-  fDarcL0P  = event.fDarcL0P;
-  fDarcL0S  = event.fDarcL0S;
-  fDarcClk  = event.fDarcClk;
-  fDarcHold = event.fDarcHold;
+  :  TObject(event),
+     fWord(event.fWord),
+     fGlobalOutput(event.fGlobalOutput),
+     fGlobalL0(event.fGlobalL0),
+     fGlobalClk(event.fGlobalClk),
+     fGlobalHold(event.fGlobalHold),   
+     fGlobalSpare(event.fGlobalSpare),
+
+     fDarcL0R(event.fDarcL0R),
+     fDarcL1P(event.fDarcL1P),
+     fDarcL1S(event.fDarcL1S),
+     fDarcL2A(event.fDarcL2A),
+     fDarcL2R(event.fDarcL2R),
+     fDarcClk(event.fDarcClk),
+     fDarcHold(event.fDarcHold),
+     fDarcSpare(event.fDarcSpare),
+     fRegHeaderArray(new TClonesArray("AliMUONRegHeader", 8))
 
+{
+  ///
+  /// copy ctor
+  ///
  
  for (Int_t i = 0; i < 4; i++)
     fGlobalInput[i] = event.fGlobalInput[i];
@@ -93,7 +136,6 @@ AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
   for (Int_t i = 0; i < 6; i++)
     fGlobalScaler[i] = event.fGlobalScaler[i];
 
-  fRegHeaderArray = new TClonesArray("AliMUONRegHeader", 8);
   for (Int_t index = 0; index < (event.fRegHeaderArray)->GetEntriesFast(); index++) {
     new ((*fRegHeaderArray)[fRegHeaderArray->GetEntriesFast()]) 
         AliMUONRegHeader(*(AliMUONRegHeader*)(event.fRegHeaderArray)->At(index));
@@ -103,9 +145,9 @@ AliMUONDarcHeader::AliMUONDarcHeader(const AliMUONDarcHeader& event)
 //___________________________________________
 AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
 {
-  // 
-  // assignment operator
-  //
+  /// 
+  /// assignment operator
+  ///
   if (this == &event) return *this;
 
   fWord         = event.fWord;
@@ -115,12 +157,14 @@ AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
   fGlobalHold   = event.fGlobalHold;   
   fGlobalSpare  = event.fGlobalSpare;
 
-  fDarcL0R  = event.fDarcL0R;
-  fDarcL0U  = event.fDarcL0U;
-  fDarcL0P  = event.fDarcL0P;
-  fDarcL0S  = event.fDarcL0S;
-  fDarcClk  = event.fDarcClk;
-  fDarcHold = event.fDarcHold;
+  fDarcL0R   = event.fDarcL0R;
+  fDarcL1P   = event.fDarcL1P;
+  fDarcL1S   = event.fDarcL1S;
+  fDarcL2A   = event.fDarcL2A;
+  fDarcL2R   = event.fDarcL2R;
+  fDarcClk   = event.fDarcClk;
+  fDarcHold  = event.fDarcHold;
+  fDarcSpare = event.fDarcSpare;
 
   for (Int_t i = 0; i < 4; i++)
     fGlobalInput[i] = event.fGlobalInput[i];
@@ -140,9 +184,9 @@ AliMUONDarcHeader& AliMUONDarcHeader::operator=(const AliMUONDarcHeader& event)
 //___________________________________________
 AliMUONDarcHeader::~AliMUONDarcHeader()
 {
-  // 
-  // dtor
-  //
+  /// 
+  /// dtor
+  ///
   fRegHeaderArray->Delete();
   delete fRegHeaderArray;
 }
@@ -150,33 +194,52 @@ AliMUONDarcHeader::~AliMUONDarcHeader()
 //___________________________________________
 void AliMUONDarcHeader::SetScalersNumbers()
 {
-  // set numbers for scaler events for Darc header
-  // since this is provided by the experiment
-  // put dummy numbers to check the monitoring
+  /// set numbers for scaler events for Darc header
+  /// since this is provided by the experiment
+  /// put dummy numbers to check the monitoring
   
   fGlobalL0    = 1000;
   fGlobalClk   = 10000;
   fGlobalHold  = 100;    
   fGlobalSpare = 1;    
 
-  fDarcL0R  = 1000;
-  fDarcL0U  = 900;
-  fDarcL0P  = 800;
-  fDarcL0S  = 700;
-  fDarcClk  = 10000;
-  fDarcHold = 100;
+  fDarcL0R   = 1000;
+  fDarcL1P   = 900;
+  fDarcL1S   = 800;
+  fDarcL2A   = 700;
+  fDarcL2R   = 700;
+  fDarcClk   = 10000;
+  fDarcHold  = 100;
+  fDarcSpare = 0;
 
    for (Int_t i = 0; i < 6; i++)
     fGlobalScaler[i] = i;
 
 }
+//___________________________________________
+Bool_t  AliMUONDarcHeader::GetEventType()  const 
+{
+  /// return 1 for physics trigger
+  /// return 0 for software trigger
+  // 01 = trigger physics
+  // 10 = trigger software "start of run"
+  // 11 = trigger software "end of run"
+  // 00 = other trigger software
+  
+  Bool_t b1 =   (fWord >> 30) &  0x1;
+  Bool_t b2 = !((fWord >> 31) &  0x1);
+  
+  //printf("%d\n", b1 & b2);
+  //printf("%d %d\n", b2 , b1);
+  return (b1 & b2);
+}
 
 //___________________________________________
 void AliMUONDarcHeader::Clear(Option_t* )
 {
-  // Clear TClones arrays
-  // instead of deleting
-  //
+  /// Clear TClones arrays
+  /// instead of deleting
+  ///
   fRegHeaderArray->Clear("C");
  
 }