Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
EventRotateTask.cxx
1/*
2 * EventRotate.cxx
3 *
4 * Created on: 18 cze 2023
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "EventRotateTask.h"
10
11#include "Cout.h"
12#include "CutContainer.h"
13#include "Event.h"
14#include "EventVirtualCut.h"
15#include "Package.h"
16#include "Parameter.h"
17
18#include <TRandom.h>
19namespace Hal {
20 EventRotateTask::EventRotateTask() : fPhiMin(-TMath::Pi()), fPhiMax(TMath::Pi()) {}
21
22 EventRotateTask& EventRotateTask::operator=(const EventRotateTask& other) {
23 if (this != &other) {
24 EventAna::operator=(other);
25 fPhiMin = other.fPhiMin;
26 fPhiMax = other.fPhiMax;
27 }
28 return *this;
29 }
30
31 EventRotateTask::~EventRotateTask() {}
32
33 EventRotateTask::EventRotateTask(const EventRotateTask& other) : EventAna(other) {
34 fPhiMin = other.fPhiMin;
35 fPhiMax = other.fPhiMax;
36 }
37
38 void Hal::EventRotateTask::ProcessEvent() { fCurrentEvent->RotateZ(gRandom->Uniform(fPhiMin, fPhiMax)); }
39
41 auto report = EventAna::Report();
42 report->AddObject(new Hal::ParameterDouble("PhiMin", fPhiMin));
43 report->AddObject(new Hal::ParameterDouble("PhiMax", fPhiMax));
44 return report;
45 }
46
50 if (no > 1) { Cout::PrintInfo("EventRotateTask - more than one event collection!", EInfo::kWarning); }
51 int cutNo = fCutContainer->GetEventCollection(0)->GetCutNo();
52 if (cutNo > 1) { Cout::PrintInfo("EventRotateTask - more than one event cut!", EInfo::kWarning); }
53 auto evcut = dynamic_cast<Hal::EventVirtualCut*>(fCutContainer->GetEventCollection(0)->GetCut(0));
54 if (evcut == nullptr) { Cout::PrintInfo("EventRotateTask - no virtual event cut", EInfo::kWarning); }
55 }
56
57} // namespace Hal
static void PrintInfo(TString text, Hal::EInfo status)
Definition Cout.cxx:370
Int_t GetCutNo() const
Int_t GetEventCollectionsNo() const
CutCollection * GetEventCollection(Int_t collection) const
CutContainer * fCutContainer
Definition EventAna.h:78
virtual void CheckCutContainerCollections()
Definition EventAna.cxx:200
Event * fCurrentEvent
Definition EventAna.h:86
virtual Package * Report() const
Definition EventAna.cxx:259
virtual Hal::Package * Report() const
virtual void ProcessEvent()
virtual void CheckCutContainerCollections()
virtual void RotateZ(Double_t phi)
Definition Event.cxx:290