StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrackPairInfo.cc
1 /***************************************************************************
2  *
3  * $Id: StTrackPairInfo.cc,v 1.11 2015/03/13 18:44:44 perev Exp $
4  * $Log: StTrackPairInfo.cc,v $
5  * Revision 1.11 2015/03/13 18:44:44 perev
6  * Roll back
7  *
8  * Revision 1.9 2011/04/01 19:40:07 perev
9  * const++
10  *
11  * Revision 1.8 2010/06/22 22:06:33 fine
12  * roll back the previous version to restore the nightly builds
13  *
14  * Revision 1.6 2005/11/22 21:44:16 fisyak
15  * Add Ssd to Associator, add IdTruth options for Svt and Ssd
16  *
17  * Revision 1.5 1999/12/14 07:07:41 calderon
18  * Added Ratio Number of Common Hits / Number of Reconstructed Hits for
19  * each detector.
20  * Numbering scheme from StEvent & StMcEvent as per SVT request
21  * Added Kink, V0 and Xi vertex associations.
22  *
23  * Revision 1.4 1999/12/08 00:00:25 calderon
24  * New version of StAssociationMaker.
25  * -Uses new StEvent / StMcEvent
26  * -Includes maps using reconstructed and monte carlo objects as keys for:
27  * TPC Hits
28  * SVT Hits
29  * FTPC Hits
30  * Tracks (using all 3 hit multimaps)
31  *
32  * Revision 1.3 1999/09/23 21:25:24 calderon
33  * Added Log & Id
34  * Modified includes according to Yuri
35  *
36  *
37  **************************************************************************/
38 #include "StTrackPairInfo.hh"
39 #include "StMcTrack.hh"
40 #include "StGlobalTrack.h"
41 #include "StTrackDetectorInfo.h"
42 static const char rcsid[] = "$Id: StTrackPairInfo.cc,v 1.11 2015/03/13 18:44:44 perev Exp $";
43 
44 StTrackPairInfo::StTrackPairInfo(const StGlobalTrack* rcTrk,
45  const StMcTrack* mcTrk,
46  unsigned int tpcPings,
47  unsigned int svtPings,
48  unsigned int ssdPings,
49  unsigned int ftpcPings)
50  :
51  mPartnerTrack(rcTrk),
52  mPartnerMcTrack(mcTrk),
53  mCommonTpcHits(tpcPings),
54  mCommonSvtHits(svtPings),
55  mCommonSsdHits(ssdPings),
56  mCommonFtpcHits(ftpcPings)
57 {
58  // Percent of Svt Hits
59  unsigned short numPoints = rcTrk->detectorInfo()->numberOfPoints(kSvtId);
60  mRatioCommonToTotalHitsSvt =
61  (numPoints) ? static_cast<float>(mCommonSvtHits)/static_cast<float>(numPoints) : 0;
62 
63  // Percent of Ssd Hits
64  numPoints = rcTrk->detectorInfo()->numberOfPoints(kSsdId);
65  mRatioCommonToTotalHitsSsd =
66  (numPoints) ? static_cast<float>(mCommonSsdHits)/static_cast<float>(numPoints) : 0;
67 
68  // Percent of Tpc Hits
69  numPoints = rcTrk->detectorInfo()->numberOfPoints(kTpcId);
70  mRatioCommonToTotalHitsTpc =
71  (numPoints) ? static_cast<float>(mCommonTpcHits)/static_cast<float>(numPoints) : 0;
72  mRatioCommonToTotalHitsFtpc = 0;
73  if (!numPoints) {
74  // Percent of Ftpc West Hits in common
75  numPoints = rcTrk->detectorInfo()->numberOfPoints(kFtpcWestId);
76  mRatioCommonToTotalHitsFtpc =
77  (numPoints) ? static_cast<float>(mCommonFtpcHits)/static_cast<float>(numPoints) : 0;
78 
79  // If no Ftpc West Hits, try Ftpc East
80  if (!numPoints) {
81  numPoints = rcTrk->detectorInfo()->numberOfPoints(kFtpcEastId);
82  mRatioCommonToTotalHitsFtpc =
83  (numPoints) ? static_cast<float>(mCommonFtpcHits)/static_cast<float>(numPoints) : 0;
84  }
85  }
86 }
87 
88 StTrackPairInfo::~StTrackPairInfo() { /* noop */ }
89 
90 void StTrackPairInfo::setPartnerMcTrack(const StMcTrack* val) { mPartnerMcTrack = val; }
91 
92 void StTrackPairInfo::setPartnerTrack(const StGlobalTrack* val) { mPartnerTrack = val; }
93 
94 void StTrackPairInfo::setCommonTpcHits(unsigned int val) { mCommonTpcHits = val; }
95 
96 void StTrackPairInfo::setCommonSvtHits(unsigned int val) { mCommonSvtHits = val; }
97 void StTrackPairInfo::setCommonSsdHits(unsigned int val) { mCommonSsdHits = val; }
98 
99 void StTrackPairInfo::setCommonFtpcHits(unsigned int val) { mCommonFtpcHits = val; }
100 
101 ostream& operator<<(ostream& os, const StTrackPairInfo& v) {
102  return os << "Mc: " << v.partnerMcTrack() << " Rc: " << v.partnerTrack()
103  << " Common Hits in Tpc :" << v.commonTpcHits() << "/" << v.percentOfPairedTpcHits()
104  << " Svt :" << v.commonSvtHits() << "/" << v.percentOfPairedSvtHits()
105  << " Ssd :" << v.commonSsdHits() << "/" << v.percentOfPairedSsdHits()
106  << " Ftpc :" << v.commonFtpcHits() << "/" << v.percentOfPairedFtpcHits()
107  << endl;
108 }
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144