773 {
774
775 Log(4,
"ShowRec.cpp",
"--- void N3_FindBestCompliments() ---");
776
778 cout << "Looking for best compliments for segment " << seg << " of pattern " << TestPattern << " ... " << endl;
779 cout << "Looking for pattern with Downstream = " << Downstream << endl;
781 }
782
785
786
787
788
789 mindeltaZ = 0.0 - Downstream * 1300.0;
790
791
792
793 if (Downstream==0) {
794
795
796 OtherPattern = TestPattern;
797 }
798 else if (Downstream==1) {
800 }
801 else if (Downstream==2) {
803 if (
NULL==OtherPatternInterim) {
805 }
806 else {
808 }
809 }
810 else if (Downstream==-1) {
812 }
813 else if (Downstream==-2) {
815 if (
NULL==OtherPatternInterim) {
817 }
818 else {
820 }
821 }
822 else {
823
824 }
825
826 if (
NULL == OtherPattern) {
827
828 return;
829 }
830
831
832
833
834 Int_t nSeg = OtherPattern->
N();
835
836
837 mindeltaZ = seg->
Z() - OtherPattern->
Z();
838
839 Double_t testval_dR=0;
840 Double_t testval_dT=0;
841 Double_t testval_dminDins=0;
842 Int_t IDmindR = -1;
843 Int_t IDmindT = -1;
844 Int_t IDmindminDist = -1;
845
846
847 mindT=9999999;
848 mindR=9999999;
849 mindMinDist=9999999;
850
851
852 for (Int_t i=0; i<nSeg; ++i) {
854
855 if (otherSeg==seg) continue;
856
857
858
859 if (TMath::Abs(seg->
X() - otherSeg->
X()) > 1000 || TMath::Abs(seg->
Y() - otherSeg->
Y()) > 1000 )
continue;
860
861
862
863
864
865 testval_dR =
GetdR(seg, otherSeg);
868
869 if (testval_dR < mindR ) {
870 mindR = testval_dR;
871 IDmindR = otherSeg->
ID();
872 }
873 if (testval_dT < mindT ) {
874 mindT = testval_dT;
875 IDmindT = otherSeg->
ID();
876 }
877 if (testval_dminDins < mindMinDist ) {
878 mindMinDist = testval_dminDins;
879 IDmindminDist = otherSeg->
ID();
880 }
881 }
882
883
884
885
886
887
888
889
890
891
892
893 Int_t ndifferent=3;
894 if (IDmindR==IDmindT || IDmindR==IDmindminDist || IDmindminDist==IDmindT) {
895 ndifferent=2;
896 if (IDmindR==IDmindT && IDmindR==IDmindminDist && IDmindminDist==IDmindT) ndifferent=1;
897 }
898 if (nSeg==0) ndifferent=0;
899 if (nSeg==1 && OtherPattern==TestPattern) ndifferent=0;
900
901 nDifferentSegs= ndifferent;
902
903
904 Log(4,
"ShowRec.cpp",
"--- void N3_FindBestCompliments() done.");
905 return;
906}
Double_t GetdeltaThetaSingleAngles(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.cpp:7258
Double_t GetdMinDist(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.h:170
Double_t GetdR(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.h:167
Definition: EdbPattern.h:273
EdbPattern * GetPatternPreceding(EdbPattern *pat) const
Definition: EdbPattern.cxx:1851
EdbPattern * GetPatternSucceding(EdbPattern *pat) const
Definition: EdbPattern.cxx:1845
Int_t ID() const
Definition: EdbSegP.h:147
Float_t X() const
Definition: EdbSegP.h:173
Float_t Z() const
Definition: EdbSegP.h:153
Float_t Y() const
Definition: EdbSegP.h:174
void PrintNice() const
Definition: EdbSegP.cxx:392
Float_t Z() const
Definition: EdbPattern.h:84
Int_t N() const
Definition: EdbPattern.h:86
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
gEDBDEBUGLEVEL
Definition: energy.C:7
#define NULL
Definition: nidaqmx.h:84