28 #include "StHbtMaker/Infrastructure/StHbtTriplet.hh"
31 unsigned long mapMask0 = 0xFFFFFF00;
32 unsigned long mapMask1 = 0x1FFFFF;
33 unsigned long padRow1To24Track1 = Track1->TopologyMap(0) & mapMask0;
34 unsigned long padRow25To45Track1 = Track1->TopologyMap(1) & mapMask1;
35 unsigned long padRow1To24Track2 = Track2->TopologyMap(0) & mapMask0;
36 unsigned long padRow25To45Track2 = Track2->TopologyMap(1) & mapMask1;
38 unsigned long bothPads1To24 = padRow1To24Track1 & padRow1To24Track2;
39 unsigned long bothPads25To45 = padRow25To45Track1 & padRow25To45Track2;
41 unsigned long onePad1To24 = padRow1To24Track1 ^ padRow1To24Track2;
42 unsigned long onePad25To45 = padRow25To45Track1 ^ padRow25To45Track2;
46 double normQual = 0.0;
47 int MaxQuality = Track1->NumberOfHits() + Track2->NumberOfHits();
48 for (ibits=8;ibits<=31;ibits++) {
51 if ( onePad1To24 & bitI ) {
56 if ( bothPads1To24 & bitI ) Quality--;
59 for (ibits=0;ibits<=20;ibits++) {
62 if ( onePad25To45 & bitI ) {
67 if ( bothPads25To45 & bitI ) Quality--;
70 normQual = (double)Quality/( (
double) MaxQuality );
75 StHbtTriplet::StHbtTriplet(){
82 : mTrack1(a), mTrack2(b), mTrack3(c)
86 StHbtTriplet::~StHbtTriplet() {}
93 double StHbtTriplet::qInv()
const
95 double dq = ::sqrt(fabs((mTrack1->FourMomentum() - mTrack2->FourMomentum()).m2()) +
96 fabs((mTrack2->FourMomentum() - mTrack3->FourMomentum()).m2()) +
97 fabs((mTrack3->FourMomentum() - mTrack1->FourMomentum()).m2()));
101 double StHbtTriplet::qInv12()
const
103 double dq = ::sqrt(fabs((mTrack1->FourMomentum() - mTrack2->FourMomentum()).m2()));
107 double StHbtTriplet::qInv23()
const
109 double dq = ::sqrt(fabs((mTrack2->FourMomentum() - mTrack3->FourMomentum()).m2()));
113 double StHbtTriplet::qInv31()
const
115 double dq = ::sqrt(fabs((mTrack3->FourMomentum() - mTrack1->FourMomentum()).m2()));
119 double StHbtTriplet::mInv()
const
121 double InvariantMass = abs(mTrack1->FourMomentum() + mTrack2->FourMomentum() + mTrack3->FourMomentum());
122 return (InvariantMass);
125 double StHbtTriplet::kT()
const
129 (mTrack1->FourMomentum() + mTrack2->FourMomentum() + mTrack3->FourMomentum()).perp();
137 StHbtLorentzVector temp = mTrack1->FourMomentum()+mTrack2->FourMomentum()+mTrack3->FourMomentum();
141 double StHbtTriplet::quality()
const {
143 double Q1 = Triplet_Quality_Calc(mTrack1, mTrack2);
144 double Q2 = Triplet_Quality_Calc(mTrack2, mTrack3);
145 double Q3 = Triplet_Quality_Calc(mTrack3, mTrack1);
148 if (Q1>Q3)
return Q1;
152 if (Q2>Q3)
return Q2;
157 double StHbtTriplet::NominalTpcExitSeparation()
const {
158 StHbtThreeVector diff1 = mTrack1->NominalTpcExitPoint() - mTrack2->NominalTpcExitPoint();
159 StHbtThreeVector diff2 = mTrack2->NominalTpcExitPoint() - mTrack3->NominalTpcExitPoint();
160 StHbtThreeVector diff3 = mTrack3->NominalTpcExitPoint() - mTrack1->NominalTpcExitPoint();
161 if (diff1.mag()<diff2.mag()) {
162 if (diff1.mag()<diff3.mag())
return (diff1.mag());
163 else return (diff3.mag());
165 else if (diff2.mag()<diff3.mag())
return (diff2.mag());
166 else return (diff3.mag());
169 double StHbtTriplet::NominalTpcEntranceSeparation()
const {
170 StHbtThreeVector diff1 = mTrack1->NominalTpcEntrancePoint() - mTrack2->NominalTpcEntrancePoint();
171 StHbtThreeVector diff2 = mTrack2->NominalTpcEntrancePoint() - mTrack3->NominalTpcEntrancePoint();
172 StHbtThreeVector diff3 = mTrack3->NominalTpcEntrancePoint() - mTrack1->NominalTpcEntrancePoint();
173 if (diff1.mag()<diff2.mag()) {
174 if (diff1.mag()<diff3.mag())
return (diff1.mag());
175 else return (diff3.mag());
177 else if (diff2.mag()<diff3.mag())
return (diff2.mag());
178 else return (diff3.mag());
181 double StHbtTriplet::NominalTpcAverageSeparation()
const {
183 double AveSep1 = 0.0;
184 double AveSep2 = 0.0;
185 double AveSep3 = 0.0;
187 for (ipt=0; ipt<11; ipt++){
188 diff1 = mTrack1->mNominalPosSample[ipt] - mTrack2->mNominalPosSample[ipt];
189 AveSep1 += diff1.mag();
190 diff2 = mTrack2->mNominalPosSample[ipt] - mTrack3->mNominalPosSample[ipt];
191 AveSep2 += diff2.mag();
192 diff3 = mTrack3->mNominalPosSample[ipt] - mTrack1->mNominalPosSample[ipt];
193 AveSep3 += diff3.mag();
195 AveSep1 = AveSep1/11.0;
196 AveSep2 = AveSep1/11.0;
197 AveSep3 = AveSep1/11.0;
198 if (AveSep1<AveSep2) {
199 if (AveSep1<AveSep3)
return (AveSep1);
200 else return (AveSep3);
202 else if (AveSep2<AveSep3)
return (AveSep2);
203 else return (AveSep3);