]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSFindClustersV2.cxx
Example macro for the creation of tags (P.Christakoglou)
[u/mrichter/AliRoot.git] / ITS / AliITSFindClustersV2.cxx
index a89787f91640da42da29fa17fb03b33f2bc5d3b3..695cc148d21191ab96b471a81e194c3ea8dbfdc8 100644 (file)
  **************************************************************************/
  
 /* $Id$ */
+///////////////////////////////////////////////////////////////////
+//Class for reconstruction of clusters V2                        //
+//                                                               //
+//                                                               //
+///////////////////////////////////////////////////////////////////
 
-#include <TROOT.h>
 #include <TFile.h>
 #include <TTree.h>
 #include <TBranch.h>
 #include "AliRun.h"
 #include "AliHeader.h"
 
-#include "AliITS.h"
 #include "AliITSRecPoint.h"
 #include "AliITSFindClustersV2.h"
 #include "AliITSclusterV2.h"
 #include "AliITSgeom.h"
+#include "AliMC.h"
 
 ClassImp(AliITSFindClustersV2)
 
@@ -97,7 +101,7 @@ AliITSFindClustersV2::AliITSFindClustersV2(const TString infile,
        return;
     } // end if !fAr
     fDeletfAr = kTRUE; // Since gAlice was read in, delete it.
-
+    /*
     AliITS *its = (AliITS*) fAr->GetModule("ITS");
     if(!its){
        Warning("AliITSFindClusterV2",
@@ -110,6 +114,16 @@ AliITSFindClustersV2::AliITSFindClustersV2(const TString infile,
                "Can't fine the ITS geometry in gAlice. Aborting.");
        return;
     } // end if !fGeom
+    */
+    AliRunLoader* rl = AliRunLoader::Open("galice.root");
+    rl->CdGAFile();
+    fGeom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+    if(!fGeom){
+       Warning("AliITSFindClusterV2",
+               "Can't fine the ITS geometry in gAlice. Aborting.");
+       return;
+    } // end if !fGeom
+    delete rl;
 
     if(fOut) fOut->cd();
     fInit = kTRUE;
@@ -148,6 +162,7 @@ AliITSFindClustersV2::AliITSFindClustersV2(TFile *in,
        return;
     } // end if !fAr
     fDeletfAr = kTRUE; // Since gAlice was read in, delete it.
+    /*
     AliITS *its = (AliITS*) fAr->GetModule("ITS");
     if(!its){
        Warning("AliITSFindClusterV2",
@@ -155,12 +170,17 @@ AliITSFindClustersV2::AliITSFindClustersV2(TFile *in,
        return;
     } // end if !its
     fGeom = its->GetITSgeom();
+    */
+    AliRunLoader* rl = AliRunLoader::Open("galice.root");
+    rl->CdGAFile();
+    fGeom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
     if(!fGeom){
        Warning("AliITSFindClusterV2",
                "Can't fine the ITS geometry in gAlice. Aborting.");
        return;
     } // end if !fGeom
-
+    delete rl;
     if(fOut) fOut->cd();
     fInit = kTRUE;
 }
@@ -203,22 +223,43 @@ AliITSFindClustersV2::AliITSFindClustersV2(AliRun *ar,
                "ar==0. Aborting.");
        return;
     } // end if !fAr
-    AliITS *its = (AliITS*) fAr->GetModule("ITS");
+
+    /*   AliITS *its = (AliITS*) fAr->GetModule("ITS");
     if(!its){
        Warning("AliITSFindClusterV2",
                "Can't fine the ITS in gAlice. Aborting.");
        return;
     } // end if !its
     fGeom = its->GetITSgeom();
+    */
+    AliRunLoader* rl = AliRunLoader::Open("galice.root");
+    rl->CdGAFile();
+    fGeom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
     if(!fGeom){
        Warning("AliITSFindClusterV2",
                "Can't fine the ITS geometry in gAlice. Aborting.");
        return;
     } // end if !fGeom
+    delete rl;
 
     if(fOut) fOut->cd();
     fInit = kTRUE;
 }
+//______________________________________________________________________
+AliITSFindClustersV2::AliITSFindClustersV2(const AliITSFindClustersV2 &/*rec*/):TTask(/*rec*/){
+    // Copy constructor. 
+
+  Error("Copy constructor","Copy constructor not allowed");
+  
+}
+//______________________________________________________________________
+AliITSFindClustersV2& AliITSFindClustersV2::operator=(const AliITSFindClustersV2& /*source*/){
+    // Assignment operator. This is a function which is not allowed to be
+    // done.
+    Error("operator=","Assignment operator not allowed\n");
+    return *this; 
+}
+
 //______________________________________________________________________
 AliITSFindClustersV2::~AliITSFindClustersV2(){
     // Default constructor.
@@ -338,7 +379,7 @@ void AliITSFindClustersV2::Exec(const Option_t *opt){
            lab[3] = i;
            lad = lab[0];
            if(lad>=0){
-               part = (TParticle*) fAr->Particle(lad);
+               part = (TParticle*) fAr->GetMCApp()->Particle(lad);
                lad = -3;
                while(part->P() < 0.005){
                    if(part->GetFirstMother()<0){
@@ -346,13 +387,14 @@ void AliITSFindClustersV2::Exec(const Option_t *opt){
                        break;
                    } // end if part->GetFirstMother()<0
                    lad = part->GetFirstMother();
-                   part = (TParticle*) fAr->Particle(lad);
+                   part = (TParticle*) fAr->GetMCApp()->Particle(lad);
                } // end while part->P() < 0.005
                if(lab[1]<0) lab[1] = lad;
                else if(lab[2]<0) lab[2] = lad;
                else Warning("Exec","No empty lables!");
            } // end if lab>=0
-           new(cl[j]) AliITSclusterV2(lab,lp);
+           Int_t info[3]={0,0,0};
+           new(cl[j]) AliITSclusterV2(lab,lp,info);
        } // end for j
        cTree->Fill();
        cluster->Delete();