1 ///////////////////////////////////////////////////////////////////////////
3 // AliFemtoPair: the Pair object is passed to the PairCuts for //
4 // verification, and then to the AddRealPair and AddMixedPair methods of //
5 // the Correlation Functions. It holds pair-specific variables like //
6 // relative momenta and has links to the particles and tracks that form //
9 ///////////////////////////////////////////////////////////////////////////
11 #include "AliFemtoPair.h"
13 double AliFemtoPair::fgMaxDuInner = .8;
14 double AliFemtoPair::fgMaxDzInner = 3.;
15 double AliFemtoPair::fgMaxDuOuter = 1.4;
16 double AliFemtoPair::fgMaxDzOuter = 3.2;
19 AliFemtoPair::AliFemtoPair() :
20 fTrack1(0), fTrack2(0),
22 fNonIdParNotCalculated(0),
28 fNonIdParNotCalculatedGlobal(0),
29 fMergingParNotCalculated(0),
33 fMergingParNotCalculatedTrkV0Pos(0),
34 fFracOfMergedRowTrkV0Pos(0),
35 fClosestRowAtDCATrkV0Pos(0),
36 fMergingParNotCalculatedTrkV0Neg(0),
37 fFracOfMergedRowTrkV0Neg(0),
38 fClosestRowAtDCATrkV0Neg(0),
39 fMergingParNotCalculatedV0PosV0Neg(0),
40 fFracOfMergedRowV0PosV0Neg(0),
41 fClosestRowAtDCAV0PosV0Neg(0),
42 fMergingParNotCalculatedV0NegV0Pos(0),
43 fFracOfMergedRowV0NegV0Pos(0),
44 fClosestRowAtDCAV0NegV0Pos(0),
45 fMergingParNotCalculatedV0PosV0Pos(0),
46 fFracOfMergedRowV0PosV0Pos(0),
47 fClosestRowAtDCAV0PosV0Pos(0),
48 fMergingParNotCalculatedV0NegV0Neg(0),
49 fFracOfMergedRowV0NegV0Neg(0),
50 fClosestRowAtDCAV0NegV0Neg(0)
52 // Default constructor
55 SetDefaultHalfFieldMergingPar();
58 AliFemtoPair::AliFemtoPair(AliFemtoParticle* a, AliFemtoParticle* b)
59 : fTrack1(a), fTrack2(b),
61 fNonIdParNotCalculated(0),
67 fNonIdParNotCalculatedGlobal(0),
68 fMergingParNotCalculated(0),
72 fMergingParNotCalculatedTrkV0Pos(0),
73 fFracOfMergedRowTrkV0Pos(0),
74 fClosestRowAtDCATrkV0Pos(0),
75 fMergingParNotCalculatedTrkV0Neg(0),
76 fFracOfMergedRowTrkV0Neg(0),
77 fClosestRowAtDCATrkV0Neg(0),
78 fMergingParNotCalculatedV0PosV0Neg(0),
79 fFracOfMergedRowV0PosV0Neg(0),
80 fClosestRowAtDCAV0PosV0Neg(0),
81 fMergingParNotCalculatedV0NegV0Pos(0),
82 fFracOfMergedRowV0NegV0Pos(0),
83 fClosestRowAtDCAV0NegV0Pos(0),
84 fMergingParNotCalculatedV0PosV0Pos(0),
85 fFracOfMergedRowV0PosV0Pos(0),
86 fClosestRowAtDCAV0PosV0Pos(0),
87 fMergingParNotCalculatedV0NegV0Neg(0),
88 fFracOfMergedRowV0NegV0Neg(0),
89 fClosestRowAtDCAV0NegV0Neg(0)
91 // Construct a pair from two particles
92 SetDefaultHalfFieldMergingPar();
95 void AliFemtoPair::SetDefaultHalfFieldMergingPar(){
101 void AliFemtoPair::SetDefaultFullFieldMergingPar(){
102 // Set default TPC merging parameters for STAR TPC
108 void AliFemtoPair::SetMergingPar(double aMaxDuInner, double aMaxDzInner,
109 double aMaxDuOuter, double aMaxDzOuter)
111 // Set TPC merging parameters for STAR TPC
112 fgMaxDuInner = aMaxDuInner;
113 fgMaxDzInner = aMaxDzInner;
114 fgMaxDuOuter = aMaxDuOuter;
115 fgMaxDzOuter = aMaxDzOuter;
118 AliFemtoPair::~AliFemtoPair() {
123 AliFemtoPair::AliFemtoPair(const AliFemtoPair &aPair):
124 fTrack1(0), fTrack2(0),
126 fNonIdParNotCalculated(0),
132 fNonIdParNotCalculatedGlobal(0),
133 fMergingParNotCalculated(0),
137 fMergingParNotCalculatedTrkV0Pos(0),
138 fFracOfMergedRowTrkV0Pos(0),
139 fClosestRowAtDCATrkV0Pos(0),
140 fMergingParNotCalculatedTrkV0Neg(0),
141 fFracOfMergedRowTrkV0Neg(0),
142 fClosestRowAtDCATrkV0Neg(0),
143 fMergingParNotCalculatedV0PosV0Neg(0),
144 fFracOfMergedRowV0PosV0Neg(0),
145 fClosestRowAtDCAV0PosV0Neg(0),
146 fMergingParNotCalculatedV0NegV0Pos(0),
147 fFracOfMergedRowV0NegV0Pos(0),
148 fClosestRowAtDCAV0NegV0Pos(0),
149 fMergingParNotCalculatedV0PosV0Pos(0),
150 fFracOfMergedRowV0PosV0Pos(0),
151 fClosestRowAtDCAV0PosV0Pos(0),
152 fMergingParNotCalculatedV0NegV0Neg(0),
153 fFracOfMergedRowV0NegV0Neg(0),
154 fClosestRowAtDCAV0NegV0Neg(0)
157 fTrack1 = aPair.fTrack1;
158 fTrack2 = aPair.fTrack2;
160 fNonIdParNotCalculated = aPair.fNonIdParNotCalculated;
161 fDKSide = aPair.fDKSide;
162 fDKOut = aPair.fDKOut;
163 fDKLong = aPair.fDKLong;
165 fKStarCalc = aPair.fKStarCalc;
167 fNonIdParNotCalculatedGlobal = aPair.fNonIdParNotCalculatedGlobal;
169 fMergingParNotCalculated = aPair.fMergingParNotCalculated;
170 fWeightedAvSep = aPair.fWeightedAvSep;
171 fFracOfMergedRow = aPair.fFracOfMergedRow;
172 fClosestRowAtDCA = aPair.fClosestRowAtDCA;
174 fMergingParNotCalculatedTrkV0Pos = aPair.fMergingParNotCalculatedTrkV0Pos;
175 fFracOfMergedRowTrkV0Pos = aPair.fFracOfMergedRowTrkV0Pos;
176 fClosestRowAtDCATrkV0Pos = aPair.fClosestRowAtDCATrkV0Pos;
178 fMergingParNotCalculatedTrkV0Neg = aPair.fMergingParNotCalculatedTrkV0Neg;
179 fFracOfMergedRowTrkV0Neg = aPair.fFracOfMergedRowTrkV0Neg;
180 fClosestRowAtDCATrkV0Neg = aPair.fClosestRowAtDCATrkV0Neg;
182 fMergingParNotCalculatedV0PosV0Neg = aPair.fMergingParNotCalculatedV0PosV0Neg;
183 fFracOfMergedRowV0PosV0Neg = aPair.fFracOfMergedRowV0PosV0Neg;
184 fClosestRowAtDCAV0PosV0Neg = aPair.fClosestRowAtDCAV0PosV0Neg;
186 fMergingParNotCalculatedV0NegV0Pos = aPair.fMergingParNotCalculatedV0NegV0Pos;
187 fFracOfMergedRowV0NegV0Pos = aPair.fFracOfMergedRowV0NegV0Pos;
188 fClosestRowAtDCAV0NegV0Pos = aPair.fClosestRowAtDCAV0NegV0Pos;
190 fMergingParNotCalculatedV0PosV0Pos = aPair.fMergingParNotCalculatedV0PosV0Pos;
191 fFracOfMergedRowV0PosV0Pos = aPair.fFracOfMergedRowV0PosV0Pos;
192 fClosestRowAtDCAV0PosV0Pos = aPair.fClosestRowAtDCAV0PosV0Pos;
194 fMergingParNotCalculatedV0NegV0Neg = aPair.fMergingParNotCalculatedV0NegV0Neg;
195 fFracOfMergedRowV0NegV0Neg = aPair.fFracOfMergedRowV0NegV0Neg;
196 fClosestRowAtDCAV0NegV0Neg = aPair.fClosestRowAtDCAV0NegV0Neg;
199 AliFemtoPair& AliFemtoPair::operator=(const AliFemtoPair &aPair)
201 // Assignment operator
205 fTrack1 = aPair.fTrack1;
206 fTrack2 = aPair.fTrack2;
208 fNonIdParNotCalculated = aPair.fNonIdParNotCalculated;
209 fDKSide = aPair.fDKSide;
210 fDKOut = aPair.fDKOut;
211 fDKLong = aPair.fDKLong;
213 fKStarCalc = aPair.fKStarCalc;
215 fNonIdParNotCalculatedGlobal = aPair.fNonIdParNotCalculatedGlobal;
217 fMergingParNotCalculated = aPair.fMergingParNotCalculated;
218 fWeightedAvSep = aPair.fWeightedAvSep;
219 fFracOfMergedRow = aPair.fFracOfMergedRow;
220 fClosestRowAtDCA = aPair.fClosestRowAtDCA;
222 fMergingParNotCalculatedTrkV0Pos = aPair.fMergingParNotCalculatedTrkV0Pos;
223 fFracOfMergedRowTrkV0Pos = aPair.fFracOfMergedRowTrkV0Pos;
224 fClosestRowAtDCATrkV0Pos = aPair.fClosestRowAtDCATrkV0Pos;
226 fMergingParNotCalculatedTrkV0Neg = aPair.fMergingParNotCalculatedTrkV0Neg;
227 fFracOfMergedRowTrkV0Neg = aPair.fFracOfMergedRowTrkV0Neg;
228 fClosestRowAtDCATrkV0Neg = aPair.fClosestRowAtDCATrkV0Neg;
230 fMergingParNotCalculatedV0PosV0Neg = aPair.fMergingParNotCalculatedV0PosV0Neg;
231 fFracOfMergedRowV0PosV0Neg = aPair.fFracOfMergedRowV0PosV0Neg;
232 fClosestRowAtDCAV0PosV0Neg = aPair.fClosestRowAtDCAV0PosV0Neg;
234 fMergingParNotCalculatedV0NegV0Pos = aPair.fMergingParNotCalculatedV0NegV0Pos;
235 fFracOfMergedRowV0NegV0Pos = aPair.fFracOfMergedRowV0NegV0Pos;
236 fClosestRowAtDCAV0NegV0Pos = aPair.fClosestRowAtDCAV0NegV0Pos;
238 fMergingParNotCalculatedV0PosV0Pos = aPair.fMergingParNotCalculatedV0PosV0Pos;
239 fFracOfMergedRowV0PosV0Pos = aPair.fFracOfMergedRowV0PosV0Pos;
240 fClosestRowAtDCAV0PosV0Pos = aPair.fClosestRowAtDCAV0PosV0Pos;
242 fMergingParNotCalculatedV0NegV0Neg = aPair.fMergingParNotCalculatedV0NegV0Neg;
243 fFracOfMergedRowV0NegV0Neg = aPair.fFracOfMergedRowV0NegV0Neg;
244 fClosestRowAtDCAV0NegV0Neg = aPair.fClosestRowAtDCAV0NegV0Neg;
249 //________________________
250 double AliFemtoPair::GetPairAngleEP() const
255 double AliFemtoPair::MInv() const
258 double tInvariantMass = abs(fTrack1->FourMomentum() + fTrack2->FourMomentum());
259 return (tInvariantMass);
262 double AliFemtoPair::KT() const
264 // transverse momentum
266 (fTrack1->FourMomentum() + fTrack2->FourMomentum()).Perp();
272 double AliFemtoPair::Rap() const
274 // longitudinal pair rapidity : Y = 0.5 ::log( E1 + E2 + pz1 + pz2 / E1 + E2 - pz1 - pz2 )
275 double tmp = 0.5 * log (
276 (fTrack1->FourMomentum().e() + fTrack2->FourMomentum().e() + fTrack1->FourMomentum().z() + fTrack2->FourMomentum().z()) /
277 (fTrack1->FourMomentum().e() + fTrack2->FourMomentum().e() - fTrack1->FourMomentum().z() - fTrack2->FourMomentum().z())
282 double AliFemtoPair::EmissionAngle() const {
284 double pxTotal = this->FourMomentumSum().x();
285 double pyTotal = this->FourMomentumSum().y();
286 double angle = atan2(pyTotal,pxTotal)*180.0/3.1415926536;
287 if (angle<0.0) angle+=360.0;
291 // get rid of ambiguously-named method fourMomentum() and replace it with
292 // fourMomentumSum() and fourMomentumDiff() - mal 13feb2000
293 AliFemtoLorentzVector AliFemtoPair::FourMomentumSum() const
296 AliFemtoLorentzVector temp = fTrack1->FourMomentum()+fTrack2->FourMomentum();
299 AliFemtoLorentzVector AliFemtoPair::FourMomentumDiff() const
301 // momentum difference
302 AliFemtoLorentzVector temp = fTrack1->FourMomentum()-fTrack2->FourMomentum();
305 //__________________________________
306 void AliFemtoPair::QYKPCMS(double& qP, double& qT, double& q0) const
308 // Yano-Koonin-Podgoretskii Parametrisation in CMS
310 // calculate momentum difference in source rest frame (= lab frame)
312 AliFemtoLorentzVector l1 = fTrack1->FourMomentum() ;
313 AliFemtoLorentzVector l2 = fTrack2->FourMomentum() ;
314 AliFemtoLorentzVector l ;
315 // random ordering of the particles
316 if ( rand()/(double)RAND_MAX > 0.50 )
320 // fill momentum differences into return variables
322 qT = l.vect().Perp() ;
325 //___________________________________
326 void AliFemtoPair::QYKPLCMS(double& qP, double& qT, double& q0) const
328 // Yano-Koonin-Podgoretskii Parametrisation in LCMS
330 // calculate momentum difference in LCMS : frame where pz1 + pz2 = 0
332 AliFemtoLorentzVector l1 = fTrack1->FourMomentum() ;
333 AliFemtoLorentzVector l2 = fTrack2->FourMomentum() ;
334 // determine beta to LCMS
335 double beta = (l1.z()+l2.z()) / (l1.e()+l2.e()) ;
336 double beta2 = beta*beta ;
337 // unfortunately STAR Class lib knows only boost(particle) not boost(beta) :(
338 // -> create particle with velocity beta and mass 1.0
339 // actually this is : dummyPz = ::sqrt( (dummyMass*dummyMass*beta2) / (1-beta2) ) ;
340 double dummyPz = ::sqrt( (beta2) / (1-beta2) ) ;
341 // boost in the correct direction
342 if (beta>0.0) { dummyPz = -dummyPz; } ;
343 // create dummy particle
344 AliFemtoLorentzVector l(0.0, 0.0, dummyPz) ;
345 double dummyMass = 1.0 ;
346 l.SetE(l.vect().MassHypothesis(dummyMass) );
347 // boost particles along the beam into a frame with velocity beta
348 AliFemtoLorentzVector l1boosted = l1.boost(l) ;
349 AliFemtoLorentzVector l2boosted = l2.boost(l) ;
350 // caculate the momentum difference with random ordering of the particle
351 if ( rand()/(double)RAND_MAX >0.50)
352 { l = l1boosted-l2boosted ; }
354 { l = l2boosted-l1boosted ;} ;
355 // fill momentum differences into return variables
357 qT = l.vect().Perp() ;
360 //___________________________________
361 // Yano-Koonin-Podgoretskii Parametrisation in pair rest frame
362 void AliFemtoPair::QYKPPF(double& qP, double& qT, double& q0) const
365 // calculate momentum difference in pair rest frame : frame where (pz1 + pz2, py1 + py2, px1 + px2) = (0,0,0)
367 AliFemtoLorentzVector l1 = fTrack1->FourMomentum() ;
368 AliFemtoLorentzVector l2 = fTrack2->FourMomentum() ;
369 // the center of gravity of the pair travels with l
370 AliFemtoLorentzVector l = l1 + l2 ;
374 AliFemtoLorentzVector l1boosted = l1.boost(l) ;
375 AliFemtoLorentzVector l2boosted = l2.boost(l) ;
376 // caculate the momentum difference with random ordering of the particle
377 if ( rand()/(double)RAND_MAX > 0.50)
378 { l = l1boosted-l2boosted ; }
380 { l = l2boosted-l1boosted ;} ;
381 // fill momentum differences into return variables
383 qT = l.vect().Perp();
387 double AliFemtoPair::QOutCMS() const
389 // relative momentum out component in lab frame
390 AliFemtoThreeVector tmp1 = fTrack1->FourMomentum().vect();
391 AliFemtoThreeVector tmp2 = fTrack2->FourMomentum().vect();
393 double dx = tmp1.x() - tmp2.x();
394 double xt = tmp1.x() + tmp2.x();
396 double dy = tmp1.y() - tmp2.y();
397 double yt = tmp1.y() + tmp2.y();
399 double k1 = (::sqrt(xt*xt+yt*yt));
400 double k2 = (dx*xt+dy*yt);
403 if(k1!=0) tmp= k2/k1;
409 double AliFemtoPair::QSideCMS() const
411 // relative momentum side component in lab frame
412 AliFemtoThreeVector tmp1 = fTrack1->FourMomentum().vect();
413 AliFemtoThreeVector tmp2 = fTrack2->FourMomentum().vect();
415 double x1 = tmp1.x(); double y1 = tmp1.y();
416 double x2 = tmp2.x(); double y2 = tmp2.y();
418 double xt = x1+x2; double yt = y1+y2;
419 double k1 = ::sqrt(xt*xt+yt*yt);
422 if(k1!=0) tmp= 2.0*(x2*y1-x1*y2)/k1;
428 //_________________________
429 double AliFemtoPair::QLongCMS() const
431 // relative momentum component in lab frame
432 AliFemtoLorentzVector tmp1 = fTrack1->FourMomentum();
433 AliFemtoLorentzVector tmp2 = fTrack2->FourMomentum();
435 double dz = tmp1.z() - tmp2.z();
436 double zz = tmp1.z() + tmp2.z();
438 double dt = tmp1.t() - tmp2.t();
439 double tt = tmp1.t() + tmp2.t();
442 double gamma = 1.0/TMath::Sqrt((1.-beta)*(1.+beta));
444 double temp = gamma*(dz - beta*dt);
448 //________________________________
449 double AliFemtoPair::QOutPf() const
451 // relative momentum out component in pair frame
452 AliFemtoLorentzVector tmp1 = fTrack1->FourMomentum();
453 AliFemtoLorentzVector tmp2 = fTrack2->FourMomentum();
455 double dt = tmp1.t() - tmp2.t();
456 double tt = tmp1.t() + tmp2.t();
458 double xt = tmp1.x() + tmp2.x();
459 double yt = tmp1.y() + tmp2.y();
461 double k1 = ::sqrt(xt*xt + yt*yt);
463 double gOut = 1.0/TMath::Sqrt((1.-bOut)*(1.+bOut));
465 double temp = gOut*(QOutCMS() - bOut*dt);
469 //___________________________________
470 double AliFemtoPair::QSidePf() const
472 // relative momentum side component in pair frame
474 return(this->QSideCMS());
477 //___________________________________
479 double AliFemtoPair::QLongPf() const
481 // relative momentum long component in pair frame
483 return(this->QLongCMS());
486 //___________________________________
487 double AliFemtoPair::QOutBf(double /* beta */) const
489 // relative momentum out component
490 return(this->QOutCMS());
493 //___________________________________
495 double AliFemtoPair::QSideBf(double /* beta */) const
497 // relative momentum side component
498 return(this->QSideCMS());
501 //___________________________________
502 double AliFemtoPair::QLongBf(double beta) const
504 // relative momentum long component
505 AliFemtoLorentzVector tmp1 = fTrack1->FourMomentum();
506 AliFemtoLorentzVector tmp2 = fTrack2->FourMomentum();
508 double dz = tmp1.z() - tmp2.z();
509 double dt = tmp1.t() + tmp2.t();
511 double gamma = 1.0/::sqrt((1.-beta)*(1.+beta));
513 double temp = gamma*(dz - beta*dt);
517 double AliFemtoPair::Quality() const {
518 // Calculate split quality of the pair
519 unsigned long mapMask0 = 0xFFFFFF00;
520 unsigned long mapMask1 = 0x1FFFFF;
521 unsigned long padRow1To24Track1 = fTrack1->TopologyMap(0) & mapMask0;
522 unsigned long padRow25To45Track1 = fTrack1->TopologyMap(1) & mapMask1;
523 unsigned long padRow1To24Track2 = fTrack2->TopologyMap(0) & mapMask0;
524 unsigned long padRow25To45Track2 = fTrack2->TopologyMap(1) & mapMask1;
526 unsigned long bothPads1To24 = padRow1To24Track1 & padRow1To24Track2;
527 unsigned long bothPads25To45 = padRow25To45Track1 & padRow25To45Track2;
529 unsigned long onePad1To24 = padRow1To24Track1 ^ padRow1To24Track2;
530 unsigned long onePad25To45 = padRow25To45Track1 ^ padRow25To45Track2;
534 double normQual = 0.0;
535 int tMaxQuality = fTrack1->NumberOfHits() + fTrack2->NumberOfHits();
536 for (ibits=8;ibits<=31;ibits++) {
538 bitI |= 1UL<<(ibits);
539 if ( onePad1To24 & bitI ) {
544 if ( bothPads1To24 & bitI ) tQuality--;
547 for (ibits=0;ibits<=20;ibits++) {
549 bitI |= 1UL<<(ibits);
550 if ( onePad25To45 & bitI ) {
555 if ( bothPads25To45 & bitI ) tQuality--;
558 normQual = (double)tQuality/( (double) tMaxQuality );
563 double AliFemtoPair::Quality2() const {
564 // second implementation of split quality
565 unsigned long mapMask0 = 0xFFFFFF00;
566 unsigned long mapMask1 = 0x1FFFFF;
567 unsigned long padRow1To24Track1 = fTrack1->TopologyMap(0) & mapMask0;
568 unsigned long padRow25To45Track1 = fTrack1->TopologyMap(1) & mapMask1;
569 unsigned long padRow1To24Track2 = fTrack2->TopologyMap(0) & mapMask0;
570 unsigned long padRow25To45Track2 = fTrack2->TopologyMap(1) & mapMask1;
573 //unsigned long bothPads1To24 = padRow1To24Track1 & padRow1To24Track2;
574 //unsigned long bothPads25To45 = padRow25To45Track1 & padRow25To45Track2;
577 unsigned long onePad1To24 = padRow1To24Track1 ^ padRow1To24Track2;
578 unsigned long onePad25To45 = padRow25To45Track1 ^ padRow25To45Track2;
582 double normQual = 0.0;
583 int tMaxQuality = fTrack1->NumberOfHits() + fTrack2->NumberOfHits();
584 for (ibits=8;ibits<=31;ibits++) {
586 bitI |= 1UL<<(ibits);
587 if ( onePad1To24 & bitI ) {
592 //if ( bothPads1To24 & bitI ) tQuality--;
595 for (ibits=0;ibits<=20;ibits++) {
597 bitI |= 1UL<<(ibits);
598 if ( onePad25To45 & bitI ) {
603 //if ( bothPads25To45 & bitI ) tQuality--;
606 normQual = (double)tQuality/( (double) tMaxQuality );
612 double AliFemtoPair::NominalTpcExitSeparation() const {
613 // separation at exit from STAR TPC
614 AliFemtoThreeVector diff = fTrack1->Track()->NominalTpcExitPoint() - fTrack2->Track()->NominalTpcExitPoint();
618 double AliFemtoPair::NominalTpcEntranceSeparation() const {
619 // separation at entrance to STAR TPC
620 AliFemtoThreeVector diff = fTrack1->Track()->NominalTpcEntrancePoint() - fTrack2->Track()->NominalTpcEntrancePoint();
624 // double AliFemtoPair::NominalTpcAverageSeparation() const {
625 // // average separation in STAR TPC
626 // AliFemtoThreeVector diff;
627 // double tAveSep = 0.0;
629 // if (fTrack1->fNominalPosSample && fTrack2->fNominalPosSample){
630 // while (fabs(fTrack1->fNominalPosSample[ipt].x())<9999. &&
631 // fabs(fTrack1->fNominalPosSample[ipt].y())<9999. &&
632 // fabs(fTrack1->fNominalPosSample[ipt].z())<9999. &&
633 // fabs(fTrack2->fNominalPosSample[ipt].x())<9999. &&
634 // fabs(fTrack2->fNominalPosSample[ipt].y())<9999. &&
635 // fabs(fTrack2->fNominalPosSample[ipt].z())<9999. &&
638 // // for (int ipt=0; ipt<11; ipt++){
639 // diff = fTrack1->fNominalPosSample[ipt] - fTrack2->fNominalPosSample[ipt];
641 // tAveSep += diff.Mag();
643 // tAveSep = tAveSep/(ipt+1.);
644 // return (tAveSep);}
648 double AliFemtoPair::OpeningAngle() const {
650 return 57.296* fTrack1->FourMomentum().vect().Angle( fTrack2->FourMomentum().vect() );
651 // AliFemtoThreeVector p1 = fTrack1->FourMomentum().vect();
652 // AliFemtoThreeVector p2 = fTrack2->FourMomentum().vect();
653 // return 57.296*(p1.phi()-p2.phi());
654 // //double dAngInv = 57.296*acos((p1.dot(p2))/(p1.Mag()*p2.Mag()));
655 // //return (dAngInv);
660 double AliFemtoPair::KStarFlipped() const {
661 // kstar with sign flipped
662 AliFemtoLorentzVector tP1 = fTrack1->FourMomentum();
664 AliFmThreeVectorD qwe = tP1.vect();
665 qwe *= -1.; // flip it
668 AliFemtoLorentzVector tSum = (tP1+fTrack2->FourMomentum());
669 double tMass = abs(tSum);
670 AliFmThreeVectorD tGammaBeta = (1./tMass)*tSum.vect();
671 double tGamma = tSum.e()/tMass;
672 AliFmThreeVectorD tLongMom = ((tP1.vect()*tGammaBeta)/
673 (tGammaBeta*tGammaBeta))*tGammaBeta;
674 AliFmLorentzVectorD tK(tGamma*tP1.e() - tP1.vect()*tGammaBeta,
675 tP1.vect() + (tGamma-1.)*tLongMom - tP1.e()*tGammaBeta);
676 //VP tP1.vect() *= -1.; // unflip it
677 return tK.vect().Mag();
680 //double AliFemtoPair::CVK() const{
681 //const AliFemtoLorentzVector& tP1 = fTrack1->FourMomentum();
682 //AliFemtoLorentzVector tSum = (tP1+fTrack2->FourMomentum());
683 //double tMass = abs(tSum);
684 //AliFmThreeVectorD tGammaBeta = (1./tMass)*tSum.vect();
685 //double tGamma = tSum.e()/tMass;
686 //AliFmThreeVectorD tLongMom = ((tP1.vect()*tGammaBeta)/
687 // (tGammaBeta*tGammaBeta))*tGammaBeta;
688 //AliFmLorentzVectorD tK(tGamma*tP1.e() - tP1.vect()*tGammaBeta,
689 // tP1.vect() + (tGamma-1.)*tLongMom - tP1.e()*tGammaBeta);
690 //return (tK.vect())*tGammaBeta/tK.vect().Magnitude()/tGammaBeta.Magnitude();
693 double AliFemtoPair::CVKFlipped() const{
694 // CVK with sign flipped
695 AliFemtoLorentzVector tP1 = fTrack1->FourMomentum();
696 AliFmThreeVectorD qwe = tP1.vect();
697 qwe *= -1.; // flip it
700 AliFemtoLorentzVector tSum = (tP1+fTrack2->FourMomentum());
701 double tMass = abs(tSum);
702 AliFmThreeVectorD tGammaBeta = (1./tMass)*tSum.vect();
703 double tGamma = tSum.e()/tMass;
704 AliFmThreeVectorD tLongMom = ((tP1.vect()*tGammaBeta)/
705 (tGammaBeta*tGammaBeta))*tGammaBeta;
706 AliFmLorentzVectorD tK(tGamma*tP1.e() - tP1.vect()*tGammaBeta,
707 tP1.vect() + (tGamma-1.)*tLongMom - tP1.e()*tGammaBeta);
708 //VP tP1.vect() *= -1.; // unflip it
709 return (tK.vect())*tGammaBeta/tGamma;
712 double AliFemtoPair::PInv() const{
713 // invariant total momentum
714 AliFemtoLorentzVector tP1 = fTrack1->FourMomentum();
715 AliFemtoLorentzVector tP2 = fTrack2->FourMomentum();
716 double tP = (tP1.px()+tP2.px())*(tP1.px()+tP2.px())+
717 (tP1.py()+tP2.py())*(tP1.py()+tP2.py())+
718 (tP1.pz()+tP2.pz())*(tP1.pz()+tP2.pz())-
719 (tP1.e() -tP2.e() )*(tP1.e() -tP2.e() );
720 return ::sqrt(fabs(tP));
723 double AliFemtoPair::QInvFlippedXY() const{
724 // qinv with X and Y flipped
725 AliFemtoLorentzVector tP1 = fTrack1->FourMomentum();
726 tP1.SetX(-1.*tP1.x());
727 tP1.SetY(-1.*tP1.y());
728 AliFemtoLorentzVector tDiff = (tP1-fTrack2->FourMomentum());
729 return ( -1.* tDiff.m());
732 void AliFemtoPair::CalcNonIdPar() const{ // fortran like function! faster?
733 // Calculate generalized relative mometum
734 // Use this instead of qXYZ() function when calculating
735 // anything for non-identical particles
736 fNonIdParNotCalculated=0;
737 double px1 = fTrack1->FourMomentum().vect().x();
738 double py1 = fTrack1->FourMomentum().vect().y();
739 double pz1 = fTrack1->FourMomentum().vect().z();
740 double pE1 = fTrack1->FourMomentum().e();
741 double tParticle1Mass;
742 if((pE1*pE1 - px1*px1 - py1*py1 - pz1*pz1)>0)
743 tParticle1Mass = ::sqrt(pE1*pE1 - px1*px1 - py1*py1 - pz1*pz1);
747 double px2 = fTrack2->FourMomentum().vect().x();
748 double py2 = fTrack2->FourMomentum().vect().y();
749 double pz2 = fTrack2->FourMomentum().vect().z();
750 double pE2 = fTrack2->FourMomentum().e();
751 double tParticle2Mass;
752 if((pE2*pE2 - px2*px2 - py2*py2 - pz2*pz2)>0)
753 tParticle2Mass = ::sqrt(pE2*pE2 - px2*px2 - py2*py2 - pz2*pz2);
757 double tPx = px1+px2;
758 double tPy = py1+py2;
759 double tPz = pz1+pz2;
760 double tPE = pE1+pE2;
762 double tPtrans = tPx*tPx + tPy*tPy;
763 double tMtrans = tPE*tPE - tPz*tPz;
764 double tPinv = ::sqrt(tMtrans - tPtrans);
765 tMtrans = ::sqrt(tMtrans);
766 tPtrans = ::sqrt(tPtrans);
768 double tQinvL = (pE1-pE2)*(pE1-pE2) - (px1-px2)*(px1-px2) -
769 (py1-py2)*(py1-py2) - (pz1-pz2)*(pz1-pz2);
771 double tQ = (tParticle1Mass*tParticle1Mass - tParticle2Mass*tParticle2Mass)/tPinv;
772 tQ = sqrt ( tQ*tQ - tQinvL);
777 double beta = tPz/tPE;
778 double gamma = tPE/tMtrans;
780 double pz1L = gamma * (pz1 - beta * pE1);
781 double pE1L = gamma * (pE1 - beta * pz1);
783 // fill histogram for beam projection ( z - axis )
786 // ad 2) rotation px -> tPt
787 double px1R = (px1*tPx + py1*tPy)/tPtrans;
788 double py1R = (-px1*tPy + py1*tPx)/tPtrans;
790 //fill histograms for side projection ( y - axis )
793 // ad 3) go from LCMS to CMS
794 beta = tPtrans/tMtrans;
795 gamma = tMtrans/tPinv;
797 double px1C = gamma * (px1R - beta * pE1L);
799 // fill histogram for out projection ( x - axis )
802 fCVK = (fDKOut*tPtrans + fDKLong*tPz)/fKStarCalc/::sqrt(tPtrans*tPtrans+tPz*tPz);
806 /*void AliFemtoPair::calcNonIdParGlobal() const{ // fortran like function! faster?
807 fNonIdParNotCalculatedGlobal=0;
808 double px1 = fTrack1->Track()->PGlobal().x();
809 double py1 = fTrack1->Track()->PGlobal().y();
810 double pz1 = fTrack1->Track()->PGlobal().z();
811 double tParticle1Mass = fTrack1->FourMomentum().m2();
812 double pE1 = ::sqrt(tParticle1Mass + px1*px1 + py1*py1 + pz1*pz1);
813 tParticle1Mass = ::sqrt(tParticle1Mass);
815 double px2 = fTrack2->Track()->PGlobal().x();
816 double py2 = fTrack2->Track()->PGlobal().y();
817 double pz2 = fTrack2->Track()->PGlobal().z();
818 double tParticle2Mass = fTrack2->FourMomentum().m2();
819 double pE2 = ::sqrt(tParticle2Mass + px2*px2 + py2*py2 + pz2*pz2);
820 tParticle2Mass = ::sqrt(tParticle2Mass);
827 double Ptrans = Px*Px + Py*Py;
828 double Mtrans = PE*PE - Pz*Pz;
829 double Pinv = ::sqrt(Mtrans - Ptrans);
830 Mtrans = ::sqrt(Mtrans);
831 Ptrans = ::sqrt(Ptrans);
833 double QinvL = (pE1-pE2)*(pE1-pE2) - (px1-px2)*(px1-px2) -
834 (py1-py2)*(py1-py2) - (pz1-pz2)*(pz1-pz2);
836 double Q = (tParticle1Mass*tParticle1Mass - tParticle2Mass*tParticle2Mass)/Pinv;
837 Q = sqrt ( Q*Q - QinvL);
839 kStarCalcGlobal = Q/2;
843 double gamma = PE/Mtrans;
845 double pz1L = gamma * (pz1 - beta * pE1);
846 double pE1L = gamma * (pE1 - beta * pz1);
848 // fill histogram for beam projection ( z - axis )
849 fDKLongGlobal = pz1L;
851 // ad 2) rotation px -> Pt
852 double px1R = (px1*Px + py1*Py)/Ptrans;
853 double py1R = (-px1*Py + py1*Px)/Ptrans;
855 //fill histograms for side projection ( y - axis )
856 fDKSideGlobal = py1R;
858 // ad 3) go from LCMS to CMS
859 beta = Ptrans/Mtrans;
862 double px1C = gamma * (px1R - beta * pE1L);
864 // fill histogram for out projection ( x - axis )
867 fCVKGlobal = (fDKOutGlobal*Ptrans + fDKLongGlobal*Pz)/
868 kStarCalcGlobal/::sqrt(Ptrans*Ptrans+Pz*Pz);
873 // double AliFemtoPair::DcaInsideTpc() const{
874 // // dcs inside the STAR TPC
875 // double tMinDist=NominalTpcEntranceSeparation();
876 // double tExit = NominalTpcExitSeparation();
877 // tMinDist = (tExit>tMinDist) ? tMinDist : tExit;
878 // double tInsideDist;
879 // //tMinDist = 999.;
881 // double rMin = 60.;
882 // double rMax = 190.;
883 // const AliFmPhysicalHelixD& tHelix1 = fTrack1->Helix();
884 // const AliFmPhysicalHelixD& tHelix2 = fTrack2->Helix();
885 // // --- One is a line and other one a helix
886 // //if (tHelix1.mSingularity != tHelix2.mSingularity) return -999.;
887 // // --- 2 lines : don't care right now
888 // //if (tHelix1.mSingularity) return -999.;
890 // double dx = tHelix2.XCenter() - tHelix1.XCenter();
891 // double dy = tHelix2.YCenter() - tHelix1.YCenter();
892 // double dd = ::sqrt(dx*dx + dy*dy);
893 // double r1 = 1/tHelix1.Curvature();
894 // double r2 = 1/tHelix2.Curvature();
895 // double cosAlpha = (r1*r1 + dd*dd - r2*r2)/(2*r1*dd);
899 // if (fabs(cosAlpha) < 1) { // two solutions
900 // double sinAlpha = sin(acos(cosAlpha));
901 // x = tHelix1.XCenter() + r1*(cosAlpha*dx - sinAlpha*dy)/dd;
902 // y = tHelix1.YCenter() + r1*(sinAlpha*dx + cosAlpha*dy)/dd;
903 // r = ::sqrt(x*x+y*y);
904 // if( r > rMin && r < rMax &&
905 // fabs(atan2(y,x)-fTrack1->Track()->NominalTpcEntrancePoint().phi())< 0.5
906 // ){ // first solution inside
907 // s = tHelix1.PathLength(x, y);
908 // tInsideDist=tHelix2.Distance(tHelix1.At(s));
909 // if(tInsideDist<tMinDist) tMinDist = tInsideDist;
912 // x = tHelix1.XCenter() + r1*(cosAlpha*dx + sinAlpha*dy)/dd;
913 // y = tHelix1.YCenter() + r1*(cosAlpha*dy - sinAlpha*dx)/dd;
914 // r = ::sqrt(x*x+y*y);
915 // if( r > rMin && r < rMax &&
916 // fabs(atan2(y,x)-fTrack1->Track()->NominalTpcEntrancePoint().phi())< 0.5
917 // ) { // second solution inside
918 // s = tHelix1.PathLength(x, y);
919 // tInsideDist=tHelix2.Distance(tHelix1.At(s));
920 // if(tInsideDist<tMinDist) tMinDist = tInsideDist;
927 // void AliFemtoPair::CalcMergingPar() const{
928 // // Calculate merging factor for the pair in STAR TPC
929 // fMergingParNotCalculated=0;
933 // fFracOfMergedRow = 0.;
934 // fWeightedAvSep =0.;
936 // double tDistMax = 200.;
937 // for(int ti=0 ; ti<45 ; ti++){
938 // if(fTrack1->fSect[ti]==fTrack2->fSect[ti] && fTrack1->fSect[ti]!=-1){
939 // tDu = fabs(fTrack1->fU[ti]-fTrack2->fU[ti]);
940 // tDz = fabs(fTrack1->fZ[ti]-fTrack2->fZ[ti]);
943 // fFracOfMergedRow += (tDu<fgMaxDuInner && tDz<fgMaxDzInner);
944 // tDist = ::sqrt(tDu*tDu/fgMaxDuInner/fgMaxDuInner+
945 // tDz*tDz/fgMaxDzInner/fgMaxDzInner);
946 // //fFracOfMergedRow += (tDu<fgMaxDuInner && tDz<fgMaxDzInner);
949 // fFracOfMergedRow += (tDu<fgMaxDuOuter && tDz<fgMaxDzOuter);
950 // tDist = ::sqrt(tDu*tDu/fgMaxDuOuter/fgMaxDuOuter+
951 // tDz*tDz/fgMaxDzOuter/fgMaxDzOuter);
952 // //fFracOfMergedRow += (tDu<fgMaxDuOuter && tDz<fgMaxDzOuter);
954 // if(tDist<tDistMax){
955 // fClosestRowAtDCA = ti+1;
958 // fWeightedAvSep += tDist;
962 // fWeightedAvSep /= tN;
963 // fFracOfMergedRow /= tN;
966 // fClosestRowAtDCA = -1;
967 // fFracOfMergedRow = -1.;
968 // fWeightedAvSep = -1.;
971 // double AliFemtoPair::TpcExitSeparationTrackV0Pos() const {
972 // //________________V0 daughters exit/entrance/average separation calc.
973 // //_______1st part is a track 2nd is a V0 considering Pos daughter
975 // AliFemtoThreeVector diff = fTrack1->Track()->NominalTpcExitPoint() - fTrack2->TpcV0PosExitPoint();
976 // return (diff.Mag());
979 // double AliFemtoPair::TpcEntranceSeparationTrackV0Pos() const {
980 // //________________V0 daughters exit/entrance/average separation calc.
981 // //_______1st part is a track 2nd is a V0 considering Pos daughter
982 // AliFemtoThreeVector diff = fTrack1->Track()->NominalTpcEntrancePoint() - fTrack2->TpcV0PosEntrancePoint();
983 // return (diff.Mag());
986 // double AliFemtoPair::TpcAverageSeparationTrackV0Pos() const {
987 // //________________V0 daughters exit/entrance/average separation calc.
988 // //_______1st part is a track 2nd is a V0 considering Pos daughter
989 // AliFemtoThreeVector diff;
990 // double tAveSep = 0.0;
992 // if (fTrack1->fNominalPosSample && fTrack2->fNominalPosSample){
993 // while (fabs(fTrack1->fNominalPosSample[ipt].x())<9999. &&
994 // fabs(fTrack1->fNominalPosSample[ipt].y())<9999. &&
995 // fabs(fTrack1->fNominalPosSample[ipt].z())<9999. &&
996 // fabs(fTrack2->fNominalPosSample[ipt].x())<9999. &&
997 // fabs(fTrack2->fNominalPosSample[ipt].y())<9999. &&
998 // fabs(fTrack2->fNominalPosSample[ipt].z())<9999. &&
1001 // diff = fTrack1->fNominalPosSample[ipt] - fTrack2->fNominalPosSample[ipt];
1003 // tAveSep += diff.Mag();
1005 // tAveSep = tAveSep/(ipt+1.);
1006 // return (tAveSep);}
1009 // double AliFemtoPair::TpcExitSeparationTrackV0Neg() const {
1010 // //_______1st part is a track 2nd is a V0 considering Neg daughter
1011 // AliFemtoThreeVector diff = fTrack1->Track()->NominalTpcExitPoint() - fTrack2->TpcV0NegExitPoint();
1012 // return (diff.Mag());
1015 // double AliFemtoPair::TpcEntranceSeparationTrackV0Neg() const {
1016 // //_______1st part is a track 2nd is a V0 considering Neg daughter
1017 // AliFemtoThreeVector diff = fTrack1->Track()->NominalTpcEntrancePoint() - fTrack2->TpcV0NegEntrancePoint();
1018 // return (diff.Mag());
1021 // double AliFemtoPair::TpcAverageSeparationTrackV0Neg() const {
1022 // //_______1st part is a track 2nd is a V0 considering Neg daughter
1023 // AliFemtoThreeVector diff;
1024 // double tAveSep = 0.0;
1026 // if (fTrack1->fNominalPosSample && fTrack2->fTpcV0NegPosSample){
1027 // while (fabs(fTrack1->fNominalPosSample[ipt].x())<9999. &&
1028 // fabs(fTrack1->fNominalPosSample[ipt].y())<9999. &&
1029 // fabs(fTrack1->fNominalPosSample[ipt].z())<9999. &&
1030 // fabs(fTrack2->fTpcV0NegPosSample[ipt].x())<9999. &&
1031 // fabs(fTrack2->fTpcV0NegPosSample[ipt].y())<9999. &&
1032 // fabs(fTrack2->fTpcV0NegPosSample[ipt].z())<9999. &&
1035 // diff = fTrack1->fNominalPosSample[ipt] - fTrack2->fTpcV0NegPosSample[ipt];
1037 // tAveSep += diff.Mag();
1039 // tAveSep = tAveSep/(ipt+1.);
1040 // return (tAveSep);}
1044 // double AliFemtoPair::TpcExitSeparationV0PosV0Pos() const {
1045 // //_______1st part is a V0 considering Pos daughter 2nd is a V0 considering Pos daughter
1046 // AliFemtoThreeVector diff = fTrack1->TpcV0PosExitPoint() - fTrack2->TpcV0PosExitPoint();
1047 // return (diff.Mag());
1050 // double AliFemtoPair::TpcEntranceSeparationV0PosV0Pos() const {
1051 // //_______1st part is a V0 considering Pos daughter 2nd is a V0 considering Pos daughter
1052 // AliFemtoThreeVector diff = fTrack1->TpcV0PosEntrancePoint() - fTrack2->TpcV0PosEntrancePoint();
1053 // return (diff.Mag());
1055 // double AliFemtoPair::TpcAverageSeparationV0PosV0Pos() const {
1056 // //_______1st part is a V0 considering Pos daughter 2nd is a V0 considering Pos daughter
1057 // AliFemtoThreeVector diff;
1058 // double tAveSep = 0.0;
1060 // if (fTrack1->fNominalPosSample && (fTrack2->fNominalPosSample)){
1061 // while ((fabs(fTrack1->fNominalPosSample[ipt].x())<9999.) &&
1062 // (fabs(fTrack1->fNominalPosSample[ipt].y())<9999.) &&
1063 // (fabs(fTrack1->fNominalPosSample[ipt].z())<9999.) &&
1064 // (fabs(fTrack2->fNominalPosSample[ipt].x())<9999.) &&
1065 // (fabs(fTrack2->fNominalPosSample[ipt].y())<9999.) &&
1066 // (fabs(fTrack2->fNominalPosSample[ipt].z())<9999.) &&
1069 // diff = fTrack1->fNominalPosSample[ipt] - fTrack2->fNominalPosSample[ipt];
1071 // tAveSep += diff.Mag();
1073 // tAveSep = tAveSep/(ipt+1);
1074 // return (tAveSep);}
1078 // double AliFemtoPair::TpcExitSeparationV0PosV0Neg() const {
1079 // //_______1st part is a V0 considering Pos daughter 2nd is a V0 considering Neg daughter
1080 // AliFemtoThreeVector diff = fTrack1->TpcV0PosExitPoint() - fTrack2->TpcV0NegExitPoint();
1081 // return (diff.Mag());
1084 // double AliFemtoPair::TpcEntranceSeparationV0PosV0Neg() const {
1085 // //_______1st part is a V0 considering Pos daughter 2nd is a V0 considering Neg daughter
1086 // AliFemtoThreeVector diff = fTrack1->TpcV0PosEntrancePoint() - fTrack2->TpcV0NegEntrancePoint();
1087 // return (diff.Mag());
1089 // double AliFemtoPair::TpcAverageSeparationV0PosV0Neg() const {
1090 // //_______1st part is a V0 considering Pos daughter 2nd is a V0 considering Neg daughter
1091 // AliFemtoThreeVector diff;
1092 // double tAveSep = 0.0;
1094 // if (fTrack1->fNominalPosSample && fTrack2->fTpcV0NegPosSample){
1095 // while (fabs(fTrack1->fNominalPosSample[ipt].x())<9999. &&
1096 // fabs(fTrack1->fNominalPosSample[ipt].y())<9999. &&
1097 // fabs(fTrack1->fNominalPosSample[ipt].z())<9999. &&
1098 // fabs(fTrack2->fTpcV0NegPosSample[ipt].x())<9999. &&
1099 // fabs(fTrack2->fTpcV0NegPosSample[ipt].y())<9999. &&
1100 // fabs(fTrack2->fTpcV0NegPosSample[ipt].z())<9999. &&
1103 // diff = fTrack1->fNominalPosSample[ipt] - fTrack2->fTpcV0NegPosSample[ipt];
1105 // tAveSep += diff.Mag();
1107 // tAveSep = tAveSep/(ipt+1.);
1108 // return (tAveSep);}
1111 // double AliFemtoPair::TpcExitSeparationV0NegV0Pos() const {
1112 // //_______1st part is a V0 considering Neg daughter 2nd is a V0 considering Pos daughter
1113 // // this is to check the upper case
1114 // AliFemtoThreeVector diff = fTrack1->TpcV0NegExitPoint() - fTrack2->TpcV0PosExitPoint();
1115 // return (diff.Mag());
1118 // double AliFemtoPair::TpcEntranceSeparationV0NegV0Pos() const {
1119 // //_______1st part is a V0 considering Neg daughter 2nd is a V0 considering Pos daughter
1120 // // this is to check the upper case
1121 // AliFemtoThreeVector diff = fTrack1->TpcV0NegEntrancePoint() - fTrack2->TpcV0PosEntrancePoint();
1122 // return (diff.Mag());
1124 // double AliFemtoPair::TpcAverageSeparationV0NegV0Pos() const {
1125 // //_______1st part is a V0 considering Neg daughter 2nd is a V0 considering Pos daughter
1126 // // this is to check the upper case
1127 // AliFemtoThreeVector diff;
1128 // double tAveSep = 0.0;
1130 // if ( fTrack1->fTpcV0NegPosSample && fTrack2->fNominalPosSample){
1131 // while (fabs(fTrack1->fTpcV0NegPosSample[ipt].x())<9999. &&
1132 // fabs(fTrack1->fTpcV0NegPosSample[ipt].y())<9999. &&
1133 // fabs(fTrack1->fTpcV0NegPosSample[ipt].z())<9999. &&
1134 // fabs(fTrack2->fNominalPosSample[ipt].x())<9999. &&
1135 // fabs(fTrack2->fNominalPosSample[ipt].y())<9999. &&
1136 // fabs(fTrack2->fNominalPosSample[ipt].z())<9999. &&
1139 // diff = fTrack1->fTpcV0NegPosSample[ipt] - fTrack2->fNominalPosSample[ipt];
1141 // tAveSep += diff.Mag();
1143 // tAveSep = tAveSep/(ipt+1);
1144 // return (tAveSep);}
1147 // double AliFemtoPair::TpcExitSeparationV0NegV0Neg() const {
1148 // //_______1st part is a V0 considering Neg daughter 2nd is a V0 considering Neg daughter
1149 // AliFemtoThreeVector diff = fTrack1->TpcV0NegExitPoint() - fTrack2->TpcV0NegExitPoint();
1150 // return (diff.Mag());
1153 // double AliFemtoPair::TpcEntranceSeparationV0NegV0Neg() const {
1154 // //_______1st part is a V0 considering Neg daughter 2nd is a V0 considering Neg daughter
1155 // AliFemtoThreeVector diff = fTrack1->TpcV0NegEntrancePoint() - fTrack2->TpcV0NegEntrancePoint();
1156 // return (diff.Mag());
1158 // double AliFemtoPair::TpcAverageSeparationV0NegV0Neg() const {
1159 // //_______1st part is a V0 considering Neg daughter 2nd is a V0 considering Neg daughter
1160 // AliFemtoThreeVector diff;
1161 // double tAveSep = 0.0;
1163 // if (fTrack1->fTpcV0NegPosSample && fTrack2->fTpcV0NegPosSample){
1164 // while (fabs(fTrack1->fTpcV0NegPosSample[ipt].x())<9999. &&
1165 // fabs(fTrack1->fTpcV0NegPosSample[ipt].y())<9999. &&
1166 // fabs(fTrack1->fTpcV0NegPosSample[ipt].z())<9999. &&
1167 // fabs(fTrack2->fTpcV0NegPosSample[ipt].x())<9999. &&
1168 // fabs(fTrack2->fTpcV0NegPosSample[ipt].y())<9999. &&
1169 // fabs(fTrack2->fTpcV0NegPosSample[ipt].z())<9999. &&
1172 // diff = fTrack1->fTpcV0NegPosSample[ipt] - fTrack2->fTpcV0NegPosSample[ipt];
1174 // tAveSep += diff.Mag();
1176 // tAveSep = tAveSep/(ipt+1);
1177 // return (tAveSep);}
1181 // void AliFemtoPair::CalcMergingParFctn(short* tmpMergingParNotCalculatedFctn,
1182 // float* tmpZ1,float* tmpU1,
1183 // float* tmpZ2,float* tmpU2,
1184 // int *tmpSect1,int *tmpSect2,
1185 // double* tmpFracOfMergedRow,
1186 // double* tmpClosestRowAtDCA
1188 // // calculate heper variables for merging
1189 // tmpMergingParNotCalculatedFctn=0;
1192 // *tmpFracOfMergedRow = 0.;
1193 // *tmpClosestRowAtDCA = 0.;
1195 // double tDistMax = 100000000.;
1196 // for(int ti=0 ; ti<45 ; ti++){
1197 // if(tmpSect1[ti]==tmpSect2[ti] && tmpSect1[ti]!=-1){
1198 // tDu = fabs(tmpU1[ti]-tmpU2[ti]);
1199 // tDz = fabs(tmpZ1[ti]-tmpZ2[ti]);
1202 // *tmpFracOfMergedRow += (tDu<fgMaxDuInner && tDz<fgMaxDzInner);
1203 // tDist = ::sqrt(tDu*tDu/fgMaxDuInner/fgMaxDuInner+
1204 // tDz*tDz/fgMaxDzInner/fgMaxDzInner);
1207 // *tmpFracOfMergedRow += (tDu<fgMaxDuOuter && tDz<fgMaxDzOuter);
1208 // tDist = ::sqrt(tDu*tDu/fgMaxDuOuter/fgMaxDuOuter+
1209 // tDz*tDz/fgMaxDzOuter/fgMaxDzOuter);
1211 // if(tDist<tDistMax){
1212 // fClosestRowAtDCA = ti+1;
1213 // tDistMax = tDist;
1215 // //fWeightedAvSep += tDist; // now, wrong but not used
1219 // //fWeightedAvSep /= tN;
1220 // *tmpFracOfMergedRow /= tN;
1223 // *tmpClosestRowAtDCA = -1;
1224 // *tmpFracOfMergedRow = -1.;
1225 // //fWeightedAvSep = -1.;