]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/AliITSUpgradeReconstructor.cxx
Use the bit set in the zdc for the energy calibration (Alberica)
[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()
1d9af2d5 31#include "AliESDEvent.h" //FillEsd()
32#include "AliRawReader.h" //Reconstruct() for raw digits
33#include "AliRun.h"
34#include "AliLog.h" //
35#include "AliITSRawStream.h" //ConvertDigits()
1d9af2d5 36#include "AliITSsegmentationUpgrade.h"
37#include "AliITSUpgradeClusterFinder.h"
38#include "AliITStrackerUpgrade.h"
ebaa7604 39#include "AliITStrackerU.h"
1d9af2d5 40ClassImp(AliITSUpgradeReconstructor)
41
42//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
43 AliITSUpgradeReconstructor::AliITSUpgradeReconstructor():
6ea6235b 44 AliReconstructor(),
665c0bc7 45 fDigits(0x0),
46 fNlayers(0)
1d9af2d5 47{
48 //
49 //ctor
50 //
665c0bc7 51
52 AliITSsegmentationUpgrade *s = new AliITSsegmentationUpgrade();
53 fNlayers = s->GetNLayers();
54 delete s;
55
56 fDigits = new TObjArray(fNlayers);
6ea6235b 57 fDigits->SetOwner(kTRUE);
665c0bc7 58 for(Int_t iLay =0; iLay<fNlayers; iLay++) fDigits->AddAt(new TClonesArray("AliITSDigitUpgrade",5000),iLay);
6ea6235b 59 AliInfo(" ************* Using the upgrade reconstructor! ****** ");
1d9af2d5 60
61
62
63}//AliITSReconstructor
64//-----------------------------------------------------------------------
65AliITSUpgradeReconstructor::~AliITSUpgradeReconstructor(){
66 //Destructor
67 if(fDigits){
68 fDigits->Delete();
69 delete fDigits;
70 fDigits=0;
71 }
1d9af2d5 72}
73
74//_________________________________________________________________
75void AliITSUpgradeReconstructor::Init() {
76 // Initalize this constructor bet getting/creating the objects
77 // nesseary for a proper ITS reconstruction.
78 // Inputs:
79 // none.
80 // Output:
81 // none.
82 // Return:
83 // none.
84 return;
85}
86
87//___________________________________________________________________________
88void AliITSUpgradeReconstructor::SetTreeAddressD(TTree* const treeD){
89
90 // Set branch address for the tree of digits.
91
92 TBranch *branch;
93 Int_t i;
94 char branchname[30];
95 if(!treeD) return;
96 if (fDigits == 0x0) fDigits = new TObjArray(6);
97 for (i=0; i<6; i++) {
98 if(!(fDigits->At(i))) {
99 fDigits->AddAt(new TClonesArray("AliITSDigitUpgrade",1000),i);
100 }
101 else{
102 ResetDigits(i);
103 }
104 sprintf(branchname,"ITSDigits%d",i+1);
105 if (fDigits) {
106 branch = treeD->GetBranch(branchname);
107 if (branch) branch->SetAddress(&((*fDigits)[i]));
108 }
109 }
110}
1d9af2d5 111//_____________________________________________________________________
112void AliITSUpgradeReconstructor::ResetDigits(){
113 // Reset number of digits and the digits array for the ITS detector.
114
115 if(!fDigits) return;
116 for(Int_t i=0;i<6;i++){
117 ResetDigits(i);
118 }
119}
120//____________________________________________________________________
121void AliITSUpgradeReconstructor::ResetDigits(Int_t branch){
122 // Reset number of digits and the digits array for this branch.
123
124 if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
125
126}
1d9af2d5 127//___________________________________________________________________
6ea6235b 128void AliITSUpgradeReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const {
129 //
130 // Clustering
131 //
665c0bc7 132 for(Int_t iLay=0;iLay<fNlayers;iLay++) {
6ea6235b 133 digitsTree->SetBranchAddress(Form("Layer%d",iLay),&(*fDigits)[iLay]);
134 }
135
136 digitsTree->GetEntry(0);
1d9af2d5 137 AliITSUpgradeClusterFinder *clf = new AliITSUpgradeClusterFinder();
6ea6235b 138 clf->MakeRecPointBranch(clustersTree);
139 clf->SetRecPointTreeAddress(clustersTree);
140 clf->DigitsToRecPoints(fDigits); //cluster finder
141 clustersTree->Fill(); //fill tree for current event
142 delete clf;
665c0bc7 143 for(Int_t iLay=0;iLay<fNlayers;iLay++){
6ea6235b 144 fDigits->At(iLay)->Clear();
145 }
1d9af2d5 146
1d9af2d5 147}
148//_______________________________________________________________________________________________________________
149AliTracker* AliITSUpgradeReconstructor::CreateTracker() const
150{
6ea6235b 151 //
ebaa7604 152 // Create the ITSUpgrade tracker switching betqween the general case and the StandAlone case.
153 // AliITStrackerUpgrade is used only for SA tracks.
154 //
1d9af2d5 155
ebaa7604 156 if(GetRecoParam()->GetTrackerSAOnly()){
665c0bc7 157 AliITStrackerUpgrade *trackUp = new AliITStrackerUpgrade(fNlayers);
6ea6235b 158 if(GetRecoParam()->GetTrackerSAOnly()) trackUp->SetSAFlag(kTRUE);
159 if(trackUp->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
160 if(GetRecoParam()->GetInwardFindingSA()){
161 trackUp->SetInwardFinding();
162 trackUp->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
163 }else{
164 trackUp->SetOutwardFinding();
165 trackUp->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
166 }
167 trackUp->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
168 return trackUp;
ebaa7604 169 } else {
170 AliITStrackerU *t = new AliITStrackerU();
171 return t;
172 }
1d9af2d5 173}
6ea6235b 174//_______________________________________________________________________