766{
767
768
769 int numrect[10000];
770 float xg, yg, zg, txg, tyg, pg;
771 int zpos;
778
779
780 int nvg = 0;
782 int ntrg = 0;
784
787
788
791
792 printf("------------------------------------------------------------\n");
793 printf("%d generated vertexes\n", nvg);
794 printf("%d generated tracks\n", ntrg);
795 fprintf(
f,
" %6d generated vertexes\n", nvg);
796 fprintf(
f,
" %6d generated tracks\n", ntrg);
797
798
799
801 {
804 }
805 else
807
808 int itrg = 0;
809 int nsegmatch = 0;
810 int ntr = 0;
812
813 for (int itr=0; itr<ntr; itr++) {
815 trg = 0;
816 if (ntrg)
817 {
818 itrg =
tr->GetSegmentsMCTrack(nsegmatch);
819 if (itrg >= 0 && itrg < ntrg)
820 {
824 else tr->SetErrorP(
p*
p*0.2*0.2);
825 tr->GetSegmentFirst()->SetErrorP(
p*
p*0.2*0.2);
826 tr->GetSegmentLast()->SetErrorP(
p*
p*0.2*0.2);
828 {
829 p =
p*(1.+
dpp*gRandom->Gaus());
830 if (
p < 0.050)
p = 0.050;
831 }
832 else
833 {
835 }
837 }
838 }
839 }
840
841 fprintf(
f,
" %6d tracks found after track making\n", ntr);
842
843 float mpar = -1.;
845 mpar = -1.;
846 else
847 mpar = 0.;
848
851
852
853 for (int i=0; i<10; i++)
855
856 ntr = 0;
858
859
860 int ntrgood = 0;
861 int ntrgood_r = 0;
862 int negflag = 0;
863 int notmatched = 0;
864 int nreject_prob = 0;
865 int nreject_nseg = 0;
866 int ntrgoodb = 0;
867 int ntrgoodb_r = 0;
868 double right_ratio = 0.;
869 float pro = 0.;
870
871
872
873 for(int itr=0; itr<ntr; itr++) {
876 {
877
878 negflag++;
879 continue;
880 }
881 if (
hp[11])
hp[11]->Fill(
tr->N());
883 {
884
885 nreject_nseg++;
886 continue;
887 }
888 trg = 0;
889 if (ntrg)
890 {
891
892 itrg =
tr->GetSegmentsMCTrack(nsegmatch);
893 if (itrg >= 0 && itrg < ntrg)
894 {
896 }
897 }
898 if (trg && ((pro =
tr->Prob()) < 0.9999))
899 {
900
902 }
904 {
905
906
907
908
909
910
911 nreject_prob++;
912 continue;
913 }
914 if (ntrg)
915 {
916 if (trg)
917 {
918 if (trg->
Flag() == 0)
919 {
920
921 ntrgoodb++;
922 right_ratio = (double)nsegmatch/
tr->N();
924 {
925
926
927 ntrgoodb_r++;
928 }
929 hp[16]->Fill(right_ratio);
930
931 }
932 else if (trg->
Flag() <= nvg)
933 {
934
935 ntrgood++;
936 right_ratio = (double)nsegmatch/
tr->N();
938 {
939
940
941 ntrgood_r++;
942 }
943 hp[15]->Fill(right_ratio);
944 }
945 }
946 else
947 {
948
949 notmatched++;
950 }
951 }
952 else
953 {
954
955 notmatched++;
956 }
957
958
959
960
961
962
963
964 if (
hp[12])
hp[12]->Fill(
tr->GetSegmentFirst()->X()-
tr->GetSegmentFFirst()->X());
965
966 if (trg != 0)
967 {
970
971
973
974
975
976 float pms =
tr->P_MS(
brick.
X0, trg->
M(),
false);
977 if (pms > 0.)
978 {
979 hp[23]->Fill((1./pms - 1./trg->
P())*trg->
P()*100.);
980 }
981 }
982 }
983
984 printf(" %6d tracks found after propagation\n", ntr-negflag);
985 printf(
" %6d matched tracks found (at vertexes), %6d with right segs >= %.0f%%\n", ntrgood, ntrgood_r,
RightRatioMin*100.);
986 printf(
" %6d matched tracks found (cosmic ), %6d with right segs >= %.0f%%\n", ntrgoodb, ntrgoodb_r,
RightRatioMin*100.);
987 printf(" ( %4d tracks not matched with generated ones)\n", notmatched);
988 printf(
" ( %4d tracks with nseg < %d )\n", nreject_nseg,
nsegMin);
989 printf(
" ( %4d tracks with prob < %6.3f )\n", nreject_prob,
ProbMinT);
990 fprintf(
f,
" %6d tracks found after propagation\n", ntr-negflag);
991 fprintf(
f,
" %6d matched tracks found (at vertexes), %6d with right segs >= %.0f%%\n", ntrgood, ntrgood_r,
RightRatioMin*100.);
992 fprintf(
f,
" %6d matched tracks found (cosmic ), %6d with right segs >= %.0f%%\n", ntrgoodb, ntrgoodb_r,
RightRatioMin*100.);
993 fprintf(
f,
" ( %4d tracks not matched with generated ones)\n", notmatched);
994 fprintf(
f,
" ( %4d tracks with nseg < %d )\n", nreject_nseg,
nsegMin);
995 fprintf(
f,
" ( %4d tracks with prob < %6.3f )\n", nreject_prob,
ProbMinT);
996
1002
1003
1004
1005 if (
hp[10])
hp[10]->Fill(ntr-negflag);
1006
1009
1012
1013
1015
1016
1017 int nvgood[100];
1018 int nvgoodm[100];
1019 for (int i=0; i<100; i++) nvgood[i] = 0;
1020 for (int i=0; i<100; i++) nvgoodm[i] = 0;
1021 for (int i=0; i<10000; i++) numrect[i] = 0;
1022
1023 int nadd = 0, npg = 0;
1025
1026
1028
1029
1030
1031 int ivg = 0, nvgoodt = 0, nvgoodmt = 0, np = 0, ntold = 0;
1032 for (int i=0; i<nvtx; i++)
1033 {
1035 if (edbv)
1036 {
1037 if (edbv->
Flag() == -10)
continue;
1039 if (v)
1040 {
1042 {
1044 {
1045
1046 nvgood[np]++;
1047 nvgoodt++;
1048 if (np == 5) printf("Found 5-prongs rec vert (id = %d)!\n",i);
1051
1052 int ivg0 = -1000000;
1053 if(
tr) ivg0 =
tr->GetSegmentsMCTrack(nsegmatch);
1054 if (ivg0 >= 0 && ivg0 < ntrg)
1056 else
1057 ivg0 = -1000000;
1058 ivg = -2000000;
1059 if (np == 5 && ivg0 > 0) printf(
"Found 5-prongs vert 1 tr (%d) ivg %d\n",
tr->ID(), ivg0);
1060
1061 for (
int j=1; j<edbv->
N() && ivg0>0; j++)
1062 {
1064 int ivg = -2000000;
1065 if(
tr) ivg =
tr->GetSegmentsMCTrack(nsegmatch);
1066 if (ivg >= 0 && ivg < ntrg)
1068 else
1069 {
1070 ivg = -2000000;
1071 break;
1072 }
1073 if (np == 5 ) printf(
"Found 5-prongs vert %d tr (%d) ivg %d\n", j+1,
tr->ID(), ivg);
1074 if (ivg != ivg0) break;
1075
1076 }
1077 if (ivg != ivg0) continue;
1078 if (ivg <= 0) continue;
1079 if (ivg > nvg) continue;
1080
1082 if (np == 5) printf("Found 5-prongs gen vert!\n");
1084 npg = edbvg->N();
1085 ntold = numrect[ivg];
1086
1087
1088 if (ntold == 0)
1089 {
1091 numrect[ivg] = npg;
1092 }
1093 nvgoodmt++;
1095 nvgoodm[np]++;
1096
1098 else if (edbvg->Flag() == 1 && ntold == 0)
negood_tot++;
1106 }
1107 }
1108 }
1109 }
1110 }
1111 if (
hp[9])
hp[9]->Fill(nvgoodmt);
1113 {
1114 if (nvgood[i] <= 0) continue;
1115 printf("%6d %d-tracks vertexes found (%d matched to MC)\n", nvgood[i], i, nvgoodm[i]);
1116 fprintf(
f,
"%6d %d-tracks vertexes found (%d matched to MC)\n", nvgood[i], i, nvgoodm[i]);
1119 }
1120 if (nvtx)
1121 {
1123 printf("------------------------------------------------------------\n");
1124 printf("%d linked vertexes found\n", nlv);
1125 if (nlv)
1126 {
1129 for(int i=0; i<nvtx; i++)
1130 {
1132 if (!vl) continue;
1133 if (vl->
Flag()) > 2)
1134 {
1136 if (!vc) continue;
1137 if (vc->
ID() > vl->
ID())
1138 {
1139
1140
1141 }
1142 }
1143 }
1144 }
1146 {
1148 printf("------------------------------------------------------------\n");
1149 printf("%d neighboring tracks and segments found\n", nn);
1150 }
1151 }
1152}
bool usemom
Definition: RecDispEX.C:20
bool use_mc_mass
Definition: RecDispMC_new.C:23
bool mc_make_tracks
Definition: RecDispMC_new.C:21
bool use_mc_momentum
Definition: RecDispMC_new.C:22
int rec_primary_vertex_ntracks_min
Definition: RecDispMC_new.C:25
double DE_FIT
Definition: RecDispMC_new.C:126
double DE_MC
Definition: RecDispMC_new.C:126
void FillHistsV(EdbVertex &edbv, Vertex &v)
Definition: RecDispMC_new.C:1218
int design
Definition: RecDispMC_new.C:68
bool select_neighborhood
Definition: RecDispMC_new.C:29
int MakeTracksMC(int nsegmin, TObjArray *tracks)
Definition: EdbPVGen.cxx:1046
int MakeTracks(int nsegments=2, int flag=0)
Definition: EdbPVRec.cxx:1989
void FillTracksCell()
Definition: EdbPVRec.cxx:1319
void FillCell(float stepx, float stepy, float steptx, float stepty)
Definition: EdbPVRec.cxx:1092
int Link()
Definition: EdbPVRec.cxx:1187
int PropagateTracks(int nplmax, int nplmin, float probMin=0.05, int ngapMax=3, int design=0)
Definition: EdbPVRec.cxx:2487
void FitTracks(float p=10., float mass=0.139, TObjArray *gener=0, int design=0)
Definition: EdbPVRec.cxx:1893
Float_t P() const
Definition: EdbSegP.h:152
Int_t Flag() const
Definition: EdbSegP.h:149
Float_t M() const
Definition: EdbPattern.h:155
Float_t DE() const
Definition: EdbPattern.h:166
Int_t ProbVertexN()
Definition: EdbVertex.cxx:1426
Int_t LinkedVertexes()
Definition: EdbVertex.cxx:1809
Int_t VertexNeighbor(float RadMax=1000., int Dpat=1, float ImpMax=1000000.)
Definition: EdbVertex.cxx:2732
Int_t FindVertex()
Definition: EdbVertex.cxx:1065
Int_t ID() const
Definition: EdbVertex.h:126
Float_t VX() const
Definition: EdbVertex.h:133
VERTEX::Vertex * V() const
Definition: EdbVertex.h:154
Float_t VY() const
Definition: EdbVertex.h:134
EdbVertex * GetConnectedVertex(int nv)
Definition: EdbVertex.cxx:405
Float_t VZ() const
Definition: EdbVertex.h:135
Definition: VtVertex.hh:88
bool valid() const
is vertex valid?
s
Definition: check_shower.C:55
float X0
Definition: RecDispMC.C:100