]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerLut.cxx
Removing quick code hack and unnecessary methods. Now have a much cleaner implementat...
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerLut.cxx
index b18d2eb6bcc7da6757d8ac5724945e762e7b0e56..e7f2ac181cd7797ddad8c5a14b97494befd956e9 100644 (file)
 
 /* $Id$ */
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONTriggerLut
-/// Local Trigger Look Up Table - reading interface
-/// LUT data is stored into TH3S histograms and readout 
-/// from the Local Trigger algorithm.
+/// 
+/// Local Trigger Look Up Table
+/// reading interface LUT data is stored into TH3S histograms and readout 
+/// from the Local Trigger algorithm
+/// \author Philippe Crochet
+//-----------------------------------------------------------------------------
 
 #include "AliMUONTriggerLut.h"
 
@@ -33,14 +37,20 @@ ClassImp(AliMUONTriggerLut)
 
 //----------------------------------------------------------------------
 AliMUONTriggerLut::AliMUONTriggerLut() 
-  : TNamed()
+    : TNamed(),
+      fLptPlus(0),
+      fLptMinu(0),
+      fLptUnde(0),
+      fHptPlus(0),
+      fHptMinu(0),
+      fHptUnde(0),
+      fAptPlus(0),
+      fAptMinu(0),
+      fAptUnde(0)
 {
-/// Default constructor
-
-  fLptPlus = fLptMinu = fLptUnde = 0;
-  fHptPlus = fHptMinu = fHptUnde = 0;
-  fAptPlus = fAptMinu = fAptUnde = 0;
+/// ctor
 }
+
 //----------------------------------------------------------------------
 AliMUONTriggerLut::~AliMUONTriggerLut() 
 {
@@ -57,8 +67,8 @@ AliMUONTriggerLut::~AliMUONTriggerLut()
   delete fAptUnde;
 }
 
-void
-AliMUONTriggerLut::ReadFromFile(const char* filename)
+//----------------------------------------------------------------------
+void AliMUONTriggerLut::ReadFromFile(const char* filename)
 {
 /// Return output of LuT for corresponding TH3S  
 
@@ -69,16 +79,28 @@ AliMUONTriggerLut::ReadFromFile(const char* filename)
     AliFatal(Form("Could not open file %s",filename));
   }
   
-  fLptPlus = (TH3*)(f.Get("LptPlus")->Clone());  
-  fLptMinu = (TH3*)(f.Get("LptMinu")->Clone());
-  fLptUnde = (TH3*)(f.Get("LptUnde")->Clone());
-  fHptPlus = (TH3*)(f.Get("HptPlus")->Clone());  
-  fHptMinu = (TH3*)(f.Get("HptMinu")->Clone());
-  fHptUnde = (TH3*)(f.Get("HptUnde")->Clone());
-  fAptPlus = (TH3*)(f.Get("AptPlus")->Clone());  
-  fAptMinu = (TH3*)(f.Get("AptMinu")->Clone());
-  fAptUnde = (TH3*)(f.Get("AptUnde")->Clone());
-
+  AliDebug(1,Form("filename=%s",filename));
+  
+//  fLptPlus = (TH3*)(f.Get("LptPlus")->Clone());  
+//  fLptMinu = (TH3*)(f.Get("LptMinu")->Clone());
+//  fLptUnde = (TH3*)(f.Get("LptUnde")->Clone());
+//  fHptPlus = (TH3*)(f.Get("HptPlus")->Clone());  
+//  fHptMinu = (TH3*)(f.Get("HptMinu")->Clone());
+//  fHptUnde = (TH3*)(f.Get("HptUnde")->Clone());
+//  fAptPlus = (TH3*)(f.Get("AptPlus")->Clone());  
+//  fAptMinu = (TH3*)(f.Get("AptMinu")->Clone());
+//  fAptUnde = (TH3*)(f.Get("AptUnde")->Clone());
+
+  fLptPlus = (TH3*)(f.Get("LptPlus"));  
+  fLptMinu = (TH3*)(f.Get("LptMinu"));
+  fLptUnde = (TH3*)(f.Get("LptUnde"));
+  fHptPlus = (TH3*)(f.Get("HptPlus"));  
+  fHptMinu = (TH3*)(f.Get("HptMinu"));
+  fHptUnde = (TH3*)(f.Get("HptUnde"));
+  fAptPlus = (TH3*)(f.Get("AptPlus"));  
+  fAptMinu = (TH3*)(f.Get("AptMinu"));
+  fAptUnde = (TH3*)(f.Get("AptUnde"));
+  
   // insure we "detach" those histograms from file f
   fLptPlus->SetDirectory(0);
   fLptMinu->SetDirectory(0);
@@ -94,7 +116,7 @@ AliMUONTriggerLut::ReadFromFile(const char* filename)
 //----------------------------------------------------------------------
 void AliMUONTriggerLut::GetLutOutput(Int_t circuit, Int_t xstrip, Int_t idev,
                                     Int_t ystrip, Int_t lutLpt[2], 
-                                    Int_t lutHpt[2], Int_t lutApt[2])
+                                    Int_t lutHpt[2])
 {
 /// Return output of LuT for corresponding TH3S  
 
@@ -132,7 +154,7 @@ void AliMUONTriggerLut::GetLutOutput(Int_t circuit, Int_t xstrip, Int_t idev,
   bin    =          fHptUnde->GetBin(circuit,xstrip,idev);
   binc   = (Short_t)fHptUnde->GetBinContent(bin);
   if ((binc & mask)!=0) lutHpt[0]=lutHpt[1]=1;
-
+/*
   // All pts.............................................
   bin    =          fAptPlus->GetBin(circuit,xstrip,idev);
   binc   = (Short_t)fAptPlus->GetBinContent(bin);
@@ -145,7 +167,7 @@ void AliMUONTriggerLut::GetLutOutput(Int_t circuit, Int_t xstrip, Int_t idev,
   bin    =          fAptUnde->GetBin(circuit,xstrip,idev);
   binc   = (Short_t)fAptUnde->GetBinContent(bin);
   if ((binc & mask)!=0) lutApt[0]=lutApt[1]=1;
-
+*/
 }
 
 //----------------------------------------------------------------------
@@ -153,14 +175,7 @@ Int_t AliMUONTriggerLut::GetMask(Int_t ystrip)
 {
 /// Return the mask corresponding to ystrip
 
-  Int_t tabMask[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-  Int_t mask=0;
-  tabMask[ystrip]=1;
-  for (Int_t i=0; i<16; i++) 
-  {          
-    mask += tabMask[i]<<i; 
-  }
-  return mask;
+    return (Int_t)(1<<ystrip);
 }