BOSS 7.0.7
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
88 float m_tmin, m_tmax,m_tcor;
89 bool m_sphereOpt;
90
91 bool m_swapYZAxis;
92 bool m_cubeProj;
93 long int m_printEvent, m_printMod;
94 long int m_selection ;
95 int m_dumpMC;
96 float m_thetamin, m_thetamax, m_phimin, m_phimax;
97
98 float m_GeV;
99 float m_mm;
100
101
102 bool m_readfile;
103 std::string m_infile;
104 std::ifstream m_ffile;
105
106 // Event scalars, three-vectors, and four-vectors:
107 std::vector<HepLorentzVector> m_fourPos;
108 std::vector<HepLorentzVector> m_fourMom;
109 Hep3Vector m_center;
110 std::vector<HepMC::Polarization> m_polarization;
111
112 // Pointer to Athena MessageSvc.
113 IMessageSvc* p_msgSvc;
114
115 // Energy dependent position cut for muons to reach the detector.
116 bool exzCut(const Hep3Vector& pos,const HepLorentzVector& p);
117
118 // property for calling exzCut
119 bool m_exzCut ;
120 // maximum r used in exzCut
121 float m_rmax ;
122
123};
124
125#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