200 |
|
|
201 |
tsorted=0; |
tsorted=0; |
202 |
timage=0; |
timage=0; |
203 |
|
|
204 |
|
howtosort = "+CAL+TOF"; |
205 |
|
//howtosort = "+TOF"; |
206 |
|
sortthr = 100.; |
207 |
|
|
208 |
}; |
}; |
209 |
/** |
/** |
597 |
} |
} |
598 |
//-------------------------------------- |
//-------------------------------------- |
599 |
// |
// |
600 |
|
|
601 |
|
/** |
602 |
|
* Sort physical (tracker) tracks and stores them in the TRefArray (of TrkTrack objects) which pointer is PamLevel2::sorted_tracks. Left here as backward compatibility method. |
603 |
|
**/ |
604 |
|
void PamLevel2::SortTracks(TString how){ |
605 |
|
printf(" WARNING! obsolete, use SortTracks() and SetSortingMethod(TString) instead! \n Setting sorting method to %s \n",how.Data()); |
606 |
|
howtosort = how; |
607 |
|
SortTracks(); |
608 |
|
}; |
609 |
|
|
610 |
// |
// |
611 |
//-------------------------------------- |
//-------------------------------------- |
612 |
/** |
/** |
620 |
* |
* |
621 |
* The total number of physical tracks is always given by GetNTracks() and the it-th physical track can be retrieved by means of the methods GetTrack(int it) and GetTrack(int it, TString how). |
* The total number of physical tracks is always given by GetNTracks() and the it-th physical track can be retrieved by means of the methods GetTrack(int it) and GetTrack(int it, TString how). |
622 |
*/ |
*/ |
623 |
void PamLevel2::SortTracks(TString how){ |
void PamLevel2::SortTracks(){ |
624 |
|
TString how = howtosort; |
625 |
|
|
626 |
// cout <<" PamLevel2::SortTracks(TString how) "<<endl; |
// cout <<" PamLevel2::SortTracks(TString how) "<<endl; |
627 |
if( !trk2_obj ){ |
if( !trk2_obj ){ |
628 |
cout << "void PamLevel2::SortTracks(TString how): TrkLevel2 not loaded !!!"; |
cout << "void PamLevel2::SortTracks(): TrkLevel2 not loaded !!!"; |
629 |
return; |
return; |
630 |
}; |
}; |
631 |
// cout << "call SortTracs() "<<endl; |
// cout << "call SortTracs() "<<endl; |
632 |
//Save current Object count |
//Save current Object count |
633 |
Int_t ObjectNumber = TProcessID::GetObjectCount(); |
Int_t ObjectNumber = TProcessID::GetObjectCount(); |
634 |
|
|
635 |
// cout << "ObjectNumber "<<ObjectNumber <<endl; |
// cout << "ObjectNumber "<<ObjectNumber <<endl; |
636 |
|
|
637 |
// if(!sorted_tracks)sorted_tracks = new TRefArray(); |
// if(!sorted_tracks)sorted_tracks = new TRefArray(); |
638 |
// sorted_tracks->Clear(); |
// sorted_tracks->Clear(); |
639 |
// sorted_tracks.Clear(); |
// sorted_tracks.Clear(); |
640 |
|
|
641 |
if(!tsorted)tsorted = new TClonesArray("PamTrack",trk2_obj->GetNTracks()); |
if(!tsorted)tsorted = new TClonesArray("PamTrack",trk2_obj->GetNTracks()); |
642 |
tsorted->Delete(); |
tsorted->Delete(); |
643 |
TClonesArray &ttsorted = *tsorted; |
TClonesArray &ttsorted = *tsorted; |
644 |
if(!timage)timage = new TClonesArray("PamTrack",trk2_obj->GetNTracks()); |
if(!timage)timage = new TClonesArray("PamTrack",trk2_obj->GetNTracks()); |
645 |
timage->Delete(); |
timage->Delete(); |
646 |
TClonesArray &ttimage = *timage; |
TClonesArray &ttimage = *timage; |
647 |
|
|
648 |
|
|
649 |
// loop over the tracks sorted by the tracker |
// loop over the tracks sorted by the tracker |
650 |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
651 |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
652 |
Bool_t use_TOF = how.Contains("TOF", TString::kIgnoreCase); |
Bool_t use_TOF = how.Contains("TOF", TString::kIgnoreCase); |
653 |
|
|
654 |
if( !CAL2 && use_CAL) use_CAL = false; |
if( !CAL2 && use_CAL) use_CAL = false; |
655 |
if( !TOF && use_TOF) use_TOF = false; |
if( !TOF && use_TOF) use_TOF = false; |
656 |
|
|
657 |
if( !TRK2 ){ |
if( !TRK2 ){ |
658 |
// cout << "SortTracks() : without tracker does not work!!! (not yet)" << endl; |
// cout << "SortTracks() : without tracker does not work!!! (not yet)" << endl; |
659 |
return; |
return; |
660 |
}; |
}; |
661 |
|
|
662 |
// cout << "use_CAL "<<use_CAL<<" use_TOF "<<use_TOF<<" use_TRK "<<use_TRK <<endl; |
// cout << "use_CAL "<<use_CAL<<" use_TOF "<<use_TOF<<" use_TRK "<<use_TRK <<endl; |
663 |
|
|
664 |
for(Int_t i=0; i < trk2_obj->TrkLevel2::GetNTracks(); i++){ |
for(Int_t i=0; i < trk2_obj->TrkLevel2::GetNTracks(); i++){ |
665 |
|
|
666 |
TrkTrack *ts = 0; |
TrkTrack *ts = 0; |
667 |
CaloTrkVar *cs = 0; |
CaloTrkVar *cs = 0; |
668 |
ToFTrkVar *os = 0; |
ToFTrkVar *os = 0; |
669 |
|
|
670 |
// get tracker tracks |
// get tracker tracks |
671 |
TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker |
TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker |
672 |
CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); |
CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); |
673 |
ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); |
ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); |
674 |
|
|
675 |
TrkTrack *ti = 0; //tracker (image) |
TrkTrack *ti = 0; //tracker (image) |
676 |
CaloTrkVar *ci = 0; |
CaloTrkVar *ci = 0; |
677 |
ToFTrkVar *oi = 0; |
ToFTrkVar *oi = 0; |
678 |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
679 |
// if track has an image, check image selection |
// if track has an image, check image selection |
680 |
if(tp->HasImage()){ |
if(tp->HasImage()){ |
681 |
|
|
682 |
ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) |
ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) |
683 |
ci = GetCaloStoredTrack(ti->GetSeqNo()); |
ci = GetCaloStoredTrack(ti->GetSeqNo()); |
684 |
oi = GetToFStoredTrack(ti->GetSeqNo()); |
oi = GetToFStoredTrack(ti->GetSeqNo()); |
685 |
|
|
686 |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
687 |
|
|
688 |
//assign starting scores |
//assign starting scores |
689 |
Int_t tp_score = 0; //main track sorted by the tracker |
Int_t tp_score = 0; //main track sorted by the tracker |
690 |
Int_t ti_score = 0; //image track |
Int_t ti_score = 0; //image track |
691 |
|
|
692 |
// ------------------------ |
// ------------------------ |
693 |
// calorimeter check |
// calorimeter check |
694 |
// ------------------------ |
// ------------------------ |
695 |
// check the Y spatial residual on the first calorimeter plane |
// check the Y spatial residual on the first calorimeter plane |
696 |
// (cut on calorimeter variables from Emiliano) |
// (cut on calorimeter variables from Emiliano) |
697 |
if( use_CAL && !calo2_obj ){ |
if( use_CAL && !calo2_obj ){ |
698 |
cout << "void PamLevel2::SortTracks(TString how): how= "<<how<<" but CaloLevel2 not loaded !!!"; |
cout << "void PamLevel2::SortTracks(): howtosort= "<<how<<" but CaloLevel2 not loaded !!!"; |
699 |
return; |
return; |
700 |
}; |
}; |
701 |
if( |
if( |
702 |
use_CAL && |
use_CAL && |
703 |
calo2_obj->npcfit[1] > 15 && //no. of fit planes on Y view |
calo2_obj->npcfit[1] > 5 && //no. of fit planes on Y view |
704 |
calo2_obj->varcfit[1] < 1000. && //fit variance on Y view |
calo2_obj->varcfit[1] < 1000. && //fit variance on Y view |
705 |
cp && ci && |
cp && ci && |
706 |
true){ |
true){ |
707 |
|
|
708 |
|
|
709 |
Float_t resy_p = cp->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; |
Float_t resy_p = cp->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; |
710 |
Float_t resy_i = ci->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; |
Float_t resy_i = ci->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; |
711 |
|
|
712 |
if(resy_p <= resy_i) tp_score++; |
if(resy_p <= resy_i) tp_score++; |
713 |
else ti_score++; |
else ti_score++; |
714 |
|
|
715 |
|
// cout << "CALO "<<tp_score<<ti_score<<endl; |
716 |
|
|
717 |
// cout << "CALO "<<tp_score<<ti_score<<endl; |
}; |
718 |
|
// ------------------------ |
719 |
|
// TOF check |
720 |
|
// ------------------------ |
721 |
|
// check the number of hit pmts along the track |
722 |
|
// on S12 S21 and S32, where paddles are parallel to Y axis |
723 |
|
if( use_TOF && !tof_obj ){ |
724 |
|
cout << "void PamLevel2::SortTracks(): howtosort= "<<how<<" but ToFLevel2 not loaded !!!"; |
725 |
|
return; |
726 |
|
}; |
727 |
|
if( use_TOF && op && oi ){ |
728 |
|
|
729 |
|
// |
730 |
|
Float_t sen = 0.; |
731 |
|
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
732 |
|
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
733 |
|
if ( pl == 2 || pl == 3 || pl == 4 || pl == 5 ) sen += (op->dedx).At(ih); |
734 |
|
}; |
735 |
|
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
736 |
|
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
737 |
|
if ( pl == 2 || pl == 3 || pl == 4 || pl == 5 ) sen += (oi->dedx).At(ih); |
738 |
|
}; |
739 |
|
// |
740 |
|
if ( sen >= sortthr ){ |
741 |
|
//printf(" IS A NUCLEUS! en = %f \n",sen); |
742 |
|
// |
743 |
|
// is a nucleus use a different algorithm |
744 |
|
// |
745 |
|
Int_t nz = 6; Float_t zin[6]; // << define TOF z-coordinates |
746 |
|
for(Int_t ip=0; ip<nz; ip++) |
747 |
|
zin[ip] = tof_obj->ToFLevel2::GetZTOF(tof_obj->ToFLevel2::GetToFPlaneID(ip)); // << read ToF plane z-coordinates |
748 |
|
Trajectory *tr = new Trajectory(nz,zin); |
749 |
|
// |
750 |
|
Int_t nphit_p =0; |
751 |
|
Int_t nphit_i =0; |
752 |
|
Float_t enhit_p = 0.; |
753 |
|
Float_t enhit_i = 0.; |
754 |
|
// |
755 |
|
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
756 |
|
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
757 |
|
if(pl == 1 || pl == 2 || pl == 5){ |
758 |
|
nphit_p++; |
759 |
|
enhit_p += (op->dedx).At(ih); |
760 |
|
}; |
761 |
|
}; |
762 |
|
// |
763 |
|
tp->DoTrack2(tr); |
764 |
|
// |
765 |
|
if ( fabs(tr->y[0]-oi->ytofpos[0]) < 2. ){ |
766 |
|
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
767 |
|
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
768 |
|
if(pl == 0){ |
769 |
|
nphit_p++; |
770 |
|
enhit_p += (op->dedx).At(ih); |
771 |
|
}; |
772 |
|
}; |
773 |
|
}; |
774 |
|
if ( fabs(tr->y[3]-oi->ytofpos[1]) < 2. ){ |
775 |
|
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
776 |
|
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
777 |
|
if(pl == 3){ |
778 |
|
nphit_p++; |
779 |
|
enhit_p += (op->dedx).At(ih); |
780 |
|
}; |
781 |
|
}; |
782 |
|
}; |
783 |
|
if ( fabs(tr->y[4]-oi->ytofpos[2]) < 2. ){ |
784 |
|
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
785 |
|
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
786 |
|
if(pl == 4){ |
787 |
|
nphit_p++; |
788 |
|
enhit_p += (op->dedx).At(ih); |
789 |
|
}; |
790 |
|
}; |
791 |
|
}; |
792 |
|
|
793 |
|
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
794 |
|
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
795 |
|
if(pl == 1 || pl == 2 || pl == 5){ |
796 |
|
nphit_i++; |
797 |
|
enhit_i += (op->dedx).At(ih); |
798 |
|
}; |
799 |
|
}; |
800 |
|
// |
801 |
|
ti->DoTrack2(tr); |
802 |
|
// |
803 |
|
if ( fabs(tr->y[0]-oi->ytofpos[0]) < 2. ){ |
804 |
|
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
805 |
|
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
806 |
|
if(pl == 0){ |
807 |
|
nphit_i++; |
808 |
|
enhit_i += (op->dedx).At(ih); |
809 |
|
}; |
810 |
|
}; |
811 |
|
}; |
812 |
|
if ( fabs(tr->y[3]-oi->ytofpos[1]) < 2. ){ |
813 |
|
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
814 |
|
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
815 |
|
if(pl == 3){ |
816 |
|
nphit_i++; |
817 |
|
enhit_i += (op->dedx).At(ih); |
818 |
|
}; |
819 |
}; |
}; |
820 |
// ------------------------ |
}; |
821 |
// TOF check |
if ( fabs(tr->y[4]-oi->ytofpos[2]) < 2. ){ |
822 |
// ------------------------ |
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
823 |
// check the number of hit pmts along the track |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
824 |
// on S12 S21 and S32, where paddles are parallel to Y axis |
if(pl == 4){ |
825 |
if( use_TOF && !tof_obj ){ |
nphit_i++; |
826 |
cout << "void PamLevel2::SortTracks(TString how): how= "<<how<<" but ToFLevel2 not loaded !!!"; |
enhit_i += (op->dedx).At(ih); |
827 |
return; |
}; |
828 |
}; |
}; |
829 |
if( use_TOF && op && oi ){ |
}; |
830 |
|
|
831 |
|
|
832 |
Int_t nphit_p =0; |
if( |
833 |
Int_t nphit_i =0; |
use_TOF && |
834 |
|
(nphit_p+nphit_i) !=0 && |
835 |
|
true){ |
836 |
|
|
837 |
|
// printf(" seqno %i nphit_p %i nphit_i %i enhit_p %f enhit_i %f \n",trk2_obj->TrkLevel2::GetSeqNo(i),nphit_p,nphit_i,enhit_p,enhit_i); |
838 |
|
// printf(" score p %i score i %i \n",tp_score,ti_score); |
839 |
|
// if( enhit_p > enhit_i ) tp_score++; |
840 |
|
// if( nphit_p >= nphit_i && enhit_p > enhit_i ) tp_score++; |
841 |
|
if ( nphit_p > nphit_i ) tp_score++; |
842 |
|
if ( nphit_p < nphit_i ) ti_score++; |
843 |
|
if ( nphit_p == nphit_i ){ |
844 |
|
if ( enhit_p > enhit_i ) tp_score++; |
845 |
|
else ti_score++; |
846 |
|
}; |
847 |
|
// printf(" dopo score p %i score i %i \n",tp_score,ti_score); |
848 |
|
}; |
849 |
|
delete tr; |
850 |
|
// |
851 |
|
} else { |
852 |
|
// |
853 |
|
// NOT a NUCLEUS |
854 |
|
// |
855 |
|
//printf(" NOT a NUCLEUS! en = %f \n",sen); |
856 |
|
|
857 |
|
Int_t nphit_p =0; |
858 |
|
Int_t nphit_i =0; |
859 |
|
|
860 |
|
|
861 |
/* cout << "track: npmtadc "<< op->npmtadc << endl; |
/* cout << "track: npmtadc "<< op->npmtadc << endl; |
862 |
cout << "track: npmttdc "<< op->npmttdc << endl; |
cout << "track: npmttdc "<< op->npmttdc << endl; |
863 |
cout << "image: npmtadc "<< oi->npmtadc << endl; |
cout << "image: npmtadc "<< oi->npmtadc << endl; |
864 |
cout << "image: npmttdc "<< oi->npmttdc << endl;*/ |
cout << "image: npmttdc "<< oi->npmttdc << endl;*/ |
865 |
|
|
866 |
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
867 |
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
868 |
if(pl == 1 || pl == 2 || pl == 5)nphit_p++; |
if(pl == 1 || pl == 2 || pl == 5)nphit_p++; |
869 |
}; |
}; |
870 |
|
|
871 |
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
872 |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
873 |
if(pl == 1 || pl == 2 || pl == 5)nphit_i++; |
if(pl == 1 || pl == 2 || pl == 5)nphit_i++; |
874 |
}; |
}; |
875 |
|
|
876 |
if( |
if( |
877 |
use_TOF && |
use_TOF && |
878 |
(nphit_p+nphit_i) !=0 && |
(nphit_p+nphit_i) !=0 && |
879 |
true){ |
true){ |
880 |
|
|
881 |
if( nphit_p >= nphit_i) tp_score++; |
if( nphit_p >= nphit_i) tp_score++; |
882 |
else ti_score++; |
else ti_score++; |
883 |
}; |
}; |
884 |
// cout << "TOF "<<tp_score<<ti_score<<endl; |
}; |
885 |
}; |
// cout << "TOF "<<tp_score<<ti_score<<endl; |
886 |
if(tp_score == ti_score) use_TRK = true; |
}; |
887 |
// ------------------------ |
if(tp_score == ti_score) use_TRK = true; |
888 |
// tracker check |
// ------------------------ |
889 |
// ------------------------ |
// tracker check |
890 |
// chi**2 difference is not always large enough to distinguish among |
// ------------------------ |
891 |
// the real track and its image. |
// chi**2 difference is not always large enough to distinguish among |
892 |
// Tracker check will be applied always when calorimeter and tof information is ambiguous. |
// the real track and its image. |
893 |
if(use_TRK){ |
// Tracker check will be applied always when calorimeter and tof information is ambiguous. |
894 |
if( tp->chi2 > 0 && tp->chi2 < ti->chi2 ) tp_score++ ; |
if(use_TRK){ |
895 |
else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; |
if( tp->chi2 > 0 && tp->chi2 < ti->chi2 ) tp_score++ ; |
896 |
// cout << "TRK "<<tp_score<<ti_score<<endl; |
else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; |
897 |
}; |
// cout << "TRK "<<tp_score<<ti_score<<endl; |
898 |
|
}; |
899 |
|
|
900 |
// ------------------------ |
// ------------------------ |
901 |
// the winner is.... |
// the winner is.... |
902 |
// ------------------------ |
// ------------------------ |
903 |
if (tp_score > ti_score) { |
if (tp_score > ti_score) { |
904 |
// ts = tp;//the track sorted by the tracker!! |
// ts = tp;//the track sorted by the tracker!! |
905 |
// cs = cp; |
// cs = cp; |
906 |
// os = op; |
// os = op; |
907 |
}else if (tp_score < ti_score) { |
// cout << "It's primary!" << endl; |
908 |
ts = ti;//its image!! |
|
909 |
cs = ci; |
}else if (tp_score < ti_score) { |
910 |
os = oi; |
|
911 |
|
// cout << "It's image!" << endl; |
912 |
ti = tp;//its image!! |
|
913 |
ci = cp; |
ts = ti;//its image!! |
914 |
oi = op; |
cs = ci; |
915 |
|
os = oi; |
916 |
tp = ts;//its image!! |
|
917 |
cp = cs; |
ti = tp;//its image!! |
918 |
op = os; |
ci = cp; |
919 |
|
oi = op; |
920 |
|
|
921 |
|
tp = ts;//its image!! |
922 |
|
cp = cs; |
923 |
|
op = os; |
924 |
|
|
925 |
|
|
926 |
}else { |
}else { |
927 |
// ts = tp; |
// ts = tp; |
928 |
// cs = cp; |
// cs = cp; |
929 |
// os = op; |
// os = op; |
930 |
// cout << "Warning - track image ambiguity not solved" << endl; |
cout << "Warning - track image ambiguity not solved" << endl; |
931 |
// cout << ts->GetNtot() << " "<< ts->chi2 << " " << npcfit[1] << " "<< nphit_p << endl; |
// cout << ts->GetNtot() << " "<< ts->chi2 << " " << npcfit[1] << " "<< nphit_p << endl; |
932 |
}; |
}; |
933 |
|
|
934 |
}else{ |
}else{ |
935 |
// ts = tp; |
// ts = tp; |
936 |
// cs = cp; |
// cs = cp; |
937 |
// os = op; |
// os = op; |
938 |
}; |
}; |
939 |
|
|
940 |
// cout <<" SortTracks() "<<i<<" -- "<<ts<<endl; |
// cout <<" SortTracks() "<<i<<" -- "<<ts<<endl; |
941 |
// sorted_tracks->Add(ts);//save the track in the sorted array |
// sorted_tracks->Add(ts);//save the track in the sorted array |
942 |
// sorted_tracks.Add(ts);//save the track in the sorted array |
// sorted_tracks.Add(ts);//save the track in the sorted array |
943 |
// sorted_tracks.Add(tp);//save the track in the sorted array |
// sorted_tracks.Add(tp);//save the track in the sorted array |
944 |
// cout << "SortTracks:: sorted_tracks->Add(it) "<<i<<" "<<ts<<endl; |
// cout << "SortTracks:: sorted_tracks->Add(it) "<<i<<" "<<ts<<endl; |
945 |
// cout<<"o "<<tp<<endl; |
// cout<<"o "<<tp<<endl; |
946 |
// cout<<"o "<<cp<<endl; |
// cout<<"o "<<cp<<endl; |
947 |
// cout<<"o "<<op<<endl; |
// cout<<"o "<<op<<endl; |
948 |
new(ttsorted[i]) PamTrack(tp,cp,op); |
new(ttsorted[i]) PamTrack(tp,cp,op); |
949 |
new(ttimage[i]) PamTrack(ti,ci,oi); |
new(ttimage[i]) PamTrack(ti,ci,oi); |
950 |
}; |
}; |
951 |
|
|
952 |
if( tsorted->GetEntries() != trk2_obj->GetNTracks() ){ |
if( tsorted->GetEntries() != trk2_obj->GetNTracks() ){ |
953 |
cout << "void PamLevel2::SortTracks(TString how): tsorted->GetEntries() "<<tsorted->GetEntries()<<" != trk2_obj->GetNTracks() = "<<trk2_obj->GetNTracks() <<endl; |
cout << "void PamLevel2::SortTracks(): tsorted->GetEntries() "<<tsorted->GetEntries()<<" != trk2_obj->GetNTracks() = "<<trk2_obj->GetNTracks() <<endl; |
954 |
tsorted->Delete(); tsorted=0; |
tsorted->Delete(); tsorted=0; |
955 |
timage->Delete(); timage=0; |
timage->Delete(); timage=0; |
956 |
} |
} |
957 |
|
|
958 |
//Restore Object count |
//Restore Object count |
959 |
//To save space in the table keeping track of all referenced objects |
//To save space in the table keeping track of all referenced objects |
960 |
//We reset the object count to what it was at the beginning of the event. |
//We reset the object count to what it was at the beginning of the event. |
961 |
TProcessID::SetObjectCount(ObjectNumber); |
TProcessID::SetObjectCount(ObjectNumber); |
962 |
|
|
963 |
}; |
}; |
964 |
//-------------------------------------- |
//-------------------------------------- |
982 |
TClonesArray *PamLevel2::GetTracks(){ |
TClonesArray *PamLevel2::GetTracks(){ |
983 |
|
|
984 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
985 |
SortTracks("+CAL+TOF"); |
SortTracks(); |
986 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
987 |
|
|
988 |
return tsorted; |
return tsorted; |
1001 |
|
|
1002 |
// if(!trk2_obj) return 0; |
// if(!trk2_obj) return 0; |
1003 |
|
|
1004 |
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
// // *-*-*-*+-*-*-*-*-*-*-*-*-* |
1005 |
// SortTracks("+CAL+TOF"); |
// SortTracks("+CAL+TOF"); |
1006 |
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
1007 |
// // if(!sorted_tracks)return 0; |
// // if(!sorted_tracks)return 0; |
1020 |
|
|
1021 |
// cout << "PamLevel2::GetTrack(int it) "<<endl; |
// cout << "PamLevel2::GetTrack(int it) "<<endl; |
1022 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
1023 |
SortTracks("+CAL+TOF"); |
SortTracks(); |
1024 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
1025 |
if(!tsorted)return 0; |
if(!tsorted)return 0; |
1026 |
if(!tsorted->GetEntries())return 0; |
if(!tsorted->GetEntries())return 0; |
1077 |
|
|
1078 |
|
|
1079 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
1080 |
SortTracks("+CAL+TOF"); |
SortTracks(); |
1081 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
1082 |
if(!timage)return 0; |
if(!timage)return 0; |
1083 |
if(!timage->GetEntries())return 0; |
if(!timage->GetEntries())return 0; |