BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTofDigitizerV.cc
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Description:
5//Author: Dengzy
6//Created: Mar, 2004
7//Modified:
8//Comment:
9//---------------------------------------------------------------------------//
10//$Id: BesTofDigitizerV.cc
11
12#include "GaudiKernel/ISvcLocator.h"
13#include "GaudiKernel/Bootstrap.h"
14#include "GaudiKernel/MsgStream.h"
15
16#include "BesTofDigitizerV.hh"
17#include "BesTofDigi.hh"
18#include "BesTofHit.hh"
19#include "G4DigiManager.hh"
20#include "BesTofGeoParameter.hh"
21#include "Randomize.hh"
22
24
25NTuple::Tuple* BesTofDigitizerV::m_tupleTof1 = 0;
26NTuple::Item<double> BesTofDigitizerV::m_partId;
27NTuple::Item<double> BesTofDigitizerV::m_scinNb;
28NTuple::Item<double> BesTofDigitizerV::m_edep;
29NTuple::Item<double> BesTofDigitizerV::m_nHits;
30NTuple::Item<double> BesTofDigitizerV::m_time1st0;
31NTuple::Item<double> BesTofDigitizerV::m_time1st1;
32NTuple::Item<double> BesTofDigitizerV::m_timelast0;
33NTuple::Item<double> BesTofDigitizerV::m_timelast1;
34NTuple::Item<double> BesTofDigitizerV::m_totalPhot0;
35NTuple::Item<double> BesTofDigitizerV::m_totalPhot1;
36NTuple::Item<double> BesTofDigitizerV::m_NphAllSteps;
37NTuple::Item<double> BesTofDigitizerV::m_max0;
38NTuple::Item<double> BesTofDigitizerV::m_max1;
39NTuple::Item<double> BesTofDigitizerV::m_tdc0;
40NTuple::Item<double> BesTofDigitizerV::m_adc0;
41NTuple::Item<double> BesTofDigitizerV::m_tdc1;
42NTuple::Item<double> BesTofDigitizerV::m_adc1;
43
44NTuple::Tuple* BesTofDigitizerV::m_tupleTof2 = 0;
45NTuple::Item<double> BesTofDigitizerV::m_eTotal;
46NTuple::Item<double> BesTofDigitizerV::m_nDigi;
47NTuple::Item<double> BesTofDigitizerV::m_partIdMPV;
48NTuple::Item<double> BesTofDigitizerV::m_scinNbMPV;
49NTuple::Item<double> BesTofDigitizerV::m_edepMPV;
50NTuple::Item<double> BesTofDigitizerV::m_nDigiOut;
51
52NTuple::Tuple* BesTofDigitizerV::m_tupleTof3 = 0;
53NTuple::Item<double> BesTofDigitizerV::m_forb;
54NTuple::Item<double> BesTofDigitizerV::m_timeFlight;
55NTuple::Item<double> BesTofDigitizerV::m_ddT;
56NTuple::Item<double> BesTofDigitizerV::m_scinSwim;
57NTuple::Item<double> BesTofDigitizerV::m_scinTime;
58NTuple::Item<double> BesTofDigitizerV::m_transitTime;
59NTuple::Item<double> BesTofDigitizerV::m_endTime;
60
61NTuple::Item<double> BesTofDigitizerV::m_edepHit;
62
63
64//NTuple::Tuple* BesTofDigitizerV::m_tupleTof4 = 0;//Write out the basic information for the Mrpc Digitizer
65//NTuple::Item<double> BesTofDigitizerV::m_partIdmrpc;
66//NTuple::Item<double> BesTofDigitizerV::m_stripidentifier;
67//NTuple::Item<double> BesTofDigitizerV::m_trackindex;
68//NTuple::Item<double> BesTofDigitizerV::m_signal_pc;
69//NTuple::Item<double> BesTofDigitizerV::m_time_threshold;
70//NTuple::Item<double> BesTofDigitizerV::m_time_1sthit;
71//NTuple::Item<double> BesTofDigitizerV::m_time_1;
72//NTuple::Item<double> BesTofDigitizerV::m_time_2;
73//NTuple::Item<double> BesTofDigitizerV::m_firedstrip;
74//NTuple::Item<double> BesTofDigitizerV::m_numberions;
75
76
77
78
79
80
81
82
84{
85 IMessageSvc* msgSvc;
86 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
87 MsgStream log(msgSvc, "BesTofDigitizerBrV1");
88
89 ISvcLocator* svcLocator = Gaudi::svcLocator();
90// StatusCode scc = svcLocator->service("TofCaliSvc", m_tofCaliSvc);
91// if (scc == StatusCode::SUCCESS) {
92// log << MSG::INFO << "TofSim Gets TofCaliSvc Service Sucessfully!! " << endreq;
93// }
94// else {
95// log << MSG::ERROR << "TofSim Gets TofCaliSvc Service Failed !! " << endreq;
96// }
97
98 StatusCode sim_scc = svcLocator->service("TofSimSvc", m_tofSimSvc);
99 if (sim_scc == StatusCode::SUCCESS) {
100 log << MSG::INFO << "TofSim Gets TofSimSvc Service Sucessfully!! " << endreq;
101 }
102 else {
103 log << MSG::ERROR << "TofSim Gets TofSimSvc Service Failed !! " << endreq;
104 }
105 StatusCode qelec_scc = svcLocator->service("TofQElecSvc", m_tofQElecSvc);
106 if (qelec_scc == StatusCode::SUCCESS) {
107 log << MSG::INFO << "TofRec Gets tofQElecSvc Sucessfully!! " << endreq;
108 }
109 else {
110 log << MSG::ERROR << "TofRec Gets tofQElecSvc Failed !! " << endreq;
111 }
112
113
114
115 //retrieve G4Svc
116 IG4Svc* tmpSvc;
117 StatusCode sc = svcLocator->service("G4Svc", tmpSvc);
118 m_G4Svc = dynamic_cast<G4Svc *>(tmpSvc);
119
120
121
122 //get Tof Ntuple from G4Svc
123 if (m_G4Svc->TofRootFlag() && (!m_booked))
124 {
125
126
127 m_tupleTof1 = m_G4Svc->GetTupleTof1();
128
129 sc = m_tupleTof1->addItem("partId",m_partId);
130 sc = m_tupleTof1->addItem("scinNb",m_scinNb);
131 sc = m_tupleTof1->addItem("edep",m_edep);
132 sc = m_tupleTof1->addItem("nHits",m_nHits);
133 sc = m_tupleTof1->addItem("time1st0",m_time1st0);
134 sc = m_tupleTof1->addItem("time1st1",m_time1st1);
135 sc = m_tupleTof1->addItem("timelast0",m_timelast0);
136 sc = m_tupleTof1->addItem("timelast1",m_timelast1);
137 sc = m_tupleTof1->addItem("totalPhot0",m_totalPhot0);
138 sc = m_tupleTof1->addItem("totalPhot1",m_totalPhot1);
139 sc = m_tupleTof1->addItem("NphAllSteps",m_NphAllSteps);
140 sc = m_tupleTof1->addItem("max0",m_max0);
141 sc = m_tupleTof1->addItem("max1",m_max1);
142 sc = m_tupleTof1->addItem("tdc0",m_tdc0);
143 sc = m_tupleTof1->addItem("adc0",m_adc0);
144 sc = m_tupleTof1->addItem("tdc1",m_tdc1);
145 sc = m_tupleTof1->addItem("adc1",m_adc1);
146
147
148
149 m_tupleTof2 = m_G4Svc->GetTupleTof2();
150 sc = m_tupleTof2->addItem("eTotal",m_eTotal);
151 sc = m_tupleTof2->addItem("nDigi",m_nDigi);
152 sc = m_tupleTof2->addItem("partIdMPV",m_partIdMPV);
153 sc = m_tupleTof2->addItem("scinNbMPV",m_scinNbMPV);
154 sc = m_tupleTof2->addItem("edepMPV",m_edepMPV);
155 sc = m_tupleTof2->addItem("nDigiOut",m_nDigiOut);
156 sc = m_tupleTof2->addItem("edepPerHit",m_edepHit);
157
158 m_tupleTof3 = m_G4Svc->GetTupleTof3();
159 //sc = m_tupleTof3->addItem("forb",m_forb);
160 sc = m_tupleTof3->addItem("timeFlight",m_timeFlight);
161 sc = m_tupleTof3->addItem("ddT",m_ddT);
162 sc = m_tupleTof3->addItem("scinSwim",m_scinSwim);
163 sc = m_tupleTof3->addItem("scinTime",m_scinTime);
164 sc = m_tupleTof3->addItem("transitTime",m_transitTime);
165 sc = m_tupleTof3->addItem("endTime",m_endTime);
166
167
168 //m_tupleTof4 = m_G4Svc->GetTupleTof4();
169 //sc = m_tupleTof4->addItem("partID",m_partIdmrpc);
170 //sc = m_tupleTof4->addItem("stripidentifier",m_stripidentifier);
171 //sc = m_tupleTof4->addItem("trackindex",m_trackindex);
172 //sc = m_tupleTof4->addItem("signal_pc",m_signal_pc);
173 //sc = m_tupleTof4->addItem("time_threshold",m_time_threshold);
174 //sc = m_tupleTof4->addItem("time_1sthit",m_time_1sthit);
175 //sc = m_tupleTof4->addItem("time_1",m_time_1);
176 //sc = m_tupleTof4->addItem("time_2",m_time_2);
177 //sc = m_tupleTof4->addItem("firedstrip",m_firedstrip);
178 //sc = m_tupleTof4->addItem("numberions",m_numberions);
179
180
181 m_booked = true;
182 }
183
184}
185
187{;}
188
190{
191 for (G4int i=0;i<2;i++)
192 {
193 m_ADC[i] = -999;
194 m_TDC[i] = -999;
195 }
196 m_trackIndex = -999;
197 m_globalTime = 9999;
198}
199
IMessageSvc * msgSvc()
static NTuple::Item< double > m_partId
static NTuple::Tuple * m_tupleTof3
static NTuple::Item< double > m_tdc1
static NTuple::Item< double > m_max0
static NTuple::Item< double > m_ddT
static NTuple::Item< double > m_scinTime
static NTuple::Item< double > m_eTotal
static NTuple::Item< double > m_NphAllSteps
static NTuple::Item< double > m_timeFlight
static NTuple::Item< double > m_tdc0
static NTuple::Item< double > m_timelast1
static NTuple::Item< double > m_timelast0
ITofQElecSvc * m_tofQElecSvc
static NTuple::Item< double > m_scinSwim
static NTuple::Item< double > m_scinNb
static NTuple::Item< double > m_adc1
static NTuple::Tuple * m_tupleTof2
static NTuple::Item< double > m_edep
static NTuple::Item< double > m_totalPhot0
static NTuple::Item< double > m_endTime
static NTuple::Item< double > m_edepHit
ITofSimSvc * m_tofSimSvc
static NTuple::Item< double > m_scinNbMPV
static NTuple::Item< double > m_transitTime
static NTuple::Item< double > m_forb
static NTuple::Item< double > m_nDigi
static NTuple::Item< double > m_adc0
static bool m_booked
static NTuple::Item< double > m_nHits
static NTuple::Item< double > m_partIdMPV
static NTuple::Item< double > m_time1st1
static NTuple::Item< double > m_nDigiOut
static NTuple::Item< double > m_totalPhot1
static NTuple::Tuple * m_tupleTof1
static NTuple::Item< double > m_edepMPV
static NTuple::Item< double > m_max1
static NTuple::Item< double > m_time1st0
Definition: G4Svc.h:33
NTuple::Tuple * GetTupleTof3()
Definition: G4Svc.h:113
bool TofRootFlag()
Definition: G4Svc.h:126
NTuple::Tuple * GetTupleTof2()
Definition: G4Svc.h:110
NTuple::Tuple * GetTupleTof1()
Definition: G4Svc.h:107
Definition: IG4Svc.h:31