CGEM BOSS 6.6.5.g
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
17#ifndef GENERATORMODULESCOSMICGEN_H
18#define GENERATORMODULESCOSMICGEN_H
19
21
22#include "HepMC/GenEvent.h"
23#include "HepMC/GenParticle.h"
24
25#include "GaudiKernel/Algorithm.h"
26#include "GaudiKernel/ISvcLocator.h"
27#include "GaudiKernel/AlgFactory.h"
28#include "GaudiKernel/NTuple.h"
29
30#include "CLHEP/Vector/LorentzVector.h"
31#include "HepMC/Polarization.h"
32#include "CLHEP/Geometry/Point3D.h"
33#include "CLHEP/Geometry/Normal3D.h"
34#include <iostream>
35#include <fstream>
36#include <vector>
37#include <string>
38
39using namespace std;
40using namespace CLHEP;
41#ifndef ENABLE_BACKWARDS_COMPATIBILITY
43typedef HepGeom::Normal3D<float> HepNormal3D;
44#endif
45
46class StoreGateSvc;
47class ActiveStoreSvc;
48
49class CosmicGun;
50
51class CosmicGenerator:public Algorithm {
52public:
53 CosmicGenerator(const std::string& name, ISvcLocator* pSvcLocator);
55 StatusCode initialize();
56 StatusCode execute();
57 StatusCode finalize();
58
59
60 HepLorentzVector generateVertex(void);
61
63
64private:
65
66 StoreGateSvc* m_sgSvc;
67 ActiveStoreSvc* m_activeStore;
68 NTuple::Tuple* m_tuple;
69 NTuple::Item<double> m_cosmicE;
70 NTuple::Item<double> m_cosmicTheta;
71 NTuple::Item<double> m_cosmicPhi;
72 NTuple::Item<double> m_cosmicCharge;
73 NTuple::Tuple* m_tuple1;
74 NTuple::Item<double> mc_phi;
75 NTuple::Item<double> mc_theta;
76 NTuple::Item<double> mc_px;
77 NTuple::Item<double> mc_py;
78 NTuple::Item<double> mc_pz;
79
80 // event counter, used for event ID
81 long int m_events, m_rejected,m_accepted,m_tried;
82 std::vector<int> m_pdgCode;
83 float m_emin, m_emax;
84 float m_ctcut;
85 float m_xlow, m_xhig, m_zlow, m_zhig, m_yval, m_IPx, m_IPy, m_IPz;
86 float m_radius, m_xpos, m_ypos, m_zpos;
87 float m_xposMin_top, m_xposMax_top, m_ypos_top, m_zposMin_top, m_zposMax_top; // top plane
88 float m_xposMin_bottom, m_xposMax_bottom, m_ypos_bottom, m_zposMin_bottom, m_zposMax_bottom; // bottom plane
89
90 float m_tmin, m_tmax,m_tcor;
91 bool m_sphereOpt;
92
93 bool m_swapYZAxis;
94 bool m_cubeProj;
95 bool m_doublePlaneTrigger;
96 long int m_printEvent, m_printMod;
97 long int m_selection ;
98 int m_dumpMC;
99 float m_thetamin, m_thetamax, m_phimin, m_phimax;
100
101 float m_GeV;
102 float m_mm;
103
104
105 bool m_readfile;
106 std::string m_infile;
107 std::ifstream m_ffile;
108
109 // Event scalars, three-vectors, and four-vectors:
110 std::vector<HepLorentzVector> m_fourPos;
111 std::vector<HepLorentzVector> m_fourMom;
112 Hep3Vector m_center;
113 std::vector<HepMC::Polarization> m_polarization;
114
115 // Pointer to Athena MessageSvc.
116 IMessageSvc* p_msgSvc;
117
118 // Energy dependent position cut for muons to reach the detector.
119 bool exzCut(const Hep3Vector& pos,const HepLorentzVector& p);
120
121 // property for calling exzCut
122 bool m_exzCut ;
123 // maximum r used in exzCut
124 float m_rmax ;
125
126};
127
128#endif
HepGeom::Point3D< double > HepPoint3D
HepGeom::Normal3D< float > HepNormal3D
HepLorentzVector generateVertex(void)
StatusCode initialize()
static IBesRndmGenSvc * p_BesRndmGenSvc
StatusCode execute()
StatusCode finalize()
manage multiple CLHEP random engines as named streams