StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuPrimaryVertex.cxx
1 /*
2  * Implementation file for StMuPrimaryVertex
3  * A simple class to store porimary vertex information
4  * All functions are inline
5  *
6  * $Id: StMuPrimaryVertex.cxx,v 1.13 2017/05/17 16:03:04 smirnovd Exp $
7  */
8 
9 #include "StMuPrimaryVertex.h"
10 #include "StEvent/StPrimaryVertex.h"
11 #include "StEventUtilities/StuRefMult.hh"
12 #include "StEventUtilities/StuFtpcRefMult.hh"
13 #include "TString.h"
14 ClassImp(StMuPrimaryVertex)
15 
17 {
18  mFlag = vertex->flag();
19  mPosition = vertex->position();
20  mPosError = vertex->positionError();
21  mVertexFinderId = vertex->vertexFinderId();
22  mRanking = vertex->ranking();
23  mNTracksUsed = vertex->numTracksUsedInFinder();
24  mNBTOFMatch = vertex->numMatchesWithBTOF();
25  mNCTBMatch = vertex->numMatchesWithCTB();
26  mNBEMCMatch = vertex->numMatchesWithBEMC();
27  mNEEMCMatch = vertex->numMatchesWithEEMC();
28 
29  mNBTOFNotMatch = vertex->numNotMatchesWithBTOF();
30  mNCTBNotMatch = vertex->numNotMatchesWithCTB();
31  mNBEMCNotMatch = vertex->numNotMatchesWithBEMC();
32  mNEEMCNotMatch = vertex->numNotMatchesWithEEMC();
33 
34  mNCrossCentralMembrane = vertex->numTracksCrossingCentralMembrane();
35  mNTpcWestOnly = vertex->numTracksTpcWestOnly();
36  mNTpcEastOnly = vertex->numTracksTpcEastOnly();
37  mNTracksWithPromptHit = vertex->numTracksWithPromptHit();
38  mNPostXTracks = vertex->numPostXTracks();
39  mSumTrackPt = vertex->sumOfTrackPt();
40  mMeanDip = vertex->meanDip();
41  mChiSquared = vertex->chiSquared();
42  mNTracks = vertex->numberOfDaughters();
43  mRefMultPos = uncorrectedNumberOfPositivePrimaries(vertex);
44  mRefMultNeg = uncorrectedNumberOfNegativePrimaries(vertex);
45  mRefMultFtpcEast = uncorrectedNumberOfFtpcEastPrimaries(vertex);
46  mRefMultFtpcWest = uncorrectedNumberOfFtpcWestPrimaries(vertex);
47 
48  mIdTruth = vertex->idTruth();
49  mQuality = vertex->qaTruth();
50  mIdParent = vertex->idParent();
51 }
52 #if 0
53 void StMuPrimaryVertex::Print(Option_t *option) const {
54  cout << "Vertex position " << mPosition << endl;
55  cout << " errors " << mPosError << endl;
56  cout << "Rank " << mRanking << endl;
57  cout << "Chisquared " << mChiSquared << endl;
58  cout << "RefMult " << refMult() << " ( pos " << mRefMultPos << ", neg "
59  << mRefMultNeg << " )" << endl;
60  cout << "Tracks used " << mNTracksUsed << endl;
61  cout << "Mean dip " << mMeanDip << endl;
62 }
63 #endif
64 //________________________________________________________________________________
65 ostream& operator<<(ostream& os, const StMuPrimaryVertex& v) {
66  const Char_t *beam = (v.isBeamConstrained()) ? "B" : " ";
67  os << Form("%1s:",beam);
68  if (v.nPostXtracks() < 10) os << Form("%i/",v.nPostXtracks());
69  else os << "*/";
70  if (v.nPromptTracks() < 10) os << Form("%i/",v.nPromptTracks());
71  else os << "*/";
72  if (v.nCrossCentralMembrane() < 10) os << Form("%i/",v.nCrossCentralMembrane());
73  else os << "*/";
74  if ((v.nBEMCMatch()+v.nBTOFMatch()) < 10) os << Form("%i/",(v.nBEMCMatch()+v.nBTOFMatch()));
75  else os << "*/";
76  if ((v.nBEMCMatch()+v.nEEMCMatch()) < 10) os << Form("%i/",(v.nBEMCMatch()+v.nEEMCMatch()));
77  else os << "*/";
78  if (v.nTpcWestOnly() < 10) os << Form("%i/",v.nTpcWestOnly());
79  else os << "*/";
80  if (v.nTpcEastOnly() < 10) os << Form("%i",v.nTpcEastOnly());
81  else os << "*";
82  os << Form(" %8.3f+/-%6.3f %8.3f+/-%6.3f %8.3f+/-%6.3f",
83  v.position().x(),v.posError().x(),
84  v.position().y(),v.posError().y(),
85  v.position().z(),v.posError().z());
86  os << Form(" Rank:%7.0f",v.ranking());
87  // os << Form(" M:%4i:R%4i",v.noTracks(),v.refMult());
88  os << Form(" M:%4i",v.noTracks());
89  // os << Form(" RefMult:%4i(%4i%4i)",v.refMult(),v.refMultPos(),-v.refMultNeg());
90  os << Form(" U:%4i ",v.nTracksUsed());
91  if (v.qaTruth())
92  os << Form(" QA:%3i",v.qaTruth());
93  return os;
94 }
95 //________________________________________________________________________________
96 void StMuPrimaryVertex::Print(Option_t *option) const {cout << *this << endl;}
97 //________________________________________________________________________________
98 // $Log: StMuPrimaryVertex.cxx,v $
99 // Revision 1.13 2017/05/17 16:03:04 smirnovd
100 // StMuPrimaryVertex: Passing pointer by reference is pointless
101 //
102 // Revision 1.12 2017/04/17 19:19:43 smirnovd
103 // [Cosmetic] Whitespace adjustments
104 //
105 // Revision 1.11 2013/01/14 23:34:29 fisyak
106 // Fix print out
107 //
108 // Revision 1.10 2012/11/26 23:14:33 fisyak
109 // Replace GetEntries() by GetEntriesFast(), fix print outs
110 //
111 // Revision 1.9 2012/09/16 21:58:16 fisyak
112 // Make use of Tpc West and East Only no. of tracks
113 //
114 // Revision 1.8 2012/05/07 14:47:06 fisyak
115 // Add handles for track to fast detector matching
116 //
117 // Revision 1.7 2011/10/17 00:19:14 fisyak
118 // Active handing of IdTruth
119 //
Definition: beam.h:43
virtual void Print(Option_t *option="") const
Print essential vertex info.