10 #define DRAW_RECO_HISTOS // draw histos which are used for reconstruction
13 #if !defined(__CINT__) || defined(__MAKECINT__)
14 #include "Riostream.h"
28 #include "TLorentzVector.h"
30 #include "TTreeIter.h"
31 #include "StDcaGeometry.h"
36 #include "TSpectrum.h"
37 #include "TVirtualFitter.h"
38 #include "TPolyMarker.h"
40 #include "TRSymMatrix.h"
41 #include "Math/Functor.h"
42 #include "Math/GSLMinimizer1D.h"
46 #include "TClonesArray.h"
47 #include "StKFVertex/StAnneling.h"
48 #include "StKFVertex/StKFEvent.h"
49 #include "StKFVertex/StKFTrack.h"
50 #include "StKFVertex/StKFVertex.h"
51 #include "StKFVertex/StKFVerticesCollection.h"
52 #include "StKFVertex/StMuDstVtxT.h"
53 #include "StKFVertex/StVertexP.h"
54 #include "StKFVertex/StVertexT.h"
55 #include "StKFVertex/StKFVertexFinder.h"
62 static Int_t beamLine = 0;
64 static Double_t pZ = 1000;
67 static Bool_t fAsk = kTRUE;
70 std::cout <<
"ask (enter - next, s - save, r - don't ask, q - quit) >";
77 }
while (symbol !=
'\n');
83 void MuPrmVtx(Int_t first, Int_t last,
const Char_t *files,
const Char_t* Out=
"") {
97 struct vertexSeed_t {Double_t x0, dxdz, y0, dydz, err_x0, err_dxdz, err_y0, err_dydz;};
98 vertexSeed_t b = { 0.42600000, 0.00118000, 0.00800000, 0.00024000, 0.00900000, 0.00003000, 0.00900000, 0.00003000};
103 while ((file = (Char_t *) Dir.NextFile())) {iter.AddFile(file); NFiles++;}
104 if (! NFiles)
return;
107 if (! iter.Chain())
return;
108 if (! iter.Chain()->GetListOfFiles())
return;
109 const Char_t *file1 = iter.Chain()->GetListOfFiles()->At(0)->GetTitle();
110 TString dir = gSystem->BaseName(file1);
111 dir.ReplaceAll(
".MuDst",
"");
114 TFile *fOut =
new TFile(output,
"recreate");
115 TTree *ftree =
new TTree(
"StVertexT",
"Vertex tree");
116 ftree->SetAutoSave(1000000000);
117 Int_t bufsize = 64000;
119 if (split) bufsize /= 4;
121 TTree::SetBranchStyle(1);
122 TBranch *branch = ftree->Branch(
"StKFEvent",
"StKFEvent", &fStKFEvent, bufsize,split);
123 branch->SetAutoDelete(kFALSE);
125 const Int_t*& MuEvent_mEventInfo_mRunId = iter(
"MuEvent.mEventInfo.mRunId");
126 const Int_t*& MuEvent_mEventInfo_mId = iter(
"MuEvent.mEventInfo.mId");
127 const Int_t& NoPrimaryVertices = iter(
"PrimaryVertices");
129 const Float_t*& PrimaryVertices_mPosition_mX1 = iter(
"PrimaryVertices.mPosition.mX1");
130 const Float_t*& PrimaryVertices_mPosition_mX2 = iter(
"PrimaryVertices.mPosition.mX2");
131 const Float_t*& PrimaryVertices_mPosition_mX3 = iter(
"PrimaryVertices.mPosition.mX3");
132 const Float_t*& PrimaryVertices_mPosError_mX1 = iter(
"PrimaryVertices.mPosError.mX1");
133 const Float_t*& PrimaryVertices_mPosError_mX2 = iter(
"PrimaryVertices.mPosError.mX2");
134 const Float_t*& PrimaryVertices_mPosError_mX3 = iter(
"PrimaryVertices.mPosError.mX3");
135 const Float_t*& PrimaryVertices_mRanking = iter(
"PrimaryVertices.mRanking");
136 const UShort_t*& PrimaryVertices_mNTracksUsed = iter(
"PrimaryVertices.mNTracksUsed");
138 const UShort_t*& PrimaryVertices_mIdTruth = iter(
"PrimaryVertices.mIdTruth");
139 const UShort_t*& PrimaryVertices_mQuality = iter(
"PrimaryVertices.mQuality");
140 const Int_t*& PrimaryVertices_mIdParent = iter(
"PrimaryVertices.mIdParent");
142 const Int_t*& PrimaryTracks_mVertexIndex = iter(
"PrimaryTracks.mVertexIndex");
143 const Int_t& NoPrimaryTracks = iter(
"PrimaryTracks");
144 const Int_t*& PrimaryTracks_mIndex2Global = iter(
"PrimaryTracks.mIndex2Global");
145 const Float_t*& PrimaryTracks_mChiSqZ = iter(
"PrimaryTracks.mChiSqZ");
147 const UShort_t*& PrimaryTracks_mIdTruth = iter(
"PrimaryTracks.mIdTruth");
148 const UShort_t*& PrimaryTracks_mQuality = iter(
"PrimaryTracks.mQuality");
149 const Int_t*& PrimaryTracks_mIdParentVx = iter(
"PrimaryTracks.mIdParentVx");
151 const Int_t& NoGlobalTracks = iter(
"GlobalTracks");
152 const Short_t*& GlobalTracks_mFlag = iter(
"GlobalTracks.mFlag");
153 const Float_t*& GlobalTracks_mEta = iter(
"GlobalTracks.mEta");
154 const Float_t*& GlobalTracks_mFirstPoint_mX3 = iter(
"GlobalTracks.mFirstPoint.mX3");
156 const UShort_t*& GlobalTracks_mIdTruth = iter(
"GlobalTracks.mIdTruth");
157 const UShort_t*& GlobalTracks_mQuality = iter(
"GlobalTracks.mQuality");
158 const Int_t*& GlobalTracks_mIdParentVx = iter(
"GlobalTracks.mIdParentVx");
162 const Int_t*& GlobalTracks_mIndex2Cov = iter(
"GlobalTracks.mIndex2Cov");
163 const Int_t& NoCovGlobTrack = iter(
"CovGlobTrack");
164 const Float_t*& CovGlobTrack_mImp = iter(
"CovGlobTrack.mImp");
165 const Float_t*& CovGlobTrack_mZ = iter(
"CovGlobTrack.mZ");
166 const Float_t*& CovGlobTrack_mPsi = iter(
"CovGlobTrack.mPsi");
167 const Float_t*& CovGlobTrack_mPti = iter(
"CovGlobTrack.mPti");
168 const Float_t*& CovGlobTrack_mTan = iter(
"CovGlobTrack.mTan");
169 const Float_t*& CovGlobTrack_mCurv = iter(
"CovGlobTrack.mCurv");
170 const Float_t*& CovGlobTrack_mImpImp = iter(
"CovGlobTrack.mImpImp");
171 const Float_t*& CovGlobTrack_mZImp = iter(
"CovGlobTrack.mZImp");
172 const Float_t*& CovGlobTrack_mZZ = iter(
"CovGlobTrack.mZZ");
173 const Float_t*& CovGlobTrack_mPsiImp = iter(
"CovGlobTrack.mPsiImp");
174 const Float_t*& CovGlobTrack_mPsiZ = iter(
"CovGlobTrack.mPsiZ");
175 const Float_t*& CovGlobTrack_mPsiPsi = iter(
"CovGlobTrack.mPsiPsi");
176 const Float_t*& CovGlobTrack_mPtiImp = iter(
"CovGlobTrack.mPtiImp");
177 const Float_t*& CovGlobTrack_mPtiZ = iter(
"CovGlobTrack.mPtiZ");
178 const Float_t*& CovGlobTrack_mPtiPsi = iter(
"CovGlobTrack.mPtiPsi");
179 const Float_t*& CovGlobTrack_mPtiPti = iter(
"CovGlobTrack.mPtiPti");
180 const Float_t*& CovGlobTrack_mTanImp = iter(
"CovGlobTrack.mTanImp");
181 const Float_t*& CovGlobTrack_mTanZ = iter(
"CovGlobTrack.mTanZ");
182 const Float_t*& CovGlobTrack_mTanPsi = iter(
"CovGlobTrack.mTanPsi");
183 const Float_t*& CovGlobTrack_mTanPti = iter(
"CovGlobTrack.mTanPti");
184 const Float_t*& CovGlobTrack_mTanTan = iter(
"CovGlobTrack.mTanTan");
186 const Double_t*& Event_mMagneticField = iter(
"MuEvent.mRunInfo.mMagneticFieldZ");
188 const Int_t& NoMuMcVertex = iter(
"StMuMcVertex");
190 const Int_t*& StMuMcVertex_Id = iter(
"StMuMcVertex.mId");
192 const Int_t*& StMuMcVertex_NoDaughters = iter(
"StMuMcVertex.mNoDaughters");
193 const Int_t*& StMuMcVertex_IdParTrk = iter(
"StMuMcVertex.mIdParTrk");
194 const Float_t*& StMuMcVertex_time = iter(
"StMuMcVertex.mTime");
195 const Float_t*& StMuMcVertex_xyzV_mX1 = iter(
"StMuMcVertex.mXyzV.mX1");
196 const Float_t*& StMuMcVertex_xyzV_mX2 = iter(
"StMuMcVertex.mXyzV.mX2");
197 const Float_t*& StMuMcVertex_xyzV_mX3 = iter(
"StMuMcVertex.mXyzV.mX3");
198 const Int_t& NoMuMcTrack = iter(
"StMuMcTrack");
200 const Int_t*& StMuMcTrack_Id = iter(
"StMuMcTrack.mId");
202 const Int_t*& StMuMcTrack_gePid = iter(
"StMuMcTrack.mGePid");
204 const Int_t*& StMuMcTrack_IdVx = iter(
"StMuMcTrack.mIdVx");
205 const Int_t*& StMuMcTrack_IdVxEnd = iter(
"StMuMcTrack.mIdVxEnd");
206 const Float_t*& StMuMcTrack_pxyz_mX1 = iter(
"StMuMcTrack.mPxyz.mX1");
207 const Float_t*& StMuMcTrack_pxyz_mX2 = iter(
"StMuMcTrack.mPxyz.mX2");
208 const Float_t*& StMuMcTrack_pxyz_mX3 = iter(
"StMuMcTrack.mPxyz.mX3");
211 StKFVertexFinder fitter;
212 #ifdef DRAW_RECO_HISTOS
213 if (! gROOT->IsBatch()) {TCanvas *c1 =
new TCanvas(
"c1z",
"c1z",1400,600); fitter.SetCanvas(c1);}
214 #endif // DRAW_RECO_HISTOS
218 while (iter.Next()) {
220 if (nev < first)
continue;
221 if (nev > last)
break;
223 if (! eventD) eventD =
new StDraw3D();
224 else eventD->
Clear();
225 #endif // EVENT_DISPLAY
229 cout <<
"#" << nev <<
"\tRun " << MuEvent_mEventInfo_mRunId[0] <<
"\tEvent " << MuEvent_mEventInfo_mId[0] << endl;
230 cout <<
"NoTracks\t" << (int) NoGlobalTracks <<
" global\t" << (
int) NoPrimaryTracks << " primary" << endl;
235 tracks.SetOwner(kTRUE);
237 particles.SetOwner(kTRUE);
240 Double_t ymax = fitter.Vtx()->GetMaximum();
241 for (Int_t l = 0; l < NoPrimaryVertices; l++) {
247 for (Int_t k = 0; k <NoPrimaryTracks; k++) {
248 if (PrimaryTracks_mVertexIndex[k] != l)
continue;
249 Int_t kg = PrimaryTracks_mIndex2Global[k];
250 if (kg < 0 || kg >= NoGlobalTracks)
continue;
251 if (GlobalTracks_mFlag[kg] < 0)
continue;
252 if (GlobalTracks_mFlag[kg] > 700)
continue;
253 if (GlobalTracks_mFlag[kg]%100 == 11)
continue;
254 Int_t kgc = GlobalTracks_mIndex2Cov[kg];
255 if (kgc < 0 || kgc > NoCovGlobTrack)
continue;
257 if (CovGlobTrack_mPti[kgc] < 0) Q -= 1;
259 if (PrimaryTracks_mChiSqZ[k] < StAnneling::Chi2Cut()) multP++;
260 if (GlobalTracks_mEta[kg] > 0 && GlobalTracks_mFirstPoint_mX3[kg] > 0) mWest++;
261 if (GlobalTracks_mEta[kg] < 0 && GlobalTracks_mFirstPoint_mX3[kg] < 0) mEast++;
263 StMuDstVtxT V(PrimaryVertices_mPosition_mX1[l],PrimaryVertices_mPosition_mX2[l],PrimaryVertices_mPosition_mX3[l],
264 PrimaryVertices_mPosError_mX1[l],PrimaryVertices_mPosError_mX2[l],PrimaryVertices_mPosError_mX3[l],
265 PrimaryVertices_mNTracksUsed[l],mult,multP,mWest,mEast,Q,PrimaryVertices_mRanking[l],
266 PrimaryVertices_mIdTruth[l],PrimaryVertices_mQuality[l],PrimaryVertices_mIdParent[l]);
268 if (V.QaTruth() > 0) {
269 V.SetMc(NoMuMcVertex,NoMuMcTrack,StMuMcVertex_time,
270 StMuMcVertex_xyzV_mX1,StMuMcVertex_xyzV_mX2,StMuMcVertex_xyzV_mX3,
271 StMuMcVertex_NoDaughters,StMuMcVertex_IdParTrk,StMuMcTrack_gePid);
274 cout << Form(
"MuDst Primary Vertex: %3i with ",l) << V << endl;
275 fStKFEvent->AddMuVtx(V);
276 Double_t X = PrimaryVertices_mPosition_mX3[l];
278 if (1.1*Y > ymax) ymax = 1.1*Y;
279 TPolyMarker * pm =
new TPolyMarker(1, &X, &Y);
280 fitter.VtxM()->GetListOfFunctions()->Add(pm);
281 pm->SetMarkerStyle(20);
282 pm->SetMarkerColor(l+2);
283 pm->SetMarkerSize(2);
285 pm =
new TPolyMarker(1, &X, &Y);
286 fitter.VtxM()->GetListOfFunctions()->Add(pm);
287 pm->SetMarkerStyle(21);
288 pm->SetMarkerColor(l+2);
289 pm->SetMarkerSize(2);
291 fitter.Vtx()->SetMaximum(ymax);
292 Int_t NGoodGlobals = 0;
293 for (Int_t kg = 0; kg < NoGlobalTracks; kg++) {
295 tracks.AddAtAndExpand (0,kg);
296 particles.AddAtAndExpand (0,kg);
298 if (GlobalTracks_mFlag[kg] < 0)
continue;
299 if (GlobalTracks_mFlag[kg] > 700)
continue;
300 if (GlobalTracks_mFlag[kg]%100 == 11)
continue;
302 Int_t kgc = GlobalTracks_mIndex2Cov[kg];
303 if (kgc < 0 || kgc > NoCovGlobTrack)
continue;
307 Double_t parsT[6] = {
308 CovGlobTrack_mImp[kgc],CovGlobTrack_mZ[kgc],CovGlobTrack_mPsi[kgc],
309 CovGlobTrack_mPti[kgc],CovGlobTrack_mTan[kgc],CovGlobTrack_mCurv[kgc]};
310 Double_t errsT[15] = {
311 CovGlobTrack_mImpImp[kgc],
312 CovGlobTrack_mZImp[kgc], CovGlobTrack_mZZ[kgc],
313 CovGlobTrack_mPsiImp[kgc],CovGlobTrack_mPsiZ[kgc],CovGlobTrack_mPsiPsi[kgc],
314 CovGlobTrack_mPtiImp[kgc],CovGlobTrack_mPtiZ[kgc],CovGlobTrack_mPtiPsi[kgc],CovGlobTrack_mPtiPti[kgc],
315 CovGlobTrack_mTanImp[kgc],CovGlobTrack_mTanZ[kgc],CovGlobTrack_mTanPsi[kgc],CovGlobTrack_mTanPti[kgc],
316 CovGlobTrack_mTanTan[kgc]};
318 dca->set(parsT, errsT);
319 KFParticle *particle = fitter.AddTrackAt(dca,kg);
322 if (GlobalTracks_mEta[kg] > 0 && GlobalTracks_mFirstPoint_mX3[kg] > 0) iWE = 1;
323 if (GlobalTracks_mEta[kg] < 0 && GlobalTracks_mFirstPoint_mX3[kg] < 0) iWE = 2;
324 particle->SetID(10000*iWE + kg+1);
325 particle->SetIdTruth(GlobalTracks_mIdTruth[kg],GlobalTracks_mQuality[kg]);
326 particle->SetIdParentVx(GlobalTracks_mIdParentVx[kg]);
328 cout <<
"particle: " << *particle << endl;
334 if (NGoodGlobals < 2)
continue;
336 if (! fitter.Vertices())
continue;
337 fitter.Vertices()->SetMc(NoMuMcVertex,NoMuMcTrack,StMuMcVertex_time,
338 StMuMcVertex_xyzV_mX1,StMuMcVertex_xyzV_mX2,StMuMcVertex_xyzV_mX3,
339 StMuMcVertex_NoDaughters,StMuMcVertex_IdParTrk,StMuMcTrack_gePid);
340 fitter.Vertices()->Print();
342 Int_t Nvtx = fitter.Vertices()->NoVertices();
343 for (Int_t l = 0; l < Nvtx; l++) {
346 fStKFEvent->AddKFVtx(*V);
352 Int_t NoMuDstVtx = fStKFEvent->NoMuDstVtx();
353 Int_t NoKFVtx = fStKFEvent->NoKFVtx();
354 for (Int_t i = 0; i < NoMuDstVtx; i++) {
356 for (Int_t j = 0; j < NoKFVtx; j++) {
358 TVector3 diff = VI->Xyz() - VJ->Xyz();
360 diff.x()*diff.x()/(VI->SigmaXyz().x()*VI->SigmaXyz().x() + VJ->SigmaXyz().x()*VJ->SigmaXyz().x()) +
361 diff.y()*diff.y()/(VI->SigmaXyz().y()*VI->SigmaXyz().y() + VJ->SigmaXyz().y()*VJ->SigmaXyz().y()) +
362 diff.z()*diff.z()/(VI->SigmaXyz().z()*VI->SigmaXyz().z() + VJ->SigmaXyz().z()*VJ->SigmaXyz().z());
364 fStKFEvent->AddDKFPair(i,j,*VI,*VJ,chi2);
368 for (Int_t i = 1; i < NoKFVtx; i++) {
370 for (Int_t j = 0; j < i; j++) {
372 TVector3 diff = VI->Xyz() - VJ->Xyz();
374 diff.x()*diff.x()/(VI->SigmaXyz().x()*VI->SigmaXyz().x() + VJ->SigmaXyz().x()*VJ->SigmaXyz().x()) +
375 diff.y()*diff.y()/(VI->SigmaXyz().y()*VI->SigmaXyz().y() + VJ->SigmaXyz().y()*VJ->SigmaXyz().y());
377 fStKFEvent->AddKFKFPair(i,j,*VI,*VJ,chi2);
384 TArrayF xyzMcVxT(3*NoMuMcVertex);
385 TArrayF xyzMcVxP(3*NoMuMcVertex);
388 for(
int i = 0; i < NoMuMcVertex; ++i ) {
389 if (TMath::Abs(StMuMcVertex_time[i]) < 100e-9) {
390 xyzMcVxT[3*NT ] = StMuMcVertex_xyzV_mX1[i];
391 xyzMcVxT[3*NT+1] = StMuMcVertex_xyzV_mX2[i];
392 xyzMcVxT[3*NT+2] = StMuMcVertex_xyzV_mX3[i];
395 xyzMcVxP[3*NP ] = StMuMcVertex_xyzV_mX1[i];
396 xyzMcVxP[3*NP+1] = StMuMcVertex_xyzV_mX2[i];
397 xyzMcVxP[3*NP+2] = StMuMcVertex_xyzV_mX3[i];
401 TArrayF xyzRcVx(3*Nvtx);
403 for (Int_t l = 0; l < Nvtx; l++) {
406 xyzRcVx[3*NR ] = V->Vertex().GetX();
407 xyzRcVx[3*NR+1] = V->Vertex().GetY();
408 xyzRcVx[3*NR+2] = V->Vertex().GetZ();
412 eventD->
Points(NR, xyzRcVx.GetArray(), kVtx); eventD->SetComment(
"Rc Vtx and Geometry");
413 eventD->
Points(NT, xyzMcVxT.GetArray(),kUsedHit); eventD->SetComment(
"Mc Vtx triggered and Geometry");
414 eventD->
Points(NP, xyzMcVxP.GetArray(),kUnusedHit); eventD->SetComment(
"Mc Vtx pile-up and Geometry");
415 eventD->UpdateModified();
416 while(!gSystem->ProcessEvents()){};
417 #endif // EVENT_DISPLAY
418 #if defined(DRAW_RECO_HISTOS) || defined(EVENT_DISPLAY)
419 if (! gROOT->IsBatch() && Ask())
break;
426 void Analysis(
const Char_t *files=
"./y*.root") {
429 TFile *fOut =
new TFile(
"MuDst_KFV.root",
"recreate");
430 TH2D *multDK =
new TH2D(
"multDK",
"log_{2} (Multiplicity_{MuDst}) versus log_{2} (Multiplicity_{KFVertex})",
431 120,-1.0,11.0, 120,-1.0,11.0);
432 TH2D *multDKQ =
new TH2D(
"multDKQ",
"log_{2} (MultiplicityQ_{MuDst}) versus log_{2} (MultiplicityQ_{KFVertex})",
433 120,-1.0,11.0, 120,-1.0,11.0);
434 TH2D *dXD =
new TH2D(
"dXD",
"dX MuDst - MC versus log_{2} (Multiplicity_{MuDst})",120,-1.0,11.0,100,-5,5);
435 TH2D *dYD =
new TH2D(
"dYD",
"dY MuDst - MC versus log_{2} (Multiplicity_{MuDst})",120,-1.0,11.0,100,-5,5);
436 TH2D *dZD =
new TH2D(
"dZD",
"dZ MuDst - MC versus log_{2} (Multiplicity_{MuDst})",120,-1.0,11.0,100,-5,5);
438 TH2D *dXK =
new TH2D(
"dXK",
"dX KFVertex - MC versus log_{2} (Multiplicity_{KFVertex})",120,-1.0,11.0,100,-5,5);
439 TH2D *dYK =
new TH2D(
"dYK",
"dY KFVertex - MC versus log_{2} (Multiplicity_{KFVertex})",120,-1.0,11.0,100,-5,5);
440 TH2D *dZK =
new TH2D(
"dZK",
"dZ KFVertex - MC versus log_{2} (Multiplicity_{KFVertex})",120,-1.0,11.0,100,-5,5);
441 cout <<
"|Simulation Production | Total no. | MuDst Efficiency | <Multiplicity> | KFVertex Efficiency | <Multiplicity>|" << endl;
442 while ((file = (Char_t *) Dir.NextFile())) {
444 if (File.Contains(
"event") || File.Contains(
"geant") ||
445 File.Contains(
"hist") || File.Contains(
"tags") || File.Contains(
"runco") ||
446 File.Contains(
"minimc") || File.Contains(
"event") ||
447 File.Contains(
"MuDst"))
continue;
448 TFile *f =
new TFile (File);
450 TTree *tree = (TTree *) f->Get(
"StVertexT");
451 if (! tree ) {
delete f;
continue;}
452 TString Name(gSystem->BaseName(f->GetName()));
453 Name.ReplaceAll(
".root",
"");
455 Title.ReplaceAll(
"_",
" ");
458 TH1D *DM =
new TH1D(Form(
"DM%s",Name.Data()),Form(
"MuDst Multiplicity for %s",Title.Data()),3000,0,3000);
459 TH1D *DMQ =
new TH1D(Form(
"DMQ%s",Name.Data()),Form(
"MuDst Multiplicity*QA for %s",Title.Data()),3000,0,3000);
460 TH1D *KM =
new TH1D(Form(
"KM%s",Name.Data()),Form(
"KFVer Multiplicity for %s",Title.Data()),3000,0,3000);
461 TH1D *KMQ =
new TH1D(Form(
"KMQ%s",Name.Data()),Form(
"KFVer Multiplicity*QA for %s",Title.Data()),3000,0,3000);
463 TBranch *branch = tree->GetBranch(
"StKFEvent");
464 if (! branch)
continue;
466 branch->SetAddress(&fStKFEvent);
467 Int_t nbytes = 0, nb = 0;
468 Long64_t nentries = tree->GetEntries();
469 for (Long64_t jentry=0; jentry<nentries;jentry++) {
471 if (tree->LoadTree(jentry) < 0)
break;
472 nb = tree->GetEntry(jentry); nbytes += nb;
473 Int_t NoMuDst = fStKFEvent->NoMuDstVtx();
474 Int_t NoKFVtx = fStKFEvent->NoKFVtx();
477 TClonesArray *MuDst = fStKFEvent->MuDstVtx();
480 Double_t MultD = 0.5;
481 Double_t MultDQ = 0.5;
483 for (Int_t l = 0; l < NoMuDst; l++) {
485 if (md->IdTruth() != 1)
continue;
486 Int_t Mult = md->Mult();
487 if (Mult > MultMx) {MultMx = Mult; kd = l;}
493 MultDQ = TMath::Nint(MultD*md->QaTruth()/100.);
495 dXyz = md->Xyz() - md->XyzMc();
496 dXD->Fill(TMath::Log2(MultD),dXyz.x());
497 dYD->Fill(TMath::Log2(MultD),dXyz.y());
498 dZD->Fill(TMath::Log2(MultD),dXyz.z());
500 TClonesArray *KF = fStKFEvent->KFVtx();
503 for (Int_t l = 0; l < NoKFVtx; l++) {
505 if (mk->IdTruth() != 1)
continue;
506 Int_t Mult = mk->Mult();
507 if (Mult > MultMx) {MultMx = Mult; kf = l;}
509 Double_t MultK = 0.5;
510 Double_t MultKQ = 0.5;
515 MultKQ = TMath::Nint(MultK*mk->QaTruth()/100.);
517 dXyz = mk->Xyz() - mk->XyzMc();
518 dXK->Fill(TMath::Log2(MultK),dXyz.x());
519 dYK->Fill(TMath::Log2(MultK),dXyz.y());
520 dZK->Fill(TMath::Log2(MultK),dXyz.z());
522 multDK->Fill(TMath::Log2(MultK), TMath::Log2(MultD));
523 multDKQ->Fill(TMath::Log2(MultKQ), TMath::Log2(MultDQ));
525 cout <<
"Process \t" << f->GetName() <<
"\tread " << nentries <<
" entries and " << nbytes <<
" Bytes" << endl;
527 TH1D *hists[4] = {DM, DMQ, KM, KMQ};
528 cout <<
"|" << DM->GetTitle() <<
"|\t" << nentries;
529 for (Int_t i = 0; i < 4; i++) {
531 cout << hists[i]->GetName() <<
"\t" << hists[i]->GetTitle()
532 <<
"\tEntries = " << hists[i]->GetEntries()
533 <<
"\tMean = " << hists[i]->GetMean() << endl;
535 cout <<
"|\t" << 100*hists[i]->GetEntries()/nentries <<
"\t|\t" << hists[i]->GetMean();
538 cout <<
"\t|" << endl;
540 TH1D *DMr = 0, *DMQr = 0, *KMr = 0, *KMQr = 0;
541 Int_t nx = DM->GetNbinsX();
542 for (Int_t i = nx; i > 0; i--) {
544 if (DM->GetBinContent(i) <= 0 && KM->GetBinContent(i) <= 0)
continue;
545 DMr =
new TH1D(Form(
"DMr%s",Name.Data()),Form(
"MuDst Multiplicity for %s",Title.Data()),100,0,DM->GetXaxis()->GetBinUpEdge(i));
546 DMQr =
new TH1D(Form(
"DMQr%s",Name.Data()),Form(
"MuDst Multiplicity*QA for %s",Title.Data()),100,0,DM->GetXaxis()->GetBinUpEdge(i));
547 KMr =
new TH1D(Form(
"KMr%s",Name.Data()),Form(
"KFVer Multiplicity for %s",Title.Data()),100,0,DM->GetXaxis()->GetBinUpEdge(i));
548 KMQr =
new TH1D(Form(
"KMQr%s",Name.Data()),Form(
"KFVer Multiplicity*QA for %s",Title.Data()),100,0,DM->GetXaxis()->GetBinUpEdge(i));
550 DMr->Fill(DM->GetBinCenter(i),DM->GetBinContent(i));
551 DMQr->Fill(DMQ->GetBinCenter(i),DMQ->GetBinContent(i));
552 KMr->Fill(KM->GetBinCenter(i),KM->GetBinContent(i));
553 KMQr->Fill(KMQ->GetBinCenter(i),KMQ->GetBinContent(i));
555 delete DM;
delete DMQ;
delete KM;
delete KMQ;
560 void MuPrmVtx(Int_t last,
const Char_t *files =
"./*MuDst.root",
const Char_t *Out=
"") {
561 MuPrmVtx(0,last,files,Out);
564 void MuPrmVtx(
const Char_t *files =
"./*MuDst.root",
const Char_t *Out=
"") {
565 MuPrmVtx(0,99999,files,Out);
Class StDraw3D - to draw the 3D primitives like 3D points and 3D lines decorated with the STAR detect...
virtual TObject * Points(int n, const float *xyz, EDraw3DStyle sty)
This is an overloaded member function, provided for convenience.
static void SetField(Double_t Bz)
virtual void Clear(Option_t *opt="update")
Remove all objects from the list and update the screen if opt is "update".