Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
EventPtMaxCut.cxx
1/*
2 * EventPtMaxCut.cxx
3 *
4 * Created on: 11-11-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "EventPtMaxCut.h"
11
12#include "Event.h"
13
14namespace Hal {
15 EventPtMaxCut::EventPtMaxCut() : EventCut(1) { SetUnitName("Max p_{t} [GeV/c]"); }
16
17 Bool_t EventPtMaxCut::Init(Int_t task_id) {
18 Bool_t stat = EventCut::Init(task_id);
19 return stat;
20 }
21
22 EventPtMaxCut::~EventPtMaxCut() {}
23
24 Bool_t EventPtMaxCut::Pass(Event* event) {
25 Double_t pt_max = 0;
26 for (int i = 0; i < event->GetTotalTrackNo(); i++) {
27 Track* track = event->GetTrack(i);
28 Double_t px = track->GetPx();
29 Double_t py = track->GetPy();
30 if ((px * px + py * py) > pt_max) { pt_max = px * px + py * py; }
31 }
32 SetValue(TMath::Sqrt(pt_max), 0);
33 return Validate();
34 }
35} // namespace Hal
Double_t GetPx() const
Definition Track.h:99
Double_t GetPy() const
Definition Track.h:104