104{
105
106
107 G4Track* currentTrack = currentStep->GetTrack();
108 if(!currentTrack)
109 {
110 cout<<"Can't get currentTrack"<<endl;
111 return;
112 }
113 G4TrackStatus currentTrackStatus = currentTrack->GetTrackStatus();
114
115 int stepNumber = currentTrack->GetCurrentStepNumber();
116 if(msgFlag) cout<<"STEP "<<stepNumber<<":"<<endl;
117
118
119 Hep3Vector currentPosition = currentTrack->GetPosition();
120 Hep3Vector currentMomentum = currentTrack->GetMomentum();
121
122
123
124 G4VPhysicalVolume* oldVolume;
125 G4VPhysicalVolume* newVolume;
126 if(!currentTrack->GetTouchableHandle()) cout<<"Can't get currentTrack->GetTouchableHandle()"<<endl;
127 else oldVolume= currentTrack->GetTouchableHandle()->GetVolume();
128 if(!currentTrack->GetNextTouchableHandle()) cout<<"Can't get currentTrack->GetNextTouchableHandle()"<<endl;
129 else newVolume= currentTrack->GetNextTouchableHandle()->GetVolume();
130 if(!oldVolume) cout<<"Can't get oldVolume!"<<endl;
131
132
133 if(stepNumber>50000) {
134 cout<<"infinite steps in the track "<<endl;
135 currentTrack->SetTrackStatus(fStopAndKill); m_trackstop =true;
136 }
137
138 G4String ParticleName = currentTrack->GetDefinition()->GetParticleName();
139 double x_ = currentPosition.x();
140 double y_ = currentPosition.y();
141 double z_ = currentPosition.z();
142 bool inner = (oldVolume!=newVolume)&&(!( (fabs(x_)>=myMucR) || (fabs(y_)>=myMucR) || ((fabs(x_-y_)/sqrt(2.))>=myMucR) || ((fabs(x_+y_)/sqrt(2.))>=myMucR) || (fabs(z_)>=myMucZ)) );
143 bool mucdec = (fabs(x_)>=myMucR) || (fabs(y_)>=myMucR) || ((fabs(x_-y_)/sqrt(2.))>=myMucR) || ((fabs(x_+y_)/sqrt(2.))>=myMucR) || (fabs(z_)>=myMucZ);
144
145
146 if(currentTrackStatus == fAlive)
147 {
148
149 if(inner||mucdec)
150 {
151
152 double currentPoint[3]={currentPosition.x(),currentPosition.y(),currentPosition.z()};
153 double currentBfield[3]={0.0,0.0,0.0};
154 Hep3Vector currentB(0.0,0.0,1.0);
155 if(G4TransportationManager::GetTransportationManager())
156 {
157 G4FieldManager* fieldManager=G4TransportationManager::GetTransportationManager()->GetFieldManager();
158 if(fieldManager)
159 {
160 if(fieldManager->GetDetectorField())
161 {
162 fieldManager->GetDetectorField()->GetFieldValue(currentPoint,currentBfield);
163 currentB.set(currentBfield[0]/tesla,currentBfield[1]/tesla,currentBfield[2]/tesla);
164 if(msgFlag) cout<<"B:"<<currentB.x()<<","<<currentB.y()<<","<<currentB.z()<<endl;
165 }
166 }
167 }
168
169
170 G4Material* oldMaterial = oldVolume->GetLogicalVolume()->GetMaterial();
171 if(!oldMaterial) std::cout<<"Can't get oldMaterial"<<std::endl;
172 else CalculateChicc(oldMaterial);
173
174
175 if(!(extXpErr->
move(currentPosition,currentMomentum,currentB,1,chicc)))
176 if(msgFlag) cout<<"can not update Error Matrix!!"<<endl;
177
178
179 if(msgFlag)
180 {
181 cout<<"Volume name:"<<newVolume->GetName()<<endl;
182 cout<<"Volume number:"<<newVolume->GetCopyNo()<<endl;
183 cout<<"x:"<<currentPoint[0]<<"//y:"<<currentPoint[1]<<"//z:"<<currentPoint[2]
184 <<"||px:"<<currentMomentum.x()<<"//py:"<<currentMomentum.y()<<"//pz:"
185 <<currentMomentum.z()<<endl;
186 cout<<
"Error matrix is:"<<extXpErr->
get_err()<<endl;
187 cout<<"phi:"<<atan(currentPoint[1]/currentPoint[0])<<endl;
188 Hep3Vector nz(0.,0.,1.);
189 cout<<
"Projected z error:"<<extXpErr->
get_plane_err(currentMomentum.unit(),nz)
190 <<endl;
193 y = currentPoint[1];
195 Hep3Vector nt(-y/R,x/R,0.);
196 cout<<
"Projected phi error:"<<(extXpErr->
get_plane_err(currentMomentum.unit(),nt))/
R
197 <<endl<<endl;
198 }
199
200
201 Hep3Vector xVector(1.0,0,0);
202 Hep3Vector yVector(0,1.0,0);
203 Hep3Vector zVector(0,0,1.0);
204 Hep3Vector tzVector;
205 tzVector.setRThetaPhi(1.0,
M_PI/2.0,currentPosition.phi());
206 double r = currentPosition.perp();
207 double x = currentPosition.x();
208 double y = currentPosition.y();
209 double z = currentPosition.z();
210 G4String newVolumeName = newVolume->GetName();
211 G4String oldVolumeName = oldVolume->GetName();
212 G4StepPoint* postStepPoint = currentStep->GetPostStepPoint();
213 G4TouchableHistory* theTouchable = (G4TouchableHistory*)(postStepPoint->GetTouchable());
214 int newVolumeNumber=newVolume->GetCopyNo();
215
216
217 int help_mrpc_nb=-2;
218
219
220
221
222
223
224
225
226
227
228 if( (!myTofFlag) && (!myTof1Flag) && (newVolumeName.contains("Tof") ))
229 {
230 newVolumeNumber = -2;
231 double currentTrackLength = currentTrack->GetTrackLength();
232 double totalTrackLength = currentTrackLength + initialPath;
233
234
235
236 double localTime = currentTrack->GetLocalTime();
237
238 double totalTOF = localTime + initialTof;
239
240
241
242
243 if(myExtTrack)
244 {
245 double xError = extXpErr->
get_plane_err(currentMomentum.unit(),xVector);
246 double yError = extXpErr->
get_plane_err(currentMomentum.unit(),yVector);
247 double zError = extXpErr->
get_plane_err(currentMomentum.unit(),zVector);
248 double tzError= extXpErr->
get_plane_err(currentMomentum.unit(),tzVector);
249 myExtTrack->
SetTof1Data(currentPosition/10.0,currentMomentum/1000.0,newVolumeName,newVolumeNumber,totalTOF,totalTrackLength/10,myOutputSymMatrix(extXpErr->
get_err()),zError/10,tzError/10,xError/10,yError/10);
250 myTofFlag = true;
251 }
252 return;
253 }
254
255
256
257
258
259
260
261
262 if( (!myTof1Flag) && (newVolumeName=="logicalScinBr1" || newVolumeName.contains("ScinEc") ||
263 newVolumeName.contains("logical_sensitive_detector_east") || newVolumeName.contains("logical_sensitive_detector_west") ) )
264 {
265 double currentTrackLength = currentTrack->GetTrackLength();
266 double totalTrackLength = currentTrackLength+initialPath;
267
268 double localTime = currentTrack->GetLocalTime();
269 double totalTOF = localTime + initialTof;
270 myInTof1 = true;
271 myPathIntoTof1 = currentTrackLength;
272 if(msgFlag) cout << "myPathIntoTof1 = " << myPathIntoTof1 << endl;
273
274
275
276 newVolumeNumber=theTouchable->GetReplicaNumber(2);
277 help_mrpc_nb = theTouchable->GetReplicaNumber(3);
278
279 if(newVolumeName.contains("ScinEc")) {
280 newVolumeNumber=(95-newVolumeNumber)/2;
281 newVolumeNumber=newVolumeNumber+176;
282
283 if(newVolumeName.contains("East")) newVolumeNumber=newVolumeNumber+48;
284
285
286 }
287 else if( newVolumeName.contains("_west_1"))
288 {
289
290 newVolumeNumber = (help_mrpc_nb)*(-0.5)+18.5;
291
292 int partID_help =5;
295 {
298 }
299 else
300 {
303 }
304
305
306
307
308
309
310
311
312
313 }
314 else if(newVolumeName.contains("_east_1") )
315 {
316
317 newVolumeNumber = (help_mrpc_nb)*(0.5)+0.5;
318
319 int partID_help =4;
322 {
325 }
326 else
327 {
330 }
331
332
333
334
335
336
337
338
339
340 }
341
342 else if( newVolumeName.contains("_west_2"))
343 {
344 newVolumeNumber = (help_mrpc_nb)*(-0.5)+18;
345
346 int partID_help =6;
349 {
352 }
353 else
354 {
357 }
358
359
360
361
362
363
364
365
366
367 }
368 else if(newVolumeName.contains("_east_2") )
369 {
370 newVolumeNumber = (help_mrpc_nb)*(0.5)+1;
371
372 int partID_help =3;
375 {
378 }
379 else
380 {
383 }
384
385
386
387
388
389
390
391
392
393 }
394 else{ newVolumeNumber=(527-newVolumeNumber)/3;}
395
396
397
398 if(myExtTrack)
399 {
400 double xError = extXpErr->
get_plane_err(currentMomentum.unit(),xVector);
401 double yError = extXpErr->
get_plane_err(currentMomentum.unit(),yVector);
402 double zError = extXpErr->
get_plane_err(currentMomentum.unit(),zVector);
403 double tzError= extXpErr->
get_plane_err(currentMomentum.unit(),tzVector);
404 myExtTrack->
SetTof1Data(currentPosition/10,currentMomentum/1000,newVolumeName,newVolumeNumber,totalTOF,totalTrackLength/10,myOutputSymMatrix(extXpErr->
get_err()),zError/10,tzError/10,xError/10,yError/10);
405 myTof1Flag = true;
406 }
407 return;
408 }
409
410
411
412
413 if( myInTof1 && ( oldVolumeName=="logicalScinBr1" || oldVolumeName.contains("ScinEc") ||
414 newVolumeName.contains("logical_sensitive_detector_east") || newVolumeName.contains("logical_sensitive_detector_west")) ) {
415 myInTof1 = false;
416 myOutTof1 = true;
417 myPathOutTof1 = currentTrack->GetTrackLength();
418 myPathInTof1.push_back(myPathOutTof1 - myPathIntoTof1);
419 if(msgFlag) cout << "myPathOutTof1 = " << myPathOutTof1 << endl;
420 }
421
422 if( myOutTof1 && ( newVolumeName=="logicalScinBr1" || newVolumeName.contains("ScinEc") ||
423 newVolumeName.contains("logical_sensitive_detector_east") || newVolumeName.contains("logical_sensitive_detector_west")) ) {
424 myInTof1 = true;
425 myOutTof1 = false;
426 myPathIntoTof1 = currentTrack->GetTrackLength();
427 if(msgFlag) cout << "myPathIntoTof1 = " << myPathIntoTof1 << endl;
428 }
429
430
431
432
433 if( (!myTof2Flag) && newVolumeName=="logicalScinBr2" )
434 {
435 double currentTrackLength = currentTrack->GetTrackLength();
436 double totalTrackLength = currentTrackLength+initialPath;
437
438 double localTime = currentTrack->GetLocalTime();
439 double totalTOF = localTime + initialTof;
440 newVolumeNumber=(527-theTouchable->GetReplicaNumber(2))/3;
441
442 myInTof2 = true;
443 myPathIntoTof2 = currentTrackLength;
444 if(msgFlag) cout << "myPathIntoTof2 = " << myPathIntoTof2 << endl;
445
446 if(myExtTrack)
447 {
448 double xError = extXpErr->
get_plane_err(currentMomentum.unit(),xVector);
449 double yError = extXpErr->
get_plane_err(currentMomentum.unit(),yVector);
450 double zError = extXpErr->
get_plane_err(currentMomentum.unit(),zVector);
451 double tzError= extXpErr->
get_plane_err(currentMomentum.unit(),tzVector);
452 myExtTrack->
SetTof2Data(currentPosition/10,currentMomentum/1000,newVolumeName,newVolumeNumber,totalTOF,totalTrackLength/10,myOutputSymMatrix(extXpErr->
get_err()),zError/10,tzError/10,xError/10,yError/10);
453 myTof2Flag = true;
454 }
455 return;
456 }
457
458 if( myInTof2 && oldVolumeName=="logicalScinBr2" ) {
459 myInTof2 = false;
460 myOutTof2 = true;
461 myPathOutTof2 = currentTrack->GetTrackLength();
462 myPathInTof2.push_back(myPathOutTof2 - myPathIntoTof2);
463 if(msgFlag) cout << "myPathOutTof2 = " << myPathOutTof2 << endl;
464 }
465
466 if( myOutTof2 && newVolumeName=="logicalScinBr2" ) {
467 myInTof2 = true;
468 myOutTof2 = false;
469 myPathIntoTof2 = currentTrack->GetTrackLength();
470 if(msgFlag) cout << "myPathIntoTof2 = " << myPathIntoTof2 << endl;
471 }
472
473
474 if( (!myPhyEmcFlag) && (!myEmcFlag) && (newVolumeName=="EMC" || newVolumeName.contains("BSC") || newVolumeName=="EndPhi"))
475 {
476 newVolumeNumber = -2;
477 if(myExtTrack)
478 {
479
480 Hep3Vector
nPhi(-y/r,x/r,0.);
482
483 Hep3Vector aPosition = currentPosition;
484 double R = aPosition.r();
485 double aTheta = aPosition.theta();
486 aPosition.setTheta(aTheta + M_PI_2);
487 double errorTheta;
488 errorTheta =(extXpErr->
get_plane_err(currentMomentum.unit(),aPosition.unit()))/
R;
489 if(msgFlag) cout<<"Theta direction: "<<aPosition<<endl;
490 myExtTrack->
SetEmcData(currentPosition/10,currentMomentum/1000,newVolumeName,newVolumeNumber,errorTheta,errorPhi,myOutputSymMatrix(extXpErr->
get_err()));
491 }
492 myPhyEmcFlag = true;
493 return;
494 }
495
496
497 if(!myEmcPathFlag && newVolumeName.contains("Crystal") )
498 {
499 myPathIntoCrystal = currentTrack->GetTrackLength();
500
501 myEmcPathFlag = true;
502 }
503
504
505 if( (!myEmcFlag) && newVolumeName.contains("Crystal") )
506 {
507 if(myExtTrack)
508 {
509
510 int npart,ntheta,nphi;
511 if(currentTrack->GetNextTouchableHandle()->GetVolume(1)->GetName().contains("BSC")) {
512 npart=1;
513 std::istringstream thetaBuf((currentTrack->GetNextTouchableHandle()->GetVolume(1)->GetName()).substr(16,2));
514 thetaBuf >> ntheta ;
515 nphi = 308-currentTrack->GetNextTouchableHandle()->GetCopyNumber(2);
516 } else {
517 npart=2-2*currentTrack->GetNextTouchableHandle()->GetCopyNumber(3);
518 int endSector=currentTrack->GetNextTouchableHandle()->GetCopyNumber(2);
519 int endNb,endNbGDML;
520 std::istringstream thetaBuf((currentTrack->GetNextTouchableHandle()->GetVolume(0)->GetName()).substr(20,2));
521 thetaBuf >> endNb ;
525 }
526 ostringstream strEmc;
527 if(ntheta<10) {
528 strEmc<<"EmcPart"<<npart<<"Theta0"<<ntheta<<"Phi"<<nphi;
529 } else {
530 strEmc<<"EmcPart"<<npart<<"Theta"<<ntheta<<"Phi"<<nphi;
531 }
532
533
534 Hep3Vector
nPhi(-y/r,x/r,0.);
536
537 Hep3Vector aPosition = currentPosition;
538 double R = aPosition.r();
539 double aTheta = aPosition.theta();
540 aPosition.setTheta(aTheta + M_PI_2);
541 double errorTheta;
542 errorTheta =(extXpErr->
get_plane_err(currentMomentum.unit(),aPosition.unit()))/
R;
543 if(msgFlag) cout<<"Theta direction: "<<aPosition<<endl;
544 myExtTrack->
SetEmcData(currentPosition/10,currentMomentum/1000,strEmc.str(),
545
546 newVolumeNumber,errorTheta,errorPhi,myOutputSymMatrix(extXpErr->
get_err()));
547 }
548 myEmcFlag = true;
549 return;
550 }
551
552
553 if(myEmcPathFlag && oldVolumeName.contains("Crystal") )
554 {
555 myPathOutCrystal = currentTrack->GetTrackLength();
556 myPathInCrystal = myPathInCrystal+myPathOutCrystal-myPathIntoCrystal;
557
558 myEmcPathFlag=false;
559 }
560
561
562
563 if( (!myMucFlag) && ( (fabs(x)>=myMucR) || (fabs(y)>=myMucR) || ((fabs(x-y)/sqrt(2.))>=myMucR) || ((fabs(x+y)/sqrt(2.))>=myMucR) || (fabs(z)>=myMucZ) ) )
564 {
565 int newVolumeNumber = newVolume->GetCopyNo();
566 if(myExtTrack)
567 {
568 Hep3Vector xVector(1.0,0,0);
569 Hep3Vector yVector(0,1.0,0);
570 Hep3Vector zVector(0,0,1.0);
571 double xError = extXpErr->
get_plane_err(currentMomentum.unit(),xVector);
572 double yError = extXpErr->
get_plane_err(currentMomentum.unit(),yVector);
573 double zError = extXpErr->
get_plane_err(currentMomentum.unit(),zVector);
574 double tzError;
575 double phi = currentPosition.phi();
576 if(phi<0.) phi+=
M_PI;
577 int i = int(8.0*phi/
M_PI);
578 if( i==0 || i==7 || i==8 )
579 {
580 tzError = yError;
581 }
582 if( i==1 || i==2 )
583 {
584 Hep3Vector tzVector(-1.0,1.0,0.);
585 tzError =extXpErr->
get_plane_err(currentMomentum.unit(),tzVector.unit());
586 }
587 if( i==3 || i==4 )
588 {
589 tzError = xError;
590 }
591 if( i==5 || i==6 )
592 {
593 Hep3Vector tzVector(1.0,1.0,0.);
594 tzError =extXpErr->
get_plane_err(currentMomentum.unit(),tzVector.unit());
595 }
596 myExtTrack->
SetMucData(currentPosition/10,currentMomentum/1000,newVolumeName,newVolumeNumber,myOutputSymMatrix(extXpErr->
get_err()),zError/10,tzError/10,xError/10,yError/10);
597 }
598 myMucFlag = true;
599 if(!(ParticleName.contains("mu")&&myUseMucKalFlag))
600 {
601
602 currentStep->GetTrack()->SetTrackStatus(fStopAndKill);
603 m_trackstop=true;
604 return;
605 }
606 }
607
608
609
610
611 HepSymMatrix XpErr = extXpErr->
get_err();
612 int namesize = oldVolumeName.size();
613 bool Flag1(false),Flag2(false),Flag3(false),Flag4(false),Flag5(false);
614 Flag1 = m_mucdigicol->size()>0;
615 Flag2 = myUseMucKalFlag;
616 Flag3 = ParticleName.contains("mu")&&oldVolumeName.contains("lMuc")&&oldVolumeName.contains("P")&&oldVolumeName.contains("S")&&(oldVolumeName.contains("G")||oldVolumeName.contains("Ab"));
617 Flag4 = oldVolumeName.contains("lMuc")&&oldVolumeName.contains("P")&&oldVolumeName.contains("S")&&((namesize==10&&oldVolumeName.contains("G"))||(namesize==11&&oldVolumeName.contains("Ab")));
618 Flag5 = !((RemID[0]==1&&RemID[2]==9)||((RemID[0]==0||RemID[0]==2)&&RemID[2]==8));
619
620 if(Flag1&&Flag2&&Flag3&&Flag5)
621 {
622
623 double depth = currentStep-> GetStepLength();
624 if(oldVolumeName.contains("Ab"))
625 RemDepth = RemDepth+ depth;
626 if(RemStep==0&&Flag4)
627 {
628 Hep3Vector ID_1 =
GetGapID(oldVolumeName);
629 RemID = ID_1;
630
631 bool LastLay = (ID_1[0]==1&&ID_1[2]<9)||((ID_1[0]==0||ID_1[0]==2)&&ID_1[2]<8);
632 if(RememberID[2]!=ID_1[2]&&LastLay)
633 {
635 double dist = fabs(pos_loc.z());
636 RemPositon = currentPosition;
637 RemMomentum = currentMomentum;
638 RemXpErr = XpErr;
639 RemDist = dist;
640 RemStep++;
641 }
642 }
643 if(RemStep>0)
644 {
645 bool WillFilter = false;
646 bool LastLay_ = false;
647 double dist_b = 99999.;
648 Hep3Vector ID_2;
649 if(Flag4)
650 {
652 LastLay_ =(ID_2[0]==1&&ID_2[2]<9)||((ID_2[0]==0||ID_2[0]==2)&&ID_2[2]<8);
653 if(LastLay_)dist_b=fabs(
MucGeoGeneral::Instance()->GetGap(ID_2[0],ID_2[1],ID_2[2])->TransformToGap(currentPosition).z());
654 if(RemID!=ID_2)
655 WillFilter=true;
656
657 }
658
660 double dist = fabs(pos_loc.z());
661
662 if(!WillFilter&&RemDist>dist)
663 {
664 RemPositon = currentPosition;
665 RemMomentum = currentMomentum;
666 RemXpErr = XpErr;
667 RemDist = dist;
668 RemVol = oldVolumeName;
669 }
670
671
672 if(WillFilter)
673 {
680 vector<MucRecHit*> tmp = muckal->
TrackHit();
682
683 double chi2 = muckal->
GetChi2();
685 if(filter&&iniOK)
686 {
687
688 myMucnfit_++;
689
690 myMucchisq_ = myMucchisq_+chi2;
691 muckal->
XPmod(m_pos_mod,m_mom_mod,m_err_mod);
693 if(RememberID[0]==1)myMucbrLastLay_=RememberID[2];
694 if(RememberID[0]==0||RememberID[0]==2)myMucecLastLay_=RememberID[2];
695 if(oldVolumeName.contains("Ab"))
696 RemDepth = RemDepth-depth;
697 if(myMucnfit_==1)
698 myMucdepth_ = RemDepth;
699 else
700 myMucdepth_=myMucdepth_+RemDepth;
701
702 if(!samestrip)
703 {
704
708 currentStep->GetTrack()->SetTrackStatus(fStopAndKill);
709
710 }
711 else
712 {
713
714 RemPositon = currentPosition;
715 RemMomentum = currentMomentum;
716 RemXpErr = XpErr;
717 RemDist = dist_b;
718 RemID =ID_2;
719 if(oldVolumeName.contains("Ab"))
720 RemDepth = depth;
721 else
722 RemDepth = 0.;
723 }
724 if(msgFlag)cout<<"---------Filter is OK---------- "<<endl;
725 }
726 else
727 {
728
729
730 RemPositon = currentPosition;
731 RemMomentum = currentMomentum;
732 RemXpErr = XpErr;
733 RemDist = dist_b;
734 RemID =ID_2;
735
736 }
737 delete muckal;
738 }
739 }
740 if(myExtTrack)myExtTrack->
SetMucKalData(myMucchisq_,myMucnfit_,myMucdepth_,myMucbrLastLay_,myMucecLastLay_,myMucnhits_);
741 }
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808 }
809 else {
810 if(msgFlag) cout<<"x:"<<currentPosition.x()<<"//y:"<<currentPosition.y()<<"//z:"<<currentPosition.z()<<"||px:"<<currentMomentum.x()<<"//py:"<<currentMomentum.y()<<"//pz:"<<currentMomentum.z()<<endl;
811 double x = currentPosition.x();
812 double y = currentPosition.y();
813 double z = currentPosition.z();
814 if( (fabs(x)>=2*myMucR) || (fabs(y)>=2*myMucR) || (fabs(z)>=2*myMucZ) )
815
816 {currentStep->GetTrack()->SetTrackStatus(fStopAndKill);m_trackstop=true;}
817 }
818
819 }
820 else if(currentTrackStatus == fStopAndKill)
821 {
822 m_trackstop=true;
823 if(myEmcFlag) myExtTrack->
SetEmcPath(myPathInCrystal/10.);
826 if(msgFlag) {
827 cout << "myPathInTof1 = " ;
828 for(int i=0; i!=myPathInTof1.size(); i++)
829 cout << myPathInTof1[i] << " ";
830 cout << endl;
831 cout << "myPathInTof2 = " ;
832 for(int i=0; i!=myPathInTof2.size(); i++)
833 cout << myPathInTof2[i] << " ";
834 cout << endl;
835 }
836
837 if(msgFlag)
838 {
839 if(newVolume!=0)
840 {
841 std::cout<<"x:"<<currentPosition.x()<<"//y:"<<currentPosition.y()<<"//z:"<<currentPosition.z()<<"||px:"<<currentMomentum.x()<<"//py:"<<currentMomentum.y()<<"//pz:"<<currentMomentum.z()<<"//stoped"<<endl;
842 cout<<
"Error matrix is:"<<extXpErr->
get_err()<<endl;
843 }
844 else {
845 cout<<"x:"<<currentPosition.x()<<"//y:"<<currentPosition.y()<<"//z:"<<currentPosition.z()<<"||px:"<<currentMomentum.x()<<"//py:"<<currentMomentum.y()<<"//pz:"<<currentMomentum.z()<<"//escaped"<<std::endl;
846 std::cout<<
"Error matrix is:"<<extXpErr->
get_err()<<std::endl;
847 }
848 }
849 }
850}
static G4int Calculate_Readoutstrip_number_continuum(G4double x_mm, G4double y_mm, G4int partId_f, G4int module_mrpc_f)
static G4int Produce_unique_identifier(G4int module_mrpc_f, G4int readoutstripnumber_f)
static G4int Produce_unique_identifier(G4int module_mrpc_f, G4int readoutstripnumber_f)
static G4int Calculate_Readoutstrip_number_continuum(G4double x_mm, G4double y_mm, G4int partId_f, G4int module_mrpc_f)
void SetTof1Data(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, double aTof, double aPath, HepSymMatrix aErrorMatrix, double aZSigma=0., double aTSigma=0., double aXSigma=0., double aYSigma=0.)
void SetEmcData(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, double aThetaSigma, double aPhiSigma, HepSymMatrix aErrorMatrix)
void SetTof2Data(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, double aTof, double aPath, HepSymMatrix aErrorMatrix, double aZSigma=0., double aTSigma=0., double aXSigma=0., double aYSigma=0.)
void SetMucData(Hep3Vector aPosition, Hep3Vector aMomentum, string aVolumeName, int aVolumeNumber, HepSymMatrix aErrorMatrix, double aZSigma=0., double aTSigma=0., double aXSigma=0., double aYSigma=0.)
void SetEmcPath(double path)
void SetMucKalData(double chi2, int dof, double depth, int brLastLay, int ecLastLay, int nhits)
void SetGapID(Hep3Vector id)
void SetPosMomErr(Hep3Vector pos, Hep3Vector mom, HepSymMatrix err)
void SetMucWindow(int aMucWindow)
void XPmod(Hep3Vector &pos, Hep3Vector &mom, HepSymMatrix &err)
void SetMucDigiCol(MucDigiCol *amucdigi)
vector< MucRecHit * > TrackHit()
int Get_which_tof_version(void)
Hep3Vector GetGapID(G4String vol)
void CalculateEmcEndThetaPhi(int npart, int sector, int nb, int &ntheta, int &nphi)
int CalculateEmcEndCopyNb(int num)
int CalculateEmcEndPhiNb(int num)
void put_err(const double error[])
const HepSymMatrix & get_err() const
double get_plane_err(const Hep3Vector &np, const Hep3Vector &nr) const
void set_mom(const Hep3Vector &mom)
bool move(const Hep3Vector &xv1, const Hep3Vector &pv1, const Hep3Vector &B, const int ms_on, const double chi_cc)
void set_pos(const Hep3Vector &pos)
HepPoint3D TransformToGap(const HepPoint3D gPoint) const
Transform a point from global coordinate to gap coordinate.
MucGeoGap * GetGap(const int part, const int seg, const int gap) const
Get a pointer to the gap identified by (part,seg,gap).
static MucGeoGeneral * Instance()
Get a pointer to the single instance of MucGeoGeneral.
void setPathInTof1(vector< double > x)
void setPathInTof2(vector< double > x)
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)