Geant4  10.02.p01
Par02TrackingAction.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: $
27 //
30 
31 #include "Par02TrackingAction.hh"
32 #include "Par02EventInformation.hh"
34 #include "Par02Output.hh"
35 
36 #include "G4ThreeVector.hh"
37 #include "G4EventManager.hh"
38 #include "G4RunManager.hh"
39 
40 #include "Randomize.hh"
41 #include "G4SystemOfUnits.hh"
42 #include "G4TrackingManager.hh"
43 #include <iomanip>
44 #include <vector>
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51 
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55 
57  // Kill the tracks that have a small transverse momentum or that are not
58  // in the central region.
59  if ( aTrack->GetMomentum().perp() < 1.0*MeV ||
60  std::abs( aTrack->GetMomentum().pseudoRapidity() ) > 5.5 ) {
61  ( (G4Track*) aTrack )->SetTrackStatus( fStopAndKill );
62  }
63 }
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68  if ( aTrack->GetTrackStatus() == fStopAndKill && aTrack->GetParentID() == 0 ) {
71  //info->Print();
73  info->GetPartID(),
74  info->GetPDG(),
75  info->GetMCMomentum()/MeV );
77  info->GetPartID(),
78  info->GetPDG(),
79  info->GetTrackerMomentum()/MeV,
80  info->GetTrackerResolution(),
81  info->GetTrackerEfficiency() );
83  info->GetPartID(),
84  info->GetPDG(),
85  info->GetEMCalPosition()/mm,
86  info->GetEMCalResolution(),
87  info->GetEMCalEfficiency(),
88  info->GetEMCalEnergy()/MeV );
90  info->GetPartID(),
91  info->GetPDG(),
92  info->GetHCalPosition()/mm,
93  info->GetHCalResolution(),
94  info->GetHCalEfficiency(),
95  info->GetHCalEnergy()/MeV );
96  }
97 }
98 
99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100 
G4double GetHCalEnergy()
Sets the energy deposit in the hadronic calorimeter.
G4int GetParentID() const
Definition of the Par02EventInformation class.
static const double MeV
Definition: G4SIunits.hh:211
G4ThreeVector GetTrackerMomentum()
Gets the particle momentum at the entrance to the tracker detector.
Par02TrackingAction()
A default constructor.
const G4DynamicParticle * GetDynamicParticle() const
virtual void PreUserTrackingAction(const G4Track *track)
Defines the actions at the start of processing the track. It checks the pseudorapidity range and if t...
G4TrackStatus GetTrackStatus() const
G4ThreeVector GetEMCalPosition()
Gets the position of the energy deposit in the electromagnetic calorimeter.
G4int GetPartID() const
Gets the particle unique ID (within event). Can be set only in the constructor.
Definition of the Par02PrimaryParticleInformation class.
G4double GetEMCalEfficiency()
Gets the electromagnetic calorimeter efficiency. Currently not used (efficiency is 1)...
G4ThreeVector GetHCalPosition()
Gets the position of the energy deposit in the hadronic calorimeter.
G4int GetPDG() const
Gets the standard PDG code. Can be set only in the constructor.
G4double GetHCalEfficiency()
Gets the hadronic calorimeter efficiency. Currently not used (efficiency is 1).
Definition of the Par02Output class.
static Par02Output * Instance()
Allows the access to the unique Par02Output object.
Definition: Par02Output.cc:60
G4PrimaryParticle * GetPrimaryParticle() const
void SaveTrack(SaveType aWhatToSave, G4int aPartID, G4int aPDG, G4ThreeVector aVector, G4double aResolution=0, G4double aEfficiency=1, G4double aEnergy=0)
Saves the information about the particle (track).
Definition: Par02Output.cc:162
Definition of the Par02TrackingAction class.
G4ThreeVector GetMomentum() const
G4double GetTrackerEfficiency()
Gets the tracker detector efficiency. Currently not used (efficiency is 1).
G4ThreeVector GetMCMomentum()
Gets the initial particle momentum (from particle generator).
G4double GetEMCalEnergy()
Sets the energy deposit in the electromagnetic calorimeter.
virtual void PostUserTrackingAction(const G4Track *track)
Defines the actions at the end of processing the track. It saves the information of MC data (PDG code...
G4double GetEMCalResolution()
Gets the electromagnetic calorimeter resolution. Currently equal to -1 if AtlFast type of smearing is...
G4double GetTrackerResolution()
Gets the tracking detector resolution. Currently equal to -1 if AtlFast type of smearing is used...
G4double GetHCalResolution()
Gets the hadronic calorimeter resolution. Currently equal to -1 if AtlFast type of smearing is used...
static const double mm
Definition: G4SIunits.hh:114
G4VUserPrimaryParticleInformation * GetUserInformation() const