CbmRoot
PairAnalysisTrackRotator.h
Go to the documentation of this file.
1 #ifndef DILEPTONTRACKROTATOR_H
2 #define DILEPTONTRACKROTATOR_H
3 
4 //#############################################################
5 //# #
6 //# Class PairAnalysisTrackRotator #
7 //# #
8 //# Authors: #
9 //# Julian Book, Uni Ffm / Julian.Book@cern.ch #
10 //# #
11 //#############################################################
12 
13 #include <TMath.h>
14 #include <TNamed.h>
15 #include <TRandom3.h>
16 
17 class PairAnalysisTrackRotator : public TNamed {
18 public:
20 
22  PairAnalysisTrackRotator(const char* name, const char* title);
23 
24  virtual ~PairAnalysisTrackRotator();
25 
26  //Setters
27  void SetIterations(UInt_t niter) { fIterations = niter; }
29  void SetStartAnglePhi(Double_t phi) { fStartAnglePhi = phi; }
30  void SetConeAnglePhi(Double_t phi) { fConeAnglePhi = phi; }
31 
32  //Getters
33  Int_t GetIterations() const { return fIterations; }
35  Double_t GetStartAnglePhi() const { return fStartAnglePhi; }
36  Double_t GetConeAnglePhi() const { return fConeAnglePhi; }
37 
38  Double_t GetAngle() const {
39  return fStartAnglePhi + (2 * gRandom->Rndm() - 1) * fConeAnglePhi;
40  }
41  Double_t GetCharge() const { return TMath::Nint(gRandom->Rndm()); }
42 
43 private:
44  UInt_t fIterations = 1; // number of iterations
45  ERotationType fRotationType = kRotateBothRandom; // which track to rotate
46  Double_t fStartAnglePhi = TMath::Pi(); // starting angle for rotation
47  Double_t fConeAnglePhi =
48  TMath::Pi(); // opening angle in phi for multiple rotation
49 
52 
53  ClassDef(PairAnalysisTrackRotator, 1) // Track rotation configuration
54 };
55 
56 
57 #endif
PairAnalysisTrackRotator::GetAngle
Double_t GetAngle() const
Definition: PairAnalysisTrackRotator.h:38
PairAnalysisTrackRotator::kRotatePositive
@ kRotatePositive
Definition: PairAnalysisTrackRotator.h:19
PairAnalysisTrackRotator::PairAnalysisTrackRotator
PairAnalysisTrackRotator(const PairAnalysisTrackRotator &c)
PairAnalysisTrackRotator
Definition: PairAnalysisTrackRotator.h:17
PairAnalysisTrackRotator::PairAnalysisTrackRotator
PairAnalysisTrackRotator()
PairAnalysisTrackRotator::SetIterations
void SetIterations(UInt_t niter)
Definition: PairAnalysisTrackRotator.h:27
PairAnalysisTrackRotator::SetRotationType
void SetRotationType(ERotationType type)
Definition: PairAnalysisTrackRotator.h:28
PairAnalysisTrackRotator::fIterations
UInt_t fIterations
Definition: PairAnalysisTrackRotator.h:44
PairAnalysisTrackRotator::GetStartAnglePhi
Double_t GetStartAnglePhi() const
Definition: PairAnalysisTrackRotator.h:35
PairAnalysisTrackRotator::kRotateBothRandom
@ kRotateBothRandom
Definition: PairAnalysisTrackRotator.h:19
PairAnalysisTrackRotator::fRotationType
ERotationType fRotationType
Definition: PairAnalysisTrackRotator.h:45
xMath::Pi
double Pi()
Definition: xMath.h:5
PairAnalysisTrackRotator::operator=
PairAnalysisTrackRotator & operator=(const PairAnalysisTrackRotator &c)
PairAnalysisTrackRotator::SetConeAnglePhi
void SetConeAnglePhi(Double_t phi)
Definition: PairAnalysisTrackRotator.h:30
PairAnalysisTrackRotator::GetRotationType
ERotationType GetRotationType() const
Definition: PairAnalysisTrackRotator.h:34
PairAnalysisTrackRotator::fStartAnglePhi
Double_t fStartAnglePhi
Definition: PairAnalysisTrackRotator.h:46
PairAnalysisTrackRotator::kRotateNegative
@ kRotateNegative
Definition: PairAnalysisTrackRotator.h:19
PairAnalysisTrackRotator::SetStartAnglePhi
void SetStartAnglePhi(Double_t phi)
Definition: PairAnalysisTrackRotator.h:29
PairAnalysisTrackRotator::~PairAnalysisTrackRotator
virtual ~PairAnalysisTrackRotator()
Definition: PairAnalysisTrackRotator.cxx:43
PairAnalysisTrackRotator::ERotationType
ERotationType
Definition: PairAnalysisTrackRotator.h:19
PairAnalysisTrackRotator::GetIterations
Int_t GetIterations() const
Definition: PairAnalysisTrackRotator.h:33
PairAnalysisTrackRotator::GetConeAnglePhi
Double_t GetConeAnglePhi() const
Definition: PairAnalysisTrackRotator.h:36
PairAnalysisTrackRotator::GetCharge
Double_t GetCharge() const
Definition: PairAnalysisTrackRotator.h:41
PairAnalysisTrackRotator::fConeAnglePhi
Double_t fConeAnglePhi
Definition: PairAnalysisTrackRotator.h:47