29 #include "TLinearFitter.h"
53 if (plane != NULL )plane->
print();
62 Info(
"process",
"Event %ld",
nEvents);
64 for(Int_t i = 0; i<
NTRACK; i++)
74 Int_t nTr = trArray->GetEntries();
75 Info(
"process",
"*********** %d **********",nTr);
77 for(Int_t plane = 0; plane<2; plane++){
79 for(Int_t itr = 0; itr<nTr; itr++){
81 if(track->
GetPlane() != plane)
continue;
91 for(Int_t itr = 0; itr<
NTRACK; itr++){
104 Int_t iMin =
NCHAN+1, iMax = -1, jMin =
NADC+1, jMax = -1;
105 Double_t xMax = 0, zMax = 0;
106 Int_t nCl = clArray->GetEntries();
107 for(Int_t icl = 0; icl<nCl; icl++){
110 Int_t mean = cluster->
GetMean();
112 if(cluster->
GetPlane() != plane)
continue;
114 if(index>jMax){ jMax = index; xMax = mean;}
115 if(index<jMin) jMin = index;
118 if(index>iMax){ iMax = index; zMax = mean;}
119 if(index<iMin) iMin = index;
123 if(iMax-iMin > jMax-jMin){
155 Info(
"FitTrack",
"New seed: (%g, %g, %g, %g)",X[0][0],X[1][0],X[2][0],X[3][0]);
158 for(
int a = 0;a<4;a++){
159 for(
int b =0;b<4;b++){
170 TArrayI* arr =
new TArrayI(2000);
171 Double_t angleorig = TMath::ATan2(X[2][0],X[3][0]);
173 arr =
FindNextClosest(X,Corig,angleorig,iTr,clArray,arr,1,plane,iTr+2,3002,2,-1);
177 for(Int_t i = 0; i<2000; i++){
178 if(arr->At(i)-1<0)
break;
191 Double_t xSt = clusterSt1->
GetXfit();
192 Double_t zSt = clusterSt1->
GetZfit();
197 Double_t xEnd = clusterEnd1->
GetXfit();
198 Double_t zEnd = clusterEnd1->
GetZfit();
233 TArrow* arrowSt =
new TArrow();
234 arrowSt->SetLineColor(iTr+2);
235 arrowSt->SetFillColor(iTr+2);
237 arrowSt->DrawArrow(zSt,xSt,zSt+10*pzSt,xSt+10*pxSt);
238 fHist[plane]->GetXaxis()->SetRangeUser(zSt-20,zSt+20);
239 fHist[plane]->GetYaxis()->SetRangeUser(xSt-20,xSt+20);
241 gSystem->Sleep(2000);
242 TArrow* arrowEnd =
new TArrow();
243 arrowEnd->SetLineColor(iTr+2);
244 arrowEnd->SetFillColor(iTr+2);
246 arrowEnd->DrawArrow(zEnd,xEnd,zEnd+10*pzEnd,xEnd+10*pxEnd);
247 fHist[plane]->GetXaxis()->SetRangeUser(zEnd-20,zEnd+20);
248 fHist[plane]->GetYaxis()->SetRangeUser(xEnd-20,xEnd+20);
250 gSystem->Sleep(2000);
267 Int_t nCl = clArray->GetEntries();
269 for(Int_t icl = 0; icl<nCl; icl++){
271 if(cluster->
GetPlane() != plane)
continue;
277 for(Int_t k = ind2; k< ind2 + width; k++){
278 Int_t i = -1, j = -1;
279 if(type ==
CCLUSTER){ i = ind; j = k;}
280 if(type ==
TCLUSTER){ i = k; j = ind;}
281 if(i<0 || i>=
NCHAN)
continue;
282 if(j<0 || j>=
NADC)
continue;
283 Double_t q = map->
GetData(i,j);
286 ULong64_t test = 1 << itr;
288 if(
fMapTmp[i][j] & test)
continue;
295 Info(
"GetQtrack",
"Plane %d, Track %d: Q = %g/%g",plane,itr,qTr,
fQtot);
305 Int_t nCl = clArray->GetEntries();
309 for(Int_t i = 0; i<
NCHAN; i++){
310 for(Int_t j = 0; j<
NADC; j++){
316 for(Int_t icl = 0; icl<nCl; icl++){
318 if(cluster->
GetPlane() != plane)
continue;
323 Int_t nTr = cluster->
GetNtr();
324 for(Int_t iTr = 0; iTr<nTr;iTr++){
326 for(Int_t k = ind2; k< ind2 + width; k++){
327 Int_t i = -1, j = -1;
328 if(type ==
CCLUSTER){ i = ind; j = k;}
329 if(type ==
TCLUSTER){ i = k; j = ind;}
330 if(i<0 || i>=NCHAN)
continue;
331 if(j<0 || j>=
NADC)
continue;
332 Double_t q = map->
GetData(i,j);
335 ULong64_t test = 1 << itr;
337 if(used4Q[i][j] & test)
continue;
340 used4Q[i][j] |= test;
346 for(Int_t i = 0; i<
fNtr[plane]; i++){
347 for(Int_t j = 0; j<fNtr[plane]; j++){
351 for(Int_t i = 0; i<
NCHAN; i++){
352 for(Int_t j = 0; j<
NADC; j++){
353 Double_t q = map->
GetData(i,j);
356 for(Int_t itr1 = 0; itr1<fNtr[plane]; itr1++){
357 ULong64_t test1 = 1 << itr1;
358 if(!(used4Q[i][j] & test1))
continue;
359 for(Int_t itr2 = itr1; itr2<fNtr[plane]; itr2++){
360 ULong64_t test2 = 1 << itr2;
361 if(!(used4Q[i][j] & test2))
continue;
369 for(Int_t i = 0; i<fNtr[plane]; i++){
370 for(Int_t j = 0; j<fNtr[plane]; j++){
373 std::cout << std::endl;
410 hNcl =
new TH1F(
"hNcl",
"hNcl",500,0,500);
418 const Int_t nbinsDist = 200;
419 Double_t xminDist = 1;
420 Double_t xmaxDist = 10000;
421 Double_t logxminDist = TMath::Log(xminDist);
422 Double_t logxmaxDist = TMath::Log(xmaxDist);
423 Double_t binwidthDist = (logxmaxDist-logxminDist)/nbinsDist;
424 Double_t xbinsDist[nbinsDist+1];
425 xbinsDist[0] = xminDist;
426 for (Int_t i=1;i<=nbinsDist;i++)
427 xbinsDist[i] = TMath::Exp(logxminDist+i*binwidthDist);
430 const Int_t nbinsTheta = 100;
431 Double_t xminTheta = 1e-5;
432 Double_t xmaxTheta = 2;
433 Double_t logxminTheta = TMath::Log(xminTheta);
434 Double_t logxmaxTheta = TMath::Log(xmaxTheta);
435 Double_t binwidthTheta = (logxmaxTheta-logxminTheta)/nbinsTheta;
436 Double_t xbinsTheta[nbinsTheta+1];
437 xbinsTheta[0] = xminTheta;
438 for (Int_t i=1;i<=nbinsTheta;i++)
439 xbinsTheta[i] = TMath::Exp(logxminTheta+i*binwidthTheta);
441 hDistTracks =
new TH1F(
"hDistTracks",
"",nbinsDist,xbinsDist);
442 hDistMinTracks =
new TH1F(
"hDistMinTracks",
"",nbinsDist,xbinsDist);
443 hThetaTracks =
new TH1F(
"hThetaTracks",
"",nbinsTheta,xbinsTheta);
445 hThetaTracksNtr =
new TH2F(
"hThetaTracksNtr",
"",nbinsDist,xbinsDist,nbinsTheta,xbinsTheta);
446 for(Int_t i = 0; i<10; i++)
447 hThetaDist[i] =
new TH2F(Form(
"hThetaDist%d",i),
"",nbinsDist,xbinsDist,nbinsTheta,xbinsTheta);
450 const Int_t nbinsQ = 100;
451 Double_t xminQ = 1e-3;
452 Double_t xmaxQ = 1e3;
453 Double_t logxminQ = TMath::Log(xminQ);
454 Double_t logxmaxQ = TMath::Log(xmaxQ);
455 Double_t binwidthQ = (logxmaxQ-logxminQ)/nbinsQ;
456 Double_t xbinsQ[nbinsQ+1];
458 for (Int_t i=1;i<=nbinsQ;i++)
459 xbinsQ[i] = TMath::Exp(logxminQ+i*binwidthQ);
460 fHistQQtestVsDist =
new TH2F(
"fHistQQtestVsDist",
"",nbinsQ,xbinsQ,nbinsDist,xbinsDist);
461 fHistQQmin =
new TH2F(
"fHistQQmin",
"",nbinsQ,xbinsQ,nbinsDist,xbinsDist);
474 for(Int_t i = 0; i<10; i++){
void SetPzEnd(Double_t val)
void SetXend(Double_t val)
Double_t GetZfit(Int_t i=0)
HarpoRecoEvent * GetRecoEvent()
TClonesArray * GetKalmanTracksArray()
void SetPxEnd(Double_t val)
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
void SetPzStart(Double_t val)
Object containing the reconstruction information for one event (with array of HarpoRecoClusters Harpo...
Int_t InitPlane(TClonesArray *clArray, Int_t plane)
TMatrixD GetTrackEnd(TClonesArray *clArray, Int_t plane, Int_t iTr)
Double_t GetQtrack(Int_t itr, Int_t plane)
TH1F * hNcl
Redefine empty default.
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)
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Int_t InitPlane(TClonesArray *clArray, Int_t plane)
HarpoRecoTracks object, Obtained with Kalman filter.
Cluster object, containing position, charge and quality information.
TFile * OpenHistFile(const char *ananame)
void SetXstart(Double_t val)
void SetZend(Double_t val)
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
ULong64_t fMapTmp[NCHAN][NADC]
Int_t FitTrack(TClonesArray *clArray, Int_t plane, HarpoRecoKalmanTracks *track)
Double_t GetQtracks(Int_t plane)
Int_t GetIdClusterTrack()
void SetZstart(Double_t val)
void SetPxStart(Double_t val)
Double_t fQcommon[NTRACK][NTRACK]
HarpoEventHeader * GetHeader()
void print()
Ovreloaded medod whic do all job.
const ULong_t gkNDetectors
Double_t GetXfit(Int_t i=0)
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
void Save(char *mode=NULL)
TClonesArray * GetClustersArray()
void SetTrackType(Int_t val)
Bool_t CheckIdClusterTrack(Int_t val)