]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/Cal/AliTRDCalPad.cxx
default to all tracks in standard cuts
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalPad.cxx
index 65ff0f0a7fcf6785864d195f3fde9aa561fed6bf..d4158b821834f74b4dafc92bf6b4aab3417d976a 100644 (file)
@@ -450,7 +450,7 @@ TH2F *AliTRDCalPad::MakeHisto2DSmPl(Int_t sm, Int_t pl, const AliTRDCalDet *calD
   Double_t col0    = padPlane0->GetCol0();
 
   char  name[1000];
-  sprintf(name,"%s Pad 2D sm %d pl %d",GetTitle(),sm,pl);
+  snprintf(name,1000,"%s Pad 2D sm %d pl %d",GetTitle(),sm,pl);
   TH2F * his = new TH2F( name, name, 76,-TMath::Abs(row0),TMath::Abs(row0),144,-TMath::Abs(col0),TMath::Abs(col0));
 
   // Where we begin
@@ -550,7 +550,7 @@ TH2F *AliTRDCalPad::MakeHisto2DCh(Int_t ch, const AliTRDCalDet *calDet, Int_t ty
   Double_t posglobal[3] = {0.0,0.0,0.0};
   
   char  name[1000];
-  sprintf(name,"%s Pad 2D ch %d",GetTitle(),ch);
+  snprintf(name,1000,"%s Pad 2D ch %d",GetTitle(),ch);
   TH2F * his = new TH2F( name, name, 400,-400.0,400.0,400,-400.0,400.0);
 
   // Where we begin
@@ -579,7 +579,9 @@ TH2F *AliTRDCalPad::MakeHisto2DCh(Int_t ch, const AliTRDCalDet *calDet, Int_t ty
              nb++;         
            }
          }
-         value = value/nb;
+          if (nb > 0) {
+           value = value/nb;
+         }
          if(typedet == 0) his->SetBinContent(binx,biny,value*factor);
          else his->SetBinContent(binx,biny,value+factor);
        }