]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Implementation of single event reconstruction. Removal of the run loaders from the...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Aug 2007 11:43:46 +0000 (11:43 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Aug 2007 11:43:46 +0000 (11:43 +0000)
15 files changed:
ITS/AliITSClusterFinderSDD.cxx
ITS/AliITSClusterFinderSDD.h
ITS/AliITSClusterFinderSPD.cxx
ITS/AliITSClusterFinderSSD.cxx
ITS/AliITSDetTypeRec.cxx
ITS/AliITSDetTypeRec.h
ITS/AliITSNeuralTracker.h
ITS/AliITSReconstructor.cxx
ITS/AliITSReconstructor.h
ITS/AliITSVertexer3D.h
ITS/AliITSVertexerIons.cxx
ITS/AliITSVertexerZ.cxx
ITS/AliITSreconstruction.cxx
ITS/AliITSreconstruction.h
STEER/AliReconstruction.cxx

index 41115ba683c95faa734a3e0a610b338a4a0708a7..d6820112aed047cbd66ab25e65aef9bc7066e86a 100644 (file)
@@ -30,6 +30,7 @@
 #include "AliITSDetTypeRec.h"
 #include "AliITSCalibrationSDD.h"
 #include "AliITSsegmentationSDD.h"
+#include "AliITSgeom.h"
 #include "AliLog.h"
 
 ClassImp(AliITSClusterFinderSDD)
index 6612bcf9d7386c04867a4ad451c35339f245863f..6da4ccde8516f11a68d3be6be69fade93604532e 100644 (file)
@@ -8,6 +8,8 @@
   $Id$
 */
 
+#include <TArrayI.h>
+
 #include "AliITSClusterFinder.h"
 #include "AliITSDetTypeRec.h"
 
index 9d6ab86fd37120f04f082ada5959e5bacd56785d..16a580589f891dfd57a5b1d73ac008e0ce36065b 100644 (file)
@@ -24,6 +24,7 @@
 #include "AliITSRecPoint.h"
 #include "AliITSdigitSPD.h"
 #include "AliITSsegmentationSPD.h"
+#include "AliITSgeom.h"
 #include "AliLog.h"
 
 //#define DEBUG
index f7224f82a08be3c769e935f9ed83df2ae63dc9e2..b818d81f62b62d899a45d6bf66b0e6477c1a1eb9 100644 (file)
@@ -32,7 +32,7 @@
 #include "AliITSclusterSSD.h"
 #include "AliITSpackageSSD.h"
 #include "AliITSsegmentationSSD.h"
-//#include "AliITSgeom.h"
+#include "AliITSgeom.h"
 #include "AliITSCalibrationSSD.h"
 #include "AliLog.h"
 
index 345dba92a9d7240a438a8dfb46e784a7902107b3..0239d6f0cc8b040a71548d178ef19217e0dd3c60 100644 (file)
@@ -37,6 +37,7 @@
 #include "AliITSClusterFinderSDD.h"
 #include "AliITSClusterFinderSSD.h"
 #include "AliITSDetTypeRec.h"
+#include "AliITSgeom.h"
 #include "AliITSRawCluster.h"
 #include "AliITSRawClusterSPD.h"
 #include "AliITSRawClusterSDD.h"
@@ -59,6 +60,7 @@ ClassImp(AliITSDetTypeRec)
 //________________________________________________________________
 AliITSDetTypeRec::AliITSDetTypeRec(): TObject(),
 fNMod(0),
+fITSgeom(0),
 fReconstruction(0),
 fSegmentation(0),
 fCalibration(0),
@@ -71,44 +73,6 @@ fNctype(0),
 fRecPoints(0),
 fNRecPoints(0),
 fSelectedVertexer(),
-fLoader(0),
-fRunNumber(0),
-fFirstcall(kTRUE){
-    // Default Constructor
-    // Inputs:
-    //    none.
-    // Outputs:
-    //    none.
-    // Return:
-    //    A properly zero-ed AliITSDetTypeRec class.
-
-  for(Int_t i=0; i<3; i++){
-    fClusterClassName[i]=0;
-    fDigClassName[i]=0;
-    fRecPointClassName[i]=0;
-  }
-
-  SelectVertexer(" ");
-
-
-}
-//________________________________________________________________
-AliITSDetTypeRec::AliITSDetTypeRec(AliITSLoader *loader): TObject(),
-fNMod(0),
-fReconstruction(0),
-fSegmentation(0),
-fCalibration(0),
-fPreProcess(0),
-fPostProcess(0),
-fDigits(0),
-fNdtype(0),
-fCtype(0),
-fNctype(0),
-fRecPoints(0),
-fNRecPoints(0),
-fSelectedVertexer(),
-fLoader(loader),
-fRunNumber(0),
 fFirstcall(kTRUE){
     // Standard Constructor
     // Inputs:
@@ -141,12 +105,12 @@ fFirstcall(kTRUE){
   }
   
   SelectVertexer(" "); 
-  SetRunNumber();
 }
 
 //______________________________________________________________________
 AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec & rec):TObject(rec),
 fNMod(rec.fNMod),
+fITSgeom(rec.fITSgeom),
 fReconstruction(rec.fReconstruction),
 fSegmentation(rec.fSegmentation),
 fCalibration(rec.fCalibration),
@@ -159,8 +123,6 @@ fNctype(rec.fNctype),
 fRecPoints(rec.fRecPoints),
 fNRecPoints(rec.fNRecPoints),
 fSelectedVertexer(rec.fSelectedVertexer),
-fLoader(rec.fLoader),
-fRunNumber(rec.fRunNumber),
 fFirstcall(rec.fFirstcall)
 {
 
@@ -179,7 +141,7 @@ AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& source){
 //_____________________________________________________________________
 AliITSDetTypeRec::~AliITSDetTypeRec(){
   //Destructor
+
   if(fReconstruction){
     fReconstruction->Delete();
     delete fReconstruction;
@@ -190,7 +152,7 @@ AliITSDetTypeRec::~AliITSDetTypeRec(){
     delete fSegmentation;
     fSegmentation = 0;
   }
-  if(fCalibration && fRunNumber<0){
+  if(fCalibration){
     AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()))->GetResponse();    
     AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSDD()))->GetResponse();
     AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD()))->GetResponse();
@@ -222,8 +184,9 @@ AliITSDetTypeRec::~AliITSDetTypeRec(){
   delete [] fNctype;
   delete [] fNdtype;
   delete [] fNMod;
-  //if(fLoader) delete fLoader; // MvL: Loader is not owned by this class; do not delete
   
+  if (fITSgeom) delete fITSgeom;
 }
 
 //___________________________________________________________________
@@ -296,16 +259,6 @@ AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){
   return (AliITSCalibration*)fCalibration->At(iMod);
 }
 
-//______________________________________________________________________
-void AliITSDetTypeRec::SetTreeAddress(){
-    // Set branch address for the Trees.
-  TTree *treeR = fLoader->TreeR();
-  TTree *treeD = fLoader->TreeD();
-  SetTreeAddressD(treeD);
-  SetTreeAddressR(treeR);
-}
 //______________________________________________________________________
 void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){
     // Set branch address for the tree of digits.
@@ -338,7 +291,7 @@ void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){
 TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree *tree, const char* name, 
                                        const char *classname, 
                                        void* address,Int_t size, 
-                                       Int_t splitlevel, const char */*file*/)
+                                       Int_t splitlevel)
 { 
 //
 // Makes branch in given tree and diverts them to a separate file
@@ -419,26 +372,22 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
     fFirstcall = kFALSE;
   }
 
-  SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun());
-  Int_t run=GetRunNumber();
+  //  SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun());
+  //  Int_t run=GetRunNumber();
 
-  Bool_t origCacheStatus = AliCDBManager::Instance()->GetCacheFlag();
-  Bool_t isCacheActive = kTRUE;
-  if(GetRunNumber()<0)isCacheActive=kFALSE;
+  Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
   if (fCalibration==0) {
     fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
-    fCalibration->SetOwner(isCacheActive);
+    fCalibration->SetOwner(!cacheStatus);
     fCalibration->Clear();
   }
 
-  AliCDBManager::Instance()->SetCacheFlag(isCacheActive);
-
-  AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSPD", run);
-  AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD", run);
-  AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD", run);
-  AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD", run);
-  AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD", run);
-  AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", run);
+  AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSPD");
+  AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
+  AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD");
+  AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD");
+  AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD");
+  AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD");
 
   if(!entrySPD || !entrySDD || !entrySSD || !entry2SPD || !entry2SDD || !entry2SSD){
     AliFatal("Calibration object retrieval failed! ");
@@ -446,31 +395,31 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
   }    
 
   TObjArray *calSPD = (TObjArray *)entrySPD->GetObject();
-  if(!isCacheActive)entrySPD->SetObject(NULL);
+  if(!cacheStatus)entrySPD->SetObject(NULL);
   entrySPD->SetOwner(kTRUE);
  
   AliITSresponseSPD *pSPD = (AliITSresponseSPD*)entry2SPD->GetObject();
-  if(!isCacheActive)entry2SPD->SetObject(NULL);
+  if(!cacheStatus)entry2SPD->SetObject(NULL);
   entry2SPD->SetOwner(kTRUE);
     
   TObjArray *calSDD = (TObjArray *)entrySDD->GetObject();
-  if(!isCacheActive)entrySDD->SetObject(NULL);
+  if(!cacheStatus)entrySDD->SetObject(NULL);
   entrySDD->SetOwner(kTRUE);
  
   AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject();
-  if(!isCacheActive)entry2SDD->SetObject(NULL);
+  if(!cacheStatus)entry2SDD->SetObject(NULL);
   entry2SDD->SetOwner(kTRUE);
 
   TObjArray *calSSD = (TObjArray *)entrySSD->GetObject();
-  if(!isCacheActive)entrySSD->SetObject(NULL);
+  if(!cacheStatus)entrySSD->SetObject(NULL);
   entrySSD->SetOwner(kTRUE);
 
   AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject();
-  if(!isCacheActive)entry2SSD->SetObject(NULL);
+  if(!cacheStatus)entry2SSD->SetObject(NULL);
   entry2SSD->SetOwner(kTRUE);
 
   // DB entries are deleted. In this way metadeta objects are deleted as well
-  if(!isCacheActive){
+  if(!cacheStatus){
     delete entrySPD;
     delete entrySDD;
     delete entrySSD;
@@ -479,8 +428,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
     delete entry2SSD;
   }
 
-  AliCDBManager::Instance()->SetCacheFlag(origCacheStatus);
-  
   if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!calSDD) || (!calSSD)) {
     AliWarning("Can not get calibration from calibration database !");
     return kFALSE;
@@ -526,9 +473,7 @@ void AliITSDetTypeRec::SetDefaultClusterFinders(){
 
   AliITSClusterFinder *clf; 
 
-  MakeTreeC();
- for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
+  for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
     //SPD
     if(dettype==0){
       if(!GetReconstructionModel(dettype)){
@@ -576,7 +521,6 @@ void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
 
   AliITSClusterFinder *clf; 
 
-  MakeTreeC();
   for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
     //SPD
     if(dettype==0){
@@ -613,7 +557,7 @@ void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
    
 }
 //______________________________________________________________________
-void AliITSDetTypeRec::MakeBranch(Option_t* option){
+void AliITSDetTypeRec::MakeBranch(TTree* tree, Option_t* option){
 
   //Creates branches for clusters and recpoints
   Bool_t cR = (strstr(option,"R")!=0);
@@ -621,100 +565,8 @@ void AliITSDetTypeRec::MakeBranch(Option_t* option){
   
   if(cRF)cR = kFALSE;
 
-  if(cR) MakeBranchR(0);
-  if(cRF) MakeBranchRF(0);
-
-}
-
-//_____________________________________________________________
-void AliITSDetTypeRec::MakeTreeC(){
-  
-  //Create a separate tree to store the clusters
-  if(!fLoader){
-    Warning("MakeTreeC","ITS loader is null!");
-    return;
-  }
-  if(fLoader->TreeC()== 0x0) fLoader->MakeTree("C");
-  MakeBranchC();
-}
-
-//______________________________________________________________
-void AliITSDetTypeRec::MakeBranchC(){
-  
-  //Make branches in the tree of clusters
-
-  if(!fLoader){
-    Warning("MakeBranchC","ITS loader is null!");
-    return;
-  }
-  TTree* lTC = fLoader->TreeC();
-  if(lTC==0x0){
-    Error("MakeTreeC","Can not get TreeC from loader");
-    return;
-  }
-  
-  Int_t buffersize = 4000;
-  Char_t branchname[30];
-  Char_t* cluclass;
-  const char *det[4]={"SPD","SDD","SSD","ITS"};
-
-  for(Int_t i=0;i<fgkNdettypes;i++){
-    cluclass = GetClusterClassName(i);
-    if(fCtype==0x0)  fCtype = new TObjArray(fgkNdettypes);
-    if(!ClustersAddress(i)){
-      fCtype->AddAt(new TClonesArray(cluclass,1000),i);
-    }
-    if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
-    else sprintf(branchname,"%sClusters%d",det[3],i+1);
-    if(fCtype && lTC){
-      if(lTC->GetBranch(branchname)){
-       Warning("MakeBranchC","Branch %s already exists in TreeC",branchname);
-      } else{
-       Info("MakeBranchC","Creating branch %s in TreeC",branchname);
-       lTC->Branch(branchname,&((*fCtype)[i]),buffersize);
-      }
-    }
-
-  }
-  
-}
-
-//_______________________________________________________________
-void AliITSDetTypeRec::GetTreeC(Int_t event){
-  
-  //Get the clusters tree for this event and
-  //sets the branch address
-
-
-  if(!fLoader){
-    Warning("GetTreeC","ITS loader is null!");
-    return;
-  }
-  
-  Char_t branchname[30];
-  const char *det[4] = {"SPD","SDD","SSD","ITS"};
-  TTree* lTC = fLoader->TreeC();
-  
-  ResetClusters();
-  if(lTC) fLoader->CleanRawClusters();
-
-  TBranch* branch;
-  if(lTC){
-    Char_t* cluclass;
-    for(Int_t i=0;i<fgkNdettypes;i++){
-      cluclass = GetClusterClassName(i);
-      if(fCtype==0x0) fCtype = new TObjArray(fgkNdettypes);
-      if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(cluclass,1000),i);
-      if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
-      else sprintf(branchname,"%sClusters%d",det[3],i+1);
-      if(fCtype){
-       branch = lTC->GetBranch(branchname);
-       if(branch) branch->SetAddress(&((*fCtype)[i]));
-      }
-    }
-  } else{
-    Error("GetTreeC","cannot find clusters Tree for vent %d",event);
-  }
+  if(cR) MakeBranchR(tree);
+  if(cRF) MakeBranchRF(tree);
 
 }
 
@@ -771,7 +623,7 @@ void AliITSDetTypeRec::ResetClusters(Int_t i){
   if (fNctype)  fNctype[i]=0;
 }
 //__________________________________________________________________
-void AliITSDetTypeRec::MakeBranchR(const char *file, Option_t *opt){
+void AliITSDetTypeRec::MakeBranchR(TTree *treeR, Option_t *opt){
 
   //Creates tree branches for recpoints
   // Inputs:
@@ -779,11 +631,6 @@ void AliITSDetTypeRec::MakeBranchR(const char *file, Option_t *opt){
   //                       to. If blank it write the SDigits to the same
   //                       file in which the Hits were found.
 
-  if(!fLoader){
-    Warning("MakeBranchR","ITS loader is null!");
-    return;
-  }
-
   Int_t buffsz = 4000;
   char branchname[30];
 
@@ -800,13 +647,8 @@ void AliITSDetTypeRec::MakeBranchR(const char *file, Option_t *opt){
   }
   
   if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
-  if (fLoader->TreeR()) {
-    if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",
-                                                     1000);
-    MakeBranchInTree(fLoader->TreeR(),branchname,0,&fRecPoints,buffsz,99,file);
-  } // end if
-
-  
+  if (treeR)
+    MakeBranchInTree(treeR,branchname,0,&fRecPoints,buffsz,99);
 }
 //______________________________________________________________________
 void AliITSDetTypeRec::SetTreeAddressR(TTree *treeR){
@@ -852,28 +694,20 @@ void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){
 }
 
 //______________________________________________________________________
-void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt, Bool_t v2){
+void AliITSDetTypeRec::DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastentry,Option_t *opt, Bool_t v2){
   // cluster finding and reconstruction of space points
   // the condition below will disappear when the geom class will be
   // initialized for all versions - for the moment it is only for v5 !
   // 7 is the SDD beam test version
   // Inputs:
-  //      Int_t evNumber   Event number to be processed.
+  //      TTree *treeD     Digits tree
+  //      TTree *treeR     Clusters tree
   //      Int_t lastentry  Offset for module when not all of the modules
   //                       are processed.
   //      Option_t *opt    String indicating which ITS sub-detectors should
   //                       be processed. If ="All" then all of the ITS
   //                       sub detectors are processed.
 
-  if(!GetITSgeom()){
-    Warning("DigitsToRecPoints","Null pointer to AliITSgeom !");
-    return;
-  }
-  if(!fLoader){
-    Warning("DigitsToRecPoints","ITS loader is null!");
-    return;
-  }
-
   const char *all = strstr(opt,"All");
   const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
                         strstr(opt,"SSD")};
@@ -886,10 +720,6 @@ void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t
     AliInfo("V2 cluster finder has been selected \n");
   }
 
-  TTree *treeC=fLoader->TreeC();
-  if(!treeC){
-    MakeTreeC();
-  }
   AliITSClusterFinder *rec     = 0;
   Int_t id,module,first=0;
   for(module=0;module<GetITSgeom()->GetIndexMax();module++){
@@ -898,70 +728,44 @@ void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t
       if(det[id]) first = GetITSgeom()->GetStartDet(id);
       rec = (AliITSClusterFinder*)GetReconstructionModel(id);
       TClonesArray *itsDigits  = DigitsAddress(id);
-      if (!rec) {
-          Error("DigitsToRecPoints",
-                "The reconstruction class was not instanciated! event=%d",
-                evNumber);
-          exit(1);
-      } 
+      if (!rec)
+          AliFatal("The reconstruction class was not instanciated!");
       ResetDigits();  // MvL: Not sure we neeed this when rereading anyways
-      TTree *lTD = fLoader->TreeD();
       if (all) {
-          lTD->GetEvent(lastentry+module);
+          treeD->GetEvent(lastentry+module);
       }else {
-          lTD->GetEvent(lastentry+(module-first));
+          treeD->GetEvent(lastentry+(module-first));
       }
       Int_t ndigits = itsDigits->GetEntriesFast();
       if(ndigits>0){
        rec->SetDetTypeRec(this);
        rec->SetDigits(DigitsAddress(id));
-       rec->SetClusters(ClustersAddress(id));
+       //      rec->SetClusters(ClustersAddress(id));
        rec->FindRawClusters(module);
       } // end if
-      fLoader->TreeR()->Fill();
+      treeR->Fill();
       ResetRecPoints();
-      treeC->Fill();
       ResetClusters();
   } 
-      
-  fLoader->WriteRecPoints("OVERWRITE");
-  fLoader->WriteRawClusters("OVERWRITE");
-  fLoader->CleanRawClusters();
 }
 //______________________________________________________________________
-void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
+void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR){
   // cluster finding and reconstruction of space points
   // the condition below will disappear when the geom class will be
   // initialized for all versions - for the moment it is only for v5 !
   // 7 is the SDD beam test version
   // Inputs:
-  //      Int_t evNumber   Event number to be processed.
-  //      Int_t lastentry  Offset for module when not all of the modules
-  //                       are processed.
-  //      Option_t *opt    String indicating which ITS sub-detectors should
-  //                       be processed. If ="All" then all of the ITS
-  //                       sub detectors are processed.
+  //      AliRawReader *rawReader  Pointer to the raw-data reader
+  //      TTree *treeR             Clusters tree
   // Outputs:
   //      none.
   // Return:
   //      none.
-  if(!GetITSgeom()){
-    Warning("DigitsToRecPoints","Null pointer to AliITSgeom !");
-    return;
-  }
-  if(!fLoader){
-    Warning("DigitsToRecPoints","ITS loader is null!");
-    return;
-  }
-
-  
   AliITSClusterFinderV2 *rec     = 0;
   Int_t id=0;
 
-  if(!fLoader->TreeR()) fLoader->MakeTree("R");
-  TTree* cTree = fLoader->TreeR();
   TClonesArray *array=new TClonesArray("AliITSRecPoint",1000);
-  cTree->Branch("ITSRecPoints",&array);
+  TBranch *branch = treeR->Branch("ITSRecPoints",&array);
   delete array;
  
   TClonesArray** clusters = new TClonesArray*[GetITSgeom()->GetIndexMax()]; 
@@ -970,10 +774,9 @@ void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
   }
   for(id=0;id<3;id++){
     rec = (AliITSClusterFinderV2*)GetReconstructionModel(id);
-    rec->SetDetTypeRec(this);
     if (!rec)
       AliFatal("The reconstruction class was not instanciated");
-
+    rec->SetDetTypeRec(this);
     rec->RawdataToClusters(rawReader,clusters);    
   } 
   Int_t nClusters =0;
@@ -984,8 +787,8 @@ void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
       AliDebug(1,Form("data for module %d missing!",iModule));
       array = emptyArray;
     }
-    cTree->SetBranchAddress("ITSRecPoints",&array);
-    cTree->Fill();
+    branch->SetAddress(&array);
+    treeR->Fill();
     nClusters+=array->GetEntriesFast();
 
     if (array != emptyArray) {
@@ -995,8 +798,6 @@ void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
   }
   delete emptyArray;
 
-  fLoader->WriteRecPoints("OVERWRITE");
-
   delete[] clusters;
   Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n", 
        nClusters);
index 074aba50d11c1125358bf96001fa70c90f38cb31..d95a7a0cebba36334cdd758fce13003db1aed51d 100644 (file)
@@ -15,8 +15,11 @@ $Id$
 #include <TObjArray.h>
 #include <TClonesArray.h>
 
-#include "AliITSLoader.h"
-#include "AliRunLoader.h"
+class TTree;
+class TBranch;
+
+//#include "AliITSLoader.h"
+//#include "AliRunLoader.h"
 
 class AliITSsegmentation;
 class AliITSCalibration;
@@ -30,17 +33,15 @@ class AliITSgeom;
 class AliITSDetTypeRec : public TObject {
   public:
     AliITSDetTypeRec(); // Default constructor
-    AliITSDetTypeRec(AliITSLoader *loader); // Standard constructor
  
     virtual ~AliITSDetTypeRec(); // Proper Destructor
-    AliITSgeom* GetITSgeom()const{return GetLoader()->GetITSgeom();}
 
-    AliITSLoader* GetLoader() const {return fLoader;}
+    virtual AliITSgeom* GetITSgeom() const { return fITSgeom; }
+    virtual void SetITSgeom(AliITSgeom *geom) { fITSgeom = geom; }
     virtual void SetDefaults();
     virtual void SetDefaultClusterFinders();
     virtual void SetDefaultClusterFindersV2(Bool_t rawdata=kFALSE);
-    virtual void MakeBranch(Option_t *opt);
-    virtual void SetTreeAddress();
+    virtual void MakeBranch(TTree *tree,Option_t *opt);
     virtual void SetTreeAddressD(TTree* treeD);
 
     virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
@@ -67,13 +68,10 @@ class AliITSDetTypeRec : public TObject {
     TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
     virtual void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;}
     //
-    virtual void MakeTreeC();
-    virtual void GetTreeC(Int_t event);
     virtual void AddCluster(Int_t branch, AliITSRawCluster *c);
     virtual void ResetClusters(); 
     virtual void ResetClusters(Int_t branch);
-    virtual void MakeBranchC();
-    TBranch* MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel, const char */*file*/);
+    TBranch* MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel);
 
     TObjArray    *Ctype()  {return fCtype;}
     Int_t        *Nctype() {return fNctype;}
@@ -81,35 +79,30 @@ class AliITSDetTypeRec : public TObject {
     virtual void ResetDigits();
     virtual void ResetDigits(Int_t branch);
 
-    void MakeBranchR(const char *file, Option_t *opt=" ");
+    void MakeBranchR(TTree *treeR,Option_t *opt=" ");
     void SetTreeAddressR(TTree *treeR);
     void AddRecPoint(const AliITSRecPoint &p);
     void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
     // Return pointer to rec points 
     TClonesArray  *RecPoints()   {return fRecPoints;}
-    void MakeBranchRF(const char *file){MakeBranchR(file,"Fast");}
-    //    void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
-    //             Option_t *add, Option_t *det, const char *filename);
-    void Digits2Reco(){
-        DigitsToRecPoints(fLoader->GetRunLoader()->GetEventNumber(),0,"All");}
-    void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det,Bool_t v2=kFALSE);
-    void DigitsToRecPoints(AliRawReader* rawReader);
-
-    virtual void SetRunNumber(Int_t rn=0){fRunNumber = rn;}
-    virtual Int_t GetRunNumber() const {return fRunNumber;}
+    void MakeBranchRF(TTree *treeR){MakeBranchR(treeR,"Fast");}
+    void DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastEntry,Option_t *det,Bool_t v2=kFALSE);
+    void DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR);
 
   private:
     // private methods
     AliITSDetTypeRec(const AliITSDetTypeRec& rec);
     AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
  
-    virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
+    //    virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
     static const Int_t fgkNdettypes;          // number of det. types
     static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
     static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
     static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
     Int_t *fNMod;     // numbers of modules from different types
 
+    AliITSgeom   *fITSgeom;       //! ITS geometry
+
     TObjArray    *fReconstruction;//! [NDet]
     TObjArray    *fSegmentation;  //! [NDet]
     TObjArray    *fCalibration;   //! [NMod]
@@ -128,11 +121,9 @@ class AliITSDetTypeRec : public TObject {
     Int_t         fNRecPoints; // Number of rec points
 
     TString fSelectedVertexer; // Vertexer selected in CreateVertexer
-    AliITSLoader* fLoader;     //! ITS loader
-    Int_t         fRunNumber;  //! run number (to access DB)
     Bool_t fFirstcall;         //! flag
 
-    ClassDef(AliITSDetTypeRec,6) // ITS Reconstruction structure
+    ClassDef(AliITSDetTypeRec,7) // ITS Reconstruction structure
 };
 
 #endif
index 6bb9f5aae302579a7a0deb252aa8e3c65a145eda..1ea82428b18d88d6948c8ce5a08eab3f4a5440b8 100644 (file)
@@ -15,6 +15,8 @@
 class TObjArray;
 class TCanvas;
 
+#include <TTree.h>
+
 #include "AliITSNeuralPoint.h"
 
 class AliITSNeuralTracker : public TObject {
@@ -179,7 +181,7 @@ public:
        Bool_t   Update();                     // an updating cycle
        void     CleanNetwork();               // removes deactivated units and resolves competitions
        Int_t    Save(Int_t sectoridx);        // save found tracks for # sector
-       TTree*   GetChains()                   {return fChains;}
+       TTree*   GetChains() const             {return fChains;}
        void     WriteChains()                 {fChains->Write();}
 
 private:
index b16f7e354fa076ce7b99c693a309200835aaaa4f..ede20b82ba70d92ab66afbca09f4983221e6d426 100644 (file)
@@ -27,6 +27,7 @@
 #include "AliRunLoader.h"
 #include "AliRawReader.h"
 #include "AliITSDetTypeRec.h"
+#include "AliITSgeom.h"
 #include "AliITSLoader.h"
 #include "AliITStrackerMI.h"
 #include "AliITStrackerV2.h"
@@ -49,7 +50,8 @@ AliITSRecoParam *AliITSReconstructor::fgkRecoParam =0;  // reconstruction parame
 
 //___________________________________________________________________________
 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
-fItsPID(0)
+fItsPID(0),
+fDetTypeRec(0)
 {
   // Default constructor
   if (!fgkRecoParam) {
@@ -62,10 +64,13 @@ AliITSReconstructor::~AliITSReconstructor(){
 // destructor
   delete fItsPID;
   if(fgkRecoParam) delete fgkRecoParam;
+  if(fDetTypeRec) delete fDetTypeRec;
 } 
 //______________________________________________________________________
 AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
-                                                                        fItsPID(ob.fItsPID)
+                                                                        fItsPID(ob.fItsPID),
+                                                                        fDetTypeRec(ob.fDetTypeRec)
+
 {
   // Copy constructor
 }
@@ -77,8 +82,9 @@ AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor&
   new(this) AliITSReconstructor(ob);
   return *this;
 }
+
 //______________________________________________________________________
-void AliITSReconstructor::Init(AliRunLoader *runLoader) const{
+void AliITSReconstructor::Init(AliRunLoader */*runLoader*/) {
     // Initalize this constructor bet getting/creating the objects
     // nesseary for a proper ITS reconstruction.
     // Inputs:
@@ -93,83 +99,36 @@ void AliITSReconstructor::Init(AliRunLoader *runLoader) const{
     AliITSInitGeometry initgeom;
     AliITSgeom *geom = initgeom.CreateAliITSgeom();
     AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
-    AliITSLoader* loader = static_cast<AliITSLoader*>
-       (runLoader->GetLoader("ITSLoader"));
-    if (!loader) {
-       Error("Init", "ITS loader not found");
-       return;
-    }
-    loader->SetITSgeom(geom);
+
+    fDetTypeRec = new AliITSDetTypeRec();
+    fDetTypeRec->SetITSgeom(geom);
+    fDetTypeRec->SetDefaults();
+    
     return;
 }
+
 //_____________________________________________________________________________
-void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
+void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
 {
 // reconstruct clusters
 
-
-  AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
-  if (!loader) {
-    Error("Reconstruct", "ITS loader not found");
-    return;
-  }
-  AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
-  rec->SetDefaults();
-
-  loader->LoadRecPoints("recreate");
-  loader->LoadDigits("read");
-  runLoader->LoadKinematics();
   TString option = GetOption();
   Bool_t clusfinder=kTRUE;   // Default: V2 cluster finder
   if(option.Contains("OrigCF"))clusfinder=kFALSE;
 
-  Int_t nEvents = runLoader->GetNumberOfEvents();
-
-  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
-    runLoader->GetEvent(iEvent);
-    if(loader->TreeR()==0x0) loader->MakeTree("R");
-    rec->MakeBranch("R");
-    rec->SetTreeAddress();
-    rec->DigitsToRecPoints(iEvent,0,"All",clusfinder);    
-  }
-
-  loader->UnloadRecPoints();
-  loader->UnloadDigits();
-  loader->UnloadRawClusters();
-  runLoader->UnloadKinematics();
-  delete rec;
+  fDetTypeRec->SetTreeAddressD(digitsTree);
+  fDetTypeRec->MakeBranch(clustersTree,"R");
+  fDetTypeRec->SetTreeAddressR(clustersTree);
+  fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",clusfinder);    
 }
 
 //_________________________________________________________________
-void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader, 
-                                      AliRawReader* rawReader) const
+void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
 {
-// reconstruct clusters
-
+  // reconstruct clusters from raw data
  
-  AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
-  if (!loader) {
-    Error("Reconstruct", "ITS loader not found");
-    return;
-  }
-
-  AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
-  rec->SetDefaults();
-  rec->SetDefaultClusterFindersV2(kTRUE);
-
-  loader->LoadRecPoints("recreate");
-
-  Int_t iEvent = 0;
-
-  while(rawReader->NextEvent()) {
-    runLoader->GetEvent(iEvent++);
-    if(loader->TreeR()==0x0) loader->MakeTree("R");
-    rec->DigitsToRecPoints(rawReader);
-  }
-
-  loader->UnloadRecPoints();
-  loader->UnloadRawClusters();
-  delete rec;
+  fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
+  fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
 }
 
 //_____________________________________________________________________________
@@ -262,24 +221,3 @@ void AliITSReconstructor::FillESD(AliRunLoader* runLoader,
     Error("FillESD","!! cannot do the PID !!\n");
   }
 }
-
-
-//_____________________________________________________________________________
-AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
-{
-// get the ITS geometry
-
-  if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
-  if (!runLoader->GetAliRun()) {
-    Error("GetITSgeom", "couldn't get AliRun object");
-    return NULL;
-  }
-  AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
-  AliITSgeom* geom = (AliITSgeom*)loader->GetITSgeom();
-  if(!geom){
-    Error("GetITSgeom","no ITS geometry available");
-    return NULL;
-  }
-  
-  return geom;
-}
index 4f1bce757b2af268966a13d3825407465944762b..99ab8ed3c02dedafd76b409df45ba95c2fede38d 100644 (file)
 #include "AliITSRecoParam.h"
 
 class AliITSgeom;
-class AliLoader;
 class AliTracker;
 class AliITStrackerMI;
 class AliITSpidESD;
+class AliITSDetTypeRec;
 
 class AliITSReconstructor: public AliReconstructor {
 public:
@@ -25,15 +25,17 @@ public:
   virtual ~AliITSReconstructor();
   AliITSReconstructor(const AliITSReconstructor &ob); // copy constructor
   AliITSReconstructor& operator=(const AliITSReconstructor & ob); // ass. op.
-  virtual void Init(AliRunLoader* runLoader) const;
+  virtual void Init(AliRunLoader* runLoader);
   
-  virtual void         Reconstruct(AliRunLoader* runLoader) const;
+  virtual Bool_t       HasLocalReconstruction() const {return kTRUE;};
+
+  virtual void         Reconstruct(AliRunLoader* runLoader) const
+    {AliReconstructor::Reconstruct(runLoader);}
   virtual void         Reconstruct(AliRunLoader* runLoader,
-                                  AliRawReader* rawReader) const;
-  virtual void         Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const 
-    {AliReconstructor::Reconstruct(rawReader,clustersTree);}
-  virtual void         Reconstruct(TTree* digitsTree, TTree* clustersTree) const 
-    {AliReconstructor::Reconstruct(digitsTree, clustersTree);}
+                                  AliRawReader* rawReader) const
+    {AliReconstructor::Reconstruct(runLoader,rawReader);}
+  virtual void         Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const;
+  virtual void         Reconstruct(TTree* digitsTree, TTree* clustersTree) const;
 
   virtual AliTracker*  CreateTracker(AliRunLoader* runLoader) const;
   virtual AliVertexer* CreateVertexer(AliRunLoader* runLoader) const;
@@ -53,12 +55,11 @@ public:
   static const AliITSRecoParam* GetRecoParam(){ return fgkRecoParam;}
 
 private:
-  // methods
-  AliITSgeom*          GetITSgeom(AliRunLoader* runLoader) const;
   //data
-  static AliITSRecoParam *   fgkRecoParam; // reconstruction parameters
-  AliITSpidESD *fItsPID; //Pid for ITS
-  ClassDef(AliITSReconstructor, 1)   // class for the ITS reconstruction
+  static AliITSRecoParam *fgkRecoParam; // reconstruction parameters
+  AliITSpidESD           *fItsPID;      // Pid for ITS
+  AliITSDetTypeRec       *fDetTypeRec;  // reconstructor
+  ClassDef(AliITSReconstructor, 2)   // class for the ITS reconstruction
 };
 
 #endif
index 8aa4b5c0e24976278c17aedf6d0885c9469bc89c..4539c6049b2193f3298eb4cb6355dc4d2ba1526b 100644 (file)
@@ -9,7 +9,7 @@
 //                                                               //
 ///////////////////////////////////////////////////////////////////
 
-class AliVertex;
+#include "AliVertex.h"
 class TClonesArray;
 
 class AliITSVertexer3D : public AliITSVertexer {
index dfd8176af57a02044489f529ae8a228d2ef0d441..eef9f19ac0a93bf7ceba306f2680256529835a11 100644 (file)
@@ -1,3 +1,4 @@
+#include "AliRunLoader.h"
 #include "AliITSDetTypeRec.h"
 #include "AliITSVertexerIons.h"
 #include "AliITSVertexerZ.h"
index c15db2bfa0ca2d7c0b5630745b14dde018ce8641..d0e17532d20fd11aae6f1e2d2608190fdbf5fcb6 100644 (file)
@@ -18,6 +18,7 @@
 #include<TH1.h>
 #include <TString.h>
 #include<TTree.h>
+#include "AliRunLoader.h"
 #include "AliITSLoader.h"
 #include "AliITSgeomTGeo.h"
 #include "AliITSDetTypeRec.h"
index 15d833aa99a07cade2cbbee84fdef63017d425f0..79b69e71c4a1e993cd83fd3a203153341e90cf26 100644 (file)
@@ -161,7 +161,8 @@ Bool_t AliITSreconstruction::Init(){
     //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;
@@ -171,13 +172,10 @@ Bool_t AliITSreconstruction::Init(){
 
     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();
@@ -278,13 +276,9 @@ void AliITSreconstruction::Exec(const Option_t *opt){
       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
 }
 //______________________________________________________________________ 
index d1d53a8efeef35beb821e3f1191e3894b0397e7d..e61e718a18106d0c842281efd8ea67a993532d8f 100644 (file)
@@ -15,6 +15,7 @@
 #include <TTask.h>
 
 class AliRunLoader;
+class AliITSLoader;
 class TString;
 
 class AliITSreconstruction : public TTask{
index 8d5b59e898d5897e8d27faec59328874038630ac..f0d810bb18a50d5abd3cbb76d4aae2ae33b36173 100644 (file)
@@ -1482,6 +1482,10 @@ Bool_t AliReconstruction::InitRunLoader()
       return kFALSE;
     }
 
+    //PH This is a temporary fix to give access to the kinematics
+    //PH that is needed for the labels of ITS clusters
+    fRunLoader->LoadKinematics();
+
   } else {               // galice.root does not exist
     if (!fRawReader) {
       AliError(Form("the file %s does not exist", fGAliceFileName.Data()));