Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackExpCut.cxx
1/*
2 * TrackExpCut.cxx
3 *
4 * Created on: 5 mar 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackExpCut.h"
10
11#include "DataFormat.h"
12#include "DataFormatManager.h"
13#include "ExpEvent.h"
14#include "ExpTrack.h"
15
16namespace Hal {
17 TrackExpCut::TrackExpCut(Int_t size) : TrackCut(size) {}
18
19 Bool_t TrackExpCut::Init(Int_t format_id) {
20 if (TrackCut::Init(format_id) == kFALSE) return kFALSE;
21 const Event* ev = DataFormatManager::Instance()->GetFormat(format_id, EFormatDepth::kNonBuffered);
22 if (dynamic_cast<const Hal::ExpEvent*>(ev)) { return kTRUE; }
23 return kTRUE;
24 }
25
26 TrackExpCut::~TrackExpCut() {}
27
28 Bool_t TrackExpCut::TpcAvaiable(Int_t format_id) const {
29 const Event* ev = DataFormatManager::Instance()->GetFormat(format_id);
30 Bool_t res = kFALSE;
31 if (ev->InheritsFrom("Hal::ExpEvent")) {
32 ExpTrack* tr = (ExpTrack*) ev->GetNewTrack();
33 if (tr->GetDetTrack(DetectorID::kTPC) != NULL) res = kTRUE;
34 delete tr;
35 }
36 return res;
37 }
38
39 Bool_t TrackExpCut::ToFAvaiable(Int_t format_id) const {
40 if (FormatInhertis("Hal::ExpEvent", format_id) == kFALSE) return kFALSE;
41 const Event* ev = DataFormatManager::Instance()->GetFormat(format_id);
42 Bool_t res = kFALSE;
43 ExpTrack* tr = (ExpTrack*) ev->GetNewTrack();
44 if (tr->GetDetTrack(DetectorID::kTOF) != NULL) res = kTRUE;
45 delete tr;
46 return res;
47 }
48} // namespace Hal
Track * GetNewTrack() const
Definition Event.cxx:204
virtual DetectorTrack * GetDetTrack(const UInt_t) const
Definition ExpTrack.h:93