Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FlowVariable.cxx
1/*
2 * FlowVariable.cxx
3 *
4 * Created on: 19-10-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "FlowVariable.h"
11
12#include "DataFormatManager.h"
13#include "Event.h"
14#include "Track.h"
15
16
17namespace Hal {
18 FlowVariable::FlowVariable(TString axisName, TString axisUnit) : fName(axisName), fUnit(axisUnit) {}
19
20 TString FlowVariable::GetAxisName() { return fName; }
21
22 Double_t FlowVariable::GetVariable(Track* /*p*/) { return 0.; }
23
24 FlowVariable::~FlowVariable() {
25 // TODO Auto-generated destructor stub
26 }
27
28 TString FlowVariable::GetAxisUnit() { return fUnit; }
29
30 FlowVirtualVariable::FlowVirtualVariable() : FlowVariable("virtual", "virtual") {}
31
32 FlowVirtualVariable::~FlowVirtualVariable() {}
33
34 FlowTrackFieldVariable::FlowTrackFieldVariable(Int_t fieldId) : fFieldId(fieldId) {}
35
36 Double_t FlowTrackFieldVariable::GetVariable(Track* p) { return p->GetFieldVal(fFieldId); }
37
38 Bool_t FlowTrackFieldVariable::Init(Int_t taskId) {
40 const Event* event = dfm->GetFormat(taskId, EFormatDepth::kNonBuffered);
41 Track* track = event->GetNewTrack();
42 TString fieldName = track->GetFieldName(fFieldId);
43 if (fieldName == "[]") return kFALSE;
44 SetFieldName(Hal::Std::RemoveUnits(fieldName));
45 SetFieldUnit(Hal::Std::GetUnits(fieldName));
46 delete track;
47 return kTRUE;
48 }
49
50} // namespace Hal
static DataFormatManager * Instance()
FlowTrackFieldVariable(Int_t fieldId=0)
Double_t GetVariable(Track *p)
virtual TString GetAxisUnit()
FlowVariable(TString axisName="dummy", TString unitName="dummy")
virtual Double_t GetVariable(Track *p)
virtual TString GetAxisName()
virtual Float_t GetFieldVal(Int_t fieldID) const
Definition Track.cxx:206
virtual TString GetFieldName(Int_t fieldID) const
Definition Track.cxx:244