X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=FASTSIM%2FAliFastMuonTriggerEff.cxx;h=a45c7eaf25b4aaae35d598ffed308c4dad996cde;hb=a31c2f7d72b0b66027fb2b29248cdec0608a93c6;hp=8940c91da1cd1e7ae7f1c0366f428e6a84e89735;hpb=a42548b0b6131829cbb3f50108aedb8785fbb6e7;p=u%2Fmrichter%2FAliRoot.git diff --git a/FASTSIM/AliFastMuonTriggerEff.cxx b/FASTSIM/AliFastMuonTriggerEff.cxx index 8940c91da1c..a45c7eaf25b 100644 --- a/FASTSIM/AliFastMuonTriggerEff.cxx +++ b/FASTSIM/AliFastMuonTriggerEff.cxx @@ -23,6 +23,8 @@ // 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) #include "AliFastMuonTriggerEff.h" @@ -37,19 +39,102 @@ 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) + :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); @@ -117,14 +202,14 @@ Int_t AliFastMuonTriggerEff::ForceBkgLevel(Float_t Bkg) 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); @@ -162,11 +247,11 @@ void AliFastMuonTriggerEff::Init() 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; @@ -176,13 +261,13 @@ void AliFastMuonTriggerEff::Init() 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){ @@ -270,6 +355,10 @@ void AliFastMuonTriggerEff::Init() 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); @@ -366,7 +455,7 @@ void AliFastMuonTriggerEff::Evaluate(Float_t charge, Float_t pt,Float_t theta, 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