Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
EventMultiplicityCut.cxx
1/*
2 * EventMultiplicityCut.cxx
3 *
4 * Created on: 28-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 "EventMultiplicityCut.h"
11
12#include "Event.h"
13#include "Package.h"
14#include "Parameter.h"
15
16namespace Hal {
17 EventMultiplicityCut::EventMultiplicityCut() : EventCut(1) { SetUnitName("Multiplicity [N_{particles}]"); }
18
19 EventMultiplicityCut::~EventMultiplicityCut() {
20 // TODO Auto-generated destructor stub
21 }
22
23 Bool_t EventMultiplicityCut::Pass(Event* event) {
24 SetValue(event->GetTotalTrackNo());
25 return Validate();
26 }
27
28 EventMultiChargedCut::EventMultiChargedCut() : EventCut(1), fScale(1), fMinEta(-1), fMaxEta(1), fRange(2), fPDG(NULL) {
29 SetUnitName("dN_{ch}/d#eta");
30 }
31
33 Double_t charged_no = 0;
34 for (int i = 0; i < event->GetTotalTrackNo(); i++) {
35 Track* track = event->GetTrack(i);
36 Double_t eta = track->GetMomentum().Eta();
37 if (eta >= fMinEta && eta <= fMaxEta) {
38 if (track->GetCharge() != 0) charged_no++;
39 }
40 }
41 Double_t value = charged_no * fScale; // *fScale/fRange
42 SetValue(value);
43 return Validate();
44 }
45
46 void EventMultiChargedCut::SetAveragingRange(Double_t min, Double_t max) {
47 fMinEta = min;
48 fMaxEta = max;
49 }
50
51 void EventMultiChargedCut::SetEfficiencyScale(Double_t scale) { fScale = scale; }
52
53 Bool_t EventMultiChargedCut::Init(Int_t task_id) {
54 Bool_t stat = EventCut::Init(task_id);
55 fPDG = TDatabasePDG::Instance();
56 fRange = fMaxEta - fMinEta;
57 fScale = fScale / fRange;
58 return stat;
59 }
60
61 EventMultiChargedCut::~EventMultiChargedCut() {
62 // TODO Auto-generated destructor stub
63 }
64
66 Package* pack = EventCut::Report();
67 pack->AddObject(new ParameterDouble("Av. Min Eta", fMinEta));
68 pack->AddObject(new ParameterDouble("Av. Max Eta", fMaxEta));
69 pack->AddObject(new ParameterDouble("Raw Scale", fScale * fRange));
70 return pack;
71 }
72} // namespace Hal
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
virtual Package * Report() const
Definition EventCut.cxx:18
void SetAveragingRange(Double_t min, Double_t max)
void SetEfficiencyScale(Double_t scale)
virtual Package * Report() const
virtual Bool_t Init(Int_t task_id=0)
Int_t GetTotalTrackNo() const
Definition Event.h:236
void AddObject(TObject *object)
Definition Package.cxx:209
const TLorentzVector & GetMomentum() const
Definition Track.h:118
Double_t GetCharge() const
Definition Track.h:184