Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TwoTrackPtSumCut.cxx
1/*
2 * TwoTrackPtSumCut.cxx
3 *
4 * Created on: 12-06-2014
5 * Author: wielanek
6 */
7
8#include "TwoTrackPtSumCut.h"
9
10#include "Track.h"
11#include "TwoTrack.h"
12namespace Hal {
13 TwoTrackPtSumCut::TwoTrackPtSumCut() : TwoTrackCut(1) { SetUnitName("p_{T,sum} [GeV/c]"); }
14
15 Bool_t TwoTrackPtSumCut::Pass(TwoTrack* pair) {
16 Double_t px = pair->GetTrack1()->GetPx();
17 Double_t py = pair->GetTrack1()->GetPy();
18 Double_t pt1 = TMath::Sqrt(px * px + py * py);
19 px = pair->GetTrack2()->GetPx();
20 py = pair->GetTrack2()->GetPy();
21 Double_t pt2 = TMath::Sqrt(px * py + py * py);
22 SetValue((pt1 + pt2) / 2.0);
23 return Validate();
24 }
25
26 TwoTrackPtSumCut::~TwoTrackPtSumCut() {
27 // TODO Auto-generated destructor stub
28 }
29} // namespace Hal
Double_t GetPx() const
Definition Track.h:99
Double_t GetPy() const
Definition Track.h:104
Track * GetTrack1() const
Definition TwoTrack.h:75
Track * GetTrack2() const
Definition TwoTrack.h:80