]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New ESD structure (Andrea)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Jul 2007 14:46:35 +0000 (14:46 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Jul 2007 14:46:35 +0000 (14:46 +0000)
STEER/AliVertexerTracksTest.C
TPC/AliBarrelRec_TPCparam.C
TPC/AliTPCtrackerParam.cxx
TPC/AliTPCtrackerParam.h

index 2ff42385b716cee4c19186fc5d1ae9dc9dac3600..41093ef037107f5fc59d6ef9c9492c56b9b1a8f4 100644 (file)
@@ -107,10 +107,10 @@ void AliVertexerTracksTest(Double_t nSigma=3.,
     return;
   }
   TFile *fin = TFile::Open("AliESDs.root");
+  AliESDEvent *esd = new AliESDEvent();
   TTree *esdTree = (TTree*)fin->Get("esdTree");
   if(!esdTree) return;
-  AliESD *esd = 0;
-  esdTree->SetBranchAddress("ESD",&esd);
+  esd->ReadFromTree(esdTree);
   Int_t events = esdTree->GetEntries();
   printf("Number of events in ESD tree: %d\n",events);
 
@@ -325,10 +325,10 @@ void VertexForOneEvent(Int_t iev=0,
     return;
   }
   TFile *fin = TFile::Open("AliESDs.root");
+  AliESDEvent *esd = new AliESDEvent();
   TTree *esdTree = (TTree*)fin->Get("esdTree");
   if(!esdTree) return;
-  AliESD *esd = 0;
-  esdTree->SetBranchAddress("ESD",&esd);
+  esd->ReadFromTree(esdTree);
 
   TArrayF o;
 
@@ -1432,10 +1432,10 @@ void TestRmTracks(Int_t iev=0) {
     return;
   }
   TFile *fin = TFile::Open("AliESDs.root");
+  AliESDEvent *esd = new AliESDEvent();
   TTree *esdTree = (TTree*)fin->Get("esdTree");
   if(!esdTree) return;
-  AliESD *esd = 0;
-  esdTree->SetBranchAddress("ESD",&esd);
+  esd->ReadFromTree(esdTree);
 
   TArrayF o;
 
@@ -1514,7 +1514,7 @@ void AliComputeVtxMeanFromESD(TString file="AliESDs.root",
 
   Double_t vtx[3],covvtx[6];
   TTree *esdTree = 0;
-  AliESD *esd = 0;
+  AliESDEvent *esd = new AliESDEvent();
   AliESDVertex *vertex = 0;
   TString vtitle;
   Int_t nc,events,total=0;
@@ -1560,7 +1560,7 @@ void AliComputeVtxMeanFromESD(TString file="AliESDs.root",
     TFile *fin = TFile::Open(inname.Data());
     esdTree = (TTree*)fin->Get("esdTree");
     if(!esdTree) continue;
-    esdTree->SetBranchAddress("ESD",&esd);
+    esd->ReadFromTree(esdTree);
     events = esdTree->GetEntries();
     printf("Number of events in ESD tree: %d\n",events);
     total += events;
@@ -1617,7 +1617,7 @@ void AliComputeVtxMeanFromESD(TString file="AliESDs.root",
     TFile *fin = TFile::Open(inname.Data());
     esdTree = (TTree*)fin->Get("esdTree");
     if(!esdTree) continue;
-    esdTree->SetBranchAddress("ESD",&esd);
+    esd->ReadFromTree(esdTree);
     events = esdTree->GetEntries();
     for(Int_t iev=0; iev<events; iev++) { //LOOP ON EVENTS
       esdTree->GetEvent(iev);
index bffb9f47276f426f894fa813a3c14557d9397812..5bf2da2118594b1a012cc9856c7b2311f6aabddd 100644 (file)
@@ -13,10 +13,11 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
   // A. Dainese - INFN Legnaro
   //
 
+
   Int_t  collcode = 1; // pp collisions
   Bool_t useMeanVtx = kFALSE;
   
-  TGeoManager::Import("geometry.root");
+  AliGeomManager::LoadGeometry("geometry.root");
   
   if (gAlice) {
     delete gAlice->GetRunLoader();
@@ -67,18 +68,13 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
   }
   itsl->LoadRecPoints("read");
   
-  AliITS *dITS = (AliITS*)gAlice->GetDetector("ITS");
-  if (!dITS) {
-    cerr<<"Cannot find the ITS detector !"<<endl;
-    return;
-  }
-  AliITSgeom *geom = dITS->GetITSgeom();
+  AliITSRecoParam * itsRecoParam = AliITSRecoParam::GetLowFluxParam();
+  AliITSReconstructor::SetRecoParam(itsRecoParam);
   
   // Instance of the ITS tracker
-  AliITStrackerSA itsTracker(geom);
+  AliITStrackerSA itsTracker(0);
   Int_t ITSclusters[6] = {1,1,1,1,1,1};
-  itsTracker.SetLayersNotToSkip(ITSclusters);
-  
+  itsTracker.SetLayersNotToSkip(ITSclusters);  
   
   // Primary vertex reconstruction in pp
   AliESDVertex *initVertex = 0;
@@ -93,7 +89,7 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
   }
   invtx->Close();
   delete invtx;
-  AliVertexerTracks *vertexer = new AliVertexerTracks();
+  AliVertexerTracks *vertexer = new AliVertexerTracks(AliTracker::GetBz());
   vertexer->SetVtxStart(initVertex);
   vertexer->SetDebug(0);
   delete initVertex;
@@ -101,8 +97,10 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
   
   /***** The TREE for ESD is born *****/
   TTree *esdTree=new TTree("esdTree","Tree with ESD objects");
-  AliESD *event=0; AliESD *eventTPCin=0;
-  esdTree->Branch("ESD","AliESD",&event);
+  AliESDEvent *event=0; AliESDEvent *eventTPCin=0;
+  event = new AliESDEvent();
+  event->CreateStdContent();
+  event->WriteToTree(esdTree);
   
   if(firstEvent>rl->GetNumberOfEvents()) firstEvent=rl->GetNumberOfEvents()-1;
   if(lastEvent>rl->GetNumberOfEvents())  lastEvent=rl->GetNumberOfEvents()-1;
@@ -121,9 +119,9 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
   for(Int_t i=firstEvent; i<=lastEvent; i++) { 
     
     cout<<" Processing event number : "<<i<<endl;
-    AliESD *event = new AliESD(); 
+    //AliESDEvent *event = new AliESDEvent(); 
     event->SetRunNumber(gAlice->GetRunNumber());
-    event->SetEventNumber(i);
+    event->SetEventNumberInFile(i);
     event->SetMagneticField(gAlice->Field()->SolenoidField());
     rl->GetEvent(i);
 
@@ -131,7 +129,7 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
     sprintf(zver,"Event%d/Vertex",i);
     vertexSPD = (AliESDVertex*)ppZ->Get(zver);
     if(!vertexSPD) {
-      esdTree->Fill(); delete event;
+      esdTree->Fill(); event->Reset();
       continue;
     }      
     event->SetVertex(vertexSPD);
@@ -141,7 +139,7 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
     //***** TPC tracking
     if ( (trc=tpcTrackerPar.BuildTPCtracks(event)) ) {
       printf("exiting TPC tracker with code %d in event %d\n",trc,i);
-      esdTree->Fill(); delete event;
+      esdTree->Fill(); event->Reset();
       continue;
     }
 
@@ -150,17 +148,18 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
 
     //***** ITS tracking
     itsTracker.AliTracker::SetVertex(vtx,sigmavtx);
+    //    itsl->LoadRecPoints("read");
     TTree *itsTree=itsl->TreeR();
     if (!itsTree) {
       cerr<<"Can't get the ITS cluster tree !\n";
-      esdTree->Fill(); delete event;
+      esdTree->Fill(); event->Reset();
       return;
     }     
     itsTracker.UnloadClusters();
     itsTracker.LoadClusters(itsTree);
     if ( (trc=itsTracker.Clusters2Tracks(event)) ) {
       printf("exiting ITS tracker with code %d in event %d\n",trc,i);
-      esdTree->Fill(); delete event;
+      esdTree->Fill(); event->Reset();
       continue;
     }
 
@@ -181,7 +180,7 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
     }
     
     esdTree->Fill();
-    delete event;
+    event->Reset();
 
   }//<-----------------------------------The Loop over events ends here
   timer.Stop(); timer.Print();
@@ -201,7 +200,7 @@ void AliBarrelRec_TPCparam(Int_t firstEvent=0,Int_t lastEvent=0) {
   return;
 }
 //--------------------------------------------------------------------------
-void BackToTPCInnerWall(AliESD *event,AliESD *eventTPC) {
+void BackToTPCInnerWall(AliESDEvent *event,AliESDEvent *eventTPC) {
 
   Int_t ntracks = eventTPC->GetNumberOfTracks();
   AliESDtrack *esdTrackTPC = 0;
index 5221a5c9bf2bb98de6f89cf205706e8883ea87d7..e511861cf87dba1fa62555ba446ec33a977e1e10 100644 (file)
@@ -293,7 +293,7 @@ Int_t AliTPCtrackerParam::Init() {
   return 0;
 }
 //-----------------------------------------------------------------------------
-Int_t AliTPCtrackerParam::BuildTPCtracks(AliESD *event) {
+Int_t AliTPCtrackerParam::BuildTPCtracks(AliESDEvent *event) {
 //-----------------------------------------------------------------------------
 // This function creates the TPC parameterized tracks and writes them
 // as AliESDtrack objects in the ESD event
index 0b8be8ab34c50d6aef62ca08dd7f08c6f17ae227..340579a6f6d0b9cdd4cf407fefbef8b7e2d57cc5 100644 (file)
@@ -30,7 +30,7 @@ class TTree;
 #include "AliConfig.h"
 #include "AliTPCkineGrid.h"
 #include "AliTPCtrack.h"
-#include "AliESD.h"
+#include "AliESDEvent.h"
 //----------------------------
 
 class AliTPC;
@@ -49,7 +49,7 @@ class AliTPCtrackerParam:
   AliTPCtrackerParam(const AliTPCtrackerParam& p);
   //
   Int_t Init();
-  Int_t BuildTPCtracks(AliESD* event);
+  Int_t BuildTPCtracks(AliESDEvent* event);
   // these functions are used to create a DB of cov. matrices,
   // including regularization, efficiencies and dE/dx
   void  AllGeantTracks() { fSelAndSmear=kFALSE; return; }