34 cout <<
"Vertex at " << vtx->position() <<
" chisq " << vtx->chiSquared() << endl;
35 cout <<
"CTB matches: " << vtx->numMatchesWithCTB() <<
" BEMC: "
36 << vtx->numMatchesWithBEMC() <<
" cross central membrane "
37 << vtx->numTracksCrossingCentralMembrane()
38 <<
" rank " << vtx->ranking() << endl;
42 Int_t n_node =
event->trackNodes().size();
45 for (
int i_node = 0; i_node < n_node; i_node++) {
50 track->fitTraits().numberOfFitPoints() >= 15 &&
51 !track->topologyMap().trackFtpc() &&
52 TMath::Finite(track->length()) ) {
55 double pathlength = track->geometry()->helix().
pathLength( vtx->position(), false );
56 StThreeVectorF dca = track->geometry()->helix().at(pathlength)-vtx->position();
57 dca_z_h->Fill(dca.z());
58 if (fabs(dca.z()) < 3) {
60 float dip = track->geometry()->helix().dipAngle();
71 rms_dip = sqrt(rms_dip - cnt_dcaz*avg_dip*avg_dip) / cnt_dcaz;
73 cout <<
"Tracks used in vtx " << vtx->numTracksUsedInFinder() <<
", num with dcaz cut " << cnt_dcaz <<
", dca < 3 " << cnt_dca << endl;
74 cout <<
"avg dip " << avg_dip <<
", rms dip " << rms_dip << endl;
75 vtx_tuple->Fill(vtx->numTracksUsedInFinder(),vtx->position().z(),vtx->chiSquared(),cnt_dcaz,cnt_dca,vtx->numMatchesWithBEMC(),vtx->numTracksCrossingCentralMembrane(),avg_dip,rms_dip);
77 return vtx->chiSquared();
80 void find_vertex(
char * fname=
"high_053/st_physics_6053108_raw_2020002.event.root", Int_t nevents=1000){
86 gSystem->Load(
"libPhysics");
87 gSystem->Load(
"libTable");
88 gSystem->Load(
"libGeom");
91 gSystem->Load(
"StarMagField");
92 gSystem->Load(
"St_base");
93 gSystem->Load(
"StChain");
94 gSystem->Load(
"St_Tables");
95 gSystem->Load(
"StUtilities");
96 gSystem->Load(
"StTreeMaker");
97 gSystem->Load(
"StIOMaker");
98 gSystem->Load(
"StarClassLibrary");
99 gSystem->Load(
"StTriggerDataMaker");
100 gSystem->Load(
"StBichsel");
101 gSystem->Load(
"StEvent");
102 gSystem->Load(
"StTpcDb");
103 gSystem->Load(
"StEventUtilities");
104 gSystem->Load(
"StEmcUtil");
105 gSystem->Load(
"StTofUtil");
106 gSystem->Load(
"StPmdUtil");
107 gSystem->Load(
"StPreEclMaker");
108 gSystem->Load(
"StStrangeMuDstMaker");
109 gSystem->Load(
"StMuDSTMaker");
110 gSystem->Load(
"StMagF");
112 gSystem->Load(
"StDbLib.so");
113 gSystem->Load(
"StDbBroker.so");
114 gSystem->Load(
"libStDb_Tables.so");
115 gSystem->Load(
"St_db_Maker.so");
118 cout <<
" loading of shared libraries done" << endl;
126 gSystem->Load(
"Sti");
127 gSystem->Load(
"libStEEmcUtil");
128 gSystem->Load(
"libMinuit");
129 gSystem->Load(
"StGenericVertexMaker");
131 TFile *fout =
new TFile(
"vtx_tree.root",
"RECREATE");
132 dca_z_h =
new TH1F(
"dca_z_h",
"dz_z_h",100,-50,50);
133 vtx_tuple =
new TNtuple(
"vtx_tuple",
"vertex info",
"num_trk:vtx_z:chisq:n_dcaz:n_dca:n_bemc:n_cross:avg_dip:rms_dip");
146 ioMaker->SetFile(fname);
149 ioMaker->SetBranch(
"*",0,
"0");
150 ioMaker->SetBranch(
"eventBranch",0,
"r");
160 myfinder->SetDebug(1);
161 myfinder->SetMode(1);
162 myfinder->SetInternalFind();
167 Int_t initStat = chain->Init();
168 if (initStat) chain->Fatal(initStat,
"during Init()");
174 if (iev>=nevents)
break;
176 cout <<
"---------------------- Processing Event : " << iev <<
" ---------------------- " << endl;
177 istat = chain->
Make();
180 cout <<
"istat " << istat<<endl;
203 Int_t nV=mEvent->numberOfPrimaryVertices();
204 if (nV == 0)
continue;
206 Float_t best_rank=1e9;
208 for(iv=0;iv<nV;iv++) {
213 Float_t rank=eval_print_vertex(mEvent, V);
214 if (best_vtx==0 || rank < best_rank) {
220 cout <<
"Best vertex: " << *best_vtx << endl;
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void Clear(Option_t *option="")
User defined functions.
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)