Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackNullCut.cxx
1/*
2 * TrackNullCut.cxx
3 *
4 * Created on: 12 lis 2021
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "TrackNullCut.h"
11
12#include "ComplexEvent.h"
13#include "ComplexTrack.h"
14#include "Cut.h"
15#include "DataFormatManager.h"
16#include "Event.h"
17
18#include <RtypesCore.h>
19
20namespace Hal {
21 TrackNullCut::TrackNullCut() : TrackCut(1) { SetUnitName("ComplexVarStatus [AU]"); }
22
23 Bool_t TrackNullCut::Pass(Track* track) {
24 ComplexTrack* particle = (ComplexTrack*) track;
25 if (particle->GetImgTrack() == nullptr) {
26 SetValue(0);
27 } else {
28 SetValue(1);
29 }
30 return Validate();
31 }
32
33 TrackNullCut::~TrackNullCut() {}
34
35 Bool_t TrackNullCut::Init(Int_t task_id) {
36 DataFormatManager* manager = DataFormatManager::Instance();
37 const Event* event = manager->GetFormat(task_id);
38 if (dynamic_cast<const ComplexEvent*>(event)) return kTRUE;
39 return kFALSE;
40 }
41} // namespace Hal
const Event * GetFormat(Int_t task_id, EFormatDepth format_depth=EFormatDepth::kAll) const