CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/CgemSim/CgemSim-01-00-32/CgemSim/BesCgemDigitizer.hh
Go to the documentation of this file.
1//-------------------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//-------------------------------------------------------------------------------------//
4/*
5 * =====================================================================================
6 *
7 * Filename: BesCgemDigitizer.hh
8 * Description:
9 * Conventions:
10 * f_ : variable used in function parameter list
11 * gv_ : global variable
12 * lv_ : local variable used in function
13 * lvd_ : local variable double
14 * m_* : normal member of class
15 * sm_* : static member of class
16 * m_M_* : class data member, material of each layer
17 * m_N_* : class data member, number of layers (CgemLayer,GemFoil)
18 * m_R_* : class data member, radius of each (material) layer, and so on
19 * m_L_* : class data member, length of each layer or hole pitch
20 * m_T_* : class data member, thickness of each (material) layer
21 * m_A_* : class data member, angle of anode VStrip
22 * Version: CgemSim-01-00-00
23 * Created: 01/05/2014 09:49:21 PM
24 * Revision: CgemSim-00-00-01(in CMT version CgemBoss-0.0.1 written by xiuql)
25 * Compiler: gcc
26 * Author: [email protected]
27 * Organization: DG1,EPC,IHEP
28 * History:
29 * <Num> <Author> <Time> <Version> <remark>
30 * 0 juxd 20140105 01-00-00 created,
31 *
32 * =====================================================================================
33 */
34
35//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36#ifndef BesCgemDigitizer_h
37#define BesCgemDigitizer_h 1
38
39class BesCgemDigitizerMessenger;
40class TFile;
41class TH1F;
42class G4Svc;
43
44/* Header file: BOSS */
45#include "BesCgemDigi.hh"
46#include "CgemGeomSvc/CgemGeomSvc.h"
47
48#include "GaudiKernel/NTuple.h"
49#include "GaudiKernel/INTupleSvc.h"
50#include "CgemDigitizerSvc/CgemDigitizerSvc.h"
51
52/* Header file: Geant4 */
53#include "globals.hh"
54#include "G4VDigitizerModule.hh"
55
56/* Header file: C++ */
57#include <vector>
58
59//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60class BesCgemDigitizer : public G4VDigitizerModule
61{
62public:
63 BesCgemDigitizer(G4String modName);
65
66 /* Realize digitize */
67 virtual void Digitize();
71
72 /* Lorentz transform */
73 void DoLorentzDiffusion(const G4int f_ID_layer, G4ThreeVector &f_XYZ_pre, G4ThreeVector &f_XYZ_post, const int f_F_print=0);
74
75 /* Diffusion of hit(or step) */
76 void Smear(void);
77
78 /* Add noise */
79 void AddNoise(void);
80
81 /* Return ID from XYZ of readout layer */
82 void GetIDFromXYZ(const G4int f_ID_layer, const G4ThreeVector f_XYZ, /* Input */
83 G4double &f_x, G4double &f_v, G4int &f_ID_sheet, G4int &f_ID_x, G4int &f_ID_v); /* Output */
84
85 /* Return ID from segment in the same sheet of readout layer */
86 void GetIDFromSegmentInSameSheet(const G4int f_ID_x_pre , const G4int f_ID_v_pre,
87 const G4int f_ID_x_post, const G4int f_ID_v_post,
88 G4int &f_N_hit_strip_x , G4int &f_N_hit_strip_v,
89 G4int &f_ID_x_start , G4int &f_ID_v_start );
90
91 /* Return X and V strip ID of the middle point by the segment which crossed sheet */
92 void GetMiddleIDFromSegmentCrossedSheet(const G4int f_ID_layer,
93 const G4int f_ID_sheet_pre , const G4double f_x_pre , const G4double f_v_pre ,
94 const G4int f_ID_sheet_post, const G4double f_x_post, const G4double f_v_post,
95 G4int &f_ID_sheet_mid_pre , G4int &f_ID_x_mid_pre , G4int &f_ID_v_mid_pre,
96 G4int &f_ID_sheet_mid_post , G4int &f_ID_x_mid_post , G4int &f_ID_v_mid_post);
97
98 /* Return XYZ of readout layer from assigned ID */
100
101private:
102 BesCgemDigisCollection *m_digi_collection;
103 CgemGeomSvc *m_cgem_geomsvc;
104 CgemDigitizerSvc *m_cgemDigiSvc;
105 G4int m_DigitizerVer;/* Flag of Digitizer version: 2: Geo projection, 3: full digitization by CgemDigitizerSvc */
106
107 G4double m_E_threshold; /* Energy threshold */
108
109 G4int m_F_lorentz; /* Flag of Lorentzdiffusion(): 0-OFF; 1-ON */
110 G4int m_F_smear; /* Flag of Smear(): 0-OFF; 1-ON */
111 G4int m_F_noise; /* Flag of AddNoise(): 0-OFF; 1-ON */
112 G4int m_F_hit[3][2][2][1500]; /* Flag of X/V strip hit: -1(1 hit); >-1(>1 hit) */
113
114 G4int m_F_printStrip; /* Flag of Print Strip information: 0-OFF; 1-ON */
115 G4int m_F_printHitStrip; /* Flag of Print Hit Strip information: 0-OFF; 1-ON */
116 G4int m_F_printDigi; /* Flag of Print Digi information: 0-OFF; 1-ON */
117 G4int m_F_ntuple; /* Flag of fill ntuple: 0-OFF; 1-ON */
118
119 NTuple::Tuple* m_nt1;
120 NTuple::Item<int> m_evt;
121 NTuple::Item<int> m_nhit;
122 NTuple::Array<int> m_layer;
123 NTuple::Array<int> m_sheet;
124 NTuple::Array<double> m_phi;
125 NTuple::Array<double> m_v;
126};
127#endif
128
129//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4TDigiCollection< BesCgemDigi > BesCgemDigisCollection
BesCgemDigitizer(G4String modName)
void AddNoise(void)
void GetIDFromXYZ(const G4int f_ID_layer, const G4ThreeVector f_XYZ, G4double &f_x, G4double &f_v, G4int &f_ID_sheet, G4int &f_ID_x, G4int &f_ID_v)
virtual void Digitize()
void DoLorentzDiffusion(const G4int f_ID_layer, G4ThreeVector &f_XYZ_pre, G4ThreeVector &f_XYZ_post, const int f_F_print=0)
void GetIDFromSegmentInSameSheet(const G4int f_ID_x_pre, const G4int f_ID_v_pre, const G4int f_ID_x_post, const G4int f_ID_v_post, G4int &f_N_hit_strip_x, G4int &f_N_hit_strip_v, G4int &f_ID_x_start, G4int &f_ID_v_start)
void Smear(void)
void GetMiddleIDFromSegmentCrossedSheet(const G4int f_ID_layer, const G4int f_ID_sheet_pre, const G4double f_x_pre, const G4double f_v_pre, const G4int f_ID_sheet_post, const G4double f_x_post, const G4double f_v_post, G4int &f_ID_sheet_mid_pre, G4int &f_ID_x_mid_pre, G4int &f_ID_v_mid_pre, G4int &f_ID_sheet_mid_post, G4int &f_ID_x_mid_post, G4int &f_ID_v_mid_post)