1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 /// -----------------------
19 /// Class AliMUONTriggerLut
20 /// -----------------------
21 /// Local Trigger Look Up Table
22 /// reading interface LUT data is stored into TH3S histograms and readout
23 /// from the Local Trigger algorithm
24 /// Author: Philippe Crochet
26 #include "AliMUONTriggerLut.h"
34 ClassImp(AliMUONTriggerLut)
37 //----------------------------------------------------------------------
38 AliMUONTriggerLut::AliMUONTriggerLut()
53 //----------------------------------------------------------------------
54 AliMUONTriggerLut::~AliMUONTriggerLut()
69 //----------------------------------------------------------------------
70 void AliMUONTriggerLut::ReadFromFile(const char* filename)
72 /// Return output of LuT for corresponding TH3S
78 AliFatal(Form("Could not open file %s",filename));
81 AliDebug(1,Form("filename=%s",filename));
83 // fLptPlus = (TH3*)(f.Get("LptPlus")->Clone());
84 // fLptMinu = (TH3*)(f.Get("LptMinu")->Clone());
85 // fLptUnde = (TH3*)(f.Get("LptUnde")->Clone());
86 // fHptPlus = (TH3*)(f.Get("HptPlus")->Clone());
87 // fHptMinu = (TH3*)(f.Get("HptMinu")->Clone());
88 // fHptUnde = (TH3*)(f.Get("HptUnde")->Clone());
89 // fAptPlus = (TH3*)(f.Get("AptPlus")->Clone());
90 // fAptMinu = (TH3*)(f.Get("AptMinu")->Clone());
91 // fAptUnde = (TH3*)(f.Get("AptUnde")->Clone());
93 fLptPlus = (TH3*)(f.Get("LptPlus"));
94 fLptMinu = (TH3*)(f.Get("LptMinu"));
95 fLptUnde = (TH3*)(f.Get("LptUnde"));
96 fHptPlus = (TH3*)(f.Get("HptPlus"));
97 fHptMinu = (TH3*)(f.Get("HptMinu"));
98 fHptUnde = (TH3*)(f.Get("HptUnde"));
99 fAptPlus = (TH3*)(f.Get("AptPlus"));
100 fAptMinu = (TH3*)(f.Get("AptMinu"));
101 fAptUnde = (TH3*)(f.Get("AptUnde"));
103 // insure we "detach" those histograms from file f
104 fLptPlus->SetDirectory(0);
105 fLptMinu->SetDirectory(0);
106 fLptUnde->SetDirectory(0);
107 fHptPlus->SetDirectory(0);
108 fHptMinu->SetDirectory(0);
109 fHptUnde->SetDirectory(0);
110 fAptPlus->SetDirectory(0);
111 fAptMinu->SetDirectory(0);
112 fAptUnde->SetDirectory(0);
115 //----------------------------------------------------------------------
116 void AliMUONTriggerLut::GetLutOutput(Int_t circuit, Int_t xstrip, Int_t idev,
117 Int_t ystrip, Int_t lutLpt[2],
120 /// Return output of LuT for corresponding TH3S
124 ReadFromFile("$(ALICE_ROOT)/MUON/data/MUONTriggerLut.root");
129 Int_t mask = GetMask(ystrip); // get ystrip mask
131 // Low pt..............................................
132 bin = fLptPlus->GetBin(circuit,xstrip,idev);
133 binc = (Short_t)fLptPlus->GetBinContent(bin);
134 if ((binc & mask)!=0) lutLpt[1]=1;
136 bin = fLptMinu->GetBin(circuit,xstrip,idev);
137 binc = (Short_t)fLptMinu->GetBinContent(bin);
138 if ((binc & mask)!=0) lutLpt[0]=1;
140 bin = fLptUnde->GetBin(circuit,xstrip,idev);
141 binc = (Short_t)fLptUnde->GetBinContent(bin);
142 if ((binc & mask)!=0) lutLpt[0]=lutLpt[1]=1;
144 // High pt.............................................
145 bin = fHptPlus->GetBin(circuit,xstrip,idev);
146 binc = (Short_t)fHptPlus->GetBinContent(bin);
147 if ((binc & mask)!=0) lutHpt[1]=1;
149 bin = fHptMinu->GetBin(circuit,xstrip,idev);
150 binc = (Short_t)fHptMinu->GetBinContent(bin);
151 if ((binc & mask)!=0) lutHpt[0]=1;
153 bin = fHptUnde->GetBin(circuit,xstrip,idev);
154 binc = (Short_t)fHptUnde->GetBinContent(bin);
155 if ((binc & mask)!=0) lutHpt[0]=lutHpt[1]=1;
157 // All pts.............................................
158 bin = fAptPlus->GetBin(circuit,xstrip,idev);
159 binc = (Short_t)fAptPlus->GetBinContent(bin);
160 if ((binc & mask)!=0) lutApt[1]=1;
162 bin = fAptMinu->GetBin(circuit,xstrip,idev);
163 binc = (Short_t)fAptMinu->GetBinContent(bin);
164 if ((binc & mask)!=0) lutApt[0]=1;
166 bin = fAptUnde->GetBin(circuit,xstrip,idev);
167 binc = (Short_t)fAptUnde->GetBinContent(bin);
168 if ((binc & mask)!=0) lutApt[0]=lutApt[1]=1;
172 //----------------------------------------------------------------------
173 Int_t AliMUONTriggerLut::GetMask(Int_t ystrip)
175 /// Return the mask corresponding to ystrip
177 return (Int_t)(1<<ystrip);