HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoKalman.cxx
Go to the documentation of this file.
1 //
2 // File HarpoKalman.cxx
3 //
10 #include "HarpoKalman.h"
11 #include "HarpoConfig.h"
12 #include "HarpoDetSet.h"
13 #include "HarpoDebug.h"
14 #include "HarpoDccEvent.h"
15 #include "Pmm2Event.h"
16 #include "HarpoEvent.h"
17 #include "HarpoRecoEvent.h"
18 
19 #include "TFile.h"
20 #include "TStyle.h"
21 #include "TCanvas.h"
22 #include "TLatex.h"
23 #include "TGraph.h"
24 #include "TF1.h"
25 #include "TArrow.h"
26 #include "TLinearFitter.h"
27 #include "TMath.h"
28 #include "TSystem.h"
29 
30 #include <cstdlib>
31 #include <cstring>
32 #include <cassert>
33 #include <fstream>
34 #include <iostream>
35 
36 
37 ClassImp(HarpoKalman);
38 
40  {
41  unsigned int nd; // number of detectors
43 
44  assert(hdr != NULL);
45  hdr->print();
46 
47  for (nd = 0; nd < gkNDetectors; nd++) {
48  // if (fEvt->isdataExist(nd)) {
49  HarpoDccMap *plane = fEvt->GetDccMap(nd);
50  if (plane != NULL )plane->print();
51  }
52  }
53 
54 Int_t HarpoKalman::InitPlane(TClonesArray* clArray, Int_t plane)
55 {
56 
57  fNtr[plane] = 0;
58 
59 
60  for(Int_t itr = 0; itr<NTRACK; itr++){
61  fStartIndex[itr] = 0;
62  fEndIndex[itr] = 0;
63  for(Int_t j = 0; j<10;j++){
64  fStartPointX[itr][j] = -1000;
65  fStartPointZ[itr][j] = -1000;
66  fStartDirX[itr][j] = -1000;
67  fStartDirZ[itr][j] = -1000;
68  }
69  }
70  for(Int_t i = 0; i<NADC; i++){
71  NTcl[i] = 0;
72  for(Int_t k = 0; k<20; k++)
73  Tcl[i][k] = -1;
74  }
75  for(Int_t i = 0; i<NCHAN; i++){
76  NCcl[i] = 0;
77  for(Int_t k = 0; k<20; k++)
78  Ccl[i][k] = -1;
79  }
80 
81 
82  HarpoDccMap* map = fEvt->GetDccMap(plane);
83 
84  fQtot = 0;
85  fQused = 0;
86  for(Int_t i = 0; i<NCHAN; i++){
87  for(Int_t j = 0; j<NADC; j++){
88  // fMapTmp[i][j] = map->GetData(i,j);
89  fMapTmp[i][j] = 0;
90  if(map->GetData(i,j)>-500) fQtot += map->GetData(i,j);
91  }
92  }
93 
94  Int_t nCl = clArray->GetEntries();
95  if(nCl>=4000){
96  Warning("InitPlane","Too many clusters %d",nCl);
97  return 0;
98  }
99  // Organise Clusters in layers
100  for(Int_t icl = 0; icl<nCl; icl++){
101  reused[icl] = 0;
102  used[icl] = -1000;
103  fTrack[icl] = -1000;
104  HarpoRecoClusters* cluster = (HarpoRecoClusters*)clArray->At(icl);
105  Int_t index = cluster->GetIndex();
106  // Info("","index = %d",index);
107  //std::cout << plane << " " << cluster->GetPlane() << std::endl;
108  if(cluster->GetPlane() != plane) continue;
109  if(cluster->GetQ() < fQmin) continue;
110  if(cluster->GetType() == TCLUSTER && cluster->GetWidth() < fWidthMinT) continue;
111  if(cluster->GetType() == CCLUSTER && cluster->GetWidth() < fWidthMinC) continue;
112  if(cluster->GetWidth() > fWidthMax) continue;
113  if(cluster->GetType() == CCLUSTER){
114  if(NCcl[index]>=20) continue;
115  Ccl[index][NCcl[index]] = icl;
116  NCcl[index]++;
117  }
118  if(cluster->GetType() == TCLUSTER){
119  if(NTcl[index]>=20) continue;
120  Tcl[index][NTcl[index]] = icl;
121  NTcl[index]++;
122  }
123  }
124 
125  if(gHarpoDebug>2){
126  for(Int_t i = 0; i<NCHAN; i++){
127  if(NCcl[i]>0) Info("process","NCcl[%d] = %d",i,NCcl[i]);
128  }
129  for(Int_t i = 0; i<NADC; i++){
130  if(NTcl[i]>0) Info("process","NTcl[%d] = %d",i,NTcl[i]);
131  }
132  }
133 
134  return 1;
135 }
136 
137 
138 TArrayI* HarpoKalman::FindNext(TMatrixD X, TMatrixD C, Double_t angle, Int_t iTr, TClonesArray* clArray, TArrayI* arr, Int_t ncl, Int_t plane, Int_t color, Int_t fill, Int_t smooth, Int_t qold)
139 {
140  // return FindNextClosest(X,C,iTr,clArray,arr,plane,color,fill,smooth);
141  return FindNextClosest(X,C,angle,iTr,clArray,arr,ncl,plane,color,fill,smooth,qold);
142 }
143 
144 
145 TArrayI* HarpoKalman::FindNextClosest(TMatrixD X, TMatrixD C, Double_t angle, Int_t iTr, TClonesArray* clArray, TArrayI* arr, Int_t ncl, Int_t plane, Int_t color, Int_t fill, Int_t smooth, Int_t qold)
146 {
147  if(gHarpoDebug>2) Info("FindNextClosest","Test2");
148  if(fCanvas[plane]) gSystem->Sleep(0);
149  if(gHarpoDebug>2) Info("FindNextClosest","angle = %g / %d = %g",angle,ncl,angle/ncl);
150 
151  TMatrixD F(4,4);
152  for(int i = 0;i<4;i++){
153  for(int j =0;j<4;j++){
154  F[i][j]=0;
155  if(i==j) F[i][j]=1;
156  }
157  }
158  TMatrixD Xproj(4,1);
159  // Double_t fNclMin = 20;
160  Double_t deltaRes = fResFinder;
161  Double_t deltaScat = fScatFinder;
162  Double_t theta = fScatKalman; // Multiple scattering
163  Int_t fNskipRows = 6;//10;
164  if(smooth == 2) fNskipRows = 30;
165  Double_t fRangeMax = 5;
166 
167  if(gHarpoDebug>2)
168  Info("FindNextClosest","%f %f %f %f",X[0][0],X[1][0],X[2][0],X[3][0]);
169 
170  Double_t angleOld = TMath::ATan2(X[2][0], X[3][0]);
171  Int_t ntr = 0;
172  Double_t distMin = 1000, meanMin = -10000, rangeMin = 0, angleMin = -1000, resMin = -1;
173  Int_t iclMin = -1, typeMin = -1, iMin = -1, kMin = -1, qMin = -1;
174  //Info("FindNextClosest","###############################");
175  for(Int_t k = 1; k<=fNskipRows; k++){
176  if(k>distMin + kMin) break;
177  for(Int_t type = 0; type<2; type++){ // look for T- and C-clusters
178  if(smooth != 2 && TMath::Abs(X[2+type][0]/X[3-type][0])>fMaxSlopeType) continue; // Angular cut for each cluster type
179 
180  // Define next layer
181  Int_t I;
182  if(X[3-type][0]>0) I = Int_t(X[1-type][0]+0.5) + k;
183  else I = Int_t(X[1-type][0]+0.5) - k;
184 
185  if(I<0 || (type==CCLUSTER && I>=NCHAN) || (type==TCLUSTER && I>=NADC)) continue; // Out of the map
186  Int_t n = 0;
187  if(type == TCLUSTER) n = NTcl[I];
188  else n = NCcl[I];
189 
190  F[0][2]=(I-X[1-type][0])*1./X[3-type][0]; // F transforms to the next layer
191  F[1][3]=(I-X[1-type][0])*1./X[3-type][0];
192  Xproj=F*X;
193 
194  for(Int_t i = 0; i<n; i++){ // For all clusters in the layer
195  if(i == 20) break;
196  Int_t icl;
197  if(type == TCLUSTER) icl = Tcl[I][i];
198  else icl = Ccl[I][i];
199  if(smooth == 0 && used[icl] > -1000) continue; // first pass: If already in a track, skip
200  if(smooth == 1 && used[icl] > -1000 && reused[icl] != 0) continue; // second pass: If already in a track (except this one), skip
201  // if(smooth == 2 && used[icl] != iTr) continue; // reordering: If not in this track, skip
202 
203  HarpoRecoClusters* cluster = (HarpoRecoClusters*)clArray->At(icl);
204  if(smooth == 2 && (cluster->GetIdClusterTrack() != iTr && used[icl] != iTr)) continue; // reordering: If not in this track, skip
205  if(cluster->GetPlane() != plane) continue;
206  if((cluster->GetQuality() & 3) == 3) continue;
207  if(cluster->GetType() != type) Warning("FindNextClosest","??? %d != %d",cluster->GetType(), type);
208  Double_t mean = cluster->GetMean();
209  //Int_t index = cluster->GetIndex();
210  Int_t q = cluster->GetQ();
211 
212  if(gHarpoDebug>2)
213  Info("FindNextClosest","#proj: %f %f %f %f",Xproj[0][0],Xproj[1][0],Xproj[2][0],Xproj[3][0]);
214 
215 
216  Double_t res = GetResolution(cluster);
217  Double_t range = deltaRes*res + deltaScat*theta*k;
218  if(range>fRangeMax) range = fRangeMax;
219 
220  Double_t dist = TMath::Abs(mean - Xproj[type][0]);// + k;
221  //fHistQQtestVsDist->Fill(q,qold);
222  fHistQQtestVsDist->Fill(q*1./qold,dist);
223  Double_t angleTmp;
224  if(type == 0) angleTmp = TMath::ATan2(mean - X[0][0], I - X[1][0] );
225  else angleTmp = TMath::ATan2(I - X[0][0], mean - X[1][0]);
226  Double_t dA = fmod(angleTmp - angle/ncl + 4*TMath::Pi(),2*TMath::Pi()) - TMath::Pi();
227  if(TMath::Abs(dA)<TMath::Pi()/2 && !(smooth == 1 && used[icl] == iTr)) continue;
228 
229  Double_t dA2 = fmod(angleTmp - angleOld + 4*TMath::Pi(),2*TMath::Pi()) - TMath::Pi();
230  //Info("","dA = %g - %g = %g",angleTmp,angle/ncl,dA);
231  if(TMath::Abs(dA2)<TMath::Pi()*0.7 && !(smooth == 1 && used[icl] == iTr)) continue;
232  if(smooth == 1 && used[icl] == iTr) dist = 0; // Catch
233  //Info("FindNextClosest","** %d %g %g %g %d %d",icl, dist,mean,range,type,I);
234  if((dist < range || smooth == 2) && (dist+k<distMin || (dist == 0 && k<=kMin))){
235  //if((dist < range) && (dist+k<distMin || (dist == 0 && k<=kMin))){
236  distMin = dist;
237  iclMin = icl;
238  meanMin = mean;
239  rangeMin = range;
240  typeMin = type;
241  iMin = I;
242  kMin = k;
243  if(smooth == 1) kMin = 100;
244  angleMin = angleTmp;
245  resMin = res;
246  qMin = q;
247  }
248  }
249  }
250  }
251 
252  fHistQQmin->Fill(qMin*1./qold,distMin);
253 
254  // Info("FindNextClosest","%d: %g %d %g %g %d %d %d %g %g",smooth,distMin,iclMin,meanMin,rangeMin,typeMin,iMin,kMin,angleMin,resMin);
255  // Info("FindNextClosest","used[%d] = %d",iclMin,used[iclMin]);
256 
257  if(iclMin!=-1) ntr++;
258  else{ // END OF TRACK
259  if(smooth == 0 && fStartIndex[iTr]>10){ // end of first pass
260  // X[2][0] = -X[2][0];
261  // X[3][0] = -X[3][0];
262 
263  Int_t index = (fStartIndex[iTr] + 4)%10;
264  X[0][0] = fStartPointZ[iTr][index];
265  X[1][0] = fStartPointX[iTr][index];
266  X[2][0] = -fStartDirZ[iTr][index];
267  X[3][0] = -fStartDirX[iTr][index];
268 
269  if(gHarpoDebug>1)
270  Info("FindNextClosest","End of first pass (Ncl = %d). New seed: (%g, %g, %g, %g)",ncl,X[0][0],X[1][0],X[2][0],X[3][0]);
271 
272  TMatrixD Corig(4,4);
273  for(int a = 0;a<4;a++){
274  for(int b =0;b<4;b++){
275  if(a==b){
276  if(a<2)
277  Corig[a][b]=fResKalman*fResKalman; //initialisation de C
278  else
279  Corig[a][b]=(2*fResKalman)*(2*fResKalman)+fScatKalman*fScatKalman;
280  }
281  else
282  Corig[a][b]=0;
283  }
284  }
285  // ncl++;
286  // Double_t angleorig = TMath::ATan2(X[2][0],X[3][0]);
287  // arr = FindNextClosest(X, Corig, angleorig, iTr, clArray, arr, 1, plane, color, fill, 1);
288  arr = FindNextClosest(X, Corig, -angle, iTr, clArray, arr, ncl, plane, color, fill, 1, qMin);
289  }else{ // end of reverse pass
290  // Int_t Ncl = 0;
291  if(gHarpoDebug>1)
292  Info("FindNextClosest","End of last pass (%d clusters)",ncl);
293  // while(arr->At(Ncl) != 0){
294  // Ncl++;
295  // }
296  // std::cout << "*** " << iTr << " => " << Ncl << " ***" << std::endl;
297  }
298  return arr;
299  }
300 
301  if(gHarpoDebug>2)
302  Info("FindNextClosest","Add New Cluster");
303 
304 
305  TMatrixD H(2,4);
306  TMatrixD Ht(2,4);
307  TMatrixD Q(4,4);
308  TMatrixD G(2,2);
309  TMatrixD V(2,2);
310  // TMatrixD Id(4,4);
311 
312 
313  Double_t inc = resMin;//fResKalman; // Space resolution
314  if(inc==0) inc = 0.000001;
315  Double_t v = X[2][0]*X[2][0] + X[3][0]*X[3][0];
316  for(int i = 0;i<4;i++){
317  for(int j =0;j<4;j++){
318  if(i==j){
319  if(i>1)
320  Q[i][j]=theta*theta*(1-X[i][0]*X[i][0]/v); //initialisation de Q
321  else
322  Q[i][j]=0;
323  }
324  }
325  }
326  for(int i = 0;i<2;i++){
327  for(int j =0;j<2;j++){
328  if(i==j){
329  H[i][j]=1;
330  V[i][j]=inc*inc;
331  G[i][j]=1./inc*inc;
332  }else{
333  H[i][j]=0;
334  V[i][j]=0;
335  G[i][j]=0;
336  }
337  }
338  }
339  Ht=H;
340  Ht.T();
341  // G=V;
342  // G.Invert();
343 
344 
345  TMatrixD Ft(4,4);
346  TMatrixD Cinv(4,4);
347  TMatrixD M(2,1);
348  TMatrixD Cproj(4,4);
349  TMatrixD Xnew(4,1);
350  TMatrixD Cnew(4,4);
351  TMatrixD Cprojinv(4,4);
352 
353  F[0][2]=(iMin-X[1-typeMin][0])*1./X[3-typeMin][0];
354  F[1][3]=(iMin-X[1-typeMin][0])*1./X[3-typeMin][0];
355  Xproj=F*X;
356  // Kalman matrices calculations
357  Ft = F;
358  Ft.T();
359  M[1-typeMin][0] = iMin;
360  M[typeMin][0] = meanMin;
361  Cproj=F*C*Ft+Q;
362  Cprojinv=Cproj;
363  Cprojinv.Invert();
364  Cinv=Cprojinv+Ht*G*H;
365  Cnew=Cinv;
366  Cnew.Invert();
367  Xnew=Cnew*((Cprojinv*Xproj)+(Ht*G*M));
368 
369 
370  if(fCanvas[plane]){ // Display for Reco monitor
371  Float_t x[3] = {(Float_t) (X[1-typeMin][0]),
372  (Float_t) (iMin),
373  (Float_t) (iMin)};
374  Float_t y[3] = {(Float_t) (X[typeMin][0]),
375  (Float_t) (Xproj[typeMin][0]-rangeMin),
376  (Float_t) (Xproj[typeMin][0]+rangeMin)};
377  if(gHarpoDebug>2)
378  Info("FindNextClosest","%g %g %g %g %g %g",x[0],y[0],x[1],y[1],x[2],y[2]);
379  TPolyLine* triangle;
380  if(typeMin == TCLUSTER) triangle = new TPolyLine(3,x,y,"FL");
381  else triangle = new TPolyLine(3,y,x,"FL");
382  triangle->SetLineColor(kBlack);
383  //triangle->SetFillColor(kRed);
384  triangle->SetFillColor(color);
385  triangle->SetFillStyle(fill);
386  fCanvas[plane]->cd();
387  triangle->Draw("FL");
388  fHist[plane]->GetXaxis()->SetRangeUser(X[0][0]-20,X[0][0]+20);
389  fHist[plane]->GetYaxis()->SetRangeUser(X[1][0]-20,X[1][0]+20);
390  fCanvas[plane]->Update();
391  }
392  used[iclMin] = iTr;
393  if(smooth == 1) reused[iclMin] = 1;
394  else reused[iclMin] = 0;
395  if(smooth == 2) used[iclMin] = 1000;
396 
397  Bool_t skip = kFALSE; // If already in this track, skip
398  Int_t kcl = 0;
399  if(arr != 0){
400  while(arr->At(kcl) != 0){
401  if(arr->At(kcl) == 0) break;
402  if(arr->At(kcl) == iclMin+1){
403  skip = kTRUE;
404  break;
405  }
406  kcl++;
407  }
408  if(!skip)
409  //Info("FindNext","Add cluster %d",iclMin);
410  arr->AddAt(iclMin+1,kcl);
411  }
412  if(gHarpoDebug>2)
413  Info("FindNextClosest","Add cluster %d, (%d %p) %d",iclMin,iTr,arr,fStartIndex[iTr]%10);
414 
415  if(smooth == 0){
416  fStartPointZ[iTr][fStartIndex[iTr]%10] = X[0][0];
417  fStartPointX[iTr][fStartIndex[iTr]%10] = X[1][0];
418  fStartDirZ[iTr][fStartIndex[iTr]%10] = X[2][0];
419  fStartDirX[iTr][fStartIndex[iTr]%10] = X[3][0];
420  fStartIndex[iTr]++;
421  }
422 
423  if(smooth == 2){
424  HarpoRecoClusters* cluster = (HarpoRecoClusters*)clArray->At(iclMin);
425  cluster->SetZfit(0,Xnew[0][0]);
426  cluster->SetXfit(0,Xnew[1][0]);
427  }
428  angle += angleMin;
429  ncl++;
430  if(gHarpoDebug>2)
431  Info("FindNextClosest","Test %g %d %p %p %d %d %d %d %d", angle, iTr, clArray, arr, ncl, plane, color, fill,smooth);
432  arr = FindNextClosest(Xnew, Cnew, angle, iTr, clArray, arr, ncl, plane, color, fill,smooth,qMin);
433 
434 
435  return arr;
436 }
437 
438 
440 {
441 
442  if((cl->GetQuality() & 3) == 3) return 2;
443  if(cl->GetQuality() & 4) return 1;
444  if(cl->GetQuality() & 3) return 1;//0.5;
445 
446 
447  if(cl->GetType() == CCLUSTER) return 1;
448  if(cl->GetType() == TCLUSTER) return 0.2;
449 
450  return 10;
451 }
452 
453 
455  {
456 
457  // Initialise histograms here
458 
459  fCanvas[0] = NULL;
460  fCanvas[1] = NULL;
461  fHist[0] = NULL;
462  fHist[1] = NULL;
463 
464  fNclMin = 10;
465  fNclMin2 = 15;
466  fMaxSlopeType = 1.5;
467  fResKalman = 0.2;
468  fScatKalman = 1;
469  fResFinder = 1;
470  fScatFinder = 0.5;
471 
472  fQmin = 200;
473  fWidthMinT = 2;
474  fWidthMinC = 5;
475  fWidthMax = 30;
476 
477 
478 
479 
480  // fNtr = 0;
481  hNcl = new TH1F("hNcl","hNcl",500,0,500);
482 
483  const Int_t nbinsDist = 200;
484  Double_t xminDist = 1;
485  Double_t xmaxDist = 10000;
486  Double_t logxminDist = TMath::Log(xminDist);
487  Double_t logxmaxDist = TMath::Log(xmaxDist);
488  Double_t binwidthDist = (logxmaxDist-logxminDist)/nbinsDist;
489  Double_t xbinsDist[nbinsDist+1];
490  xbinsDist[0] = xminDist;
491  for (Int_t i=1;i<=nbinsDist;i++)
492  xbinsDist[i] = TMath::Exp(logxminDist+i*binwidthDist);
493 
494 
495  const Int_t nbinsTheta = 100;
496  Double_t xminTheta = 1e-5;
497  Double_t xmaxTheta = 2;
498  Double_t logxminTheta = TMath::Log(xminTheta);
499  Double_t logxmaxTheta = TMath::Log(xmaxTheta);
500  Double_t binwidthTheta = (logxmaxTheta-logxminTheta)/nbinsTheta;
501  Double_t xbinsTheta[nbinsTheta+1];
502  xbinsTheta[0] = xminTheta;
503  for (Int_t i=1;i<=nbinsTheta;i++)
504  xbinsTheta[i] = TMath::Exp(logxminTheta+i*binwidthTheta);
505 
506  hDistTracks = new TH1F("hDistTracks","",nbinsDist,xbinsDist);
507  hDistMinTracks = new TH1F("hDistMinTracks","",nbinsDist,xbinsDist);
508  hThetaTracks = new TH1F("hThetaTracks","",nbinsTheta,xbinsTheta);//,100,-1,1);
509  // hThetaTracksNtr = new TH2F("hThetaTracksNtr","",NTRACK,0,NTRACK,100,-1,1);
510  hThetaTracksNtr = new TH2F("hThetaTracksNtr","",nbinsDist,xbinsDist,nbinsTheta,xbinsTheta);
511  for(Int_t i = 0; i<10; i++)
512  hThetaDist[i] = new TH2F(Form("hThetaDist%d",i),"",nbinsDist,xbinsDist,nbinsTheta,xbinsTheta);
513 
514 
515  const Int_t nbinsQ = 100;
516  Double_t xminQ = 1e-3;
517  Double_t xmaxQ = 1e3;
518  Double_t logxminQ = TMath::Log(xminQ);
519  Double_t logxmaxQ = TMath::Log(xmaxQ);
520  Double_t binwidthQ = (logxmaxQ-logxminQ)/nbinsQ;
521  Double_t xbinsQ[nbinsQ+1];
522  xbinsQ[0] = xminQ;
523  for (Int_t i=1;i<=nbinsQ;i++)
524  xbinsQ[i] = TMath::Exp(logxminQ+i*binwidthQ);
525  fHistQQtestVsDist = new TH2F("fHistQQtestVsDist","",nbinsQ,xbinsQ,nbinsDist,xbinsDist);
526  fHistQQmin = new TH2F("fHistQQmin","",nbinsQ,xbinsQ,nbinsDist,xbinsDist);
527 
528  }
529 
530 void HarpoKalman::Save(char * /* mode */)
531  {
532 
533  // TString * hstFile = gHConfig->GetHistFile();
534  // if ( hstFile == NULL ) {
535  // std::cout << gHConfig->GetProgramName() << " " <<
536  // "No Hist File name given, use default" << std::endl;
537  // // const char* dir = gSystem->ExpandPathName("$HARPO_ANA_DIR/reco");
538  // const char* dir = "$HARPO_ANA_DIR/reco";
539  // if(gSystem->AccessPathName(dir))
540  // hstFile = new TString(Form("trackingKalman%lli.root",gHConfig->GetRunNo()));
541  // else
542  // hstFile = new TString(Form("%s/trackingKalman%lli.root",dir,gHConfig->GetRunNo()));
543  // // hstFile = new TString(Form("outputs/anaph%lli.root",gHConfig->GetRunNo()));
544  // }
545 
546  // TFile *hf = new TFile(hstFile->Data(),"RECREATE");
547  OpenHistFile("trackingKalman");
548  // Save histograms here
549  hDistTracks->Write();
550  hDistMinTracks->Write();
551  hThetaTracks->Write();
552  hThetaTracksNtr->Write();
553  for(Int_t i = 0; i<10; i++){
554  if(hThetaDist[i])
555  hThetaDist[i]->Write();
556  }
557  fHistQQtestVsDist->Write();
558  fHistQQmin->Write();
559 
560  // hf->Close();
561  // printf("fNewFile %s closed\n", hstFile->Data() );
562 
563  }
564 
#define NTRACK
Int_t NCcl[NCHAN]
Definition: HarpoKalman.h:69
Double_t fScatKalman
Definition: HarpoKalman.h:128
Double_t fStartPointZ[NTRACK][10]
Definition: HarpoKalman.h:79
TH2F * hThetaDist[10]
Definition: HarpoKalman.h:107
#define NCHAN
Definition: HarpoDccMap.h:16
Double_t GetMean()
Double_t fWidthMax
Definition: HarpoKalman.h:123
Int_t fNclMin
Definition: HarpoKalman.h:124
Double_t fQtot
Definition: HarpoKalman.h:94
Double_t fResKalman
Definition: HarpoKalman.h:127
Int_t fTrack[4000]
Definition: HarpoKalman.h:99
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
Definition: HarpoDccMap.cxx:84
TH1F * hThetaTracks
Definition: HarpoKalman.h:105
Int_t used[4000]
Definition: HarpoKalman.h:97
void Save(char *mode=NULL)
TH2F * hThetaTracksNtr
Definition: HarpoKalman.h:106
Double_t fMaxSlopeType
Definition: HarpoKalman.h:126
Double_t fQmin
Definition: HarpoKalman.h:120
Int_t InitPlane(TClonesArray *clArray, Int_t plane)
Definition: HarpoKalman.cxx:54
TH1F * hDistMinTracks
Definition: HarpoKalman.h:104
A virtual class for Kalman tracking.
Definition: HarpoKalman.h:26
TArrayI * FindNextClosest(TMatrixD X, TMatrixD C, Double_t angle, Int_t Ntr, TClonesArray *clArray, TArrayI *arr, Int_t ncl, Int_t plane, Int_t color, Int_t fill, Int_t smooth, Int_t q)
virtual void print()
FullEvent Header not scecific to the detectors The class is ....
TVirtualPad * fCanvas[2]
Definition: HarpoKalman.h:100
TH1F * hNcl
Redefine empty default.
Definition: HarpoKalman.h:39
virtual void print()
Int_t fEndIndex[NTRACK]
Definition: HarpoKalman.h:88
Cluster object, containing position, charge and quality information.
TFile * OpenHistFile(const char *ananame)
Double_t fScatFinder
Definition: HarpoKalman.h:130
static int type
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
Definition: HarpoDccMap.h:29
ULong64_t fMapTmp[NCHAN][NADC]
Definition: HarpoKalman.h:93
Int_t reused[4000]
Definition: HarpoKalman.h:98
Int_t NTcl[NADC]
Definition: HarpoKalman.h:71
Double_t fWidthMinC
Definition: HarpoKalman.h:122
Double_t GetResolution(HarpoRecoClusters *cl)
void print()
Definition: HarpoKalman.cxx:39
Int_t GetIdClusterTrack()
void SetXfit(Int_t i, Double_t val)
#define NADC
Definition: HarpoDccMap.h:18
Int_t fNtr[2]
Definition: HarpoKalman.h:72
Double_t fWidthMinT
Definition: HarpoKalman.h:121
#define TCLUSTER
Long64_t gHarpoDebug
Definition: HarpoDebug.cxx:9
Double_t fStartDirX[NTRACK][10]
Definition: HarpoKalman.h:81
Int_t fNclMin2
Definition: HarpoKalman.h:125
Double_t fResFinder
Definition: HarpoKalman.h:129
TH1F * hDistTracks
Definition: HarpoKalman.h:103
Int_t fStartIndex[NTRACK]
Definition: HarpoKalman.h:87
HarpoEventHeader * GetHeader()
Definition: HarpoEvent.cxx:80
TArrayI * FindNext(TMatrixD X, TMatrixD C, Double_t angle, Int_t Ntr, TClonesArray *clArray, TArrayI *arr, Int_t ncl, Int_t plane, Int_t color, Int_t fill, Int_t smooth, Int_t q)
HarpoEvent * fEvt
Definition: HarpoAnalyse.h:70
Double_t fQused
Definition: HarpoKalman.h:95
unsigned int res
Definition: Pmm2Status.h:428
Int_t Tcl[NADC][20]
Definition: HarpoKalman.h:70
Double_t fStartPointX[NTRACK][10]
Definition: HarpoKalman.h:78
const ULong_t gkNDetectors
Definition: HarpoDet.h:14
Double_t fStartDirZ[NTRACK][10]
Definition: HarpoKalman.h:82
#define CCLUSTER
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
Definition: HarpoEvent.cxx:108
void SetZfit(Int_t i, Double_t val)
TH2F * fHist[2]
Definition: HarpoKalman.h:101
TH2F * fHistQQmin
Definition: HarpoKalman.h:110
TH2F * fHistQQtestVsDist
Definition: HarpoKalman.h:109
Int_t Ccl[NCHAN][20]
Definition: HarpoKalman.h:68