43 #include <TObjString.h>
89 AliDebug(1,Form(
"h1 %s h2 %s",h1 ? h1->GetName() :
"null", h2 ? h2->GetName() :
"null"));
96 for ( Int_t ix = 0; ix <= h1->GetNbinsX()+1; ix++ )
97 for ( Int_t iy = 0; iy <= h1->GetNbinsY()+1; iy++ )
98 for ( Int_t iz = 0; iz <= h1->GetNbinsZ()+1; iz++ )
102 bin = h1->GetBin(ix,iy,iz);
103 Double_t x1 = h1->GetBinContent(bin);
104 Double_t x2 = h2->GetBinContent(bin);
105 if ( x1 != x2 )
return 0;
141 AliDebug(1,Form(
"Same Lpt %d Hpt %d Apt %d",rvLpt,rvHpt,rv));
143 if ( rvLpt == 3 && rvHpt == 3 )
160 AliFatal(Form(
"Could not open file %s",filename));
163 AliDebug(1,Form(
"filename=%s",filename));
165 fLptPlus = (TH3*)(f.Get(
"LptPlus"));
166 fLptMinu = (TH3*)(f.Get(
"LptMinu"));
167 fLptUnde = (TH3*)(f.Get(
"LptUnde"));
168 fHptPlus = (TH3*)(f.Get(
"HptPlus"));
169 fHptMinu = (TH3*)(f.Get(
"HptMinu"));
170 fHptUnde = (TH3*)(f.Get(
"HptUnde"));
171 fAptPlus = (TH3*)(f.Get(
"AptPlus"));
172 fAptMinu = (TH3*)(f.Get(
"AptMinu"));
173 fAptUnde = (TH3*)(f.Get(
"AptUnde"));
216 fMap->SetOwner(kTRUE);
219 if (h)
fMap->Add(
new TObjString(h->GetName()),h);
225 UChar_t idev, Short_t value)
232 fLptPlus =
new TH3S(
"LptPlus",
"LptPlus",234,0,234,31,0,31,31,0,31);
233 fLptMinu =
new TH3S(
"LptMinu",
"LptMinu",234,0,234,31,0,31,31,0,31);
234 fLptUnde =
new TH3S(
"LptUnde",
"LptUnde",234,0,234,31,0,31,31,0,31);
236 fHptPlus =
new TH3S(
"HptPlus",
"HptPlus",234,0,234,31,0,31,31,0,31);
237 fHptMinu =
new TH3S(
"HptMinu",
"HptMinu",234,0,234,31,0,31,31,0,31);
238 fHptUnde =
new TH3S(
"HptUnde",
"HptUnde",234,0,234,31,0,31,31,0,31);
240 fAptPlus =
new TH3S(
"AptPlus",
"AptPlus",234,0,234,31,0,31,31,0,31);
241 fAptMinu =
new TH3S(
"AptMinu",
"AptMinu",234,0,234,31,0,31,31,0,31);
242 fAptUnde =
new TH3S(
"AptUnde",
"AptUnde",234,0,234,31,0,31,31,0,31);
247 TH3* h =
static_cast<TH3*
>(
fMap->GetValue(hname));
249 Int_t bin = h->GetBin(icirc,istripX,idev);
250 h->SetBinContent(bin,value);
255 Int_t ystrip, Int_t lutLpt[2],
256 Int_t lutHpt[2])
const
262 AliError(
"LUT not initialized");
271 bin =
fLptPlus->GetBin(circuit,xstrip,idev);
272 binc = (Short_t)
fLptPlus->GetBinContent(bin);
273 if ((binc & mask)!=0) lutLpt[1]=1;
275 bin =
fLptMinu->GetBin(circuit,xstrip,idev);
276 binc = (Short_t)
fLptMinu->GetBinContent(bin);
277 if ((binc & mask)!=0) lutLpt[0]=1;
279 bin =
fLptUnde->GetBin(circuit,xstrip,idev);
280 binc = (Short_t)
fLptUnde->GetBinContent(bin);
281 if ((binc & mask)!=0) lutLpt[0]=lutLpt[1]=1;
284 bin =
fHptPlus->GetBin(circuit,xstrip,idev);
285 binc = (Short_t)
fHptPlus->GetBinContent(bin);
286 if ((binc & mask)!=0) lutHpt[1]=1;
288 bin =
fHptMinu->GetBin(circuit,xstrip,idev);
289 binc = (Short_t)
fHptMinu->GetBinContent(bin);
290 if ((binc & mask)!=0) lutHpt[0]=1;
292 bin =
fHptUnde->GetBin(circuit,xstrip,idev);
293 binc = (Short_t)
fHptUnde->GetBinContent(bin);
294 if ((binc & mask)!=0) lutHpt[0]=lutHpt[1]=1;
316 return (Int_t)(1<<ystrip);
326 AliWarning(
"Nothing registered in the map ?... ");
329 TH3* h =
static_cast<TH3*
>(
fMap->GetValue(
"LptPlus"));
330 h->SetTitle(Form(
"LptPlus 0x%02x",lutCode));
342 TString lutCode =
fLptPlus->GetTitle();
344 if (lutCode.Length() == 0) {
345 AliInfo(
"No code stored (older version).");
347 AliInfo(lutCode.Data());
349 AliInfo(
"---------------------------------");
350 AliInfo(
"1st/2nd cut code pt cut [GeV/c]");
352 AliInfo(
" 0 0.5 (a.k.a. Apt)");
353 AliInfo(
" 1 1.0 (a.k.a. Lpt)");
354 AliInfo(
" 2 1.7 (a.k.a. Hpt)");
355 AliInfo(
" 3 4.2 (a.k.a. infinity)");
360 AliInfo(
"15 default (for backward compatibility)");
361 AliInfo(
"---------------------------------------");
TH3 * fLptUnde
3-d histogram with 234x32x31 bins Low pt Undefined
TH3 * fAptMinu
3-d histogram with 234x32x31 bins All pt Minus
TH3 * fLptMinu
3-d histogram with 234x32x31 bins Low pt Minus
TH3 * fHptPlus
3-d histogram with 234x32x31 bins High pt Plus
virtual ~AliMUONTriggerLut()
TFile f("CalibObjects.root")
TH3 * fHptMinu
3-d histogram with 234x32x31 bins High pt Minus
TMap * fMap
! from name to histo
void ReadFromFile(const char *filename)
void GetLutOutput(Int_t circuit, Int_t xstrip, Int_t idev, Int_t ystrip, Int_t lutLpt[2], Int_t lutHpt[2]) const
void SetLutCode(const UChar_t lutCode)
TH3 * fLptPlus
3-d histogram with 234x32x31 bins Low pt Plus
Int_t GetMask(Int_t ystrip) const
TH3 * fAptPlus
3-d histogram with 234x32x31 bins All pt Plus
Int_t Compare(const TObject *object) const
void SetContent(const char *hname, Int_t icirc, UChar_t istripX, UChar_t idev, Short_t value)
MUON trigger look up table class.
TH3 * fHptUnde
3-d histogram with 234x32x31 bins High pt Undefined
TH3 * fAptUnde
3-d histogram with 234x32x31 bins All pt Undefined