Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
EventImpactParameterCut.cxx
1/*
2 * EventImpactParameterCut.cxx
3 *
4 * Created on: 15-11-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "EventImpactParameterCut.h"
11
12#include "Cout.h"
13#include "DataFormatManager.h"
14#include "McEvent.h"
15
16namespace Hal {
17 EventImpactParameterCut::EventImpactParameterCut() : EventMcCut(1) { SetUnitName("Impact Parameter [fm]"); }
18
19 Bool_t EventImpactParameterCut::Pass(Event* event) {
20 SetValue(((McEvent*) event)->GetImpactParameter());
21 return Validate();
22 }
23
24 EventImpactParameterCut::~EventImpactParameterCut() {}
25
26 EventImpactCentralityCut::EventImpactCentralityCut() : EventMcCut(1), fBMax(-1), fAlpha(0) { SetUnitName("Centrality [%]"); }
27
28 void EventImpactCentralityCut::SetBMax(Double_t bmax) { fBMax = bmax; }
29
31 SetValue(ImpactToCentrality(((McEvent*) event)->GetImpactParameter()));
32 return Validate();
33 }
34
35 Double_t EventImpactCentralityCut::ImpactToCentrality(const Double_t impact) { return impact * impact * fAlpha; }
36
37 Bool_t EventImpactCentralityCut::Init(Int_t task_id) {
38 Bool_t stat = EventCut::Init(task_id);
39 const Event* ev = DataFormatManager::Instance()->GetFormat(task_id);
40 if (!ev->InheritsFrom("Hal::McEvent")) { return kFALSE; }
41 if (fBMax < 0) {
42 Cout::PrintInfo("Max impact parameter in EventImpactCentralityCut is "
43 "<0 setting to 0",
44 EInfo::kLowWarning);
45 fBMax = 0;
46 fAlpha = 1.0;
47 } else {
48 fAlpha = 100.0 / (fBMax * fBMax);
49 }
50 return stat;
51 }
52
53 EventImpactCentralityCut::~EventImpactCentralityCut() {}
54} // namespace Hal
static void PrintInfo(TString text, Hal::EInfo status)
Definition Cout.cxx:370
virtual Bool_t Init(Int_t=0)
Definition Cut.h:346
void SetValue(Double_t val, Int_t i=0)
Definition Cut.h:235
Bool_t Validate()
Definition Cut.cxx:43
void SetUnitName(TString name, Int_t i=0)
Definition Cut.h:241
const Event * GetFormat(Int_t task_id, EFormatDepth format_depth=EFormatDepth::kAll) const
static DataFormatManager * Instance()
virtual Bool_t Pass(Event *event)