/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/CosmicGenerator/CosmicGenerator-00-00-09/CosmicGenerator/CosmicGenerator.h

Go to the documentation of this file.
00001 // --------------------------------------------------
00002 // 
00003 // File:  CosmicGenerator/CosmicGenerator.h
00004 // Description:
00005 // Ported from Atlas to BES
00006 //                      by Beijiang Liu 
00007 
00008 //    The output will be stored in the transient event store so it can be
00009 //    passed to the simulation.
00010 // 
00011 // AuthorList:
00012 //         W. Seligman: Initial Code 08-Nov-2002,
00013 //         based on work by M. Shapiro and I. Hinchliffe
00014 //         adapted for the CosmicGun by S Bentvelsen
00015 
00016 
00017 #ifndef GENERATORMODULESCOSMICGEN_H
00018 #define GENERATORMODULESCOSMICGEN_H
00019 
00020 #include "BesKernel/IBesRndmGenSvc.h"
00021 
00022 #include "HepMC/GenEvent.h"
00023 #include "HepMC/GenParticle.h"
00024 
00025 #include "GaudiKernel/Algorithm.h"
00026 #include "GaudiKernel/ISvcLocator.h"
00027 #include "GaudiKernel/AlgFactory.h"
00028 #include "GaudiKernel/NTuple.h"
00029 
00030 #include "CLHEP/Vector/LorentzVector.h"
00031 #include "HepMC/Polarization.h"
00032 #include "CLHEP/Geometry/Point3D.h"
00033 #include "CLHEP/Geometry/Normal3D.h"
00034 #include <iostream>
00035 #include <fstream>
00036 #include <vector>
00037 #include <string>
00038 
00039 using namespace std;
00040 using namespace CLHEP;
00041 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00042 typedef HepGeom::Point3D<double>       HepPoint3D;
00043 typedef HepGeom::Normal3D<float>       HepNormal3D;
00044 #endif
00045 
00046 class StoreGateSvc;
00047 class ActiveStoreSvc;
00048 
00049 class CosmicGun;
00050 
00051 class CosmicGenerator:public Algorithm {
00052 public:
00053   CosmicGenerator(const std::string& name, ISvcLocator* pSvcLocator);
00054   ~CosmicGenerator();
00055   StatusCode initialize();
00056   StatusCode execute();
00057   StatusCode finalize();
00058 
00059 
00060   HepLorentzVector generateVertex(void);
00061 
00062   static IBesRndmGenSvc*         p_BesRndmGenSvc;
00063 
00064 private:
00065 
00066   StoreGateSvc*  m_sgSvc;
00067   ActiveStoreSvc* m_activeStore;
00068   NTuple::Tuple* m_tuple;
00069   NTuple::Item<double> m_cosmicE;
00070   NTuple::Item<double>  m_cosmicTheta;
00071   NTuple::Item<double> m_cosmicPhi;
00072   NTuple::Item<double>  m_cosmicCharge;
00073   NTuple::Tuple* m_tuple1;
00074   NTuple::Item<double>  mc_phi;
00075   NTuple::Item<double> mc_theta;
00076   NTuple::Item<double>  mc_px;
00077   NTuple::Item<double> mc_py;
00078   NTuple::Item<double> mc_pz;
00079 
00080   // event counter, used for event ID
00081   long int m_events, m_rejected,m_accepted,m_tried;
00082   std::vector<int> m_pdgCode;
00083   float m_emin, m_emax;
00084   float m_ctcut;
00085   float m_xlow, m_xhig, m_zlow, m_zhig, m_yval, m_IPx, m_IPy, m_IPz;
00086   float m_radius, m_xpos, m_ypos, m_zpos;
00087 
00088   float m_tmin, m_tmax,m_tcor;
00089   bool m_sphereOpt;
00090  
00091   bool m_swapYZAxis;
00092   bool m_cubeProj;
00093   long int m_printEvent, m_printMod;
00094   long int m_selection ; 
00095   int m_dumpMC;
00096   float m_thetamin, m_thetamax, m_phimin, m_phimax;
00097   
00098   float m_GeV;
00099   float m_mm;
00100 
00101 
00102   bool m_readfile;
00103   std::string m_infile;
00104   std::ifstream    m_ffile;
00105 
00106   // Event scalars, three-vectors, and four-vectors:
00107   std::vector<HepLorentzVector> m_fourPos;
00108   std::vector<HepLorentzVector> m_fourMom;
00109   Hep3Vector m_center;
00110   std::vector<HepMC::Polarization> m_polarization;
00111 
00112   // Pointer to Athena MessageSvc.
00113   IMessageSvc* p_msgSvc;
00114 
00115   // Energy dependent position cut for muons to reach the detector.
00116   bool exzCut(const Hep3Vector& pos,const HepLorentzVector& p); 
00117 
00118   // property for calling exzCut
00119   bool m_exzCut ; 
00120   // maximum r used in exzCut 
00121   float m_rmax ; 
00122 
00123 };
00124 
00125 #endif

Generated on Tue Nov 29 23:12:37 2016 for BOSS_7.0.2 by  doxygen 1.4.7