BOSS 7.0.8
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_detVer, 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 36 of file Ext_track.cxx.

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

◆ Ext_track() [2/2]

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

Definition at line 50 of file Ext_track.cxx.

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

◆ ~Ext_track()

Ext_track::~Ext_track ( )

Definition at line 66 of file Ext_track.cxx.

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

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 90 of file Ext_track.cxx.

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

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

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

Referenced by TrkExtAlg::execute().


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