00001
00011
00012 #include "BesTofDigitizerEcV3.hh"
00013 #include "BesTofHit.hh"
00014 #include "G4DigiManager.hh"
00015 #include "G4RunManager.hh"
00016 #include "Randomize.hh"
00017 #include "G4Poisson.hh"
00018 #include "BesTofDigi.hh"
00019 #include "BesTofGeoParameter.hh"
00020 #include "GaudiKernel/ISvcLocator.h"
00021 #include "GaudiKernel/Bootstrap.h"
00022 #include "GaudiKernel/IDataProviderSvc.h"
00023 #include "G4Svc/IG4Svc.h"
00024 #include "G4Svc/G4Svc.h"
00025 #include "TH1F.h"
00026 #include "TNtuple.h"
00027 #include "TFile.h"
00028 #include "TMath.h"
00029 #include <unistd.h>
00030
00031 BesTofDigitizerEcV3::BesTofDigitizerEcV3()
00032 {
00033 ReadData();
00034 m_timeBinSize = 0.005;
00035
00036
00037
00038
00039
00040
00041
00042
00043 ISvcLocator* svcLocator = Gaudi::svcLocator();
00044 IG4Svc* tmpSvc;
00045 StatusCode sc = svcLocator->service("G4Svc", tmpSvc);
00046 if(!sc.isSuccess())
00047 {
00048 std::cout << " Could not initialize Realization Service in BesTofDigitizerBrV2" << std::endl;
00049 }
00050 else
00051 {
00052 m_G4Svc = dynamic_cast<G4Svc *>(tmpSvc);
00053 }
00054
00055
00056 IRealizationSvc *tmpReal;
00057 StatusCode scReal = svcLocator->service("RealizationSvc",tmpReal);
00058 if (!scReal.isSuccess())
00059 {
00060 std::cout << " Could not initialize Realization Service in BesTofDigitizerEcV3" << std::endl;
00061 }
00062 else
00063 {
00064 m_RealizationSvc = dynamic_cast<RealizationSvc*>(tmpReal);
00065 }
00066
00067
00068
00069 for(int i=0;i<50;i++)
00070 {
00071 for(int j=0;j<10;j++)
00072 {
00073 for(int k=0;k<10;k++)
00074 {
00075 for(int m=0;m<num1;m++)
00076 {
00077
00078 propTime[i][j][k][m] = 0;
00079 prob[i][j][k][m] = 0;
00080 eff[i][j][k] = 0;
00081 }
00082 }
00083 }
00084 }
00085
00086 ReadEffTree();
00087 G4cout << "ETofSim: Reading nTuples of is completed." << G4endl;
00088 }
00089
00090 void BesTofDigitizerEcV3::ReadData()
00091 {
00092 BesTofGeoParameter* tofPara = BesTofGeoParameter::GetInstance();
00093
00094 m_ecR1 = tofPara->GetEcR1();
00095 m_tau1Ec = tofPara->GetTau1Ec();
00096 m_tau2Ec = tofPara->GetTau2Ec();
00097 m_tau3Ec = tofPara->GetTau3Ec();
00098 m_tauRatioEc = tofPara->GetTauRatioEc();
00099 m_refIndexEc = tofPara->GetRefIndexEc();
00100 m_phNConstEc = tofPara->GetPhNConstEc();
00101 m_Cpe2pmtEc = tofPara->GetCpe2pmtEc();
00102 m_rAngleEc = tofPara->GetRAngleEc();
00103 m_QEEc = tofPara->GetQEEc();
00104 m_CEEc = tofPara->GetCEEc();
00105 m_peCorFacEc = tofPara->GetPeCorFacEc();
00106 m_attenEc = tofPara->GetAttenEc();
00107
00108 m_ttsMeanEc = tofPara->GetTTSmeanEc();
00109 m_ttsSigmaEc = tofPara->GetTTSsigmaEc();
00110 m_PMTgainEc = tofPara->GetPMTgainEc();
00111 m_CeEc = tofPara->GetCeEc();
00112 m_riseTimeEc = tofPara->GetRiseTimeEc();
00113 m_LLthreshEc = tofPara->GetLLthreshEc();
00114 m_HLthreshEc = tofPara->GetHLthreshEc();
00115 m_preGainEc = tofPara->GetPreGainEc();
00116 m_noiseSigmaEc = tofPara->GetNoiseSigmaEc();
00117
00118
00119
00120 }
00121
00122
00123 void BesTofDigitizerEcV3::ReadEffTree()
00124 {
00125 int rBin,phiBin,zBin;
00126 const int nR = 43;
00127 const int nPhi = 6;
00128 const int nZ = 6;
00129 float efficiency0,x[400],y[400];
00130
00131
00132 G4String dataPath = getenv("TOFSIMROOT");
00133 if(!dataPath)
00134 {
00135 G4Exception("Boss environment is not set!");
00136 }
00137
00138 char treePath[200];
00139 G4int runId = m_RealizationSvc->getRunId();
00140 if(runId>=-80000 && runId<=-9484)
00141 {
00142
00143 sprintf(treePath,"%s/dat/effTree_1600mm.root",dataPath.c_str());
00144 }
00145 else
00146 {
00147
00148 sprintf(treePath,"%s/dat/effTree_1600mm.root",dataPath.c_str());
00149 }
00150
00151 TFile *f = new TFile(treePath, "read");
00152 TTree *t = (TTree*)f->Get("effTree");
00153
00154 t->SetBranchAddress("rBin", &rBin);
00155 t->SetBranchAddress("phiBin", &phiBin);
00156 t->SetBranchAddress("zBin", &zBin);
00157 t->SetBranchAddress("efficiency0", &efficiency0);
00158 t->SetBranchAddress("x", x);
00159 t->SetBranchAddress("y", y);
00160
00161 int r,phi,z;
00162 for (Int_t i = 0; i < nR*nPhi*nZ; i++){
00163 t->GetEntry(i);
00164 r = rBin;
00165 phi = phiBin;
00166 z = zBin;
00167 eff[r][phi][z] = efficiency0;
00168 for (Int_t j = 0; j < 400; j++){
00169 propTime[r][phi][z][j] = x[j];
00170 prob[r][phi][z][j] = y[j];
00171
00172 }
00173 }
00174
00175 }
00176
00177 BesTofDigitizerEcV3::~BesTofDigitizerEcV3()
00178 {;}
00179
00180 void BesTofDigitizerEcV3::Digitize(ScintSingle* scint, BesTofDigitsCollection* DC)
00181 {
00182 m_beamTime = m_G4Svc->GetBeamTime() * ns;
00183 m_besTofDigitsCollection = DC;
00184
00185 G4DigiManager* digiManager = G4DigiManager::GetDMpointer();
00186
00187 G4int THCID = digiManager->GetHitsCollectionID("BesTofHitsCollection");
00188 m_THC = (BesTofHitsCollection*) (digiManager->GetHitsCollection(THCID));
00189
00190 if (m_G4Svc->TofRootFlag())
00191 {
00192 m_eTotal = 0;
00193 m_nDigi = 0;
00194 m_partIdMPV = -9;
00195 m_scinNbMPV = -9;
00196 m_edepMPV = 0;
00197 m_nDigiOut = 0;
00198 }
00199
00200 if (m_THC)
00201 {
00202
00203 G4int partId, scinNb, nHits;
00204 G4double edep;
00205 BesTofHit* hit;
00206 partId=scint->GetPartId();
00207 scinNb=scint->GetScinNb();
00208 edep = scint->GetEdep();
00209 nHits=scint->GetHitIndexes()->size();
00210
00211 TofPmtInit();
00212
00213
00214 if (m_G4Svc->TofRootFlag())
00215 {
00216 if (edep>m_edepMPV)
00217 {
00218 m_partIdMPV = partId;
00219 m_scinNbMPV = scinNb;
00220 m_edepMPV = edep;
00221 }
00222 m_eTotal += edep;
00223 m_nDigi ++;
00224
00225 m_partId = partId;
00226 m_scinNb = scinNb;
00227 m_edep = edep;
00228 m_nHits = nHits;
00229 }
00230
00231 if (edep>0.01)
00232 {
00233 for (G4int j=0;j<nHits;j++)
00234 {
00235 hit= (*m_THC)[( *(scint->GetHitIndexes()) )[j]];
00236 TofPmtAccum(hit);
00237 }
00238
00239 if (m_G4Svc->TofRootFlag())
00240 {
00241 m_time1st0=m_t1st[0];
00242 m_time1st1=m_t1st[1];
00243 m_timelast0=m_tLast[0];
00244 m_timelast1=m_tLast[1];
00245 m_totalPhot0=m_totalPhot[0];
00246 m_totalPhot1=m_totalPhot[1];
00247 }
00248
00249
00250 TofPmtRspns(partId,scinNb);
00251
00252 G4double temp0 = m_ADC[0]+m_TDC[0];
00253 G4double temp1 = m_ADC[1]+m_TDC[1];
00254
00255 if ( (partId!=1) && temp0>0. )
00256 {
00257 BesTofDigi* digi = new BesTofDigi;
00258 digi->SetTrackIndex(m_trackIndex);
00259 digi->SetPartId(partId);
00260 digi->SetScinNb(scinNb);
00261 digi->SetForwADC( m_ADC[0]) ;
00262 digi->SetBackADC( m_ADC[1]) ;
00263 if (m_TDC[0]>0.)
00264 m_TDC[0] = m_TDC[0]+m_beamTime;
00265 digi->SetForwTDC( m_TDC[0]) ;
00266 digi->SetBackTDC( m_TDC[1]) ;
00267
00268
00269
00270 m_besTofDigitsCollection->insert(digi);
00271 if (m_G4Svc->TofRootFlag() )
00272 m_nDigiOut++;
00273 }
00274 if (m_G4Svc->TofRootFlag() )
00275 m_tupleTof1->write();
00276
00277 }
00278
00279 }
00280 if (m_G4Svc->TofRootFlag())
00281 m_tupleTof2->write();
00282
00283
00284 }
00285
00286 void BesTofDigitizerEcV3::TofPmtInit()
00287 {
00288 m_ADC[0] = -999.;
00289 m_ADC[1] = -999.;
00290 m_TDC[0] = -999.;
00291 m_TDC[1] = -999.;
00292 m_trackIndex = -999;
00293 m_globalTime = 9999;
00294
00295 m_t1st[0]=100;
00296 m_t1st[1]=100;
00297 m_tLast[0]=0.;
00298 m_tLast[1]=0;
00299 m_totalPhot[0]=0;
00300 m_totalPhot[1]=0;
00301 for (G4int i=0;i<2;i++)
00302 for (G4int j=0;j<m_profBinNEcV3;j++)
00303 m_nPhot[j][i]=0;
00304
00305 if (m_G4Svc->TofRootFlag())
00306 {
00307 m_partId = -9;
00308 m_scinNb = -9;
00309 m_edep = 0;
00310 m_nHits = 0;
00311 m_time1st0 = 100;
00312 m_time1st1 = 100;
00313 m_timelast0 = 0;
00314 m_timelast1 = 0;
00315 m_totalPhot0 = 0;
00316 m_totalPhot1 = 0;
00317 m_NphAllSteps = 0;
00318 m_max0 = 0;
00319 m_max1 = 0;
00320 m_tdc0 = -999;
00321 m_adc0 = -999;
00322 m_tdc1 = -999;
00323 m_adc1 = -999;
00324 }
00325
00326 }
00327
00328 void BesTofDigitizerEcV3::TofPmtAccum(BesTofHit* hit)
00329 {
00330 G4double cvelScint = c_light/m_refIndexEc;
00331
00332 G4ThreeVector pos = hit->GetPos();
00333 G4int trackIndex = hit->GetTrackIndex();
00334 G4int partId = hit->GetPartId();
00335 G4double edep = hit->GetEdep();
00336 G4double stepL = hit->GetStepL();
00337
00338 G4double deltaT=hit->GetDeltaT();
00339 G4double timeFlight=hit->GetTime()-m_beamTime;
00340 if (timeFlight < m_globalTime)
00341 {
00342 m_globalTime = timeFlight;
00343 m_trackIndex = trackIndex;
00344 }
00345
00346 G4ThreeVector pDirection=hit->GetPDirection();
00347 G4double nx=pDirection.x();
00348 G4double ny=pDirection.y();
00349 G4double nz=pDirection.z();
00350
00351
00352
00353 G4int NphStep;
00354 G4double nMean, nPhoton;
00355 nMean = m_phNConstEc*BirksLaw(hit);
00356
00357 if(nMean>10)
00358 {
00359 G4double resolutionScale=1.;
00360 G4double sigma=resolutionScale*sqrt(nMean);
00361 nPhoton=G4int(G4RandGauss::shoot(nMean,sigma)+0.5);
00362 }
00363 else
00364 nPhoton=G4int(G4Poisson(nMean));
00365
00366
00367 NphStep=G4int(nPhoton*0.66*m_QEEc*m_CEEc);
00368
00369
00370
00371 if (m_G4Svc->TofRootFlag())
00372 m_NphAllSteps += G4int(nPhoton*0.66*m_QEEc*m_CEEc);
00373
00374 if (NphStep>0)
00375 {
00376 for (G4int i=0;i<NphStep;i++)
00377 {
00378
00379 G4double ddS, ddT;
00380 ddS=stepL*G4UniformRand();
00381 ddT=deltaT*G4UniformRand();
00382 G4ThreeVector emtPos;
00383 emtPos.setX(pos.x() + nx*ddS);
00384 emtPos.setY(pos.y() + ny*ddS);
00385 emtPos.setZ(pos.z() + nz*ddS);
00386
00387
00388 G4double radius = sqrt(emtPos.x()*emtPos.x()+emtPos.y()*emtPos.y())-m_ecR1;
00389 const G4double pie = 2.*asin(1.);
00390 G4double phi;
00391 if(emtPos.x()>0 && emtPos.y()>0)
00392 phi = atan(emtPos.y()/emtPos.x());
00393 else if(emtPos.x()==0 && emtPos.y()>0)
00394 phi = pie/2.;
00395 else if(emtPos.x()<0)
00396 phi = atan(emtPos.y()/emtPos.x())+pie;
00397 else if(emtPos.x()==0 && emtPos.y()<0)
00398 phi = 1.5*pie;
00399 else if(emtPos.x()>0 && emtPos.y()<0)
00400 phi = 2.*pie+atan(emtPos.y()/emtPos.x());
00401 phi = phi*180./pie;
00402 G4double z = fabs(emtPos.z());
00403
00404
00405 G4int rBin = G4int(radius/10.);
00406 G4double resPhi = phi-(G4int(phi/7.5)*7.5);
00407 G4int phiBin = G4int(resPhi/1.25);
00408 G4int zBin = G4int((z-1332.)/8.);
00409
00410
00411
00412 G4int forb = 0;
00413 G4double transpTime = 0;
00414 G4double pathL = 0;
00415 G4double efficiency1;
00416 G4double efficiency2;
00417 efficiency1 = G4RandGauss::shoot(0,0.004);
00418 if(rBin>=0&&rBin<=nR && phiBin>=0&& phiBin<=nPhi && zBin>=0&&zBin<=nZ)
00419 efficiency1 += eff[rBin][phiBin][zBin];
00420 else
00421 efficiency1 = 0;
00422
00423 if(m_attenEc==0)
00424 {
00425 G4cout <<" ERROR: Attenuation Length is null!" << G4endl;
00426 break;
00427 }
00428
00429 if(G4UniformRand() <= efficiency1)
00430 {
00431 DirectPh(rBin, phiBin, zBin, transpTime);
00432
00433 }
00434
00435
00436
00437
00438
00439 if(transpTime>0)
00440 {
00441
00442 G4double scinSwim = transpTime;
00443
00444 G4double scinTime = Scintillation(partId);
00445
00446
00447 G4double transitTime = TransitTime();
00448
00449 G4double endTime = timeFlight + ddT + scinSwim + scinTime + transitTime;
00450
00451 if (m_G4Svc->TofRootFlag())
00452 {
00453
00454 m_timeFlight = timeFlight+ddT;
00455 m_ddT = ddT;
00456 m_scinSwim = scinSwim;
00457 m_scinTime = scinTime;
00458 m_transitTime = transitTime;
00459 m_endTime = endTime;
00460 m_tupleTof3->write();
00461 }
00462
00463
00464 AccuSignal(endTime, forb);
00465
00466
00467 if (m_t1st[forb]>endTime) m_t1st[forb] = endTime;
00468 if (m_tLast[forb]<endTime) m_tLast[forb]= endTime;
00469
00470
00471 }
00472 }
00473 }
00474 }
00475
00476 G4double BesTofDigitizerEcV3::BirksLaw(BesTofHit* hit)
00477 {
00478 const G4double kappa = 0.015*cm/MeV;
00479 const G4String brMaterial = "BC404";
00480 G4double dE = hit->GetEdep();
00481
00482 G4double dX = hit->GetStepL();
00483
00484 G4double charge = hit->GetCharge();
00485 G4double cor_dE = dE;
00486
00487 if(charge!=0.&& dX!=0.)
00488 {
00489 cor_dE = dE/(1+kappa*dE/dX);
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502 }
00503 return cor_dE;
00504
00505 }
00506
00507 void BesTofDigitizerEcV3::DirectPh(G4int rBin, G4int phiBin, G4int zBin, G4double& t)
00508 {
00509 G4double ran = G4UniformRand();
00510 G4double p = 0;
00511 G4int nth = 1;
00512 G4int key = 0;
00513 t = 0;
00514 while(1)
00515 {
00516 if(p>ran||nth==400)
00517 {
00518 key = nth;
00519
00520 break;
00521 }
00522 p = p + prob[rBin][phiBin][zBin][nth];
00523 nth++;
00524 }
00525 t = propTime[rBin][phiBin][zBin][key-1];
00526 }
00527
00528 G4double BesTofDigitizerEcV3::Scintillation(G4int partId)
00529 {
00530 G4double tmp_tauRatio,tmp_tau1,tmp_tau2,tmp_tau3;
00531 tmp_tauRatio = m_tauRatioEc;
00532 tmp_tau1 = m_tau1Ec;
00533 tmp_tau2 = m_tau2Ec;
00534 tmp_tau3 = m_tau3Ec;
00535
00536 G4double UniformR = tmp_tauRatio/(1+tmp_tauRatio);
00537 G4double EmissionTime;
00538 if (G4UniformRand()>UniformR) {
00539 while (1) {
00540 EmissionTime = -tmp_tau2*log( G4UniformRand() );
00541 if (G4UniformRand()-exp(EmissionTime/tmp_tau2-EmissionTime/tmp_tau1)>1.E-8)
00542 break;
00543 }
00544 }
00545 else EmissionTime = -tmp_tau3*log( G4UniformRand() );
00546 return EmissionTime;
00547 }
00548
00549 G4double BesTofDigitizerEcV3::TransitTime()
00550 {
00551
00552
00553 return G4RandGauss::shoot(m_ttsMeanEc,m_ttsSigmaEc);
00554 }
00555
00556 void BesTofDigitizerEcV3::AccuSignal(G4double endTime, G4int forb)
00557 {
00558 G4int ihst;
00559 ihst=G4int(endTime/m_timeBinSize);
00560 if (ihst>0 &&ihst<m_profBinNEcV3)
00561 {
00562 m_nPhot[ihst][forb]=m_nPhot[ihst][forb]+1;
00563 m_totalPhot[forb]=m_totalPhot[forb]+1;
00564 }
00565 }
00566
00567 void BesTofDigitizerEcV3::TofPmtRspns(G4int partId, G4int scinNb)
00568 {
00569
00570
00571 static G4double snpe[m_snpeBinNEcV3];
00572 static G4int istore_snpe=-1;
00573
00574
00575
00576 G4double tau = m_riseTimeEc;
00577 G4double norma_const=sqrt(M_PI)*tau*tau*tau/4.0;
00578 G4double echarge=1.6e-7;
00579
00580
00581 G4double profPmt[m_profBinNEcV3][2];
00582
00583 G4double t;
00584 G4int n1, n2, ii;
00585 G4int phtn;
00586
00587 if (istore_snpe<0)
00588 {
00589 istore_snpe = 1;
00590 for (G4int i=0;i<m_snpeBinNEcV3;i++)
00591 {
00592 t=(i+1)*m_timeBinSize;
00593 snpe[i]=m_CeEc*t*t*exp(- (t/tau) * (t/tau) )/norma_const;
00594 }
00595 }
00596
00597 G4int fb=1;
00598
00599 G4double tmpADC[2] = {0,0};
00600
00601 for (G4int j=0; j<fb; j++)
00602 {
00603 if (m_totalPhot[j] > 0)
00604 {
00605 n1=G4int(m_t1st[j]/m_timeBinSize);
00606 n2=G4int(m_tLast[j]/m_timeBinSize);
00607
00608 for (G4int i=0;i<m_profBinNEcV3;i++)
00609 profPmt[i][j]=0.0;
00610
00611
00612 n2 = n2<m_profBinNEcV3 ? n2:m_profBinNEcV3;
00613 for (G4int i=n1;i<n2;i++)
00614 {
00615 phtn=m_nPhot[i][j];
00616 if (phtn>0)
00617 {
00618 G4double Npoisson;
00619 while(1) {
00620 Npoisson=G4Poisson(10.0);
00621 if(Npoisson>0) break;
00622 }
00623 G4double tmpPMTgain;
00624 while(1) {
00625 m_PMTgainEc = m_tofSimSvc->EndPMTGain();
00626 tmpPMTgain=G4RandGauss::shoot(m_PMTgainEc,m_PMTgainEc/sqrt(Npoisson));
00627
00628 if(tmpPMTgain>0) break;
00629 }
00630 tmpADC[j]+=phtn*tmpPMTgain;
00631
00632 for (G4int ihst=0; ihst<m_snpeBinNEcV3; ihst++)
00633 {
00634 ii=i+ihst;
00635 if (ii<m_profBinNEcV3)
00636 profPmt[ii][j] += tmpPMTgain*phtn*snpe[ihst];
00637 else
00638 break;
00639 }
00640 }
00641 }
00642
00643
00644 for (int i=0;i<m_profBinNEcV3;i++)
00645 {
00646 if (profPmt[i][j]>0)
00647 profPmt[i][j] = m_preGainEc*profPmt[i][j]+G4RandGauss::shoot(0,m_noiseSigmaEc);
00648 }
00649
00650
00651 G4double max=0;
00652 for (int i=n1;i<m_profBinNEcV3;i++)
00653 {
00654 if (profPmt[i][j]>max)
00655 max=profPmt[i][j];
00656 }
00657 if (m_G4Svc->TofRootFlag())
00658 {
00659 if (j==0) m_max0=max;
00660 else m_max1=max;
00661 }
00662
00663
00664 G4double tmp_HLthresh, tmp_LLthresh, ratio;
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682 G4double adcFactor = 3.35;
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693 tmp_HLthresh = m_tofSimSvc->EndHighThres();
00694 tmp_LLthresh = m_tofSimSvc->EndLowThres();
00695 ratio = m_tofSimSvc->EndConstant();
00696
00697
00698 if (max>=tmp_HLthresh)
00699 {
00700 for (int i=0;i<m_profBinNEcV3;i++)
00701 {
00702 if ( profPmt[i][j] >= tmp_LLthresh )
00703 {
00704 m_TDC[j] = i*m_timeBinSize + G4RandGauss::shoot(0,0.025);
00705 G4double NoiseSigma;
00706 G4int EndNoiseSwitch = int(m_tofSimSvc->EndNoiseSwitch());
00707
00708 switch (EndNoiseSwitch) {
00709 case 0:
00710 NoiseSigma = 0.;
00711 break;
00712 case 1:
00713 if (partId==0) { NoiseSigma = m_tofSimSvc->EndNoiseSmear(scinNb); }
00714 if (partId==2) { NoiseSigma = 0.; }
00715 break;
00716 case 2:
00717 if (partId==0) { NoiseSigma = m_tofSimSvc->EndNoiseSmear(scinNb); }
00718 if (partId==2) { NoiseSigma = m_tofSimSvc->EndNoiseSmear(scinNb+48.); }
00719 break;
00720 }
00721
00722 m_TDC[j] = m_TDC[j] + G4RandGauss::shoot(0,NoiseSigma);
00723
00724
00725
00726 if( m_G4Svc->TofSaturationFlag())
00727 {
00728 double x = tmpADC[j]*m_preGainEc*echarge*ratio;
00729 int id;
00730 if (partId==0) { id = scinNb;}
00731 if (partId==2) { id = scinNb+48;}
00732
00733 m_ADC[j] = m_tofQElecSvc->EQChannel(id,x);
00734 }
00735 else
00736 m_ADC[j] = tmpADC[j]*m_preGainEc*echarge*adcFactor;
00737
00738 if (m_G4Svc->TofRootFlag())
00739 {
00740 if (j==0) {
00741 m_tdc0 = m_TDC[0];
00742 m_adc0 = m_ADC[0];
00743 }
00744 else {
00745 m_tdc1 = m_TDC[1];
00746 m_adc1 = m_ADC[1];
00747 }
00748 }
00749 break;
00750 }
00751 }
00752 }
00753 }
00754 }
00755 }
00756