]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSFindClustersV2.cxx
Remove AliTRDv2
[u/mrichter/AliRoot.git] / ITS / AliITSFindClustersV2.cxx
index 77949b10cf9f2eb10016388e9136945fd631882b..3b980a113fcda9d2636294f66c18428cd4dbe4c0 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
  
-/*
-$Log$
-Revision 1.3.4.2  2002/12/11 10:00:15  hristov
-Merging with v3-09-04 (P.Skowronski)
+/* $Id$ */
+///////////////////////////////////////////////////////////////////
+//Class for reconstruction of clusters V2                        //
+//                                                               //
+//                                                               //
+///////////////////////////////////////////////////////////////////
 
-Revision 1.3.4.1  2002/11/26 16:58:52  hristov
-Merging NewIO with v3-09-04
-
-Revision 1.3  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.2.2.1  2002/10/14 13:14:08  hristov
-Updating VirtualMC to v3-09-02
-
-Revision 1.2  2002/09/23 13:25:52  hristov
-Typo corrected (HP)
-
-Revision 1.1  2002/09/09 17:36:05  nilsen
-new TTask to replace non-working AliITSFindClusterV2.C macro.
-
-*/
-#include <TROOT.h>
 #include <TFile.h>
 #include <TTree.h>
 #include <TBranch.h>
@@ -44,11 +29,11 @@ new TTask to replace non-working AliITSFindClusterV2.C macro.
 #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)
 
@@ -116,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",
@@ -129,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;
@@ -167,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",
@@ -174,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;
 }
@@ -222,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.
@@ -287,7 +309,7 @@ void AliITSFindClustersV2::Exec(const Option_t *opt){
     Char_t name[50];
 
     if(!fInit){
-       Warning("Exec","Initilization not succesfull. Aborting.");
+       Warning("Exec","(opt=%s) Initilization not succesfull. Aborting.\n",opt);
        return;
     } // end if !fInit
 
@@ -345,10 +367,10 @@ void AliITSFindClustersV2::Exec(const Option_t *opt){
        if(fGeom->GetModuleType(i)==kSSD) kmip = 38.0;
        for(j=0;j<ncl;j++){
            p = (AliITSRecPoint*)(points->UncheckedAt(j));
-           lp[0] = - (p->GetX() + yshift);
+           lp[0] = - (p->GetDetLocalX() + yshift);
            if(lay==1) lp[0] = -lp[0];
            lp[1] = p->GetZ() + zshift;
-           lp[2] = p->GetSigmaX2();
+           lp[2] = p->GetSigmaDetLocX2();
            lp[3] = p->GetSigmaZ2();
            lp[4] = p->GetQ()/kmip;
            lab[0] = p->GetLabel(0);
@@ -357,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){
@@ -365,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();