CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
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 "BesCgemHit.hh"
46#include "BesCgemDigi.hh"
48
49#include "GaudiKernel/NTuple.h"
50#include "GaudiKernel/INTupleSvc.h"
52
53/* Header file: Geant4 */
54#include "globals.hh"
55#include "G4VDigitizerModule.hh"
56
57/* Header file: C++ */
58#include <vector>
59
60//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61class BesCgemDigitizer : public G4VDigitizerModule
62{
63public:
64 BesCgemDigitizer(G4String modName);
66
67 /* Realize digitize */
68 virtual void Digitize();
69 void Digitize_v1();
70 void Digitize_v2();
71 void Digitize_v3();
72
73 /* Lorentz transform */
74 void DoLorentzDiffusion(const G4int f_ID_layer, G4ThreeVector &f_XYZ_pre, G4ThreeVector &f_XYZ_post, const int f_F_print=0);
75
76 /* Diffusion of hit(or step) */
77 void Smear(void);
78
79 /* Add noise */
80 void AddNoise(void);
81
82 /* Return ID from XYZ of readout layer */
83 void GetIDFromXYZ(const G4int f_ID_layer, const G4ThreeVector f_XYZ, /* Input */
84 G4double &f_x, G4double &f_v, G4int &f_ID_sheet, G4int &f_ID_x, G4int &f_ID_v); /* Output */
85
86 /* Return ID from segment in the same sheet of readout layer */
87 void GetIDFromSegmentInSameSheet(const G4int f_ID_x_pre , const G4int f_ID_v_pre,
88 const G4int f_ID_x_post, const G4int f_ID_v_post,
89 G4int &f_N_hit_strip_x , G4int &f_N_hit_strip_v,
90 G4int &f_ID_x_start , G4int &f_ID_v_start );
91
92 /* Return X and V strip ID of the middle point by the segment which crossed sheet */
93 void GetMiddleIDFromSegmentCrossedSheet(const G4int f_ID_layer,
94 const G4int f_ID_sheet_pre , const G4double f_x_pre , const G4double f_v_pre ,
95 const G4int f_ID_sheet_post, const G4double f_x_post, const G4double f_v_post,
96 G4int &f_ID_sheet_mid_pre , G4int &f_ID_x_mid_pre , G4int &f_ID_v_mid_pre,
97 G4int &f_ID_sheet_mid_post , G4int &f_ID_x_mid_post , G4int &f_ID_v_mid_post);
98
99 /* Return XYZ of readout layer from assigned ID */
100 void GetXYZFromID();
101
102private:
103 BesCgemDigisCollection *m_digi_collection;
104 CgemGeomSvc *m_cgem_geomsvc;
105 CgemDigitizerSvc *m_cgemDigiSvc;
106 G4int m_DigitizerVer;/* Flag of Digitizer version: 2: Geo projection, 3: full digitization by CgemDigitizerSvc */
107
108 G4double m_E_threshold; /* Energy threshold */
109
110 G4int m_F_lorentz; /* Flag of Lorentzdiffusion(): 0-OFF; 1-ON */
111 G4int m_F_smear; /* Flag of Smear(): 0-OFF; 1-ON */
112 G4int m_F_noise; /* Flag of AddNoise(): 0-OFF; 1-ON */
113 G4int m_F_hit[3][2][2][1500]; /* [layer][sheet][x/v-view][strip] Flag of X/V strip hit: -1(1 hit); >-1(>1 hit) */
114 BesCgemHit* m_cgemHitTimePnt[3][2][2][1500]; /* [layer][sheet][x/v-view][strip] pointer to the Cgem hit giving the time */
115
116 G4int m_F_printStrip; /* Flag of Print Strip information: 0-OFF; 1-ON */
117 G4int m_F_printHitStrip; /* Flag of Print Hit Strip information: 0-OFF; 1-ON */
118 G4int m_F_printDigi; /* Flag of Print Digi information: 0-OFF; 1-ON */
119 G4int m_F_ntuple; /* Flag of fill ntuple: 0-OFF; 1-ON */
120
121 NTuple::Tuple* m_nt1;
122 NTuple::Item<int> m_evt;
123 NTuple::Item<int> m_nhit;
124 NTuple::Array<int> m_layer;
125 NTuple::Array<int> m_sheet;
126 NTuple::Array<double> m_phi;
127 NTuple::Array<double> m_v;
128};
129#endif
130
131//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4TDigiCollection< BesCgemDigi > BesCgemDigisCollection
Definition: BesCgemDigi.hh:91
virtual void Digitize()
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)
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 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)
Definition: G4Svc.h:32