Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackDCACut.cxx
1/*
2 * TrackDCACut.cxx
3 *
4 * Created on: 27 lut 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackDCACut.h"
10
11#include "DataFormatManager.h"
12#include "ExpEvent.h"
13#include "ExpTrack.h"
14
15namespace Hal {
16 TrackDCACut::TrackDCACut() : TrackCut(3) {
17 SetUnitName("DCA [cm]", DCA());
18 SetUnitName("DCA XY[cm]", DCAxy());
19 SetUnitName("DCA Z[cm]", DCAz());
20 }
21
22 Bool_t TrackDCACut::Pass(Track* track) {
23 const TVector3& dca = ((ExpTrack*) track)->GetDCA();
24 SetValue(dca.Mag(), DCA());
25 SetValue(dca.Pt(), DCAxy());
26 SetValue(dca.Z(), DCAz());
27 return Validate();
28 }
29
30 Bool_t TrackDCACut::Init(Int_t id_format) {
31 if (TrackCut::Init() == kFALSE) return kFALSE;
32 const Event* ev = DataFormatManager::Instance()->GetFormat(id_format);
33 if (ev->InheritsFrom("Hal::ExpEvent")) {
34 return kTRUE;
35 } else {
36 return kFALSE;
37 }
38 }
39
40 TrackDCACut::~TrackDCACut() {
41 // TODO Auto-generated destructor stub
42 }
43} // namespace Hal