]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSPreprocessor.cxx
Coverity 18290 solved by non-implemented private copy constructor and assignment...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPreprocessor.cxx
index 9a3a395179ce97ad5966297891fb4a75dc0085d9..78f4120f845825c2780f0b6bd51bae746649780e 100644 (file)
@@ -198,8 +198,8 @@ Float_t AliPHOSPreprocessor::HG2LG(Int_t mod, Int_t X, Int_t Z, TFile* f)
   //Calculates High gain to Low gain ratio 
   //for crystal at the position (X,Z) in the PHOS module mod.
   
-  char hname[128];
-  sprintf(hname,"%d_%d_%d",mod,X,Z);
+  char hname[128]; TString shname = "%d_%d_%d"; 
+  snprintf(hname,shname.Length(),shname.Data(),mod,X,Z);
 
   TH1F* h1 = (TH1F*)f->Get(hname);
   if(!h1) return 16.;
@@ -300,7 +300,6 @@ Bool_t AliPHOSPreprocessor::DoFindBadChannelsEmc(Int_t system, TList* list, AliP
 
   TIter iter(list);
   TObjString *source;
-  char hnam[80];
   TH1F* h1=0;
 
   const Float_t fQualityCut = 1.;
@@ -326,9 +325,10 @@ Bool_t AliPHOSPreprocessor::DoFindBadChannelsEmc(Int_t system, TList* list, AliP
       for(Int_t iX=0; iX<64; iX++) {
        for(Int_t iZ=0; iZ<56; iZ++) {
          
-         sprintf(hnam,"%d_%d_%d_%d",mod,iX,iZ,1); // high gain 
+         TString hnam;
+         hnam += mod; hnam += "_"; hnam += iX; hnam += "_"; hnam += iZ; hnam += "_"; hnam += "1";
          h1 = (TH1F*)f.Get(hnam);
-
+         
          if(h1) {
            Double_t mean = h1->GetMean();
            
@@ -573,12 +573,14 @@ Bool_t AliPHOSPreprocessor::DoCalibrateEmc(Int_t system, TList* list, const AliP
     Double_t refMean=hRef->GetMean();
     
     // Calculates relative calibration coefficients for all non-zero channels
+
+    TString shnam = "%d_%d_%d_1";
     
     for(Int_t mod=0; mod<nMod; mod++) {
       for(Int_t col=0; col<nCol; col++) {
        for(Int_t row=0; row<nRow; row++) {
          
-         sprintf(hnam,"%d_%d_%d_1",mod,row,col); // high gain!
+         snprintf(hnam,shnam.Length(),shnam.Data(),mod,row,col); // high gain!
          h2 = (TH2F*)f.Get(hnam);
          
          //TODO: dead channels exclusion!