770 float xg, yg, zg, txg, tyg, pg;
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);
813 for (
int itr=0; itr<ntr; itr++) {
818 itrg =
tr->GetSegmentsMCTrack(nsegmatch);
819 if (itrg >= 0 && itrg < ntrg)
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);
829 p =
p*(1.+
dpp*gRandom->Gaus());
830 if (
p < 0.050)
p = 0.050;
841 fprintf(
f,
" %6d tracks found after track making\n", ntr);
853 for (
int i=0; i<10; i++)
864 int nreject_prob = 0;
865 int nreject_nseg = 0;
868 double right_ratio = 0.;
873 for(
int itr=0; itr<ntr; itr++) {
881 if (
hp[11])
hp[11]->Fill(
tr->N());
892 itrg =
tr->GetSegmentsMCTrack(nsegmatch);
893 if (itrg >= 0 && itrg < ntrg)
898 if (trg && ((pro =
tr->Prob()) < 0.9999))
918 if (trg->
Flag() == 0)
922 right_ratio = (double)nsegmatch/
tr->N();
929 hp[16]->Fill(right_ratio);
932 else if (trg->
Flag() <= nvg)
936 right_ratio = (double)nsegmatch/
tr->N();
943 hp[15]->Fill(right_ratio);
964 if (
hp[12])
hp[12]->Fill(
tr->GetSegmentFirst()->X()-
tr->GetSegmentFFirst()->X());
976 float pms =
tr->P_MS(
brick.
X0, trg->
M(),
false);
979 hp[23]->Fill((1./pms - 1./trg->
P())*trg->
P()*100.);
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);
1005 if (
hp[10])
hp[10]->Fill(ntr-negflag);
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;
1023 int nadd = 0, npg = 0;
1031 int ivg = 0, nvgoodt = 0, nvgoodmt = 0, np = 0, ntold = 0;
1032 for (
int i=0; i<nvtx; i++)
1037 if (edbv->
Flag() == -10)
continue;
1048 if (np == 5) printf(
"Found 5-prongs rec vert (id = %d)!\n",i);
1052 int ivg0 = -1000000;
1053 if(
tr) ivg0 =
tr->GetSegmentsMCTrack(nsegmatch);
1054 if (ivg0 >= 0 && ivg0 < ntrg)
1059 if (np == 5 && ivg0 > 0) printf(
"Found 5-prongs vert 1 tr (%d) ivg %d\n",
tr->ID(), ivg0);
1061 for (
int j=1; j<edbv->
N() && ivg0>0; j++)
1065 if(
tr) ivg =
tr->GetSegmentsMCTrack(nsegmatch);
1066 if (ivg >= 0 && ivg < ntrg)
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;
1077 if (ivg != ivg0)
continue;
1078 if (ivg <= 0)
continue;
1079 if (ivg > nvg)
continue;
1082 if (np == 5) printf(
"Found 5-prongs gen vert!\n");
1085 ntold = numrect[ivg];
1098 else if (edbvg->Flag() == 1 && ntold == 0)
negood_tot++;
1111 if (
hp[9])
hp[9]->Fill(nvgoodmt);
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]);
1123 printf(
"------------------------------------------------------------\n");
1124 printf(
"%d linked vertexes found\n", nlv);
1129 for(
int i=0; i<nvtx; i++)
1133 if (vl->
Flag()) > 2)
1137 if (vc->
ID() > vl->
ID())
1148 printf(
"------------------------------------------------------------\n");
1149 printf(
"%d neighboring tracks and segments found\n", nn);
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:1985
void FillTracksCell()
Definition: EdbPVRec.cxx:1315
void FillCell(float stepx, float stepy, float steptx, float stepty)
Definition: EdbPVRec.cxx:1088
int Link()
Definition: EdbPVRec.cxx:1183
int PropagateTracks(int nplmax, int nplmin, float probMin=0.05, int ngapMax=3, int design=0)
Definition: EdbPVRec.cxx:2483
void FitTracks(float p=10., float mass=0.139, TObjArray *gener=0, int design=0)
Definition: EdbPVRec.cxx:1889
Float_t P() const
Definition: EdbSegP.h:149
Int_t Flag() const
Definition: EdbSegP.h:146
Float_t M() const
Definition: EdbPattern.h:160
Float_t DE() const
Definition: EdbPattern.h:171
Int_t ProbVertexN()
Definition: EdbVertex.cxx:1448
Int_t LinkedVertexes()
Definition: EdbVertex.cxx:1831
Int_t VertexNeighbor(float RadMax=1000., int Dpat=1, float ImpMax=1000000.)
Definition: EdbVertex.cxx:2754
Int_t FindVertex()
Definition: EdbVertex.cxx:1087
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:427
Float_t VZ() const
Definition: EdbVertex.h:135
Definition: VtVertex.hh:88
bool valid() const
is vertex valid?
float X0
Definition: RecDispMC.C:100
EdbSegP * s
Definition: tlg2pattern.C:32