]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSReconstructor.cxx
Changed inheritance to include Reve::RenderElement; use ZTrans to store transformatio...
[u/mrichter/AliRoot.git] / ITS / AliITSReconstructor.cxx
index 937a18b36df4ec8cf808ef8aa3c92e10e0151f82..fbb7288670bf9e86ca4348423d70990bae2046ef 100644 (file)
 #include "AliITSpidESD2.h"
 #include "AliV0vertexer.h"
 #include "AliCascadeVertexer.h"
+#include "AliITSInitGeometry.h"
 
 ClassImp(AliITSReconstructor)
 
 //___________________________________________________________________________
-AliITSReconstructor::AliITSReconstructor() : AliReconstructor(){
+AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
+fItsPID(0)
+{
   // Default constructor
-  fItsPID=0;
 }
  //___________________________________________________________________________
 AliITSReconstructor::~AliITSReconstructor(){
@@ -54,39 +56,57 @@ AliITSReconstructor::~AliITSReconstructor(){
   delete fItsPID;
 } 
 //______________________________________________________________________
-AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob) {
+AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
+fItsPID(ob.fItsPID) 
+{
   // Copy constructor
-  // Copies are not allowed. The method is protected to avoid misuse.
-  Error("AliITSpidESD2","Copy constructor not allowed\n");
 }
 
 //______________________________________________________________________
-AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& /* ob */){
+AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor&  ob ){
   // Assignment operator
-  // Assignment is not allowed. The method is protected to avoid misuse.
-  Error("= operator","Assignment operator not allowed\n");
+  this->~AliITSReconstructor();
+  new(this) AliITSReconstructor(ob);
   return *this;
 }
+//______________________________________________________________________
+void AliITSReconstructor::Init(AliRunLoader *runLoader) const{
+    // Initalize this constructor bet getting/creating the objects
+    // nesseary for a proper ITS reconstruction.
+    // Inputs:
+    //    AliRunLoader *runLoader   Pointer to the run loader to allow
+    //                              the getting of files/folders data
+    //                              needed to do reconstruction
+    // Output:
+    //   none.
+    // Return:
+    //   none.
 
+    AliITSInitGeometry *initgeom = new AliITSInitGeometry("AliITSvPPRasymmFMD",
+                                                         2);
+    AliITSgeom *geom = initgeom->CreateAliITSgeom();
+    delete initgeom; // once created, do not need initgeom any more.
+    AliITSLoader* loader = static_cast<AliITSLoader*>
+       (runLoader->GetLoader("ITSLoader"));
+    if (!loader) {
+       Error("Init", "ITS loader not found");
+       return;
+    }
+    loader->SetITSgeom(geom);
+    return;
+}
 //_____________________________________________________________________________
 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
 {
 // reconstruct clusters
 
 
-  AliLoader* loader = runLoader->GetLoader("ITSLoader");
+  AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
   if (!loader) {
     Error("Reconstruct", "ITS loader not found");
     return;
   }
-  gAlice=runLoader->GetAliRun();
-  TDirectory* olddir = gDirectory;
-  runLoader->CdGAFile();
-  AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");  
-  olddir->cd();
-  AliITSDetTypeRec* rec = new AliITSDetTypeRec();
-  rec->SetLoader((AliITSLoader*)loader);
-  rec->SetITSgeom(geom);
+  AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
   rec->SetDefaults();
 
   loader->LoadRecPoints("recreate");
@@ -118,20 +138,13 @@ void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
 // reconstruct clusters
 
  
-  AliLoader* loader = runLoader->GetLoader("ITSLoader");
+  AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
   if (!loader) {
     Error("Reconstruct", "ITS loader not found");
     return;
   }
-  gAlice=runLoader->GetAliRun();
-  TDirectory* olddir = gDirectory;
-  runLoader->CdGAFile();
-  AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");  
-  olddir->cd();
 
-  AliITSDetTypeRec* rec = new AliITSDetTypeRec();
-  rec->SetLoader((AliITSLoader*)loader);
-  rec->SetITSgeom(geom);
+  AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
   rec->SetDefaults();
   rec->SetDefaultClusterFindersV2(kTRUE);
 
@@ -268,11 +281,8 @@ AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
     Error("GetITSgeom", "couldn't get AliRun object");
     return NULL;
   }
-  
-  TDirectory * olddir = gDirectory;
-  runLoader->CdGAFile();
-  AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
-  olddir->cd();
+  AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
+  AliITSgeom* geom = (AliITSgeom*)loader->GetITSgeom();
   if(!geom){
     Error("GetITSgeom","no ITS geometry available");
     return NULL;
@@ -280,4 +290,3 @@ AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
   
   return geom;
 }
-