]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/AliITSUpgradeReconstructor.cxx
Major Changes to comply with the modifications in Alireconstruction (->still private).
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUpgradeReconstructor.cxx
CommitLineData
1d9af2d5 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18//.
19// ITSupgrade base class to reconstruct an event
20//.
21//.
22//.
23#include "TObjArray.h"
24#include "TTree.h"
25#include "AliITSRecPoint.h"
26#include "AliITSReconstructor.h"
27#include "AliITSupgrade.h"
28#include "AliITSUpgradeReconstructor.h" //class header
29#include "AliITSDetTypeRec.h"
30#include "AliITS.h" //Reconstruct()
31#include "AliCDBEntry.h" //ctor
32#include "AliCDBManager.h" //ctor
33#include "AliESDEvent.h" //FillEsd()
34#include "AliRawReader.h" //Reconstruct() for raw digits
35#include "AliRun.h"
36#include "AliLog.h" //
37#include "AliITSRawStream.h" //ConvertDigits()
38#include "AliRunLoader.h"
39#include "AliDataLoader.h"
40#include "AliITSLoader.h"
41#include "AliITSsegmentationUpgrade.h"
42#include "AliITSUpgradeClusterFinder.h"
43#include "AliITStrackerUpgrade.h"
44#include "AliStack.h"
45#include "TFile.h"
46#include "TNtupleD.h"
47ClassImp(AliITSUpgradeReconstructor)
48
49//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
50 AliITSUpgradeReconstructor::AliITSUpgradeReconstructor():
6ea6235b 51 AliReconstructor(),
52 fDigits(0x0)
1d9af2d5 53{
54 //
55 //ctor
56 //
6ea6235b 57 fDigits = new TObjArray(kNLayers);
58 fDigits->SetOwner(kTRUE);
59 for(Int_t iLay =0; iLay<kNLayers; iLay++) fDigits->AddAt(new TClonesArray("AliITSDigitUpgrade",5000),iLay);
60 AliInfo(" ************* Using the upgrade reconstructor! ****** ");
1d9af2d5 61
62
63
64}//AliITSReconstructor
65//-----------------------------------------------------------------------
66AliITSUpgradeReconstructor::~AliITSUpgradeReconstructor(){
67 //Destructor
68 if(fDigits){
69 fDigits->Delete();
70 delete fDigits;
71 fDigits=0;
72 }
1d9af2d5 73}
74
75//_________________________________________________________________
76void AliITSUpgradeReconstructor::Init() {
77 // Initalize this constructor bet getting/creating the objects
78 // nesseary for a proper ITS reconstruction.
79 // Inputs:
80 // none.
81 // Output:
82 // none.
83 // Return:
84 // none.
85 return;
86}
87
88//___________________________________________________________________________
89void AliITSUpgradeReconstructor::SetTreeAddressD(TTree* const treeD){
90
91 // Set branch address for the tree of digits.
92
93 TBranch *branch;
94 Int_t i;
95 char branchname[30];
96 if(!treeD) return;
97 if (fDigits == 0x0) fDigits = new TObjArray(6);
98 for (i=0; i<6; i++) {
99 if(!(fDigits->At(i))) {
100 fDigits->AddAt(new TClonesArray("AliITSDigitUpgrade",1000),i);
101 }
102 else{
103 ResetDigits(i);
104 }
105 sprintf(branchname,"ITSDigits%d",i+1);
106 if (fDigits) {
107 branch = treeD->GetBranch(branchname);
108 if (branch) branch->SetAddress(&((*fDigits)[i]));
109 }
110 }
111}
1d9af2d5 112//_____________________________________________________________________
113void AliITSUpgradeReconstructor::ResetDigits(){
114 // Reset number of digits and the digits array for the ITS detector.
115
116 if(!fDigits) return;
117 for(Int_t i=0;i<6;i++){
118 ResetDigits(i);
119 }
120}
121//____________________________________________________________________
122void AliITSUpgradeReconstructor::ResetDigits(Int_t branch){
123 // Reset number of digits and the digits array for this branch.
124
125 if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
126
127}
1d9af2d5 128//___________________________________________________________________
6ea6235b 129void AliITSUpgradeReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const {
130 //
131 // Clustering
132 //
133 for(Int_t iLay=0;iLay<kNLayers;iLay++) {
134 digitsTree->SetBranchAddress(Form("Layer%d",iLay),&(*fDigits)[iLay]);
135 }
136
137 digitsTree->GetEntry(0);
1d9af2d5 138 AliITSUpgradeClusterFinder *clf = new AliITSUpgradeClusterFinder();
6ea6235b 139 clf->MakeRecPointBranch(clustersTree);
140 clf->SetRecPointTreeAddress(clustersTree);
141 clf->DigitsToRecPoints(fDigits); //cluster finder
142 clustersTree->Fill(); //fill tree for current event
143 delete clf;
144 for(Int_t iLay=0;iLay<kNLayers;iLay++){
145 fDigits->At(iLay)->Clear();
146 }
1d9af2d5 147
1d9af2d5 148}
149//_______________________________________________________________________________________________________________
150AliTracker* AliITSUpgradeReconstructor::CreateTracker() const
151{
6ea6235b 152 //
153 // create the ITSUpgrade tracker
154 //
1d9af2d5 155
6ea6235b 156 AliITStrackerUpgrade *trackUp = new AliITStrackerUpgrade();
157 if(GetRecoParam()->GetTrackerSAOnly()) trackUp->SetSAFlag(kTRUE);
158 if(trackUp->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
159 if(GetRecoParam()->GetInwardFindingSA()){
160 trackUp->SetInwardFinding();
161 trackUp->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
162 }else{
163 trackUp->SetOutwardFinding();
164 trackUp->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
165 }
166 trackUp->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
167 return trackUp;
1d9af2d5 168}
6ea6235b 169//_______________________________________________________________________