]>
Commit | Line | Data |
---|---|---|
5a5a1232 | 1 | // $Header$ |
2 | ||
3 | //__________________________________________________________________________ | |
4 | // TPCDigitsInfo | |
5 | // | |
6 | // | |
7 | ||
8 | ||
9 | #include <TFile.h> | |
10 | #include <TStopwatch.h> | |
11 | #include <Reve/TTreeTools.h> | |
12 | ||
13 | #include "TPCDigitsInfo.h" | |
14 | ||
15 | ||
16 | using namespace Reve; | |
17 | using namespace Alieve; | |
18 | using namespace std; | |
19 | ||
20 | void TPCSeg::Dump() const | |
21 | { | |
22 | printf("TPCSeg: pw %f, pl %f, R %f, nRows %d, nMaxPads %d \n", | |
23 | fPadWidth, fPadLength,fRlow,fNRows,fNMaxPads); | |
24 | } | |
25 | ||
26 | ||
27 | ClassImp(TPCDigitsInfo) | |
28 | ||
29 | /**************************************************************************/ | |
30 | ||
31 | void TPCDigitsInfo::Init() | |
32 | { | |
33 | fTree = 0; | |
34 | fParameter= 0; | |
35 | } | |
36 | ||
37 | ||
38 | TPCDigitsInfo::~TPCDigitsInfo() | |
39 | { | |
40 | delete fParameter; | |
41 | delete fTree; | |
42 | } | |
43 | ||
44 | /**************************************************************************/ | |
45 | ||
46 | void TPCDigitsInfo::SetData(AliTPCParam* par, TTree* digits) | |
47 | { | |
48 | ||
49 | static const Exc_t eH("TPCDigitsInfo::SetData"); | |
50 | ||
51 | fParameter = par; | |
52 | fTree = digits; | |
53 | ||
54 | TStopwatch* sw = new TStopwatch(); | |
55 | sw->Start(); | |
56 | fTree->LoadBaskets(); | |
57 | sw->Stop(); | |
58 | // printf("TPCDigitsInfo::SetData timer %f\n", sw->RealTime()); | |
59 | // sw->Dump(); | |
60 | ||
61 | fSegEnt.assign(72,-1); | |
62 | AliSimDigits *digit = &fSimDigits; | |
63 | fTree->GetBranch("Segment")->SetAddress(&digit); | |
64 | ||
65 | Int_t sbr=(Int_t)fTree->GetEntries(); | |
66 | for (Int_t ent=0; ent<sbr; ent++) { | |
67 | fTree->GetEntry(ent); | |
68 | Int_t s, row; | |
69 | par->AdjustSectorRow(digit->GetID(),s,row); | |
70 | // printf("found entry %d in sec %d row %d \n",ent, s, row); | |
71 | ||
72 | if(row == 0) fSegEnt[s] = ent; | |
73 | } | |
74 | ||
75 | ||
76 | // read TPC Seg data | |
77 | fInnSeg.fPadWidth = par->GetInnerPadPitchWidth(); | |
78 | fInnSeg.fPadLength = par->GetInnerPadPitchLength(); | |
79 | fInnSeg.fRlow = par->GetPadRowRadiiLow(0); | |
80 | fInnSeg.fNRows = par->GetNRowLow(); | |
81 | fInnSeg.fNMaxPads = par->GetNPadsLow(fInnSeg.fNRows - 1); | |
82 | ||
83 | ||
84 | fOut1Seg.fPadWidth = par->GetOuterPadPitchWidth(); | |
85 | fOut1Seg.fPadLength = par->GetOuter1PadPitchLength(); | |
86 | fOut1Seg.fRlow = par->GetPadRowRadiiUp(0); | |
87 | fOut1Seg.fNRows = par->GetNRowUp1(); | |
88 | fOut1Seg.fNMaxPads = par->GetNPadsUp(fOut1Seg.fNRows-1); | |
89 | ||
90 | ||
91 | fOut2Seg.fPadWidth = par->GetOuterPadPitchWidth(); | |
92 | fOut2Seg.fPadLength = par->GetOuter2PadPitchLength(); | |
93 | fOut2Seg.fRlow = par->GetPadRowRadiiUp(fOut1Seg.fNRows); | |
94 | fOut2Seg.fNRows = par->GetNRowUp() - fOut1Seg.fNRows; | |
95 | fOut2Seg.fNMaxPads = par->GetNPadsUp(par->GetNRowUp()-1); | |
96 | ||
97 | ||
98 | // set stepsize array | |
99 | Int_t k, npads; | |
100 | // Inn | |
101 | k=0, npads = par->GetNPadsLow(0); | |
102 | for (int row = 0; row < fInnSeg.fNRows ;row++ ){ | |
103 | if (par->GetNPadsLow(row) > npads){ | |
104 | npads = par->GetNPadsLow(row); | |
105 | fInnSeg.fStepY[k]=row* fInnSeg.fPadLength +fInnSeg.fRlow; | |
106 | k++; | |
107 | } | |
108 | } | |
109 | fInnSeg.fNsteps=k; | |
110 | // Out1 seg | |
111 | k=0; npads = par->GetNPadsUp(0); | |
112 | for (int row = 0; row < fOut1Seg.fNRows ;row++ ){ | |
113 | if (par->GetNPadsUp(row) > npads){ | |
114 | npads = par->GetNPadsUp(row); | |
115 | fOut1Seg.fStepY[k]=row* fOut1Seg.fPadLength + fOut1Seg.fRlow ; | |
116 | k++; | |
117 | } | |
118 | } | |
119 | fOut1Seg.fNsteps=k; | |
120 | // Out2 seg | |
121 | k=0; npads = par->GetNPadsUp(fOut1Seg.fNRows); | |
122 | for (int row = fOut1Seg.fNRows; row < par->GetNRowUp() ;row++ ){ | |
123 | if (par->GetNPadsUp(row) > npads){ | |
124 | npads = par->GetNPadsUp(row); | |
125 | fOut2Seg.fStepY[k]=(row - fOut1Seg.fNRows)* fOut2Seg.fPadLength + fOut2Seg.fRlow ; | |
126 | k++; | |
127 | } | |
128 | } | |
129 | fOut2Seg.fNsteps=k; | |
130 | } | |
131 | ||
132 | /**************************************************************************/ | |
133 | ||
134 | void TPCDigitsInfo::Print(Option_t* ) const | |
135 | { | |
136 | fInnSeg.Dump(); | |
137 | fOut1Seg.Dump(); | |
138 | fOut2Seg.Dump(); | |
139 | } |