]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSIhepAnalyze.cxx
move from Bz to BxByBz in track propagation
[u/mrichter/AliRoot.git] / PHOS / AliPHOSIhepAnalyze.cxx
index b01381ef35f62c2d222f34a18991ddac2b93c1a3..5b3723a6e138645555296906b26e90ccbfe70c80 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;
@@ -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;
@@ -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++) {
@@ -794,7 +791,7 @@ void AliPHOSIhepAnalyze::HitsCPV(Int_t nev)
      AliError(Form("Could not obtain the Loader object !"));
      return ;
    }
-  const AliPHOSGeometry *  fGeom  = please->PHOSGeometry();
+  AliPHOSGeometry * phosgeom =  AliPHOSGeometry::GetInstance() ;
 
      
   printf("\n=================== Event %10d ===================\n",nev);
@@ -815,7 +812,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 +826,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++) {