* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-The trigger parametrization is computed for background levels 0., 0.5 and 1.
-In order to set a background level different from 0 it is necessary to
-explicitly force it with:
-ForceBkgLevel(BkgLevel).
+/* $Id$ */
+// The trigger parametrization is computed for background levels 0., 0.5 and 1.
+// In order to set a background level different from 0 it is necessary to
+// explicitly force it with:
+// ForceBkgLevel(BkgLevel).
+// For intermediate background levels, the trigger response is linearly
+// interpolated between these values.
+// There is increased granularity in the pT region below 3 GeV. Although
+// it does not seem to be necessary it is also possible to interpolate
+// between pT bins using SetInt().
+// Author: Pietro Cortese (Universita' del Piemonte Orientale - Alessandria
+// and INFN of Torino)
-For intermediate background levels, the trigger response is linearly
-interpolated between these values.
-
-There is increased granularity in the pT region below 3 GeV. Although
-it does not seem to be necessary it is also possible to interpolate
-between pT bins using SetInt().
-
-$Log$
-Revision 1.10 2006/04/19 21:58:28 morsch
-Coding rule violations corrected
-
-Revision 1.9 2005/09/24 03:51:43 hristov
-Removing extra semicolon (Fedora Core 4)
-
-Revision 1.8 2005/09/22 11:31:42 morsch
-Completely revised version. (P. Cortese)
-
-*/
#include "AliFastMuonTriggerEff.h"
#include "TROOT.h"
ClassImp(AliFastMuonTriggerEff)
AliFastMuonTriggerEff::AliFastMuonTriggerEff():
- AliFastResponse("Efficiency", "Muon Trigger Efficiency")
+ AliFastResponse("Efficiency", "Muon Trigger Efficiency"),
+ fPtMin(0.),
+ fPtMax(0.),
+ fDpt(0.),
+ fnptb(0),
+ fPhiMin(0.),
+ fPhiMax(0.),
+ fDphi(0.),
+ fnphib(0),
+ fThetaMin(0.),
+ fThetaMax(0.),
+ fDtheta(0.),
+ fnthetab(0),
+ fCut(kLow),
+ fZones(0),
+ fhEffAPt(0),
+ fhEffLPt(0),
+ fhEffHPt(0),
+ fhLX(0),
+ fhLY(0),
+ fhLZ(0),
+ fBkg(0.),
+ fTableTitle(0),
+ fDescription(0),
+ fInt(0),
+ fibx(0),
+ fiby(0),
+ fibz(0)
{
//
// Default constructor
//
- SetCut(kLow);
- fZones=0;
- SetBkgLevel(0.);
- UnsetInt();
+}
+
+AliFastMuonTriggerEff::AliFastMuonTriggerEff(const char* Name, const char* Title):
+ AliFastResponse(Name, Title),
+ fPtMin(0.),
+ fPtMax(0.),
+ fDpt(0.),
+ fnptb(0),
+ fPhiMin(0.),
+ fPhiMax(0.),
+ fDphi(0.),
+ fnphib(0),
+ fThetaMin(0.),
+ fThetaMax(0.),
+ fDtheta(0.),
+ fnthetab(0),
+ fCut(kLow),
+ fZones(0),
+ fhEffAPt(0),
+ fhEffLPt(0),
+ fhEffHPt(0),
+ fhLX(0),
+ fhLY(0),
+ fhLZ(0),
+ fBkg(0.),
+ fTableTitle(0),
+ fDescription(0),
+ fInt(0),
+ fibx(0),
+ fiby(0),
+ fibz(0)
+{
+// Another constructor
+}
+
+AliFastMuonTriggerEff::AliFastMuonTriggerEff(const AliFastMuonTriggerEff& eff)
+ :AliFastResponse(eff),
+ fPtMin(0.),
+ fPtMax(0.),
+ fDpt(0.),
+ fnptb(0),
+ fPhiMin(0.),
+ fPhiMax(0.),
+ fDphi(0.),
+ fnphib(0),
+ fThetaMin(0.),
+ fThetaMax(0.),
+ fDtheta(0.),
+ fnthetab(0),
+ fCut(kLow),
+ fZones(0),
+ fhEffAPt(0),
+ fhEffLPt(0),
+ fhEffHPt(0),
+ fhLX(0),
+ fhLY(0),
+ fhLZ(0),
+ fBkg(0.),
+ fTableTitle(0),
+ fDescription(0),
+ fInt(0),
+ fibx(0),
+ fiby(0),
+ fibz(0)
+{
+// Copy constructor
+ eff.Copy(*this);
}
void AliFastMuonTriggerEff::SetCut(Int_t cut)
return 0;
}
-Int_t AliFastMuonTriggerEff::LoadTables(Char_t *namet=""){
+Int_t AliFastMuonTriggerEff::LoadTables(const Char_t *namet){
//
// Load the trigger tables
//
Char_t hNameA[100],hNameL[100],hNameH[100];
- sprintf(hNameA,"hEffAPt%s",namet);
- sprintf(hNameL,"hEffLPt%s",namet);
- sprintf(hNameH,"hEffHPt%s",namet);
+ snprintf(hNameA, 100, "hEffAPt%s",namet);
+ snprintf(hNameL, 100, "hEffLPt%s",namet);
+ snprintf(hNameH, 100, "hEffHPt%s",namet);
fhEffAPt = (TH3F*)gDirectory->Get(hNameA);
fhEffLPt = (TH3F*)gDirectory->Get(hNameL);
fhEffHPt = (TH3F*)gDirectory->Get(hNameH);
Int_t intb=0;
Char_t namet[10];
if(TMath::Abs(fBkg)<0.00001){
- sprintf(namet,"00");
+ snprintf(namet, 10, "00");
}else if(TMath::Abs(fBkg-0.5)<0.00001){
- sprintf(namet,"05");
+ snprintf(namet, 10, "05");
}else if(TMath::Abs(fBkg-1.0)<0.00001){
- sprintf(namet,"10");
+ snprintf(namet, 10, "10");
}else{
PLIN; printf("A table for Bkg level: %f does not exists\n",fBkg);
intb=1;
TH3F* ha1,*hl1,*hh1,*ha2,*hl2,*hh2,*ha0,*hl0,*hh0;
Char_t name1[10],name2[10]; Float_t b1,b2;
if(fBkg>0&&fBkg<0.5){
- sprintf(name1,"00");
- sprintf(name2,"05");
+ snprintf(name1,10, "00");
+ snprintf(name2,10, "05");
b1=0.;
b2=0.5;
}else if(fBkg>0.5){
- sprintf(name1,"05");
- sprintf(name2,"10");
+ snprintf(name1, 10, "05");
+ snprintf(name2, 10, "10");
b1=0.5;
b2=1.0;
if(fBkg>1.0){
fnptb=fhEffLPt->GetNbinsZ();
fDpt = (fPtMax-fPtMin)/fnptb;
+ printf("***** This version of AliFastMuonTriggerEff can use both *****\n");
+ printf("***** new and old ALICE reference frames depending on *****\n");
+ printf("***** which LUT has been loaded. You can find below some *****\n");
+ printf("***** information on the current parametrization: *****\n");
printf("%4d bins in theta [%f:%f]\n",fnthetab,fThetaMin,fThetaMax);
printf("%4d bins in phi [%f:%f]\n",fnphib,fPhiMin,fPhiMax);
printf("%4d bins in pt [%f:%f]\n",fnptb,fPtMin,fPtMax);
printf(" 6:1 No more points above! No interpolation is needed!\n");
#endif
return;
- }else if(ptc==pt){
+ }else if(TMath::Abs(ptc-pt) < 1.e-10){
#ifdef MYTRIGDEBUG
printf(" 6:1 No interpolation is needed!\n");
#endif
return eff;
}
+
+AliFastMuonTriggerEff& AliFastMuonTriggerEff::operator=(const AliFastMuonTriggerEff& rhs)
+{
+// Assignment operator
+ rhs.Copy(*this);
+ return *this;
+}
+