]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSreconstruction.cxx
from Ruediger
[u/mrichter/AliRoot.git] / ITS / AliITSreconstruction.cxx
index 92d791a71995f9af8d22e1e02b632b68935250c7..0e099239b85e9991eff1f2a7606237a5694063f7 100644 (file)
@@ -28,7 +28,8 @@
 #include "AliITSreconstruction.h"
 #include "AliITSgeom.h"
 
-
+using std::endl;
+using std::cout;
 ClassImp(AliITSreconstruction)
 
 //______________________________________________________________________
@@ -36,8 +37,9 @@ AliITSreconstruction::AliITSreconstruction():
  fInit(kFALSE),
  fEnt(0),
  fEnt0(0),
//fITS(0x0),
fDetTypeRec(0x0),
  fDfArp(kFALSE),
+ fITSgeom(0x0),
  fLoader(0x0),
  fRunLoader(0x0)
 {
@@ -56,8 +58,9 @@ AliITSreconstruction::AliITSreconstruction(AliRunLoader *rl):
  fInit(kFALSE),
  fEnt(0),
  fEnt0(0),
//fITS(0x0),
fDetTypeRec(0x0),
  fDfArp(kFALSE),
+ fITSgeom(0x0),
  fLoader(0x0),
  fRunLoader(rl)
 {
@@ -68,8 +71,9 @@ AliITSreconstruction::AliITSreconstruction(const char* filename):
  fInit(kFALSE),
  fEnt(0),
  fEnt0(0),
//fITS(0x0),
fDetTypeRec(0x0),
  fDfArp(kFALSE),
+ fITSgeom(0x0),
  fLoader(0x0),
  fRunLoader(0x0)
 {
@@ -90,33 +94,12 @@ AliITSreconstruction::AliITSreconstruction(const char* filename):
     fRunLoader = AliRunLoader::Open(filename);
     if (fRunLoader == 0x0)
      {
-       Error("AliITSreconstruction","Can not load the session",filename);
+       Error("AliITSreconstruction","Can not load the session %s \n",filename);
        return;
      }
-    fRunLoader->LoadgAlice();
-    gAlice = fRunLoader->GetAliRun();
-
-    if(!gAlice) {
-          Error("AliITSreconstruction","gAlice not found on file. Aborting.");
-          fInit = kFALSE;
-          return;
-      } // end if !gAlice
 
 }
-//______________________________________________________________________
-AliITSreconstruction::AliITSreconstruction(const AliITSreconstruction &/*rec*/):TTask(/*rec*/){
-    // Copy constructor. 
 
-  Error("Copy constructor","Copy constructor not allowed");
-  
-}
-//______________________________________________________________________
-AliITSreconstruction& AliITSreconstruction::operator=(const AliITSreconstruction& /*source*/){
-    // Assignment operator. This is a function which is not allowed to be
-    // done.
-    Error("operator=","Assignment operator not allowed\n");
-    return *this; 
-}
 
 //______________________________________________________________________
 AliITSreconstruction::~AliITSreconstruction(){
@@ -135,14 +118,14 @@ Bool_t AliITSreconstruction::Init(){
     //   none.
     // Return:
     //    kTRUE if no errors initilizing this class occurse else kFALSE
-    Info("Init","");
+    Info("Init"," Init ITS reconstruction");
     if (fRunLoader == 0x0)
      {
        Error("Init","Run Loader is NULL");
        return kFALSE;
      }
-    fRunLoader->LoadgAlice();
-    fRunLoader->LoadHeader();  
+    //  fRunLoader->LoadgAlice();
+    //   fRunLoader->LoadHeader();  
 
     fLoader = (AliITSLoader*) fRunLoader->GetLoader("ITSLoader");
     if(!fLoader) {
@@ -152,26 +135,23 @@ Bool_t AliITSreconstruction::Init(){
 
     // Now ready to init.
  
-    fRunLoader->CdGAFile();
+    //fRunLoader->CdGAFile();
     fITSgeom = fLoader->GetITSgeom();
 
-    fDetTypeRec = new AliITSDetTypeRec(fLoader);
+    fDetTypeRec = new AliITSDetTypeRec();
+    fDetTypeRec->SetITSgeom(fITSgeom);
     fDetTypeRec->SetDefaults();
     fDet[0] = fDet[1] = fDet[2] = kTRUE;
     fEnt0 = 0;
 
-    //fEnt  = gAlice->GetEventsPerRun();
-    fEnt = Int_t(fRunLoader->TreeE()->GetEntries());
+    fEnt = Int_t(fRunLoader->GetNumberOfEvents());
 
     fLoader->LoadDigits("read");
     fLoader->LoadRecPoints("recreate");
-    fLoader->LoadRawClusters("recreate");
     if (fLoader->TreeR() == 0x0) fLoader->MakeTree("R");
-    if (fLoader->TreeC() == 0x0) fLoader->MakeTree("C");
  
-    fDetTypeRec->MakeBranchR(0);
-    fDetTypeRec->MakeBranchC();
-    fDetTypeRec->SetTreeAddress();
+    fDetTypeRec->SetTreeAddressD(fLoader->TreeD());
+    fDetTypeRec->MakeBranchR(fLoader->TreeR());
     fDetTypeRec->SetTreeAddressR(fLoader->TreeR());
 
     fInit = InitRec();
@@ -189,51 +169,11 @@ Bool_t AliITSreconstruction::InitRec(){
     //      none.
     // Return:
     //      none.
-  /*
-  //AliITSDetType *idt;
-  fDetTypeRec->SetLoader(fLoader);
-    // SPD
-  if(fDet[kSPD]){
-    Info("InitRec","SPD");
-    //idt = fITS->DetType(kSPD);
-    AliITSsegmentationSPD *segSPD = (AliITSsegmentationSPD*)fDetTypeRec->GetSegmentationModel(0);
-      TClonesArray *digSPD = fDetTypeRec->DigitsAddress(kSPD);
-      TClonesArray *recpSPD = fDetTypeRec->ClustersAddress(kSPD);
-      Info("InitRec","idt = %#x; digSPD = %#x; recpSPD = %#x",fDetTypeRec,digSPD,recpSPD);
-      AliITSClusterFinderSPD *recSPD = new AliITSClusterFinderSPD(segSPD,digSPD,recpSPD);
-      fDetTypeRec->SetReconstructionModel(kSPD,recSPD);
-    } // end if fDet[kSPD].
-  // SDD
-  if(fDet[kSDD]){
-    Info("InitRec","SDD");
-    //    idt = fITS->DetType(kSDD);
-    AliITSsegmentationSDD *segSDD = (AliITSsegmentationSDD*)
-      fDetTypeRec->GetSegmentationModel(1);
-    AliITSresponseSDD *resSDD = (AliITSresponseSDD*)
-      fDetTypeRec->GetCalibrationModel(fDetTypeRec->GetITSgeom()->GetStartSDD()); 
-    TClonesArray *digSDD = fDetTypeRec->DigitsAddress(kSDD);
-    TClonesArray *recpSDD = fDetTypeRec->ClustersAddress(kSDD);
-    AliITSClusterFinderSDD *recSDD =new AliITSClusterFinderSDD(segSDD,
-                                                              resSDD,
-                                                              digSDD,recpSDD);
-    fDetTypeRec->SetReconstructionModel(kSDD,recSDD);
-  } // end if fDet[kSDD]
-    // SSD
-  if(fDet[kSSD]){
-    Info("InitRec","SSD");
-    //idt = fITS->DetType(kSSD);
-    AliITSsegmentationSSD *segSSD = (AliITSsegmentationSSD*)
-                                       fDetTypeRec->GetSegmentationModel(2);
-      TClonesArray *digSSD = fDetTypeRec->DigitsAddress(kSSD);
-      AliITSClusterFinderSSD *recSSD =new AliITSClusterFinderSSD(segSSD,
-                                                                digSSD);
-      recSSD->SetITSgeom(fDetTypeRec->GetITSgeom());
-      fDetTypeRec->SetReconstructionModel(kSSD,recSSD);
-    } // end if fDet[kSSD]
-  */
-  fDetTypeRec->SetDefaultClusterFinders();
-    Info("InitRec","    Done\n");
-    return kTRUE;
+
+
+  fDetTypeRec->SetDefaultClusterFindersV2();
+  Info("InitRec","    Done\n");
+  return kTRUE;
 }
 //______________________________________________________________________ 
 void AliITSreconstruction::Exec(const Option_t *opt){
@@ -246,8 +186,14 @@ void AliITSreconstruction::Exec(const Option_t *opt){
     //      none.
     Option_t *lopt;
     Int_t evnt;
-
-    if(strstr(opt,"All")||strstr(opt,"ALL")||strstr(opt,"ITS")||opt==0){
+    Bool_t condition =kFALSE;
+    if(opt){
+      if(strstr(opt,"All")||strstr(opt,"ALL")||strstr(opt,"ITS"))condition =kTRUE;
+    }
+    else{
+      condition = kTRUE;
+    }
+    if(condition){
       fDet[0] = fDet[1] = fDet[2] = kTRUE;
       lopt = "All";
     }else{
@@ -265,20 +211,16 @@ void AliITSreconstruction::Exec(const Option_t *opt){
     } // end if !fInit
     for(evnt=0;evnt<fEnt;evnt++)
      {
-      Info("Exec","");
+       //      Info("Exec","");
       Info("Exec","Processing Event %d",evnt);
-      Info("Exec","");
+      //      Info("Exec","");
 
       fRunLoader->GetEvent(evnt);
       if (fLoader->TreeR() == 0x0) fLoader->MakeTree("R");
       fDetTypeRec->MakeBranchR(0);
-      if (fLoader->TreeC() == 0x0){
-       fDetTypeRec->MakeTreeC();
-       fDetTypeRec->MakeBranchC();
-      }
       fDetTypeRec->SetTreeAddressR(fLoader->TreeR());
       fDetTypeRec->SetTreeAddressD(fLoader->TreeD());
-      fDetTypeRec->DigitsToRecPoints(evnt,0,lopt);
+      fDetTypeRec->DigitsToRecPoints(fLoader->TreeD(),fLoader->TreeR(),0,lopt);
     } // end for evnt
 }
 //______________________________________________________________________