]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSIhepAnalyze.cxx
Changes for #94366: Fix in copy constructor of AliEventplane
[u/mrichter/AliRoot.git] / PHOS / AliPHOSIhepAnalyze.cxx
index b01381ef35f62c2d222f34a18991ddac2b93c1a3..83e7bc654a815ba5712d404841bc71de1e4a5d81 100644 (file)
@@ -113,7 +113,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV1(Int_t Nevents)
      return ;
    }
 
-  const AliPHOSGeometry *  fGeom  = please->PHOSGeometry();
+  AliPHOSGeometry * phosgeom =  AliPHOSGeometry::GetInstance() ;
 
   AliInfo(Form("Start CPV Analysis-1. Resolutions, cluster multiplicity and lengths")) ;
   for ( Int_t ievent=0; ievent<Nevents; ievent++) {  
@@ -141,7 +141,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV1(Int_t Nevents)
  
     // Create and fill arrays of hits for each CPV module
       
-    Int_t nOfModules = fGeom->GetNModules();
+    Int_t nOfModules = phosgeom->GetNModules();
     TClonesArray **hitsPerModule = new TClonesArray *[nOfModules];
     Int_t iModule = 0;         
     for (iModule=0; iModule < nOfModules; iModule++)
@@ -158,7 +158,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV1(Int_t Nevents)
       branchCPVimpacts ->SetAddress(&fCpvImpacts);
       branchCPVimpacts ->GetEntry(itrack,0);
 
-      for (Int_t iModule=0; iModule < nOfModules; iModule++) {
+      for (iModule=0; iModule < nOfModules; iModule++) {
        impacts = (TClonesArray *)fCpvImpacts->At(iModule);
        // Do loop over impacts in the module
        for (Int_t iImpact=0; iImpact<impacts->GetEntries(); iImpact++) {
@@ -215,14 +215,12 @@ void AliPHOSIhepAnalyze::AnalyzeCPV1(Int_t Nevents)
        ygen   = impact->Y();
        
        //Transform to the local ref.frame
-       const AliPHOSGeometry* geom = please->PHOSGeometry();
-       Float_t phig = geom->GetPHOSAngle(phosModule);
+       Float_t phig = phosgeom->GetPHOSAngle(phosModule);
        Float_t phi = TMath::Pi()/180*phig;
-       Float_t distanceIPtoCPV = geom->GetIPtoOuterCoverDistance() -
-                         (geom->GetFTPosition(1)+
-                          geom->GetFTPosition(2)+
-                          geom->GetCPVTextoliteThickness()
-                         )/2;
+       Float_t distanceIPtoCPV = phosgeom->GetIPtoOuterCoverDistance() -
+         (phosgeom->GetFTPosition(1)+
+          phosgeom->GetFTPosition(2)+
+          phosgeom->GetCPVTextoliteThickness())/2;
        Float_t xoL,yoL,zoL ;
 //     xoL = xgen*TMath::Cos(phig)+ygen*TMath::Sin(phig) ;
 //     yoL = -xgen*TMath::Sin(phig)+ygen*TMath::Cos(phig) + distanceIPtoCPV;
@@ -261,7 +259,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV1(Int_t Nevents)
   // Save histograms
 
   Text_t outputname[80] ;
-  sprintf(outputname,"%s.analyzed",GetFileName().Data());
+  snprintf(outputname,80,"%s.analyzed",GetFileName().Data());
   TFile output(outputname,"RECREATE");
   output.cd();
   
@@ -347,7 +345,7 @@ void AliPHOSIhepAnalyze::AnalyzeEMC1(Int_t Nevents)
      return ;
    }
 
-  const AliPHOSGeometry *  fGeom  = please->PHOSGeometry();
+  AliPHOSGeometry * phosgeom =  AliPHOSGeometry::GetInstance() ;
 
   AliInfo(Form("Start EMC Analysis-1. Resolutions, cluster multiplicity and lengths"));
   for ( Int_t ievent=0; ievent<Nevents; ievent++) {  
@@ -374,7 +372,7 @@ void AliPHOSIhepAnalyze::AnalyzeEMC1(Int_t Nevents)
  
     // Create and fill arrays of hits for each EMC module
       
-    Int_t nOfModules = fGeom->GetNModules();
+    Int_t nOfModules = phosgeom->GetNModules();
     TClonesArray **hitsPerModule = new TClonesArray *[nOfModules];
     Int_t iModule = 0;         
     for (iModule=0; iModule < nOfModules; iModule++)
@@ -391,7 +389,7 @@ void AliPHOSIhepAnalyze::AnalyzeEMC1(Int_t Nevents)
       branchEMCimpacts ->SetAddress(&fEmcImpacts);
       branchEMCimpacts ->GetEntry(itrack,0);
 
-      for (Int_t iModule=0; iModule < nOfModules; iModule++) {
+      for (iModule=0; iModule < nOfModules; iModule++) {
        impacts = (TClonesArray *)fEmcImpacts->At(iModule);
        // Do loop over impacts in the module
        for (Int_t iImpact=0; iImpact<impacts->GetEntries(); iImpact++) {
@@ -446,10 +444,9 @@ void AliPHOSIhepAnalyze::AnalyzeEMC1(Int_t Nevents)
       
        
        //Transform to the local ref.frame
-       const AliPHOSGeometry* geom = please->PHOSGeometry();
-       Float_t phig = geom->GetPHOSAngle(phosModule);
+       Float_t phig = phosgeom->GetPHOSAngle(phosModule);
        Float_t phi = TMath::Pi()/180*phig;
-       Float_t distanceIPtoEMC = geom->GetIPtoCrystalSurface();
+       Float_t distanceIPtoEMC = phosgeom->GetIPtoCrystalSurface();
        Float_t xoL,yoL,zoL ;
 //     xoL = xgen*TMath::Cos(phig)+ygen*TMath::Sin(phig) ;
 //     yoL = -xgen*TMath::Sin(phig)+ygen*TMath::Cos(phig) + distanceIPtoEMC;
@@ -489,7 +486,7 @@ void AliPHOSIhepAnalyze::AnalyzeEMC1(Int_t Nevents)
   // Save histograms
 
   Text_t outputname[80] ;
-  sprintf(outputname,"%s.analyzed",GetFileName().Data());
+  snprintf(outputname,80,"%s.analyzed",GetFileName().Data());
   TFile output(outputname,"update");
   output.cd();
   
@@ -565,7 +562,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV2(Int_t Nevents)
      AliError(Form("Could not obtain the Loader object !"));
      return ;
    }
-  const AliPHOSGeometry *  fGeom  = please->PHOSGeometry();
+  AliPHOSGeometry * phosgeom =  AliPHOSGeometry::GetInstance() ;
   fRunLoader->LoadHeader();
 
   for (Int_t nev=0; nev<Nevents; nev++) 
@@ -588,7 +585,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV2(Int_t Nevents)
       if (! (branchCPVimpacts =treeH->GetBranch("PHOSCpvImpacts")) )  return;
       
       // Create and fill arrays of hits for each CPV module
-      Int_t nOfModules = fGeom->GetNModules();
+      Int_t nOfModules = phosgeom->GetNModules();
       TClonesArray **hitsPerModule = new TClonesArray *[nOfModules];
       Int_t iModule = 0;       
       for (iModule=0; iModule < nOfModules; iModule++)
@@ -602,7 +599,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV2(Int_t Nevents)
        AliInfo(Form(" branchCPVimpacts ->SetAddress(&fCpvImpacts) OK."));
        branchCPVimpacts ->GetEntry(itrack,0);
 
-       for (Int_t iModule=0; iModule < nOfModules; iModule++) {
+       for (iModule=0; iModule < nOfModules; iModule++) {
          impacts = (TClonesArray *)fCpvImpacts->At(iModule);
          // Do loop over impacts in the module
          for (Int_t iImpact=0; iImpact<impacts->GetEntries(); iImpact++) {
@@ -736,7 +733,7 @@ void AliPHOSIhepAnalyze::CpvSingle(Int_t nevents)
     }
        
   Text_t outputname[80] ;
-  sprintf(outputname,"%s.analyzed.single",GetFileName().Data());
+  snprintf(outputname,80,"%s.analyzed.single",GetFileName().Data());
   TFile output(outputname,"RECREATE");
   output.cd();
     
@@ -785,19 +782,23 @@ void AliPHOSIhepAnalyze::HitsCPV(Int_t nev)
 {
   // Cumulative list of charged CPV impacts in event nev.
 
-  TList * fCpvImpacts ;
-  TBranch * branchCPVimpacts;
-
   AliPHOSLoader* please = dynamic_cast<AliPHOSLoader*>(fRunLoader->GetLoader("PHOSLoader"));
   if ( please == 0 )
    {
      AliError(Form("Could not obtain the Loader object !"));
      return ;
    }
-  const AliPHOSGeometry *  fGeom  = please->PHOSGeometry();
 
      
   printf("\n=================== Event %10d ===================\n",nev);
+  //16.03.2011: DP. Code below seems to be obsollete
+  //Comment it to sutisfy Coverity
+/* 
+  TList * fCpvImpacts ;
+  TBranch * branchCPVimpacts;
+
+  AliPHOSGeometry * phosgeom =  AliPHOSGeometry::GetInstance() ;
+
   fRunLoader->GetEvent(nev);
   Int_t ntracks = fRunLoader->GetHeader()->GetNtrack();
     
@@ -815,7 +816,7 @@ void AliPHOSIhepAnalyze::HitsCPV(Int_t nev)
   if (! (branchCPVimpacts =treeH->GetBranch("PHOSCpvImpacts")) )  return;
       
   // Create and fill arrays of hits for each CPV module
-  Int_t nOfModules = fGeom->GetNModules();
+  Int_t nOfModules = phosgeom->GetNModules();
   TClonesArray **hitsPerModule = new TClonesArray *[nOfModules];
   Int_t iModule = 0;   
   for (iModule=0; iModule < nOfModules; iModule++)
@@ -829,7 +830,7 @@ void AliPHOSIhepAnalyze::HitsCPV(Int_t nev)
     AliInfo(Form(" branchCPVimpacts ->SetAddress(&fCpvImpacts) OK."));
     branchCPVimpacts ->GetEntry(itrack,0);
 
-    for (Int_t iModule=0; iModule < nOfModules; iModule++) {
+    for (iModule=0; iModule < nOfModules; iModule++) {
       impacts = (TClonesArray *)fCpvImpacts->At(iModule);
       // Do loop over impacts in the module
       for (Int_t iImpact=0; iImpact<impacts->GetEntries(); iImpact++) {
@@ -846,6 +847,9 @@ void AliPHOSIhepAnalyze::HitsCPV(Int_t nev)
     printf("CPV module %d has %d hits\n",iModule,nsum);
   }
 
+*/
+
+
 //    TList * fCpvImpacts ;
 //    TBranch * branchCPVimpacts;
 //    AliPHOSImpact* impact;