Belle II Software  release-05-01-25
SGCosmic.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Based on the Belle single track generator by KUNIYA Toshio *
7  * Contributors: Sergey Yashchenko *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 #pragma once
13 
14 #include <mdst/dataobjects/MCParticleGraph.h>
15 
16 namespace Belle2 {
26  class SGCosmic {
27 
28  public:
29 
33  struct Parameters {
37  int level;
41  int ipRequirement;
45  double ipdr;
49  double ipdz;
53  double ptmin;
57  double cylindricalR;
58  };
59 
63  SGCosmic();
64 
68  ~SGCosmic() {}
69 
74  bool generateEvent(MCParticleGraph& graph);
75 
79  bool setParameters(const Parameters& parameters);
80 
81  protected:
82 
86  Parameters m_params;
87 
88  private:
89 
93  double findMax(const double* dim, const int num);
94 
99  void genCosmic(const int level, int& charge,
100  double& dr, double& phi, double& Pt, double& dz, double& tanl);
101 
105  int muChargeFlag(const double);
106 
110  void mkdist_v1(const int charge, double*);
115  int mkDr_pos_v1(const double dr, const float rndm);
120  int mkDr_neg_v1(const double dr, const float rndm);
125  int mkPhi_pos_v1(const double phi, const float rndm);
130  int mkPhi_neg_v1(const double phi, const float rndm);
135  int mkPt_pos_v1(const double pt, const float rndm);
140  int mkPt_neg_v1(const double pt, const float rndm);
145  int mkDz_pos_v1(const double dz, const float rndm);
150  int mkDz_neg_v1(const double dz, const float rndm);
155  int mkTanl_pos_v1(const double tanl, const float rndm);
160  int mkTanl_neg_v1(const double tanl, const float rndm);
161 
165  void mkdist_v2(const int charge, double*);
170  int mkDr_pos_v2(const double dr, const float rndm);
175  int mkDr_neg_v2(const double dr, const float rndm);
180  int mkPhi_pos_v2(const double phi, const float rndm);
185  int mkPhi_neg_v2(const double phi, const float rndm);
190  int mkPt_pos_v2(const double pt, const float rndm);
195  int mkPt_neg_v2(const double pt, const float rndm);
200  int mkDz_pos_v2(const double dz, const float rndm);
205  int mkDz_neg_v2(const double dz, const float rndm);
210  int mkTanl_pos_v2(const double tanl, const float rndm);
215  int mkTanl_neg_v2(const double tanl, const float rndm);
216 
217  };
218 
220 } //end namespace Belle2
221 
Belle2::SGCosmic::mkPhi_pos_v2
int mkPhi_pos_v2(const double phi, const float rndm)
Generates azimuthal angle phi distributions by accept-reject method for positively charged particles.
Definition: SGCosmic.cc:696
Belle2::SGCosmic::mkPhi_pos_v1
int mkPhi_pos_v1(const double phi, const float rndm)
Generates azimuthal angle phi distributions by accept-reject method for positively charged particles.
Definition: SGCosmic.cc:344
Belle2::SGCosmic::Parameters::ipdz
double ipdz
Vertex restriction in z direction.
Definition: SGCosmic.h:58
Belle2::SGCosmic::mkDr_pos_v1
int mkDr_pos_v1(const double dr, const float rndm)
Generates vertex distributions in the radial direction dr by accept-reject method for positively char...
Definition: SGCosmic.cc:276
Belle2::SGCosmic::mkTanl_pos_v2
int mkTanl_pos_v2(const double tanl, const float rndm)
Generates tangent of the polar angle tanl distributions by accept-reject method for positively charge...
Definition: SGCosmic.cc:900
Belle2::MCParticleGraph
Class to build, validate and sort a particle decay chain.
Definition: MCParticleGraph.h:48
Belle2::SGCosmic::mkPhi_neg_v1
int mkPhi_neg_v1(const double phi, const float rndm)
Generates azimuthal angle phi distributions by accept-reject method for negatively charged particles.
Definition: SGCosmic.cc:378
Belle2::SGCosmic::~SGCosmic
~SGCosmic()
Default destructor.
Definition: SGCosmic.h:77
Belle2::SGCosmic::mkPt_neg_v2
int mkPt_neg_v2(const double pt, const float rndm)
Generates transverse momentum pt distributions by accept-reject method for negatively charged particl...
Definition: SGCosmic.cc:778
Belle2::SGCosmic::mkDr_neg_v1
int mkDr_neg_v1(const double dr, const float rndm)
Generates vertex distributions in the radial direction dr by accept-reject method for negatively.
Definition: SGCosmic.cc:310
Belle2::SGCosmic::setParameters
bool setParameters(const Parameters &parameters)
Sets the parameters for generating the Particles.
Definition: SGCosmic.cc:47
Belle2::SGCosmic::mkDz_pos_v2
int mkDz_pos_v2(const double dz, const float rndm)
Generates z vertex dz distributions by accept-reject method for positively charged particles.
Definition: SGCosmic.cc:812
Belle2::SGCosmic::muChargeFlag
int muChargeFlag(const double)
Generates the muon charge according to the positively/negatively charged muon ratio.
Definition: SGCosmic.cc:203
Belle2::SGCosmic::mkPt_neg_v1
int mkPt_neg_v1(const double pt, const float rndm)
Generates transverse momentum pt distributions by accept-reject method for negatively charged particl...
Definition: SGCosmic.cc:436
Belle2::SGCosmic::mkdist_v2
void mkdist_v2(const int charge, double *)
Generates distributions in 5-parameter space for different particle charges.
Definition: SGCosmic.cc:597
Belle2::SGCosmic::mkTanl_neg_v2
int mkTanl_neg_v2(const double tanl, const float rndm)
Generates tangent of the polar angle tanl distributions by accept-reject method for negatively charge...
Definition: SGCosmic.cc:934
Belle2::SGCosmic::mkDr_neg_v2
int mkDr_neg_v2(const double dr, const float rndm)
Generates vertex distributions in the radial direction dr by accept-reject method for negatively char...
Definition: SGCosmic.cc:672
Belle2::SGCosmic::m_params
Parameters m_params
All relevant parameters.
Definition: SGCosmic.h:95
Belle2::SGCosmic::mkDz_neg_v2
int mkDz_neg_v2(const double dz, const float rndm)
Generates z vertex dz distributions by accept-reject method for negatively charged particles.
Definition: SGCosmic.cc:866
Belle2::SGCosmic::mkPhi_neg_v2
int mkPhi_neg_v2(const double phi, const float rndm)
Generates azimuthal angle phi distributions by accept-reject method for negatively charged particles.
Definition: SGCosmic.cc:720
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SGCosmic::mkdist_v1
void mkdist_v1(const int charge, double *)
Generates distributions in 5-parameter space for different particle charges.
Definition: SGCosmic.cc:212
Belle2::SGCosmic::mkTanl_pos_v1
int mkTanl_pos_v1(const double tanl, const float rndm)
Generates tangent of the polar angle tanl distributions by accept-reject method for positively charge...
Definition: SGCosmic.cc:528
Belle2::SGCosmic::genCosmic
void genCosmic(const int level, int &charge, double &dr, double &phi, double &Pt, double &dz, double &tanl)
Generates cosmic events according to tabulated distributions in 5-dimensional space: dr,...
Definition: SGCosmic.cc:155
Belle2::SGCosmic::generateEvent
bool generateEvent(MCParticleGraph &graph)
Generates the next event and store the result in the given MCParticle graph.
Definition: SGCosmic.cc:77
Belle2::SGCosmic::Parameters::ptmin
double ptmin
Minimum value of the transverse momentum.
Definition: SGCosmic.h:62
Belle2::SGCosmic::Parameters::level
int level
Generator version: level 1 (default) or 2.
Definition: SGCosmic.h:46
Belle2::SGCosmic::mkDz_neg_v1
int mkDz_neg_v1(const double dz, const float rndm)
Generates z vertex dz distributions by accept-reject method for negatively charged particles.
Definition: SGCosmic.cc:494
Belle2::SGCosmic::mkPt_pos_v1
int mkPt_pos_v1(const double pt, const float rndm)
Generates transverse momentum pt distributions by accept-reject method for positively charged particl...
Definition: SGCosmic.cc:412
Belle2::SGCosmic::Parameters::ipdr
double ipdr
Vertex restriction in the radial direction.
Definition: SGCosmic.h:54
Belle2::SGCosmic::Parameters::cylindricalR
double cylindricalR
Cylindrical radius of generation.
Definition: SGCosmic.h:66
Belle2::SGCosmic::mkPt_pos_v2
int mkPt_pos_v2(const double pt, const float rndm)
Generates transverse momentum pt distributions by accept-reject method for positively charged particl...
Definition: SGCosmic.cc:744
Belle2::SGCosmic::findMax
double findMax(const double *dim, const int num)
Finds maximum value in an array.
Definition: SGCosmic.cc:68
Belle2::SGCosmic::mkTanl_neg_v1
int mkTanl_neg_v1(const double tanl, const float rndm)
Generates tangent of the polar angle tanl distributions by accept-reject method for negatively charge...
Definition: SGCosmic.cc:562
Belle2::SGCosmic::mkDr_pos_v2
int mkDr_pos_v2(const double dr, const float rndm)
Generates vertex distributions in the radial direction dr by accept-reject method for positively char...
Definition: SGCosmic.cc:648
Belle2::SGCosmic::Parameters::ipRequirement
int ipRequirement
Restrict the vertex to IP or not (default)
Definition: SGCosmic.h:50
Belle2::SGCosmic::mkDz_pos_v1
int mkDz_pos_v1(const double dz, const float rndm)
Generates z vertex dz distributions by accept-reject method for positively charged particles.
Definition: SGCosmic.cc:460
Belle2::SGCosmic::SGCosmic
SGCosmic()
Default constructor.
Definition: SGCosmic.cc:34