240 |
Track = new TClonesArray("TrkTrack"); |
Track = new TClonesArray("TrkTrack"); |
241 |
SingletX = new TClonesArray("TrkSinglet"); |
SingletX = new TClonesArray("TrkSinglet"); |
242 |
SingletY = new TClonesArray("TrkSinglet"); |
SingletY = new TClonesArray("TrkSinglet"); |
243 |
// Track = 0; |
|
244 |
// Singlet = 0; |
// PhysicalTrack = new TClonesArray("TrkTrack"); |
245 |
// SingletY = 0; |
//sostituire con TRefArray... appena ho capito come si usa |
246 |
} |
} |
247 |
//-------------------------------------- |
//-------------------------------------- |
248 |
// |
// |
270 |
/** |
/** |
271 |
* Fills a TrkLevel2 object with values from a struct cTrkLevel2 (to get data from F77 common). |
* Fills a TrkLevel2 object with values from a struct cTrkLevel2 (to get data from F77 common). |
272 |
*/ |
*/ |
273 |
void TrkLevel2::FillCommonVar(cTrkLevel2 *l2){ |
void TrkLevel2::SetFromLevel2Struct(cTrkLevel2 *l2){ |
274 |
// |
// |
275 |
// Track = new TClonesArray("TrkTrack"); |
// Track = new TClonesArray("TrkTrack"); |
276 |
// SingletX = new TClonesArray("TrkSinglet"); |
// SingletX = new TClonesArray("TrkSinglet"); |
337 |
delete t_track; |
delete t_track; |
338 |
delete t_singlet; |
delete t_singlet; |
339 |
} |
} |
340 |
|
/** |
341 |
|
* Fills a struct cTrkLevel2 with values from a TrkLevel2 object (to put data into a F77 common). |
342 |
|
*/ |
343 |
|
|
344 |
|
void TrkLevel2::GetLevel2Struct(cTrkLevel2 *l2) const { |
345 |
|
|
346 |
|
// general variables |
347 |
|
l2->good2 = good2 ; |
348 |
|
for(Int_t i=0; i<12 ; i++){ |
349 |
|
l2->crc[i] = crc[i]; |
350 |
|
}; |
351 |
|
// *** TRACKS *** |
352 |
|
|
353 |
|
l2->ntrk = Track->GetEntries(); |
354 |
|
for(Int_t i=0;i<l2->ntrk;i++){ |
355 |
|
l2->image[i] = 1 + ((TrkTrack *)Track->At(i))->image; |
356 |
|
l2->chi2_nt[i] = ((TrkTrack *)Track->At(i))->chi2; |
357 |
|
for(int it1=0;it1<5;it1++){ |
358 |
|
l2->al_nt[i][it1] = ((TrkTrack *)Track->At(i))->al[it1]; |
359 |
|
for(int it2=0;it2<5;it2++) |
360 |
|
l2->coval[i][it2][it1] = ((TrkTrack *)Track->At(i))->coval[it1][it2]; |
361 |
|
}; |
362 |
|
for(int ip=0;ip<6;ip++){ |
363 |
|
l2->xgood_nt[i][ip] = ((TrkTrack *)Track->At(i))->xgood[ip]; |
364 |
|
l2->ygood_nt[i][ip] = ((TrkTrack *)Track->At(i))->ygood[ip]; |
365 |
|
l2->xm_nt[i][ip] = ((TrkTrack *)Track->At(i))->xm[ip]; |
366 |
|
l2->ym_nt[i][ip] = ((TrkTrack *)Track->At(i))->ym[ip]; |
367 |
|
l2->zm_nt[i][ip] = ((TrkTrack *)Track->At(i))->zm[ip]; |
368 |
|
l2->resx_nt[i][ip] = ((TrkTrack *)Track->At(i))->resx[ip]; |
369 |
|
l2->resy_nt[i][ip] = ((TrkTrack *)Track->At(i))->resy[ip]; |
370 |
|
l2->xv_nt[i][ip] = ((TrkTrack *)Track->At(i))->xv[ip]; |
371 |
|
l2->yv_nt[i][ip] = ((TrkTrack *)Track->At(i))->yv[ip]; |
372 |
|
l2->zv_nt[i][ip] = ((TrkTrack *)Track->At(i))->zv[ip]; |
373 |
|
l2->axv_nt[i][ip] = ((TrkTrack *)Track->At(i))->axv[ip]; |
374 |
|
l2->ayv_nt[i][ip] = ((TrkTrack *)Track->At(i))->ayv[ip]; |
375 |
|
l2->dedx_x[i][ip] = ((TrkTrack *)Track->At(i))->dedx_x[ip]; |
376 |
|
l2->dedx_y[i][ip] = ((TrkTrack *)Track->At(i))->dedx_y[ip]; |
377 |
|
}; |
378 |
|
} |
379 |
|
|
380 |
|
// *** SINGLETS *** |
381 |
|
l2->nclsx = SingletX->GetEntries(); |
382 |
|
for(Int_t i=0;i<l2->nclsx;i++){ |
383 |
|
l2->planex[i] = ((TrkSinglet *)SingletX->At(i))->plane; |
384 |
|
l2->xs[i][0] = ((TrkSinglet *)SingletX->At(i))->coord[0]; |
385 |
|
l2->xs[i][1] = ((TrkSinglet *)SingletX->At(i))->coord[1]; |
386 |
|
l2->signlxs[i] = ((TrkSinglet *)SingletX->At(i))->sgnl; |
387 |
|
} |
388 |
|
l2->nclsy = SingletY->GetEntries(); |
389 |
|
for(Int_t i=0;i<l2->nclsy;i++){ |
390 |
|
l2->planey[i] = ((TrkSinglet *)SingletY->At(i))->plane; |
391 |
|
l2->ys[i][0] = ((TrkSinglet *)SingletY->At(i))->coord[0]; |
392 |
|
l2->ys[i][1] = ((TrkSinglet *)SingletY->At(i))->coord[1]; |
393 |
|
l2->signlys[i] = ((TrkSinglet *)SingletY->At(i))->sgnl; |
394 |
|
} |
395 |
|
} |
396 |
//-------------------------------------- |
//-------------------------------------- |
397 |
// |
// |
398 |
// |
// |
418 |
* Sort physical tracks and stores them in a TObjectArray, ordering by increasing chi**2 value (in case of track image, it selects the one with lower chi**2). The total number of physical tracks is given by GetNTracks() and the it-th physical track can be retrieved by means of the method GetTrack(int it). |
* Sort physical tracks and stores them in a TObjectArray, ordering by increasing chi**2 value (in case of track image, it selects the one with lower chi**2). The total number of physical tracks is given by GetNTracks() and the it-th physical track can be retrieved by means of the method GetTrack(int it). |
419 |
* This method is overridden by PamLevel2::GetTracks(), where calorimeter and TOF information is used. |
* This method is overridden by PamLevel2::GetTracks(), where calorimeter and TOF information is used. |
420 |
*/ |
*/ |
421 |
TClonesArray *TrkLevel2::GetTracks(){ |
// TClonesArray *TrkLevel2::GetTracks(){ |
422 |
TClonesArray *sorted = GetTracks_NFitSorted(); |
// TClonesArray *sorted = GetTracks_NFitSorted(); |
423 |
return sorted; |
// return sorted; |
424 |
}; |
// }; |
425 |
|
|
426 |
TClonesArray *TrkLevel2::GetTracks_Chi2Sorted(){ |
/*TClonesArray *TrkLevel2::GetTracks_Chi2Sorted(){ |
427 |
|
|
428 |
TClonesArray *sorted = new TClonesArray("TrkTrack"); |
TClonesArray *sorted = new TClonesArray("TrkTrack"); |
429 |
TClonesArray &t = *Track; |
TClonesArray &t = *Track; |
451 |
indo++; |
indo++; |
452 |
} |
} |
453 |
return sorted; |
return sorted; |
454 |
} |
}*/ |
455 |
TClonesArray *TrkLevel2::GetTracks_NFitSorted(){ |
/*TClonesArray *TrkLevel2::GetTracks_NFitSorted(){ |
456 |
|
|
457 |
TClonesArray *sorted = new TClonesArray("TrkTrack"); |
TClonesArray *sorted = new TClonesArray("TrkTrack"); |
458 |
TClonesArray &t = *Track; |
TClonesArray &t = *Track; |
459 |
TClonesArray &ts = *sorted; |
TClonesArray &ts = *sorted; |
460 |
int N=this->ntrk(); |
// TClonesArray &ts = *PhysicalTrack; |
461 |
|
int N = ntrk(); |
462 |
vector<int> m(N); for(int i=0; i<N; i++)m[i]=1; |
vector<int> m(N); for(int i=0; i<N; i++)m[i]=1; |
463 |
|
// int m[50]; for(int i=0; i<N; i++)m[i]=1; |
464 |
|
|
465 |
int indo=0; |
int indo=0; |
466 |
int indi=0; |
int indi=0; |
467 |
while(N != 0){ |
while(N != 0){ |
468 |
int nfit =0; |
int nfit =0; |
469 |
float chi2ref=1000000; |
float chi2ref = numeric_limits<float>::max(); |
470 |
// first loop to search maximum num. of fit points |
// first loop to search maximum num. of fit points |
471 |
for(int i=0; i<this->ntrk(); i++){ |
for(int i=0; i < ntrk(); i++){ |
472 |
if( ((TrkTrack *)t[i])->GetNtot() >= nfit && m[i]==1){ |
// if(N==ntrk())cout << "** "<<i<< " " << ((TrkTrack *)t[i])->GetImageSeqNo()<< " " <<((TrkTrack *)t[i])->GetNtot() << " " <<((TrkTrack *)t[i])->chi2 << endl; |
473 |
nfit = ((TrkTrack *)t[i])->GetNtot(); |
if( ((TrkTrack *)t[i])->GetNtot() >= nfit && m[i]==1){ |
474 |
// cout << "1** "<<i<< " " << nfit<<endl; |
nfit = ((TrkTrack *)t[i])->GetNtot(); |
475 |
} |
} |
476 |
} |
} |
477 |
//second loop to search minimum chi2 among selected |
//second loop to search minimum chi2 among selected |
478 |
for(int i=0; i<this->ntrk(); i++){ |
for(int i=0; i<this->ntrk(); i++){ |
479 |
if( ((TrkTrack *)t[i])->chi2 < chi2ref |
if( ((TrkTrack *)t[i])->chi2 < chi2ref |
480 |
&& ((TrkTrack *)t[i])->GetNtot()== nfit |
&& ((TrkTrack *)t[i])->GetNtot()== nfit |
481 |
&& m[i]==1){ |
&& m[i]==1){ |
482 |
chi2ref = ((TrkTrack *)t[i])->chi2; |
chi2ref = ((TrkTrack *)t[i])->chi2; |
483 |
indi = i; |
indi = i; |
484 |
// cout << "2** "<<i<< " " << nfit <<" "<<chi2ref<<endl; |
// cout << "2** "<<i<< " " << nfit <<" "<<chi2ref<<endl; |
485 |
} |
} |
486 |
} |
} |
487 |
if( ((TrkTrack *)t[indi])->HasImage() ){ |
if( ((TrkTrack *)t[indi])->HasImage() ){ |
488 |
m[((TrkTrack *)t[indi])->image] = 0; |
m[((TrkTrack *)t[indi])->image] = 0; |
489 |
N--; |
N--; |
490 |
|
|
491 |
|
// Int_t nfiti=((TrkTrack *)t[((TrkTrack *)t[indi])->image ])->GetNtot(); |
492 |
|
// Float_t chi2i=((TrkTrack *)t[((TrkTrack *)t[indi])->image ])->chi2; |
493 |
|
|
494 |
|
// cout << "i** "<< ((TrkTrack *)t[indi])->image << " " << nfiti <<" "<<chi2i<<endl; |
495 |
|
} |
496 |
|
new(ts[indo]) TrkTrack(*(TrkTrack*)t[indi]); |
497 |
|
m[indi] = 0; |
498 |
|
// cout << "SORTED "<< indo << " "<< indi << " "<< N << endl; |
499 |
|
N--; |
500 |
|
indo++; |
501 |
|
} |
502 |
|
m.clear(); |
503 |
|
return sorted; |
504 |
|
// return PhysicalTrack; |
505 |
|
}*/ |
506 |
|
//TClonesArray *TrkLevel2::GetTracks_NFitSorted(){ |
507 |
|
TRefArray *TrkLevel2::GetTracks_NFitSorted(){ |
508 |
|
|
509 |
// Int_t nfiti=((TrkTrack *)t[((TrkTrack *)t[indi])->image ])->GetNtot(); |
// cout << "GetTracks_NFitSorted(it): new TRefArray()"<< endl; |
510 |
// Float_t chi2i=((TrkTrack *)t[((TrkTrack *)t[indi])->image ])->chi2; |
// TClonesArray *sorted = new TClonesArray("TrkTrack"); |
511 |
|
// TClonesArray &ts = *sorted; |
512 |
|
TRefArray *sorted = new TRefArray(); |
513 |
|
|
514 |
|
TClonesArray &t = *Track; |
515 |
|
// TClonesArray &ts = *PhysicalTrack; |
516 |
|
int N = ntrk(); |
517 |
|
vector<int> m(N); for(int i=0; i<N; i++)m[i]=1; |
518 |
|
// int m[50]; for(int i=0; i<N; i++)m[i]=1; |
519 |
|
|
520 |
|
int indo=0; |
521 |
|
int indi=0; |
522 |
|
while(N != 0){ |
523 |
|
int nfit =0; |
524 |
|
float chi2ref = numeric_limits<float>::max(); |
525 |
|
// first loop to search maximum num. of fit points |
526 |
|
for(int i=0; i < ntrk(); i++){ |
527 |
|
// if(N==ntrk())cout << "** "<<i<< " " << ((TrkTrack *)t[i])->GetImageSeqNo()<< " " <<((TrkTrack *)t[i])->GetNtot() << " " <<((TrkTrack *)t[i])->chi2 << endl; |
528 |
|
if( ((TrkTrack *)t[i])->GetNtot() >= nfit && m[i]==1){ |
529 |
|
nfit = ((TrkTrack *)t[i])->GetNtot(); |
530 |
|
} |
531 |
|
} |
532 |
|
//second loop to search minimum chi2 among selected |
533 |
|
for(int i=0; i<this->ntrk(); i++){ |
534 |
|
if( ((TrkTrack *)t[i])->chi2 < chi2ref |
535 |
|
&& ((TrkTrack *)t[i])->GetNtot()== nfit |
536 |
|
&& m[i]==1){ |
537 |
|
chi2ref = ((TrkTrack *)t[i])->chi2; |
538 |
|
indi = i; |
539 |
|
// cout << "2** "<<i<< " " << nfit <<" "<<chi2ref<<endl; |
540 |
|
} |
541 |
|
} |
542 |
|
if( ((TrkTrack *)t[indi])->HasImage() ){ |
543 |
|
m[((TrkTrack *)t[indi])->image] = 0; |
544 |
|
N--; |
545 |
|
|
546 |
|
// Int_t nfiti=((TrkTrack *)t[((TrkTrack *)t[indi])->image ])->GetNtot(); |
547 |
|
// Float_t chi2i=((TrkTrack *)t[((TrkTrack *)t[indi])->image ])->chi2; |
548 |
|
|
549 |
|
// cout << "i** "<< ((TrkTrack *)t[indi])->image << " " << nfiti <<" "<<chi2i<<endl; |
550 |
|
} |
551 |
|
// new(ts[indo]) TrkTrack(*(TrkTrack*)t[indi]); |
552 |
|
// cout << "GetTracks_NFitSorted(it): Add("<<indo<<")"<< endl; |
553 |
|
sorted->Add( (TrkTrack*)t[indi] ); |
554 |
|
|
555 |
// cout << "i** "<< ((TrkTrack *)t[indi])->image << " " << nfiti <<" "<<chi2i<<endl; |
m[indi] = 0; |
556 |
|
// cout << "SORTED "<< indo << " "<< indi << " "<< N << endl; |
557 |
|
N--; |
558 |
|
indo++; |
559 |
} |
} |
560 |
new(ts[indo]) TrkTrack(*(TrkTrack*)t[indi]); |
m.clear(); |
561 |
m[indi] = 0; |
// cout << "GetTracks_NFitSorted(it): Done"<< endl; |
562 |
N--; |
|
563 |
indo++; |
return sorted; |
564 |
} |
// return PhysicalTrack; |
|
return sorted; |
|
565 |
} |
} |
566 |
//-------------------------------------- |
//-------------------------------------- |
567 |
// |
// |
588 |
// |
// |
589 |
//-------------------------------------- |
//-------------------------------------- |
590 |
/** |
/** |
591 |
|
* Retrieves the is-th stored X singlet. |
592 |
|
* @param it Singlet number, ranging from 0 to nclsx(). |
593 |
|
*/ |
594 |
|
TrkSinglet *TrkLevel2::GetSingletX(int is){ |
595 |
|
|
596 |
|
if(is >= this->nclsx()){ |
597 |
|
cout << "** TrkLevel2 ** Singlet "<< is << "doen not exits! " << endl; |
598 |
|
cout << " Stored x-singlets nclsx() = "<< this->nclsx() << endl; |
599 |
|
return 0; |
600 |
|
} |
601 |
|
TClonesArray &t = *(SingletX); |
602 |
|
TrkSinglet *singlet = (TrkSinglet*)t[is]; |
603 |
|
return singlet; |
604 |
|
} |
605 |
|
//-------------------------------------- |
606 |
|
// |
607 |
|
// |
608 |
|
//-------------------------------------- |
609 |
|
/** |
610 |
|
* Retrieves the is-th stored Y singlet. |
611 |
|
* @param it Singlet number, ranging from 0 to nclsx(). |
612 |
|
*/ |
613 |
|
TrkSinglet *TrkLevel2::GetSingletY(int is){ |
614 |
|
|
615 |
|
if(is >= this->nclsy()){ |
616 |
|
cout << "** TrkLevel2 ** Singlet "<< is << "doen not exits! " << endl; |
617 |
|
cout << " Stored y-singlets nclsy() = "<< this->nclsx() << endl; |
618 |
|
return 0; |
619 |
|
} |
620 |
|
TClonesArray &t = *(SingletY); |
621 |
|
TrkSinglet *singlet = (TrkSinglet*)t[is]; |
622 |
|
return singlet; |
623 |
|
} |
624 |
|
//-------------------------------------- |
625 |
|
// |
626 |
|
// |
627 |
|
//-------------------------------------- |
628 |
|
/** |
629 |
* Retrieves the it-th "physical" track, sorted by the method GetNTracks(). |
* Retrieves the it-th "physical" track, sorted by the method GetNTracks(). |
630 |
* @param it Track number, ranging from 0 to GetNTracks(). |
* @param it Track number, ranging from 0 to GetNTracks(). |
631 |
*/ |
*/ |
632 |
TrkTrack *TrkLevel2::GetTrack(int it){ |
/*TrkTrack *TrkLevel2::GetTrack(int it){ |
633 |
|
|
634 |
if(it >= this->GetNTracks()){ |
if(it >= this->GetNTracks()){ |
635 |
cout << "** TrkLevel2 ** Track "<< it << "does not exits! " << endl; |
cout << "** TrkLevel2 ** Track "<< it << "does not exits! " << endl; |
636 |
cout << " Physical tracks GetNTracks() = "<< this->ntrk() << endl; |
cout << " Physical tracks GetNTracks() = "<< this->ntrk() << endl; |
637 |
return 0; |
return 0; |
638 |
} |
} |
639 |
TrkTrack *track = (TrkTrack*)(*(this->GetTracks()))[it]; |
TClonesArray* sorted = GetTracks(); |
640 |
GetTracks()->Delete();////TEMPORANEO |
TClonesArray &ts = *sorted; |
641 |
return track; |
|
642 |
|
// TrkTrack *track = (TrkTrack*)ts[it]; |
643 |
|
TrkTrack *track = new TrkTrack( *(TrkTrack*)ts[it] ); //copia |
644 |
|
sorted->Delete("all");////TEMPORANEO |
645 |
|
return track; |
646 |
|
}*/ |
647 |
|
TrkTrack *TrkLevel2::GetTrack(int it){ |
648 |
|
|
649 |
|
if(it >= this->GetNTracks()){ |
650 |
|
cout << "** TrkLevel2 ** Track "<< it << "does not exits! " << endl; |
651 |
|
cout << " Physical tracks GetNTracks() = "<< this->ntrk() << endl; |
652 |
|
return 0; |
653 |
|
} |
654 |
|
|
655 |
|
TRefArray *sorted = GetTracks(); //TEMPORANEO |
656 |
|
TrkTrack *track = (TrkTrack*)sorted->At(it); |
657 |
|
sorted->Delete(); |
658 |
|
return track; |
659 |
} |
} |
660 |
|
/** |
661 |
|
* Give the number of "physical" tracks, sorted by the method GetTracks(). |
662 |
|
*/ |
663 |
Int_t TrkLevel2::GetNTracks(){ |
Int_t TrkLevel2::GetNTracks(){ |
664 |
Int_t ntot=0; |
|
665 |
ntot = GetTracks()->GetEntries(); |
Float_t ntot=0; |
666 |
GetTracks()->Delete();////TEMPORANEO |
TClonesArray &t = *Track; |
667 |
return ntot; |
for(int i=0; i<ntrk(); i++) { |
668 |
|
if( ((TrkTrack *)t[i])->GetImageSeqNo() == -1 ) ntot+=1.; |
669 |
|
else ntot+=0.5; |
670 |
|
} |
671 |
|
return (Int_t)ntot; |
672 |
|
|
673 |
}; |
}; |
674 |
//-------------------------------------- |
//-------------------------------------- |
675 |
// |
// |
679 |
* Retrieves (if present) the image of the it-th "physical" track, sorted by the method GetNTracks(). |
* Retrieves (if present) the image of the it-th "physical" track, sorted by the method GetNTracks(). |
680 |
* @param it Track number, ranging from 0 to GetNTracks(). |
* @param it Track number, ranging from 0 to GetNTracks(). |
681 |
*/ |
*/ |
682 |
TrkTrack *TrkLevel2::GetTrackImage(int it){ |
/*TrkTrack *TrkLevel2::GetTrackImage(int it){ |
683 |
|
|
684 |
if(it >= this->GetNTracks()){ |
if(it >= this->GetNTracks()){ |
685 |
cout << "** TrkLevel2 ** Track "<< it << "does not exits! " << endl; |
cout << "** TrkLevel2 ** Track "<< it << "does not exits! " << endl; |
686 |
cout << " Physical tracks GetNTracks() = "<< this->ntrk() << endl; |
cout << " Physical tracks GetNTracks() = "<< this->ntrk() << endl; |
687 |
return 0; |
return 0; |
688 |
} |
} |
689 |
TrkTrack *track = (TrkTrack*)(*(this->GetTracks()))[it]; |
|
690 |
if(!track->HasImage()){ |
TClonesArray* sorted = GetTracks(); |
691 |
|
TClonesArray &ts = *sorted; |
692 |
|
TrkTrack *track = (TrkTrack*)ts[it]; |
693 |
|
// TrkTrack *track = (TrkTrack*)(*(this->GetTracks()))[it]; |
694 |
|
|
695 |
|
if(!track->HasImage()){ |
696 |
cout << "** TrkLevel2 ** Track "<< it << "does not have image! " << endl; |
cout << "** TrkLevel2 ** Track "<< it << "does not have image! " << endl; |
697 |
return 0; |
return 0; |
698 |
} |
} |
699 |
TrkTrack *image = (TrkTrack*)(*Track)[track->image]; |
TrkTrack *image = (TrkTrack*)(*Track)[track->image]; |
700 |
|
|
701 |
|
// GetTracks()->Delete(); ////TEMPORANEO |
702 |
|
sorted->Delete(); ////TEMPORANEO |
703 |
|
|
704 |
return image; |
return image; |
705 |
|
|
706 |
|
}*/ |
707 |
|
TrkTrack *TrkLevel2::GetTrackImage(int it){ |
708 |
|
|
709 |
|
if(it >= this->GetNTracks()){ |
710 |
|
cout << "** TrkLevel2 ** Track "<< it << "does not exits! " << endl; |
711 |
|
cout << " Physical tracks GetNTracks() = "<< this->ntrk() << endl; |
712 |
|
return 0; |
713 |
|
} |
714 |
|
|
715 |
|
TRefArray* sorted = GetTracks(); //TEMPORANEO |
716 |
|
TrkTrack *track = (TrkTrack*)sorted->At(it); |
717 |
|
|
718 |
|
if(!track->HasImage()){ |
719 |
|
cout << "** TrkLevel2 ** Track "<< it << "does not have image! " << endl; |
720 |
|
return 0; |
721 |
|
} |
722 |
|
TrkTrack *image = (TrkTrack*)(*Track)[track->image]; |
723 |
|
|
724 |
|
sorted->Delete(); |
725 |
|
|
726 |
|
return image; |
727 |
|
|
728 |
} |
} |
729 |
//-------------------------------------- |
//-------------------------------------- |
730 |
// |
// |
742 |
// |
// |
743 |
//-------------------------------------- |
//-------------------------------------- |
744 |
/** |
/** |
745 |
|
* Get tracker-plane (mechanical) z-coordinate |
746 |
|
* @param plane_id plane index (1=TOP,2,3,4,5,6=BOTTOM) |
747 |
|
*/ |
748 |
|
Float_t TrkLevel2::GetZTrk(Int_t plane_id){ |
749 |
|
switch(plane_id){ |
750 |
|
case 1: return ZTRK1; |
751 |
|
case 2: return ZTRK2; |
752 |
|
case 3: return ZTRK3; |
753 |
|
case 4: return ZTRK4; |
754 |
|
case 5: return ZTRK5; |
755 |
|
case 6: return ZTRK6; |
756 |
|
default: return 0.; |
757 |
|
}; |
758 |
|
}; |
759 |
|
//-------------------------------------- |
760 |
|
// |
761 |
|
// |
762 |
|
//-------------------------------------- |
763 |
|
/** |
764 |
* Trajectory default constructor. |
* Trajectory default constructor. |
765 |
* (By default is created with z-coordinates inside the tracking volume) |
* (By default is created with z-coordinates inside the tracking volume) |
766 |
*/ |
*/ |
772 |
thx = new float[npoint]; |
thx = new float[npoint]; |
773 |
thy = new float[npoint]; |
thy = new float[npoint]; |
774 |
tl = new float[npoint]; |
tl = new float[npoint]; |
775 |
float dz = ((ZTRKUP)-(ZTRKDW))/(npoint-1); |
float dz = ((ZTRK1)-(ZTRK6))/(npoint-1); |
776 |
for(int i=0; i<npoint; i++){ |
for(int i=0; i<npoint; i++){ |
777 |
x[i] = 0; |
x[i] = 0; |
778 |
y[i] = 0; |
y[i] = 0; |
779 |
z[i] = (ZTRKUP) - i*dz; |
z[i] = (ZTRK1) - i*dz; |
780 |
thx[i] = 0; |
thx[i] = 0; |
781 |
thy[i] = 0; |
thy[i] = 0; |
782 |
tl[i] = 0; |
tl[i] = 0; |
803 |
thx = new float[npoint]; |
thx = new float[npoint]; |
804 |
thy = new float[npoint]; |
thy = new float[npoint]; |
805 |
tl = new float[npoint]; |
tl = new float[npoint]; |
806 |
float dz = ((ZTRKUP)-(ZTRKDW))/(npoint-1); |
float dz = ((ZTRK1)-(ZTRK6))/(npoint-1); |
807 |
for(int i=0; i<npoint; i++){ |
for(int i=0; i<npoint; i++){ |
808 |
x[i] = 0; |
x[i] = 0; |
809 |
y[i] = 0; |
y[i] = 0; |
810 |
z[i] = (ZTRKUP) - i*dz; |
z[i] = (ZTRK1) - i*dz; |
811 |
thx[i] = 0; |
thx[i] = 0; |
812 |
thy[i] = 0; |
thy[i] = 0; |
813 |
tl[i] = 0; |
tl[i] = 0; |
881 |
return l; |
return l; |
882 |
|
|
883 |
} |
} |
884 |
|
|
885 |
ClassImp(TrkLevel2); |
ClassImp(TrkLevel2); |
886 |
ClassImp(TrkSinglet); |
ClassImp(TrkSinglet); |
887 |
ClassImp(TrkTrack); |
ClassImp(TrkTrack); |