Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
Par02FastSimModelEMCal.cc
이 파일의 문서화 페이지로 가기
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 
32 #include "Par02EventInformation.hh"
34 #include "Par02Smearer.hh"
35 #include "Par02Output.hh"
36 
37 #include "G4Track.hh"
38 #include "G4Event.hh"
39 #include "G4RunManager.hh"
40 #include "g4root.hh"
41 
42 #include "Randomize.hh"
43 #include "G4SystemOfUnits.hh"
44 
45 #include "G4Electron.hh"
46 #include "G4Positron.hh"
47 #include "G4Gamma.hh"
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
53  G4VFastSimulationModel( aModelName, aEnvelope ), fCalculateParametrisation(),
54  fParametrisation( aType ) {}
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59  G4Region* aEnvelope ) :
60  G4VFastSimulationModel( aModelName, aEnvelope ), fCalculateParametrisation(),
61  fParametrisation( Par02DetectorParametrisation::eCMS ) {}
62 
63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64 
66  G4VFastSimulationModel( aModelName ), fCalculateParametrisation(),
67  fParametrisation( Par02DetectorParametrisation::eCMS ) {}
68 
69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70 
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
76  const G4ParticleDefinition& aParticleType ) {
77  // Applicable for electrons, positrons, and gammas
78  return &aParticleType == G4Electron::Definition() ||
79  &aParticleType == G4Positron::Definition() ||
80  &aParticleType == G4Gamma::Definition();
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86  return true; // No kinematical restrictions to apply the parametrisation
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
91 void Par02FastSimModelEMCal::DoIt( const G4FastTrack& aFastTrack,
92  G4FastStep& aFastStep ) {
93  //G4cout << " ________EMCal model triggered _________" << G4endl;
94 
95  // Kill the parameterised particle at the entrance of the electromagnetic calorimeter
96  aFastStep.KillPrimaryTrack();
97  aFastStep.ProposePrimaryTrackPathLength( 0.0 );
98  G4double Edep = aFastTrack.GetPrimaryTrack()->GetKineticEnergy();
99 
100  // Consider only primary tracks (do nothing else for secondary e-, e+, gammas)
101  G4ThreeVector Pos = aFastTrack.GetPrimaryTrack()->GetPosition();
102  if ( ! aFastTrack.GetPrimaryTrack()->GetParentID() ) {
105  if ( info->GetDoSmearing() ) {
106  // Smearing according to the electromagnetic calorimeter resolution
107  G4ThreeVector Porg = aFastTrack.GetPrimaryTrack()->GetMomentum();
112  G4double Esm;
113  Esm = std::abs( Par02Smearer::Instance()->
114  SmearEnergy( aFastTrack.GetPrimaryTrack(), res ) );
115  Par02Output::Instance()->FillHistogram( 1, (Esm/MeV) / (Edep/MeV) );
116  // Setting the values of Pos, Esm, res and eff
117  ( (Par02PrimaryParticleInformation*) ( const_cast< G4PrimaryParticle* >
118  ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
119  GetUserInformation() ) )->SetEMCalPosition( Pos );
120  ( (Par02PrimaryParticleInformation*) ( const_cast< G4PrimaryParticle* >
121  ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
122  GetUserInformation() ) )->SetEMCalEnergy( Esm );
123  ( (Par02PrimaryParticleInformation*) ( const_cast< G4PrimaryParticle* >
124  ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
125  GetUserInformation() ) )->SetEMCalResolution( res );
126  ( (Par02PrimaryParticleInformation*) ( const_cast< G4PrimaryParticle* >
127  ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
128  GetUserInformation() ) )->SetEMCalEfficiency( eff );
129  // The (smeared) energy of the particle is deposited in the step
130  // (which corresponds to the entrance of the electromagnetic calorimeter)
131  aFastStep.ProposeTotalEnergyDeposited( Esm );
132  } else {
133  // No smearing: simply setting the value of Edep
134  ( (Par02PrimaryParticleInformation*) ( const_cast< G4PrimaryParticle* >
135  ( aFastTrack.GetPrimaryTrack()->GetDynamicParticle()->GetPrimaryParticle() )->
136  GetUserInformation() ) )->SetEMCalEnergy( Edep );
137  // The (initial) energy of the particle is deposited in the step
138  // (which corresponds to the entrance of the electromagnetic calorimeter)
139  aFastStep.ProposeTotalEnergyDeposited( Edep );
140  }
141  }
142 }
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145 
void ProposePrimaryTrackPathLength(G4double)
G4double GetKineticEnergy() const
const XML_Char XML_Encoding * info
Definition: expat.h:530
static Par02Smearer * Instance()
Definition: Par02Smearer.cc:59
static G4Gamma * Definition()
Definition: G4Gamma.cc:49
static constexpr double MeV
Definition: G4SIunits.hh:214
Definition of the Par02FastSimModelEMCal class.
ush Pos
Definition: deflate.h:92
const G4Track * GetPrimaryTrack() const
Definition: G4FastTrack.hh:208
G4double GetEfficiency(Detector aDetector, Parametrisation aParametrisation, G4double aMomentum)
virtual void DoIt(const G4FastTrack &aFastTrack, G4FastStep &aFastStep)
void FillHistogram(G4int HNo, G4double value) const
Definition: Par02Output.cc:219
G4ThreeVector GetMomentum() const
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
Definition of the Par02Output class.
G4VUserEventInformation * GetUserInformation()
G4double GetResolution(Detector aDetector, Parametrisation aParametrisation, G4double aMomentum)
static G4EventManager * GetEventManager()
const G4ThreeVector & GetPosition() const
Parametrisation
A parametrisation type (CMS, ATLAS, ALEPH).
Definition of the Par02PrimaryParticleInformation class.
void KillPrimaryTrack()
Definition: G4FastStep.cc:88
G4PrimaryParticle * GetPrimaryParticle() const
static G4Electron * Definition()
Definition: G4Electron.cc:49
Par02DetectorParametrisation::Parametrisation fParametrisation
A parametrisation type.
Definition of the Par02EventInformation class.
double mag() const
Par02FastSimModelEMCal(G4String aModelName, G4Region *aEnvelope, Par02DetectorParametrisation::Parametrisation aParamType)
G4bool GetDoSmearing()
Gets the flag indicating if smearing should be done.
static Par02Output * Instance()
Definition: Par02Output.cc:60
virtual G4bool IsApplicable(const G4ParticleDefinition &aParticle)
Definition of the Par02Smearer class.
static G4Positron * Definition()
Definition: G4Positron.cc:49
void ProposeTotalEnergyDeposited(G4double anEnergyPart)
const G4DynamicParticle * GetDynamicParticle() const
Par02DetectorParametrisation * fCalculateParametrisation
virtual G4bool ModelTrigger(const G4FastTrack &aFastTrack)
G4int GetParentID() const