Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
EventPrimaryTracksNoCut.cxx
1/*
2 * EventPrimaryNoCut.cxx
3 *
4 * Created on: 15 mar 2019
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "EventPrimaryTracksNoCut.h"
10
11#include "McTrack.h"
12#include "Event.h"
13
14namespace Hal {
15 EventPrimaryTracksNoCut::EventPrimaryTracksNoCut() : EventCut(1) { SetUnitName("N_{primaries}", 0); }
16
17 Bool_t EventPrimaryTracksNoCut::Pass(Event* event) {
18 Int_t multi = 0;
19 for (int i = 0; i < event->GetTotalTrackNo(); i++) {
20 Track* track = event->GetTrack(i);
21 if (track->IsPrimary()) { multi++; }
22 }
23 SetValue(multi);
24 return Validate();
25 }
26
27 EventPrimaryTracksNoCut::~EventPrimaryTracksNoCut() {}
28} // namespace Hal
Bool_t IsPrimary() const
Definition Track.h:209