BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
Ext_track Class Reference

#include <Ext_track.h>

Public Member Functions

 Ext_track ()
 
 Ext_track (const bool msgFlag, const bool myBFieldOn, const bool GeomOptimization, const int m_tofversion, const bool UseMucKal, const int MucWindow)
 
 ~Ext_track ()
 
void Initialization (const bool aMsgFlag, const bool Bfield, const bool GeomOptimization, const bool aUseMucKal, const int aMucWindow)
 
bool Set (const Hep3Vector &xv3, const Hep3Vector &pv3, const HepSymMatrix &err, const std::string &particleName, const double pathInMDC, const double tofInMdc)
 
void TrackExtrapotation ()
 
void Dir (const int dir)
 
ExtSteppingActionGetStepAction ()
 

Detailed Description

Definition at line 40 of file Ext_track.h.

Constructor & Destructor Documentation

◆ Ext_track() [1/2]

Ext_track::Ext_track ( )

Definition at line 35 of file Ext_track.cxx.

35 : myMsgFlag(true),myBFieldOn(true),myGeomOptimization(true),m_dir(0),m_tofversion(2),myUseMucKal(true),myMucWindow(6)
36{
37// BesSensitiveManager *besSensitiveManager = new BesSensitiveManager;
38 bes3DetectorConstruction = new ExtBesDetectorConstruction(myBFieldOn,m_tofversion);
39 bes3WorldVolume = bes3DetectorConstruction->Construct();
40 extPhysicsList = new ExtPhysicsList;
41 extTrack = new G4Track;
42
43 //for geant4.8.1, move this line to Initialization, extSteppingAction = new ExtSteppingAction;
44 extTrackingManager = new G4TrackingManager;
45 //RunManagerKernel for geant4.9.0
46 extRunManagerKernel = new G4RunManagerKernel;
47}

◆ Ext_track() [2/2]

Ext_track::Ext_track ( const bool  msgFlag,
const bool  myBFieldOn,
const bool  GeomOptimization,
const int  m_tofversion,
const bool  UseMucKal,
const int  MucWindow 
)

Definition at line 49 of file Ext_track.cxx.

49 : myMsgFlag(msgFlag),myBFieldOn(BFieldOn),myGeomOptimization(GeomOptimization),m_dir(0),myUseMucKal(aUseMucKal),myMucWindow(aMucWindow)
50{
51// BesSensitiveManager *besSensitiveManager = new BesSensitiveManager;
52 bes3DetectorConstruction = new ExtBesDetectorConstruction(myBFieldOn,m_tofversion);
53 bes3WorldVolume = bes3DetectorConstruction->Construct();
54 extPhysicsList = new ExtPhysicsList;
55 extTrack = new G4Track;
56
57 //for geant4.8.1, move this line to Initialization, extSteppingAction = new ExtSteppingAction;
58 extTrackingManager = new G4TrackingManager;
59 //RunManagerKernel for geant4.9.0
60 extRunManagerKernel = new G4RunManagerKernel;
61}

◆ ~Ext_track()

Ext_track::~Ext_track ( )

Definition at line 65 of file Ext_track.cxx.

66{
67 if(extRunManagerKernel) delete extRunManagerKernel;
68 if(extTrackingManager) delete extTrackingManager;
69// if(extSteppingAction) delete extSteppingAction;
70 if(extTrack) delete extTrack;
71 if(bes3DetectorConstruction) delete bes3DetectorConstruction;
72 if(extPhysicsList) delete extPhysicsList;
73
74 // open geometry for deletion
75 G4GeometryManager::GetInstance()->OpenGeometry();
76
77 // deletion of Geant4 kernel classes
78 G4SDManager* fSDM = G4SDManager::GetSDMpointerIfExist();
79 if(fSDM)
80 {
81 delete fSDM;
82 }
83}

Member Function Documentation

◆ Dir()

void Ext_track::Dir ( const int  dir)
inline

Termination of the track extrapolation. Accessors for the parameters. Modifiers for the parameters. Modifiers for the track direction. (0/1)=(outgoing/incoming).

Definition at line 154 of file Ext_track.h.

154{ m_dir = dir; }

◆ GetStepAction()

ExtSteppingAction * Ext_track::GetStepAction ( )
inline

Definition at line 90 of file Ext_track.h.

90{return extSteppingAction;};

Referenced by TrkExtAlg::execute().

◆ Initialization()

void Ext_track::Initialization ( const bool  aMsgFlag,
const bool  Bfield,
const bool  GeomOptimization,
const bool  aUseMucKal,
const int  aMucWindow 
)

Definition at line 89 of file Ext_track.cxx.

90{
91 myMsgFlag=aMsgFlag;
92 myGeomOptimization = GeomOptimization;
93 myBFieldOn=Bfield,
94 myUseMucKal=aUseMucKal;
95 myMucWindow = aMucWindow;
96 //add for geant4.8.1
97 G4ParticleTable::GetParticleTable()->SetReadiness();
98 extPhysicsList->ConstructParticle();
99
100 if(myMsgFlag) cout << "Ext_track::Init will execute geant initialization." << endl;
101 if(!GeometryInitialization()) cout << "Error in Ext_track::GeometryInitialization()" << endl;
102 PhysicsInitialization();
103
104 extSteppingAction = new ExtSteppingAction;
105 extSteppingAction->SetMsgFlag(aMsgFlag);
106 extSteppingAction->SetMucKalFlag(aUseMucKal);
107 extSteppingAction->SetMucWindow(aMucWindow);
108 //Set extSteppingAction
109 extTrackingManager->SetUserAction(extSteppingAction);
110
111
112
113}
void SetMsgFlag(bool aMsgFalg)
void SetMucWindow(int aMucWindow)
void SetMucKalFlag(bool aMucKalFlag)

Referenced by TrkExtAlg::initialize().

◆ Set()

bool Ext_track::Set ( const Hep3Vector &  xv3,
const Hep3Vector &  pv3,
const HepSymMatrix &  err,
const std::string &  particleName,
const double  pathInMDC,
const double  tofInMdc 
)

Setup the error skip list as a part of the initialization. errskip_list – Name of the error skip file. Print out the contents of the error skip list.

Definition at line 234 of file Ext_track.cxx.

235{
236 if( err.num_row() != 6 ){ // ?static const int Ndim_err=6, see Ext_errmx.h line58
237 std::cerr << "%ERROR at Ext_track::Set. Dimension of error matrix: "
238 << err.num_row() << " should be 6" << std::endl;
239 exit( 0 );
240 }
241
242 m_vect[0] = xv3.x();// ?set starting position,private data
243 m_vect[1] = xv3.y();
244 m_vect[2] = xv3.z();
245
246// m_errskip_flag = 0;
247// m_errskip_level = 0;
248
249
250 // Check the starting point is inside the setup.
251 if(!CheckVertexInsideWorld(xv3)) return 0;
252
253 float p( pv3.mag() );
254 m_vect[3] = pv3.x()/p; //?set direction of momentum
255 m_vect[4] = pv3.y()/p;
256 m_vect[5] = pv3.z()/p;
257 m_vect[6] = p;
258
259 // check Particlename
260 if(particleName!="e+"&&particleName!="e-"&&
261 particleName!="mu+"&&particleName!="mu-"&&
262 particleName!="pi+"&&particleName!="pi-"&&
263 particleName!="kaon+"&&particleName!="kaon-"&&
264 particleName!="proton"&&particleName!="anti_proton"&&
265 particleName!="gamma")
266 {
267 std::cerr <<"Unknown or unconstructed Particle."<< std::endl;
268 return 0;
269 }
270
271
272 double mass;
273 double Q;
274
275 G4ParticleDefinition* particleDefinition=G4ParticleTable::GetParticleTable()->FindParticle(particleName);
276 Q = particleDefinition->GetPDGCharge();
277 mass = particleDefinition->GetPDGMass();
278
279
280 Hep3Vector xv( m_vect[0], m_vect[1], m_vect[2] );
281 Hep3Vector pv(m_vect[3]*m_vect[6], m_vect[4]*m_vect[6], m_vect[5]*m_vect[6]);
282
283 m_xp_err.set_err( err, xv, pv, Q, mass ); // Set error matrix.
284
285 extSteppingAction->SetXpErrPointer(&m_xp_err);
286 extSteppingAction->SetInitialPath(pathInMDC);
287 extSteppingAction->SetInitialTof(tofInMdc);
288
289 double betaInMDC = p/sqrt(mass*mass+p*p);//velocity
290 extSteppingAction->SetBetaInMDC(betaInMDC);
291// double tofInMDC = pathInMDC/(betaInMDC*299.792458);
292// if(myMsgFlag) cout<<"TOF in MDC: "<<tofInMDC<<endl;
293
294// extSteppingAction->Reset();
295 extSteppingAction->MucReset();
296 // extTrack Initialization.
297
298/* // comment 2008.04.07 due to memory loss
299 // Initialize a G4PrimaryParticle.
300 G4PrimaryParticle* primaryParticle = new G4PrimaryParticle(particleDefinition,pv3.x(),pv3.y(),pv3.z());
301 primaryParticle->SetMass(mass);
302 primaryParticle->SetCharge(Q);
303
304 // Initialize a G4DynamicParticle.
305// G4DynamicParticle* DP = new G4DynamicParticle(particleDefinition,primaryParticle->GetMomentum());
306// DP->SetPrimaryParticle(primaryParticle);
307*/
308 G4DynamicParticle* DP = new G4DynamicParticle(particleDefinition,pv);
309
310 delete extTrack; // add on 2008.04.07 to avoid memory loss
311 extTrack = new G4Track(DP,0.0,xv3);
312// extTrack->CopyTrackInfo(G4Track::G4Track(DP,0.0,xv3));
313
314 // Reset navigator
315 Hep3Vector center(0,0,0);
316 G4Navigator* navigator= G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
317 navigator->LocateGlobalPointAndSetup(center,0,false);
318
319 return 1;
320}
double mass
void SetBetaInMDC(double aBeta)
void SetInitialPath(double aPath)
void SetInitialTof(double aTof)
void SetXpErrPointer(Ext_xp_err *xpErr)
void set_err(const HepSymMatrix &err, const Hep3Vector &xv, const Hep3Vector &pv, const double &q, const double &mass)
Definition: Ext_xp_err.cxx:47

Referenced by TrkExtAlg::execute().

◆ TrackExtrapotation()

void Ext_track::TrackExtrapotation ( )

Definition at line 342 of file Ext_track.cxx.

343{
344 extTrackingManager->ProcessOneTrack(extTrack);
345}

Referenced by TrkExtAlg::execute().


The documentation for this class was generated from the following files: