]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FASTSIM/AliFastMuonTriggerEff.cxx
Bug in storage manager making possible to delete permanent event fixed
[u/mrichter/AliRoot.git] / FASTSIM / AliFastMuonTriggerEff.cxx
index ab508a01aa734ca9605fcb1d8ff6650fdbf332fb..a45c7eaf25b4aaae35d598ffed308c4dad996cde 100644 (file)
@@ -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"
@@ -200,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);
@@ -245,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;
@@ -259,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){
@@ -353,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);
@@ -449,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