Belle II Software development
SGCosmic.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <mdst/dataobjects/MCParticleGraph.h>
12
13namespace Belle2 {
23 class SGCosmic {
24
25 public:
26
30 struct Parameters {
34 int level;
42 double ipdr;
46 double ipdz;
50 double ptmin;
55 };
56
60 SGCosmic();
61
66
71 bool generateEvent(MCParticleGraph& graph);
72
76 bool setParameters(const Parameters& parameters);
77
78 protected:
79
84
85 private:
86
90 double findMax(const double* dim, const int num);
91
96 void genCosmic(const int level, int& charge,
97 double& dr, double& phi, double& Pt, double& dz, double& tanl);
98
102 int muChargeFlag(const double);
103
107 void mkdist_v1(const int charge, double*);
112 int mkDr_pos_v1(const double dr, const float rndm);
117 int mkDr_neg_v1(const double dr, const float rndm);
122 int mkPhi_pos_v1(const double phi, const float rndm);
127 int mkPhi_neg_v1(const double phi, const float rndm);
132 int mkPt_pos_v1(const double pt, const float rndm);
137 int mkPt_neg_v1(const double pt, const float rndm);
142 int mkDz_pos_v1(const double dz, const float rndm);
147 int mkDz_neg_v1(const double dz, const float rndm);
152 int mkTanl_pos_v1(const double tanl, const float rndm);
157 int mkTanl_neg_v1(const double tanl, const float rndm);
158
162 void mkdist_v2(const int charge, double*);
167 int mkDr_pos_v2(const double dr, const float rndm);
172 int mkDr_neg_v2(const double dr, const float rndm);
177 int mkPhi_pos_v2(const double phi, const float rndm);
182 int mkPhi_neg_v2(const double phi, const float rndm);
187 int mkPt_pos_v2(const double pt, const float rndm);
192 int mkPt_neg_v2(const double pt, const float rndm);
197 int mkDz_pos_v2(const double dz, const float rndm);
202 int mkDz_neg_v2(const double dz, const float rndm);
207 int mkTanl_pos_v2(const double tanl, const float rndm);
212 int mkTanl_neg_v2(const double tanl, const float rndm);
213
214 };
215
217} //end namespace Belle2
218
Class to build, validate and sort a particle decay chain.
Class to generate tracks in the cosmics generator and store them in a MCParticle graph.
Definition: SGCosmic.h:23
~SGCosmic()
Default destructor.
Definition: SGCosmic.h:65
SGCosmic()
Default constructor.
Definition: SGCosmic.cc:31
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:693
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:559
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:457
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:525
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:433
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:152
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:375
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:307
void mkdist_v2(const int charge, double *)
Generates distributions in 5-parameter space for different particle charges.
Definition: SGCosmic.cc:594
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:741
Parameters m_params
All relevant parameters.
Definition: SGCosmic.h:83
bool generateEvent(MCParticleGraph &graph)
Generates the next event and store the result in the given MCParticle graph.
Definition: SGCosmic.cc:74
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:491
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:409
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:717
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:669
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:645
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:897
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:931
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:863
bool setParameters(const Parameters &parameters)
Sets the parameters for generating the Particles.
Definition: SGCosmic.cc:44
void mkdist_v1(const int charge, double *)
Generates distributions in 5-parameter space for different particle charges.
Definition: SGCosmic.cc:209
int muChargeFlag(const double)
Generates the muon charge according to the positively/negatively charged muon ratio.
Definition: SGCosmic.cc:200
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:775
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:809
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:273
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:341
double findMax(const double *dim, const int num)
Finds maximum value in an array.
Definition: SGCosmic.cc:65
Abstract base class for different kinds of events.
Struct to keep all necessary parameters for the cosmic generator.
Definition: SGCosmic.h:30
int ipRequirement
Restrict the vertex to IP or not (default)
Definition: SGCosmic.h:38
double ipdr
Vertex restriction in the radial direction.
Definition: SGCosmic.h:42
double cylindricalR
Cylindrical radius of generation.
Definition: SGCosmic.h:54
double ptmin
Minimum value of the transverse momentum.
Definition: SGCosmic.h:50
int level
Generator version: level 1 (default) or 2.
Definition: SGCosmic.h:34
double ipdz
Vertex restriction in z direction.
Definition: SGCosmic.h:46