Fix coverity warnings (F. Prino)
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2010 09:12:27 +0000 (09:12 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2010 09:12:27 +0000 (09:12 +0000)
ITS/AliITSCorrMapSDD.cxx
ITS/AliITSDDLRawData.cxx
ITS/AliITSMapSDD.cxx
ITS/AliITSOnlineSDDBase.cxx
ITS/AliITSOnlineSDDCMN.cxx
ITS/AliITSOnlineSDDTP.cxx
ITS/AliITSPreprocessorSDD.cxx
ITS/AliITSsimulationSDD.cxx

index 75f62a1..6a466d8 100644 (file)
@@ -65,9 +65,9 @@ Float_t AliITSCorrMapSDD::GetCorrection(Float_t z, Float_t x, AliITSsegmentation
 //______________________________________________________________________
 TH2F* AliITSCorrMapSDD::GetMapHisto() const{
   // Returns a TH2F histogram with map of residuals
-  Char_t hname[50];
-  sprintf(hname,"h%s",GetName());
-  TH2F* hmap=new TH2F(hname,"",fNAnodePts,-0.5,255.5,fNDriftPts,0.,35.);
+  TString hname;
+  hname.Form("h%s",GetName());
+  TH2F* hmap=new TH2F(hname.Data(),"",fNAnodePts,-0.5,255.5,fNDriftPts,0.,35.);
   for(Int_t iAn=0;iAn<fNAnodePts; iAn++){
     for(Int_t iDr=0;iDr<fNDriftPts; iDr++){
       hmap->SetBinContent(iAn+1,iDr+1,GetCellContent(iAn,iDr));
@@ -78,9 +78,9 @@ TH2F* AliITSCorrMapSDD::GetMapHisto() const{
 //______________________________________________________________________
 TH1F* AliITSCorrMapSDD::GetMapProfile() const{
   // Returns a TH1F with the projection of the map along drift coordinate
-  Char_t hname[50];
-  sprintf(hname,"p%s",GetName());
-  TH1F* hprof=new TH1F(hname,"",fNDriftPts,0.,35.);
+  TString hname;
+  hname.Form("p%s",GetName());
+  TH1F* hprof=new TH1F(hname.Data(),"",fNDriftPts,0.,35.);
   for(Int_t iDr=0;iDr<fNDriftPts; iDr++){
     Float_t meanval=0.;
     for(Int_t iAn=0;iAn<fNAnodePts; iAn++){
@@ -94,9 +94,9 @@ TH1F* AliITSCorrMapSDD::GetMapProfile() const{
 //______________________________________________________________________
 TH1F* AliITSCorrMapSDD::GetResidualDistr(Float_t dmin, Float_t dmax) const{
   // Returns a TH1F histogram with distribution of residual
-  Char_t hname[50];
-  sprintf(hname,"hd%s",GetName());
-  TH1F* hd=new TH1F(hname,"",100,dmin,dmax);
+  TString hname;
+  hname.Form("hd%s",GetName());
+  TH1F* hd=new TH1F(hname.Data(),"",100,dmin,dmax);
   for(Int_t iAn=0;iAn<fNAnodePts; iAn++){
     for(Int_t iDr=0;iDr<fNDriftPts; iDr++){
       hd->Fill(GetCellContent(iAn,iDr));
index 83ebe31..ecf8c72 100644 (file)
@@ -544,14 +544,14 @@ Int_t AliITSDDLRawData::RawDataSPD(TBranch* branch, AliITSFOSignalsSPD* foSignal
   fIndex=-1;
 
   TClonesArray*& digits = * (TClonesArray**) branch->GetAddress();
-  char fileName[15];
+  TString fileName;
   AliFstream* outfile;         // logical name of the output file 
   AliRawDataHeaderSim header;
 
   //loop over DDLs
   for(Int_t ddl=0;ddl<AliDAQ::NumberOfDdls("ITSSPD");ddl++){
-    strcpy(fileName,AliDAQ::DdlFileName("ITSSPD",ddl)); //The name of the output file.
-    outfile = new AliFstream(fileName);
+    fileName.Form("%s",AliDAQ::DdlFileName("ITSSPD",ddl)); //The name of the output file.
+    outfile = new AliFstream(fileName.Data());
     //write Dummy DATA HEADER
     UInt_t dataHeaderPosition=outfile->Tellp();
     outfile->WriteBuffer((char*)(&header),sizeof(header));
@@ -591,14 +591,14 @@ Int_t AliITSDDLRawData::RawDataSSD(TBranch* branch){
   fIndex=-1;
 
   TClonesArray*& digits = * (TClonesArray**) branch->GetAddress();
-  char fileName[15];
+  TString fileName;
   AliFstream* outfile;         // logical name of the output file 
   AliRawDataHeaderSim header;
 
   //loop over DDLs  
   for(Int_t i=0;i<AliDAQ::NumberOfDdls("ITSSSD");i++){
-    strcpy(fileName,AliDAQ::DdlFileName("ITSSSD",i)); //The name of the output file.
-    outfile = new AliFstream(fileName);
+    fileName.Form("%s",AliDAQ::DdlFileName("ITSSSD",i)); //The name of the output file.
+    outfile = new AliFstream(fileName.Data());
     //write Dummy DATA HEADER
     UInt_t dataHeaderPosition=outfile->Tellp();
     outfile->WriteBuffer((char*)(&header),sizeof(header));
@@ -638,7 +638,7 @@ Int_t AliITSDDLRawData::RawDataSDD(TBranch* branch, AliITSDDLModuleMapSDD* ddlsd
   fIndex=-1;
 
   TClonesArray*& digits = * (TClonesArray**) branch->GetAddress();
-  char fileName[15];
+  TString fileName;
   AliFstream* outfile;             // logical name of the output file 
   AliRawDataHeaderSim header;
   
@@ -657,8 +657,8 @@ Int_t AliITSDDLRawData::RawDataSDD(TBranch* branch, AliITSDDLModuleMapSDD* ddlsd
  
   //loop over DDLs  
   for(Int_t i=0;i<AliDAQ::NumberOfDdls("ITSSDD");i++){
-    strcpy(fileName,AliDAQ::DdlFileName("ITSSDD",i)); //The name of the output file.
-    outfile = new AliFstream(fileName);
+    fileName.Form("%s",AliDAQ::DdlFileName("ITSSDD",i)); //The name of the output file.
+    outfile = new AliFstream(fileName.Data());
     //write Dummy DATA HEADER
     UInt_t dataHeaderPosition=outfile->Tellp();
     outfile->WriteBuffer((char*)(&header),sizeof(header));
index 47a6c93..70c8eb6 100644 (file)
@@ -77,9 +77,9 @@ Float_t AliITSMapSDD::GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD
 //______________________________________________________________________
 TH2F* AliITSMapSDD::GetMapHisto() const{
   // Returns a TH2F histogram with map of residuals
-  Char_t hname[50];
-  sprintf(hname,"h%s",GetName());
-  TH2F* hmap=new TH2F(hname,"",fgkNAnodPts,-0.5,255.5,fgkNDrifPts,0.,35.);
+  TString hname;
+  hname.Form("h%s",GetName());
+  TH2F* hmap=new TH2F(hname.Data(),"",fgkNAnodPts,-0.5,255.5,fgkNDrifPts,0.,35.);
   for(Int_t iAn=0;iAn<fgkNAnodPts; iAn++){
     for(Int_t iDr=0;iDr<fgkNDrifPts; iDr++){
       hmap->SetBinContent(iAn+1,iDr+1,GetCellContent(iAn,iDr));
@@ -90,9 +90,9 @@ TH2F* AliITSMapSDD::GetMapHisto() const{
 //______________________________________________________________________
 TH1F* AliITSMapSDD::GetResidualDistr(Float_t dmin, Float_t dmax) const{
   // Returns a TH1F histogram with distribution of residual
-  Char_t hname[50];
-  sprintf(hname,"hd%s",GetName());
-  TH1F* hd=new TH1F(hname,"",100,dmin,dmax);
+  TString hname;
+  hname.Form("hd%s",GetName());
+  TH1F* hd=new TH1F(hname.Data(),"",100,dmin,dmax);
   for(Int_t iAn=0;iAn<fgkNAnodPts; iAn++){
     for(Int_t iDr=0;iDr<fgkNDrifPts; iDr++){
       hd->Fill(GetCellContent(iAn,iDr));
index 5cdb9c0..25865ba 100644 (file)
@@ -182,7 +182,7 @@ Float_t AliITSOnlineSDDBase::CalcMeanRawNoise() const{
 //______________________________________________________________________
 void AliITSOnlineSDDBase::WriteToASCII(){
   //
-  Char_t outfilnam[100];
+  TString outfilnam;
   Float_t basMin,basMax;
   GetMinAndMaxBaseline(basMin,basMax);
   Float_t finalVal=basMin;
@@ -194,8 +194,8 @@ void AliITSOnlineSDDBase::WriteToASCII(){
   Int_t thrH=(Int_t)(finalVal+fHighThrFact*avNoise+0.5);
   if(CountGoodAnodes()==0) thrH=255;
 
-  sprintf(outfilnam,"SDDbase_step1_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
-  FILE* outf=fopen(outfilnam,"w");
+  outfilnam.Form("SDDbase_step1_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
+  FILE* outf=fopen(outfilnam.Data(),"w");
   fprintf(outf,"%d\n",thrH);
   fprintf(outf,"%d\n",thrL);
   Float_t corrnoise=2.;
index cb24f9e..f31cce3 100644 (file)
@@ -67,9 +67,9 @@ void AliITSOnlineSDDCMN::Reset(){
 //______________________________________________________________________
 void AliITSOnlineSDDCMN::ReadBaselines(){
   // assume baselines and good anodes are taken from previous run
-  Char_t basfilnam[100];
-  sprintf(basfilnam,"SDDbase_step1_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
-  FILE* basf=fopen(basfilnam,"r");
+  TString basfilnam;
+  basfilnam.Form("SDDbase_step1_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
+  FILE* basf=fopen(basfilnam.Data(),"r");
   if(basf==0){
     AliWarning(Form("Baseline file not present (ddl %d  carlos %d side %d, Set all baselines to 50\n",fDDL,fCarlos,fSide));
     for(Int_t ian=0;ian<fgkNAnodes;ian++){ 
@@ -168,9 +168,9 @@ Float_t AliITSOnlineSDDCMN::CalcMeanNoise() const{
 //______________________________________________________________________
 void AliITSOnlineSDDCMN::WriteToASCII(){
   //
-  Char_t outfilnam[100];
-  sprintf(outfilnam,"SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
-  FILE* outf=fopen(outfilnam,"w");
+  TString outfilnam;
+  outfilnam.Form("SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
+  FILE* outf=fopen(outfilnam.Data(),"w");
   fprintf(outf,"%d\n",fHighThreshold);
   fprintf(outf,"%d\n",fLowThreshold);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
@@ -182,9 +182,9 @@ void AliITSOnlineSDDCMN::WriteToASCII(){
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetBaselineAnodeHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeBaseline(ian));
   }
@@ -193,9 +193,9 @@ TH1F* AliITSOnlineSDDCMN::GetBaselineAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetRawNoiseAnodeHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeRawNoise(ian));
   }
@@ -204,9 +204,9 @@ TH1F* AliITSOnlineSDDCMN::GetRawNoiseAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetCorrNoiseAnodeHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeCorrNoise(ian));
   }
@@ -215,9 +215,9 @@ TH1F* AliITSOnlineSDDCMN::GetCorrNoiseAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetCMNCoefAnodeHisto() const {
 //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeCommonMode(ian));
   }
@@ -226,9 +226,9 @@ TH1F* AliITSOnlineSDDCMN::GetCMNCoefAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetStatusAnodeHisto() const {
 //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,float(IsAnodeGood(ian)));
   }
@@ -237,9 +237,9 @@ TH1F* AliITSOnlineSDDCMN::GetStatusAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetBaselineHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hdbd%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",100,0.,150.);
+  TString hisnam;  
+  hisnam.Form("hdbd%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",100,0.,150.);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->Fill(GetAnodeBaseline(ian));
   }
@@ -248,9 +248,9 @@ TH1F* AliITSOnlineSDDCMN::GetBaselineHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetRawNoiseHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hdnd%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",100,0.,8.);
+  TString hisnam;  
+  hisnam.Form("hdnd%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",100,0.,8.);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->Fill(GetAnodeRawNoise(ian));
   }
@@ -259,9 +259,9 @@ TH1F* AliITSOnlineSDDCMN::GetRawNoiseHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDCMN::GetCorrNoiseHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hdcd%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",100,0.,8.);
+  TString hisnam;  
+  hisnam.Form("hdcd%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",100,0.,8.);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->Fill(GetAnodeCorrNoise(ian));
   }
@@ -274,18 +274,18 @@ Bool_t AliITSOnlineSDDCMN::WriteToROOT(TFile *fil){
     AliWarning("Invalid pointer to ROOT file");
     return kFALSE;    
   }
-  Char_t hisnam[20];
+  TString hisnam;
   fil->cd();
-  sprintf(hisnam,"hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hgood(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hbase(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hnois(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hcmn(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hcorn(hisnam,"",256,-0.5,255.5);
+  hisnam.Form("hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hgood(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hbase(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hnois(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hcmn(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hcorn(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     hgood.SetBinContent(ian+1,float(IsAnodeGood(ian)));
     hbase.SetBinContent(ian+1,GetAnodeBaseline(ian));
index a4efc27..ea8461d 100644 (file)
@@ -89,9 +89,9 @@ void AliITSOnlineSDDTP::AddEvent(TH2F* hrawd){
 //______________________________________________________________________
 void AliITSOnlineSDDTP::ReadBaselines(){
   // assume baselines and good anodes are taken from previous run
-  Char_t basfilnam[100];
-  sprintf(basfilnam,"SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
-  FILE* basf=fopen(basfilnam,"r");
+  TString basfilnam;
+  basfilnam.Form("SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
+  FILE* basf=fopen(basfilnam.Data(),"r");
   if(basf==0){
     AliWarning(Form("Baseline file not present (ddl %d  carlos %d side %d, Set all baselines to 20",fDDL,fCarlos,fSide));
     for(Int_t ian=0;ian<fgkNAnodes;ian++){ 
@@ -172,9 +172,9 @@ void AliITSOnlineSDDTP::StatGain(Float_t &mean, Float_t  &rms){
 //______________________________________________________________________
 void AliITSOnlineSDDTP::WriteToASCII(){
   //
-  Char_t outfilnam[100];
-  sprintf(outfilnam,"SDDbase_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
-  FILE* outf=fopen(outfilnam,"w");
+  TString outfilnam;
+  outfilnam.Form("SDDbase_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
+  FILE* outf=fopen(outfilnam.Data(),"w");
   fprintf(outf,"%d %d %d\n",fCarlos,fSide,IsModuleGood());
   fprintf(outf,"%d\n",fHighThreshold);
   fprintf(outf,"%d\n",fLowThreshold);
@@ -186,9 +186,9 @@ void AliITSOnlineSDDTP::WriteToASCII(){
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDTP::GetBaselineAnodeHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeBaseline(ian));
   }
@@ -197,9 +197,9 @@ TH1F* AliITSOnlineSDDTP::GetBaselineAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDTP::GetRawNoiseAnodeHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeRawNoise(ian));
   }
@@ -208,9 +208,9 @@ TH1F* AliITSOnlineSDDTP::GetRawNoiseAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDTP::GetCorrNoiseAnodeHisto() const {
   //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeCorrNoise(ian));
   }
@@ -219,9 +219,9 @@ TH1F* AliITSOnlineSDDTP::GetCorrNoiseAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDTP::GetCMNCoefAnodeHisto() const {
 //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetAnodeCommonMode(ian));
   }
@@ -230,9 +230,9 @@ TH1F* AliITSOnlineSDDTP::GetCMNCoefAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDTP::GetStatusAnodeHisto() const {
 //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,float(IsAnodeGood(ian)));
   }
@@ -241,9 +241,9 @@ TH1F* AliITSOnlineSDDTP::GetStatusAnodeHisto() const {
 //______________________________________________________________________
 TH1F* AliITSOnlineSDDTP::GetGainAnodeHisto() const {
 //
-  Char_t hisnam[20];  
-  sprintf(hisnam,"hgain%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F* h=new TH1F(hisnam,"",256,-0.5,255.5);
+  TString hisnam;  
+  hisnam.Form("hgain%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     h->SetBinContent(ian+1,GetChannelGain(ian));
   }
@@ -256,22 +256,22 @@ Bool_t AliITSOnlineSDDTP::WriteToROOT(TFile *fil){
     AliWarning("Invalid pointer to ROOT file");
     return kFALSE;    
   }
-  Char_t hisnam[20];
+  TString hisnam;  
   fil->cd();
-  sprintf(hisnam,"hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hgood(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hbase(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hnois(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hcmn(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hcorn(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"hgain%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F hgain(hisnam,"",256,-0.5,255.5);
-  sprintf(hisnam,"htptb%02dc%02ds%d",fDDL,fCarlos,fSide);
-  TH1F htptb(hisnam,"",256,-0.5,255.5);
+  hisnam.Form("hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hgood(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hbase(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hnois(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hcmn(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hcorn(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("hgain%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hgain(hisnam.Data(),"",256,-0.5,255.5);
+  hisnam.Form("htptb%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F htptb(hisnam.Data(),"",256,-0.5,255.5);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     hgood.SetBinContent(ian+1,float(IsAnodeGood(ian)));
     hbase.SetBinContent(ian+1,GetAnodeBaseline(ian));
index 4f1616a..d498b86 100644 (file)
@@ -315,8 +315,8 @@ UInt_t AliITSPreprocessorSDD::ProcessInjector(AliITSDDLModuleMapSDD* ddlmap){
     if(nPtLay4>0) aveCoefLay4[ic]/=nPtLay4; // mean parameters
     else aveCoefLay4[ic]=defCoef[ic]; // default parameters
   }
-  AliITSDriftSpeedSDD *avdsp3=new AliITSDriftSpeedSDD(evNumb,timeStamp,polDeg,aveCoefLay3);
-  AliITSDriftSpeedSDD *avdsp4=new AliITSDriftSpeedSDD(evNumb,timeStamp,polDeg,aveCoefLay4);
+  AliITSDriftSpeedSDD *avdsp3=new AliITSDriftSpeedSDD(evNumb,timeStamp,3,aveCoefLay3);
+  AliITSDriftSpeedSDD *avdsp4=new AliITSDriftSpeedSDD(evNumb,timeStamp,3,aveCoefLay4);
 
   for(Int_t ihyb=0; ihyb<2*kNumberOfSDDLay3; ihyb++){
     if(modSet[ihyb]==0){ 
index ac17f9a..9767f58 100644 (file)
@@ -470,9 +470,11 @@ void AliITSsimulationSDD::HitsToAnalogDigits( AliITSmodule *mod ) {
      
     tof=0.;
     AliITShit* h=(AliITShit*)hits->At(ii);
-    if(h) tof=h->GetTOF()*1E9; 
-    AliDebug(1,Form("TOF for hit %d on mod %d (particle %d)=%g",ii,fModule,h->Track(),tof));
-   
+    if(h){ 
+      tof=h->GetTOF()*1E9; 
+      AliDebug(1,Form("TOF for hit %d on mod %d (particle %d)=%g",ii,fModule,h->Track(),tof));
+    }
+
     xL[0] += 0.0001*gRandom->Gaus( 0, jitter ); //
     pathInSDD = TMath::Sqrt(dxL[0]*dxL[0]+dxL[1]*dxL[1]+dxL[2]*dxL[2]);
     
@@ -732,10 +734,6 @@ void AliITSsimulationSDD::ApplyCrosstalk(Int_t mod) {
   
     // create and inizialice crosstalk map
     Float_t* ctk = new Float_t[fNofMaps*fMaxNofSamples+1];
-    if( ctk == NULL ) {
-        Error( "ApplyCrosstalk", "no memory for temporal map: exit " );
-        return;
-    }
     memset( ctk, 0, sizeof(Float_t)*(fNofMaps*fMaxNofSamples+1) );
     AliITSCalibrationSDD* calibr = (AliITSCalibrationSDD*)GetCalibrationModel(mod);
     for( Int_t z=0; z<fNofMaps; z++ ) {
@@ -764,11 +762,6 @@ void AliITSsimulationSDD::ApplyCrosstalk(Int_t mod) {
                         // make smooth derivative
                         Float_t* dev = new Float_t[fMaxNofSamples+1];
                         memset( dev, 0, sizeof(Float_t)*(fMaxNofSamples+1) );
-                        if( ctk == NULL ) {
-                            Error( "ApplyCrosstalk", 
-                                   "no memory for temporal array: exit " );
-                            return;
-                        }
                         for( Int_t i=tstart; i<tstop; i++ ) {   
                             if( i > 2 && i < fMaxNofSamples-2 )
                                 dev[i] = -0.2*fHitMap2->GetSignal( z,i-2 ) 
@@ -903,18 +896,16 @@ void AliITSsimulationSDD::StoreAllDigits(){
 } 
 //______________________________________________________________________
 void AliITSsimulationSDD::CreateHistograms(Int_t scale){
-    // Creates histograms of maps for debugging
-    Int_t i;
-
-    fHis=new TObjArray(fNofMaps);
-    for (i=0;i<fNofMaps;i++) {
-        TString sddName("sdd_");
-        Char_t candNum[4];
-        sprintf(candNum,"%d",i+1);
-        sddName.Append(candNum);
-        fHis->AddAt(new TH1F(sddName.Data(),"SDD maps",scale*fMaxNofSamples,
-                             0.,(Float_t) scale*fMaxNofSamples), i);
-    } // end for i
+  // Creates histograms of maps for debugging
+  Int_t i;
+  
+  fHis=new TObjArray(fNofMaps);
+  for (i=0;i<fNofMaps;i++) {
+    TString sddName;
+    sddName.Form("sdd_%d",i+1);
+    fHis->AddAt(new TH1F(sddName.Data(),"SDD maps",scale*fMaxNofSamples,
+                        0.,(Float_t) scale*fMaxNofSamples), i);
+  } // end for i
 }
 //______________________________________________________________________
 void AliITSsimulationSDD::FillHistograms(){