BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
CosmicGenerator.h
Go to the documentation of this file.
1// --------------------------------------------------
2//
3// File: CosmicGenerator/CosmicGenerator.h
4// Description:
5// Ported from Atlas to BES
6// by Beijiang Liu
7
8// The output will be stored in the transient event store so it can be
9// passed to the simulation.
10//
11// AuthorList:
12// W. Seligman: Initial Code 08-Nov-2002,
13// based on work by M. Shapiro and I. Hinchliffe
14// adapted for the CosmicGun by S Bentvelsen
15
16#ifndef GENERATORMODULESCOSMICGEN_H
17#define GENERATORMODULESCOSMICGEN_H
18
19#include "BesRndmGenSvc/IBesRndmGenSvc.h"
20
21#include "GaudiKernel/Algorithm.h"
22#include "GaudiKernel/ISvcLocator.h"
23#include "GaudiKernel/NTuple.h"
24
25#include "CLHEP/Geometry/Normal3D.h"
26#include "CLHEP/Geometry/Point3D.h"
27#include "CLHEP/Vector/LorentzVector.h"
28#include "HepMC/Polarization.h"
29#include <fstream>
30#include <string>
31#include <vector>
32
33using namespace std;
34using namespace CLHEP;
35#ifndef ENABLE_BACKWARDS_COMPATIBILITY
36typedef HepGeom::Point3D<double> HepPoint3D;
37typedef HepGeom::Normal3D<float> HepNormal3D;
38#endif
39
40class StoreGateSvc;
41class ActiveStoreSvc;
42
43class CosmicGun;
44
45class CosmicGenerator : public Algorithm {
46public:
47 CosmicGenerator( const std::string& name, ISvcLocator* pSvcLocator );
49 StatusCode initialize();
50 StatusCode execute();
51 StatusCode finalize();
52
53 HepLorentzVector generateVertex( void );
54
56
57private:
58 StoreGateSvc* m_sgSvc;
59 ActiveStoreSvc* m_activeStore;
60 NTuple::Tuple* m_tuple;
61 NTuple::Item<double> m_cosmicE;
62 NTuple::Item<double> m_cosmicTheta;
63 NTuple::Item<double> m_cosmicPhi;
64 NTuple::Item<double> m_cosmicCharge;
65 NTuple::Tuple* m_tuple1;
66 NTuple::Item<double> mc_phi;
67 NTuple::Item<double> mc_theta;
68 NTuple::Item<double> mc_px;
69 NTuple::Item<double> mc_py;
70 NTuple::Item<double> mc_pz;
71
72 // event counter, used for event ID
73 long int m_events, m_rejected, m_accepted, m_tried;
74 std::vector<int> m_pdgCode;
75 float m_emin, m_emax;
76 float m_ctcut;
77 float m_xlow, m_xhig, m_zlow, m_zhig, m_yval, m_IPx, m_IPy, m_IPz;
78 float m_radius, m_xpos, m_ypos, m_zpos;
79 float m_xposMin_top, m_xposMax_top, m_ypos_top, m_zposMin_top, m_zposMax_top; // top plane
80 float m_xposMin_bottom, m_xposMax_bottom, m_ypos_bottom, m_zposMin_bottom,
81 m_zposMax_bottom; // bottom plane
82
83 float m_tmin, m_tmax, m_tcor;
84 bool m_sphereOpt;
85
86 bool m_swapYZAxis;
87 bool m_cubeProj;
88 bool m_doublePlaneTrigger;
89 long int m_printEvent, m_printMod;
90 long int m_selection;
91 int m_dumpMC;
92 float m_thetamin, m_thetamax, m_phimin, m_phimax;
93
94 float m_GeV;
95 float m_mm;
96
97 bool m_readfile;
98 std::string m_infile;
99 std::ifstream m_ffile;
100
101 // Event scalars, three-vectors, and four-vectors:
102 std::vector<HepLorentzVector> m_fourPos;
103 std::vector<HepLorentzVector> m_fourMom;
104 Hep3Vector m_center;
105 std::vector<HepMC::Polarization> m_polarization;
106
107 // Pointer to Athena MessageSvc.
108 IMessageSvc* p_msgSvc;
109
110 // Energy dependent position cut for muons to reach the detector.
111 bool exzCut( const Hep3Vector& pos, const HepLorentzVector& p );
112
113 // property for calling exzCut
114 bool m_exzCut;
115 // maximum r used in exzCut
116 float m_rmax;
117};
118
119#endif
HepGeom::Point3D< double > HepPoint3D
HepGeom::Normal3D< float > HepNormal3D
HepLorentzVector generateVertex(void)
StatusCode initialize()
static IBesRndmGenSvc * p_BesRndmGenSvc
CosmicGenerator(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode finalize()
manage multiple CLHEP random engines as named streams