]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONLocalTrigger.cxx
Adding a method to dump the readout errors at the end of the decoding
[u/mrichter/AliRoot.git] / MUON / AliMUONLocalTrigger.cxx
index c91d10df7bac8d346b0dc93f10eda9722d2d7461..3be952f5a11a1f3c643747414150177c1eb17fc7 100644 (file)
@@ -202,6 +202,39 @@ void AliMUONLocalTrigger::SetLocalStruct(Int_t loCircuit, AliMUONLocalStruct& lo
 
 }
 
+//----------------------------------------------------------------------
+void AliMUONLocalTrigger::SetLocalStruct(Int_t loCircuit, const AliMUONRawStreamTriggerHP::AliLocalStruct& localStruct)
+{
+/// Set local trigger info from rawdata localStruct (new raw reader)
+
+  // set id'
+  SetLoCircuit(loCircuit);
+
+  // set X, Y, dev, Sdev and TrigY
+  SetLoStripX((Int_t)localStruct.GetXPos());
+  SetLoStripY((Int_t)localStruct.GetYPos());
+  SetLoDev((Int_t)localStruct.GetXDev());
+  SetLoSdev((Int_t)localStruct.GetSXDev());
+  SetLoTrigY((Int_t)localStruct.GetTrigY());
+  // set L(H)pt
+  SetLoLpt(localStruct.GetLpt());
+  SetLoHpt(localStruct.GetHpt());
+
+  // set pattern X
+  SetX1Pattern(localStruct.GetX1());
+  SetX2Pattern(localStruct.GetX2());
+  SetX3Pattern(localStruct.GetX3());
+  SetX4Pattern(localStruct.GetX4());
+
+  // set pattern Y
+  SetY1Pattern(localStruct.GetY1());
+  SetY2Pattern(localStruct.GetY2());
+  SetY3Pattern(localStruct.GetY3());
+  SetY4Pattern(localStruct.GetY4());
+
+}
+
 namespace
 {
   const char* AsString(Int_t t)
@@ -249,6 +282,36 @@ void AliMUONLocalTrigger::Print(Option_t* opt) const
   }
 }
 
+//----------------------------------------------------------------------
+Int_t AliMUONLocalTrigger::GetDeviation() const
+{
+  /// return deviation
+  
+  Int_t deviation = LoDev(); 
+  Int_t sign = 0;
+  if ( !LoSdev() &&  deviation ) sign=-1;
+  if ( !LoSdev() && !deviation ) sign= 0;
+  if (  LoSdev() == 1 )          sign=+1;
+  deviation *= sign;
+  deviation += 15;
+  return deviation;
+}
+
+//----------------------------------------------------------------------
+void AliMUONLocalTrigger::SetDeviation(Int_t deviation)
+{
+  /// set LoDev and LoSDev according to deviation
+  
+  deviation -= 15;
+  if (deviation > 0) {
+    SetLoDev(deviation);
+    SetLoSdev(1);
+  } else {
+    SetLoDev(-deviation);
+    SetLoSdev(0);
+  }
+}
+
 //----------------------------------------------------------------------
 const char*
 AliMUONLocalTrigger::GetName() const
@@ -257,3 +320,27 @@ AliMUONLocalTrigger::GetName() const
 
   return Form("LocalBoard%3d",LoCircuit());
 }
+
+
+//----------------------------------------------------------------------
+Bool_t AliMUONLocalTrigger::IsTrigX()
+{
+/// Trigger response X strips
+  Bool_t xTrig;
+  if ( LoSdev()==1 && LoDev()==0 && 
+       LoStripX()==0) xTrig=kFALSE; // no trigger in X
+  else xTrig = kTRUE;                       // trigger in X
+  return xTrig;
+}
+
+
+//----------------------------------------------------------------------
+Bool_t AliMUONLocalTrigger::IsTrigY()
+{
+/// Trigger response Y strips
+  Bool_t yTrig;
+  if ( LoTrigY()==1 && 
+       LoStripY()==15 ) yTrig = kFALSE; // no trigger in Y
+  else yTrig = kTRUE;                          // trigger in Y
+  return yTrig;
+}