Import Geant4 10.2.0 source tree
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02ActionInitialization.hh
|
||||
/// \brief Definition of the Par02ActionInitialization class
|
||||
|
||||
#ifndef PAR02_ACTION_INITIALIZATION_H
|
||||
#define PAR02_ACTION_INITIALIZATION_H
|
||||
|
||||
#include "G4VUserActionInitialization.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Actions initialization.
|
||||
///
|
||||
/// Initialization of all user defined actions as well as mandatory
|
||||
/// particle generator.
|
||||
/// Based on G4 examples/extended/parametrisations/Par01/include/
|
||||
/// Par01ActionInitialization.hh .
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02ActionInitialization : public G4VUserActionInitialization {
|
||||
public:
|
||||
|
||||
/// A default constructor: sets the output file name fFileName
|
||||
/// (passed to Par02RunAction) to DefaultOutput.root as well as
|
||||
/// flag fSmear (passed to Par02EventAction) to true indicating
|
||||
/// that smearing will be performed.
|
||||
Par02ActionInitialization();
|
||||
|
||||
/// A constructor: sets the flag fSmear (passed to Par02EventAction)
|
||||
/// to true indicating that smearing will be performed.
|
||||
/// @param aOutName The output file name passed to Par02RunAction.
|
||||
Par02ActionInitialization( const G4String aOutName );
|
||||
|
||||
/// A constructor.
|
||||
/// @param aOutName The output file name passed to Par02RunAction.
|
||||
/// @param aSmear The flag indicating if smearing should be done,
|
||||
/// passed to Par02EventAction.
|
||||
Par02ActionInitialization( const G4String aOutName, const G4String aSmear );
|
||||
|
||||
virtual ~Par02ActionInitialization();
|
||||
|
||||
virtual void BuildForMaster() const;
|
||||
|
||||
/// A method where all the user actions are created.
|
||||
/// One of them, Par02PrimaryGeneratorAction is a mandatory class.
|
||||
virtual void Build() const;
|
||||
|
||||
private:
|
||||
/// An output file name. Passed in Build() to the Par02RunAction.
|
||||
G4String fFileName;
|
||||
|
||||
/// A flag indicating if smearing should be performed.
|
||||
/// Passed in Build() to the Par02EventAction.
|
||||
G4bool fSmear;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02DetectorConstruction.hh
|
||||
/// \brief Definition of the Par02DetectorConstruction class
|
||||
|
||||
#ifndef PAR02_DETECTOR_CONSTRUCTION_H
|
||||
#define PAR02_DETECTOR_CONSTRUCTION_H
|
||||
|
||||
#include "Par02FastSimModelTracker.hh"
|
||||
#include "Par02FastSimModelEMCal.hh"
|
||||
#include "Par02FastSimModelHCal.hh"
|
||||
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Construction of detector geometry.
|
||||
///
|
||||
/// A mandatory initialization class of the detector setup.
|
||||
/// Detector construction allows to use the geometry read from a GDML file.
|
||||
/// Based on G4 examples/persistency/gdml/G01/include/G01DetectorConstruction.hh .
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02DetectorConstruction : public G4VUserDetectorConstruction {
|
||||
public:
|
||||
|
||||
/// A default constructor.
|
||||
Par02DetectorConstruction();
|
||||
|
||||
virtual ~Par02DetectorConstruction();
|
||||
|
||||
/// A method invoked by G4RunManager::Initialize()
|
||||
/// @return A pointer to the world volume.
|
||||
virtual G4VPhysicalVolume* Construct();
|
||||
|
||||
/// A method invoked by G4RunManager::Initialize() to construct thread local objects
|
||||
virtual void ConstructSDandField();
|
||||
|
||||
/// A vector of the tracking detector regions
|
||||
std::vector< G4Region* > fTrackerList;
|
||||
|
||||
/// A vector of the the electromagnetic calorimeter regions
|
||||
std::vector< G4Region* > fECalList;
|
||||
|
||||
/// A vector of the the hadronic calorimeter regions
|
||||
std::vector< G4Region* > fHCalList;
|
||||
|
||||
/// A vector of the muon detector regions
|
||||
std::vector< G4Region* > fMuonList;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02DetectorParametrisation.hh
|
||||
/// \brief Definition of the Par02DetectorParameterisation class
|
||||
|
||||
#ifndef PAR02_DETECTOR_PARAMETRSIATION_H
|
||||
#define PAR02_DETECTOR_PARAMETRSIATION_H
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
/// Definition of detector resolution and efficiency.
|
||||
///
|
||||
/// A simple class used to provide the detector resolution and efficiency
|
||||
/// (dependent on the detector, parametrisation type and particle momentum).
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02DetectorParametrisation {
|
||||
public:
|
||||
|
||||
/// A default constructor.
|
||||
Par02DetectorParametrisation();
|
||||
|
||||
~Par02DetectorParametrisation();
|
||||
|
||||
/// A parametrisation type (CMS, ATLAS, ALEPH).
|
||||
enum Parametrisation { eCMS, eATLAS, eALEPH };
|
||||
|
||||
/// A detector type (tracking detector, electromagnetic calorimeter,
|
||||
/// hadronic calorimeter).
|
||||
enum Detector { eTRACKER, eEMCAL, eHCAL };
|
||||
|
||||
/// Gets the resolution of a detector for a given particle.
|
||||
/// @param aDetector A detector type.
|
||||
/// @param aParametrisation A parametrisation type.
|
||||
/// @param aMomentum A particle momentum.
|
||||
G4double GetResolution( Detector aDetector, Parametrisation aParametrisation,
|
||||
G4double aMomentum );
|
||||
|
||||
/// Gets the efficiency of a detector for a given particle.
|
||||
/// @param aDetector A detector type.
|
||||
/// @param aParametrisation A parametrisation type.
|
||||
/// @param aMomentum A particle momentum.
|
||||
G4double GetEfficiency( Detector aDetector, Parametrisation aParametrisation,
|
||||
G4double aMomentum );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02EventAction.hh
|
||||
/// \brief Definition of the Par02EventAction class
|
||||
|
||||
#ifndef PAR02_EVENT_ACTION_H
|
||||
#define PAR02_EVENT_ACTION_H
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Event action (before/after event processing).
|
||||
///
|
||||
/// Defines the action at the beginning and at the end of each event.
|
||||
/// It is invoked by a G4EventManager when a G4Event object is sent
|
||||
/// (which contains primary vertices and particles created by the
|
||||
/// Par02PrimaryGeneratorAction).
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02EventAction : public G4UserEventAction {
|
||||
public:
|
||||
|
||||
/// A default constructor.
|
||||
/// Sets the flag fSmear to true indicating that smearing will be performed.
|
||||
Par02EventAction();
|
||||
|
||||
/// A constructor.
|
||||
/// @param aSmear The flag indicating if smearing has to be done.
|
||||
Par02EventAction( G4bool aSmear );
|
||||
|
||||
virtual ~Par02EventAction();
|
||||
|
||||
/// Defines the actions at the beginning of the event.
|
||||
/// It sets the Par02EventInformation with fSmear flag.
|
||||
/// It creates all the ntuples defined in Par02Output singleton class.
|
||||
virtual void BeginOfEventAction( const G4Event* );
|
||||
|
||||
/// Defines the actions at the end of the event.
|
||||
virtual void EndOfEventAction( const G4Event* );
|
||||
|
||||
private:
|
||||
|
||||
/// A flag indicating if smearing should be performed.
|
||||
/// Passed to Par02EventInformation in BeginOfEventAction(const G4Event*).
|
||||
G4bool fSmear;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02EventInformation.hh
|
||||
/// \brief Definition of the Par02EventInformation class
|
||||
|
||||
#ifndef PAR02_EVENT_INFORMATION_H
|
||||
#define PAR02_EVENT_INFORMATION_H
|
||||
|
||||
#include "G4VUserEventInformation.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Event information.
|
||||
///
|
||||
/// Describes the information that can be associated with a G4Event class object.
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02EventInformation : public G4VUserEventInformation {
|
||||
public:
|
||||
|
||||
/// A default constructor. Sets flag fDoSmearing to true.
|
||||
Par02EventInformation();
|
||||
|
||||
/// A constructor.
|
||||
/// @param aSmear The flag indicating if smearing should be done.
|
||||
Par02EventInformation( G4bool aSmear );
|
||||
|
||||
virtual ~Par02EventInformation();
|
||||
|
||||
/// Prints event information.
|
||||
virtual void Print() const;
|
||||
|
||||
/// Sets the flag indicating if smearing should be done.
|
||||
/// @param aSmear A boolean flag.
|
||||
void SetDoSmearing( G4bool aSmear );
|
||||
|
||||
/// Gets the flag indicating if smearing should be done.
|
||||
G4bool GetDoSmearing();
|
||||
|
||||
private:
|
||||
|
||||
/// A flag indicating if smearing should be performed.
|
||||
/// It is read by implementations of G4VFastSimulationModel.
|
||||
G4bool fDoSmearing;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02FastSimModelEMCal.hh
|
||||
/// \brief Definition of the Par02FastSimModelEMCal class
|
||||
|
||||
#ifndef PAR02_EMCAL_FAST_SIM_MODEL_H
|
||||
#define PAR02_EMCAL_FAST_SIM_MODEL_H
|
||||
|
||||
#include "G4VFastSimulationModel.hh"
|
||||
#include "Par02DetectorParametrisation.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
/// Shortcut to the ordinary tracking for electromagnetic calorimeters.
|
||||
///
|
||||
/// The fast simulation model describes what should be done instead of a
|
||||
/// normal tracking. Instead of the ordinary tracking, a particle deposits
|
||||
/// its energy at the entrance to the electromagnetic calorimeter and its value
|
||||
/// is smeared (by Par02Smearer::SmearMomentum()). Based on G4
|
||||
/// examples/extended/parametrisations/Par01/include/Par01EMShowerModel.hh .
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02FastSimModelEMCal : public G4VFastSimulationModel {
|
||||
public:
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
/// @param aEnvelope A region where the model can take over the ordinary tracking.
|
||||
/// @param aParamType A parametrisation type.
|
||||
Par02FastSimModelEMCal( G4String aModelName, G4Region* aEnvelope,
|
||||
Par02DetectorParametrisation::Parametrisation aParamType );
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
/// @param aEnvelope A region where the model can take over the ordinary tracking.
|
||||
Par02FastSimModelEMCal( G4String aModelName, G4Region* aEnvelope );
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
Par02FastSimModelEMCal( G4String aModelName );
|
||||
|
||||
~Par02FastSimModelEMCal();
|
||||
|
||||
/// Checks if this model should be applied to this particle type.
|
||||
/// @param aParticle A particle definition (type).
|
||||
virtual G4bool IsApplicable( const G4ParticleDefinition& aParticle );
|
||||
|
||||
/// Checks if the model should be applied, taking into account the
|
||||
/// kinematics of a track.
|
||||
/// @param aFastTrack A track.
|
||||
virtual G4bool ModelTrigger( const G4FastTrack & aFastTrack );
|
||||
|
||||
/// Smears the energy deposit and saves it, together with the
|
||||
/// position of the deposit, the electromagnetic calorimeter resolution
|
||||
/// and efficiency to the Par02PrimaryParticleInformation.
|
||||
/// @param aFastTrack A track.
|
||||
/// @param aFastStep A step.
|
||||
virtual void DoIt( const G4FastTrack& aFastTrack, G4FastStep& aFastStep );
|
||||
|
||||
private:
|
||||
|
||||
/// A pointer to Par02DetectorParametrisation used to get the efficiency and
|
||||
/// resolution of the detector for a given particle and parametrisation type.
|
||||
Par02DetectorParametrisation* fCalculateParametrisation;
|
||||
|
||||
/// A parametrisation type.
|
||||
Par02DetectorParametrisation::Parametrisation fParametrisation;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02FastSimModelHCal.hh
|
||||
/// \brief Definition of the Par02FastSimModelHCal class
|
||||
|
||||
#ifndef PAR02_HCAL_FAST_SIM_MODEL_H
|
||||
#define PAR02_HCAL_FAST_SIM_MODEL_H
|
||||
|
||||
#include "G4VFastSimulationModel.hh"
|
||||
#include "Par02DetectorParametrisation.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
/// Shortcut to the ordinary tracking for hadronic calorimeters.
|
||||
///
|
||||
/// Fast simulation model describes what should be done instead of a
|
||||
/// normal tracking. Instead of the ordinary tracking, a particle deposits
|
||||
/// its energy at the entrance to the hadronic calorimeter and its value
|
||||
/// is smeared (by Par02Smearer::SmearMomentum()). Based on G4
|
||||
/// examples/extended/parametrisations/Par01/include/Par01EMShowerModel.hh .
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02FastSimModelHCal : public G4VFastSimulationModel {
|
||||
public:
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
/// @param aEnvelope A region where the model can take over the ordinary tracking.
|
||||
/// @param aParamType A parametrisation type.
|
||||
Par02FastSimModelHCal( G4String aModelName, G4Region* aEnvelope,
|
||||
Par02DetectorParametrisation::Parametrisation aParamType );
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
/// @param aEnvelope A region where the model can take over the ordinary tracking.
|
||||
Par02FastSimModelHCal( G4String aModelName, G4Region* aEnvelope );
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
Par02FastSimModelHCal( G4String aModelName );
|
||||
|
||||
~Par02FastSimModelHCal();
|
||||
|
||||
/// Checks if this model should be applied to this particle type.
|
||||
/// @param aParticle A particle definition (type).
|
||||
virtual G4bool IsApplicable( const G4ParticleDefinition& aParticle );
|
||||
|
||||
/// Checks if the model should be applied, taking into account the
|
||||
/// kinematics of a track.
|
||||
/// @param aFastTrack A track.
|
||||
virtual G4bool ModelTrigger( const G4FastTrack& aFastTrack );
|
||||
|
||||
/// Smears the energy deposit and saves it, together with the
|
||||
/// position of the deposit, the hadronic calorimeter resolution and
|
||||
/// efficiency to the Par02PrimaryParticleInformation.
|
||||
/// @param aFastTrack A track.
|
||||
/// @param aFastStep A step.
|
||||
virtual void DoIt( const G4FastTrack& aFastTrack, G4FastStep& aFastStep );
|
||||
|
||||
private:
|
||||
|
||||
/// A pointer to Par02DetectorParametrisation used to get the efficiency and
|
||||
/// resolution of the detector for a given particle and parametrisation type.
|
||||
Par02DetectorParametrisation* fCalculateParametrisation;
|
||||
|
||||
/// A parametrisation type.
|
||||
Par02DetectorParametrisation::Parametrisation fParametrisation;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02FastSimModelTracker.hh
|
||||
/// \brief Definition of the Par02FastSimModelTracker class
|
||||
|
||||
#ifndef PAR02_TRACKER_FAST_SIM_MODEL_H
|
||||
#define PAR02_TRACKER_FAST_SIM_MODEL_H
|
||||
|
||||
#include "G4VFastSimulationModel.hh"
|
||||
#include "Par02DetectorParametrisation.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Navigator.hh"
|
||||
|
||||
/// Shortcut to the ordinary tracking for tracking detectors.
|
||||
///
|
||||
/// The fast simulation model describes what should be done instead of a
|
||||
/// normal tracking. Instead of the ordinary tracking, a particle momentum
|
||||
/// at the entrance of the tracking detector is smeared
|
||||
/// (by Par02Smearer::SmearMomentum()) and the particle is placed at the
|
||||
/// tracking detector exit, at the place it would reach without the change
|
||||
/// of its momentum. Based on G4
|
||||
/// examples/extended/parametrisations/Par01/include/Par01EMShowerModel.hh .
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02FastSimModelTracker : public G4VFastSimulationModel {
|
||||
public:
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
/// @param aEnvelope A region where the model can take over the ordinary tracking.
|
||||
/// @param aParamType A parametrisation type.
|
||||
Par02FastSimModelTracker( G4String aModelName, G4Region* aEnvelope,
|
||||
Par02DetectorParametrisation::Parametrisation aParamType );
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
/// @param aEnvelope A region where the model can take over the ordinary tracking.
|
||||
Par02FastSimModelTracker( G4String aModelName, G4Region* aEnvelope );
|
||||
|
||||
/// A constructor.
|
||||
/// @param aModelName A name of the fast simulation model.
|
||||
Par02FastSimModelTracker( G4String aModelName );
|
||||
|
||||
~Par02FastSimModelTracker();
|
||||
|
||||
/// Checks if this model should be applied to this particle type.
|
||||
/// @param aParticle A particle definition (type).
|
||||
virtual G4bool IsApplicable( const G4ParticleDefinition& aParticle );
|
||||
|
||||
/// Checks if the model should be applied taking into account the kinematics
|
||||
/// of a track.
|
||||
/// @param aFastTrack A track.
|
||||
virtual G4bool ModelTrigger( const G4FastTrack& aFastTrack );
|
||||
|
||||
/// Calculates the final position (at the outer boundary of the tracking detector)
|
||||
/// of a particle with the momentum at the entrance of the tracking detector.
|
||||
/// Smears the particle momentum and saves it, together with the tracking detector
|
||||
/// resolution and efficiency to the Par02PrimaryParticleInformation.
|
||||
/// @param aFastTrack A track.
|
||||
/// @param aFastStep A step.
|
||||
virtual void DoIt( const G4FastTrack& aFastTrack, G4FastStep& aFastStep );
|
||||
|
||||
private:
|
||||
|
||||
/// A pointer to Par02DetectorParametrisation used to get the efficiency and
|
||||
/// resolution of the tracking detector for a given particle and
|
||||
/// parametrisation type.
|
||||
Par02DetectorParametrisation* fCalculateParametrisation;
|
||||
|
||||
/// A parametrisation type.
|
||||
Par02DetectorParametrisation::Parametrisation fParametrisation;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02Output.hh
|
||||
/// \brief Definition of the Par02Output class
|
||||
|
||||
#ifndef PAR02_OUTPUT_H
|
||||
#define PAR02_OUTPUT_H
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Handling the saving to the file.
|
||||
///
|
||||
/// A singleton class that manages creation, writing to and closing of the
|
||||
/// Root output file.
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02Output {
|
||||
public:
|
||||
|
||||
/// Indicates to which ntuple to save the information.
|
||||
enum SaveType { eNoSave, eSaveMC, eSaveTracker, eSaveEMCal, eSaveHCal };
|
||||
|
||||
/// Allows the access to the unique Par02Output object.
|
||||
/// @return A pointer to the Par02Output class.
|
||||
static Par02Output* Instance();
|
||||
|
||||
/// Sets the file name of the output root file.
|
||||
/// @param name The name of the file.
|
||||
void SetFileName( G4String name );
|
||||
|
||||
/// Gets the file name of the output root file.
|
||||
/// @return The name of the file.
|
||||
G4String GetFileName();
|
||||
|
||||
/// Sets fFileNameWithRunNo that indicates whether to add the run number
|
||||
/// to the file name.
|
||||
/// @param app If add the run number.
|
||||
void AppendName( G4bool app );
|
||||
|
||||
/// Calls the G4AnalysisManager::Instance(). It sets the file name of the
|
||||
/// output file based on fFileName and fFileNameWithRunNo and opens the file.
|
||||
/// @param runID A run number (to be added to file name if fFileNameWithRunNo
|
||||
/// is true).
|
||||
void StartAnalysis( G4int runID );
|
||||
|
||||
/// Calls the G4AnalysisManager::Instance().
|
||||
/// It writes to the output file and close it.
|
||||
void EndAnalysis();
|
||||
|
||||
/// Creates Ntuples used to store information about particle (its ID, PDG code,
|
||||
/// energy deposits, etc.). To be called for each event in Par02EventAction.
|
||||
void CreateNtuples();
|
||||
|
||||
/// Creates histograms to combine information from all the events in the run.
|
||||
/// To be called for each run in Par02RunAction.
|
||||
void CreateHistograms();
|
||||
|
||||
/// Saves the information about the particle (track).
|
||||
/// @param aWhatToSave enum indicating what kind of information to store
|
||||
/// (in which ntuple).
|
||||
/// @param aPartID A unique ID within event (taken Geant TrackID).
|
||||
/// @param aPDG A PDG code of a particle.
|
||||
/// @param aVector A vector to be stored (particle momentum in tracker or
|
||||
/// position of energy deposit in calorimeter).
|
||||
/// @param aResolution A resolution of the detector that was used.
|
||||
/// @param aEfficiency An efficiency of the detector that was used.
|
||||
/// @param aEnergy An energy deposit (for calorimeters only:
|
||||
/// Par02Output::SaveType::eEMCal or Par02Output::SaveType::eHCal).
|
||||
void SaveTrack( SaveType aWhatToSave, G4int aPartID, G4int aPDG,
|
||||
G4ThreeVector aVector, G4double aResolution = 0,
|
||||
G4double aEfficiency = 1, G4double aEnergy = 0 ) ;
|
||||
|
||||
/// Fills the histogram.
|
||||
/// @param HNo Number of a histogram (decided by the order of creation
|
||||
/// in CreateHistograms(), the first one is 0).
|
||||
/// @param value A value to be filled into the histogram.
|
||||
void FillHistogram( G4int HNo, G4double value ) const;
|
||||
|
||||
~Par02Output();
|
||||
|
||||
protected:
|
||||
|
||||
/// A default, protected constructor (due to singleton pattern).
|
||||
Par02Output();
|
||||
|
||||
private:
|
||||
|
||||
/// The pointer to the only Par02Output class object.
|
||||
static Par02Output* fPar02Output;
|
||||
|
||||
/// Current ntuple Id
|
||||
static G4ThreadLocal G4int fCurrentNtupleId;
|
||||
|
||||
/// A name of the output root file.
|
||||
G4String fFileName;
|
||||
|
||||
/// If true, a run number should be added to the file. Default: false.
|
||||
G4bool fFileNameWithRunNo;
|
||||
|
||||
/// A control value of particle ID to ensure that data saved to various ntuples
|
||||
/// match the same particle. It is set when Monte Carlo information is saved
|
||||
/// and checked for all the detectors.
|
||||
static G4ThreadLocal G4int fCurrentID;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02PhysicsList.hh
|
||||
/// \brief Definition of the Par02PhysicsList class
|
||||
|
||||
#ifndef PAR02_PHYSICS_LIST_H
|
||||
#define PAR02_PHYSICS_LIST_H
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Construction of a physics list.
|
||||
///
|
||||
/// A mandatory initialization class of the physics list.
|
||||
/// For the purposes of fast simulation, only transportation, decays and
|
||||
/// parametrisation is used. Based on G4
|
||||
/// examples/extended/parametrisations/Par01/include/Par01PhysicsList.hh .
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02PhysicsList : public G4VUserPhysicsList {
|
||||
public:
|
||||
|
||||
/// A default constructor. Sets the default cut value.
|
||||
Par02PhysicsList();
|
||||
|
||||
virtual ~Par02PhysicsList();
|
||||
|
||||
protected:
|
||||
|
||||
/// Constructs particles: bosons, leptons, mesons, baryons and ions.
|
||||
virtual void ConstructParticle();
|
||||
|
||||
/// Constructs physics processes: particle transportation, decays,
|
||||
/// parametrisation (for the purpose of fast parametric simulation).
|
||||
virtual void ConstructProcess();
|
||||
|
||||
/// Sets cuts with the default value for all particle types.
|
||||
virtual void SetCuts();
|
||||
|
||||
/// Constructs bosons (including geantino)
|
||||
virtual void ConstructBosons();
|
||||
|
||||
/// Constructs all leptons.
|
||||
virtual void ConstructLeptons();
|
||||
|
||||
/// Constructs all mesons.
|
||||
virtual void ConstructMesons();
|
||||
|
||||
/// Constructs all barions.
|
||||
virtual void ConstructBaryons();
|
||||
|
||||
/// Constructs light ions.
|
||||
virtual void ConstructIons();
|
||||
|
||||
/// Creates a G4FastSimulationManagerProcess object for all the particle types.
|
||||
void AddParameterisation();
|
||||
|
||||
/// Adds decay process.
|
||||
virtual void ConstructGeneral();
|
||||
|
||||
/// Adds the particle transport.
|
||||
/// G4CoupledTransportation is used to allow the calculation of the expected
|
||||
/// position of the particle within a G4VFastSimulationModel.
|
||||
virtual void AddTransportation();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the Par02PrimaryGeneratorAction class
|
||||
|
||||
#ifndef PAR02PrimaryGeneratorAction_h
|
||||
#define PAR02PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
|
||||
/// Construction of a primary generation action.
|
||||
///
|
||||
/// For simplicity, we use here the particle gun, but in the original
|
||||
/// application for FCC (developed by Anna Zaborowska), the Monte Carlo
|
||||
/// event generator Pythia8 is used as generator and it is interfaced
|
||||
/// to Geant4 via HepMC.
|
||||
|
||||
class Par02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
|
||||
public:
|
||||
Par02PrimaryGeneratorAction();
|
||||
~Par02PrimaryGeneratorAction();
|
||||
|
||||
virtual void GeneratePrimaries( G4Event* anEvent );
|
||||
G4ParticleGun* GetParticleGun();
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02PrimaryParticleInformation.hh
|
||||
/// \brief Definition of the Par02PrimaryParticleInformation class
|
||||
|
||||
#ifndef PAR02_PRIMARY_PARTICLE_INFORMATION_H
|
||||
#define PAR02_PRIMARY_PARTICLE_INFORMATION_H
|
||||
|
||||
#include "G4VUserPrimaryParticleInformation.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Primary particle information
|
||||
///
|
||||
/// Describes the information that can be associated with a G4PrimaryParticle
|
||||
/// class object.
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02PrimaryParticleInformation : public G4VUserPrimaryParticleInformation {
|
||||
public:
|
||||
|
||||
/// A constructor.
|
||||
/// @param aID A unique particle ID within event.
|
||||
/// @param aPDG A PDG code of the particle.
|
||||
/// @param aMomentum An initial particle momentum (at the primary vertex).
|
||||
Par02PrimaryParticleInformation( G4int aID, G4int aPDG, G4ThreeVector aMomentum );
|
||||
|
||||
virtual ~Par02PrimaryParticleInformation();
|
||||
|
||||
/// Prints the information about the particle.
|
||||
virtual void Print() const;
|
||||
|
||||
/// Sets the initial particle momentum (from particle generator).
|
||||
/// @param aMomentum The particle momentum.
|
||||
inline void SetMCMomentum( G4ThreeVector aMomentum ) { fMomentumMC = aMomentum; };
|
||||
|
||||
/// Gets the initial particle momentum (from particle generator).
|
||||
inline G4ThreeVector GetMCMomentum() { return fMomentumMC; };
|
||||
|
||||
/// Sets the particle momentum at the entrance to the tracker detector.
|
||||
/// @param aMomentum The particle momentum.
|
||||
inline void SetTrackerMomentum( G4ThreeVector aMomentum )
|
||||
{ fMomentumTracker = aMomentum; };
|
||||
|
||||
/// Gets the particle momentum at the entrance to the tracker detector.
|
||||
inline G4ThreeVector GetTrackerMomentum() { return fMomentumTracker; }
|
||||
|
||||
/// Sets the tracker detector resolution.
|
||||
/// Currently equal to -1 if AtlFast type of smearing is used.
|
||||
/// @param aResolution The detector resolution
|
||||
/// (particle type and momentum dependent).
|
||||
inline void SetTrackerResolution( G4double aResolution )
|
||||
{ fResolutionTracker = aResolution; };
|
||||
|
||||
/// Gets the tracking detector resolution.
|
||||
/// Currently equal to -1 if AtlFast type of smearing is used.
|
||||
inline G4double GetTrackerResolution() { return fResolutionTracker; };
|
||||
|
||||
/// Sets the tracking detector efficiency.
|
||||
/// Currently not used (efficiency is 1).
|
||||
/// @param aEfficiency The detector efficiency.
|
||||
inline void SetTrackerEfficiency( G4double aEfficiency )
|
||||
{ fEfficiencyTracker = aEfficiency; };
|
||||
|
||||
/// Gets the tracker detector efficiency.
|
||||
/// Currently not used (efficiency is 1).
|
||||
inline G4double GetTrackerEfficiency() { return fEfficiencyTracker; };
|
||||
|
||||
/// Sets the position of the energy deposit in the electromagnetic calorimeter.
|
||||
/// @param aPosition The position of the energy deposit.
|
||||
inline void SetEMCalPosition( G4ThreeVector aPosition )
|
||||
{ fPositionEMCal = aPosition; };
|
||||
|
||||
/// Gets the position of the energy deposit in the electromagnetic calorimeter.
|
||||
inline G4ThreeVector GetEMCalPosition() { return fPositionEMCal; };
|
||||
|
||||
/// Sets the energy deposit in the electromagnetic calorimeter.
|
||||
/// @param aEnergy The energy deposited in the detector.
|
||||
inline void SetEMCalEnergy( G4double aEnergy ) { fEnergyEMCal = aEnergy; };
|
||||
|
||||
/// Sets the energy deposit in the electromagnetic calorimeter.
|
||||
inline G4double GetEMCalEnergy() { return fEnergyEMCal; };
|
||||
|
||||
/// Sets the electromagnetic calorimeter resolution.
|
||||
/// Currently equal to -1 if AtlFast type of smearing is used.
|
||||
/// @param aResolution The calorimeter resolution
|
||||
/// (particle type and momentum dependent).
|
||||
inline void SetEMCalResolution( G4double aResolution )
|
||||
{ fResolutionEMCal = aResolution; };
|
||||
|
||||
/// Gets the electromagnetic calorimeter resolution.
|
||||
/// Currently equal to -1 if AtlFast type of smearing is used.
|
||||
inline G4double GetEMCalResolution() { return fResolutionEMCal; };
|
||||
|
||||
/// Sets the electromagnetic calorimeter efficiency.
|
||||
/// Currently not used (efficiency is 1).
|
||||
/// @param aEfficiency The detector efficiency.
|
||||
inline void SetEMCalEfficiency( G4double aEfficiency )
|
||||
{ fEfficiencyEMCal = aEfficiency; };
|
||||
|
||||
/// Gets the electromagnetic calorimeter efficiency.
|
||||
/// Currently not used (efficiency is 1).
|
||||
inline G4double GetEMCalEfficiency() { return fEfficiencyEMCal; };
|
||||
|
||||
/// Sets the position of the energy deposit in the hadronic calorimeter.
|
||||
/// @param aPosition The position of the energy deposit.
|
||||
inline void SetHCalPosition( G4ThreeVector aPosition )
|
||||
{ fPositionHCal = aPosition; };
|
||||
|
||||
/// Gets the position of the energy deposit in the hadronic calorimeter.
|
||||
inline G4ThreeVector GetHCalPosition() { return fPositionHCal; };
|
||||
|
||||
/// Sets the energy deposit in the hadronic calorimeter.
|
||||
/// @param aEnergy The energy deposited in the detector.
|
||||
inline void SetHCalEnergy( G4double aEnergy ) { fEnergyHCal = aEnergy; };
|
||||
|
||||
/// Sets the energy deposit in the hadronic calorimeter.
|
||||
inline G4double GetHCalEnergy() { return fEnergyHCal; };
|
||||
|
||||
/// Sets the hadronic calorimeter resolution.
|
||||
/// Currently equal to -1 if AtlFast type of smearing is used.
|
||||
/// @param aResolution The calorimeter resolution
|
||||
/// (particle type and momentum dependent).
|
||||
inline void SetHCalResolution( G4double aResolution )
|
||||
{ fResolutionHCal = aResolution; };
|
||||
|
||||
/// Gets the hadronic calorimeter resolution.
|
||||
/// Currently equal to -1 if AtlFast type of smearing is used.
|
||||
inline G4double GetHCalResolution() { return fResolutionHCal; };
|
||||
|
||||
/// Sets the hadronic calorimeter efficiency.
|
||||
/// Currently not used (efficiency is 1).
|
||||
/// @param aEfficiency The detector efficiency.
|
||||
inline void SetHCalEfficiency( G4double aEfficiency )
|
||||
{ fEfficiencyHCal = aEfficiency; };
|
||||
|
||||
/// Gets the hadronic calorimeter efficiency.
|
||||
/// Currently not used (efficiency is 1).
|
||||
inline G4double GetHCalEfficiency() { return fEfficiencyHCal; };
|
||||
|
||||
/// Gets the particle unique ID (within event). Can be set only in the constructor.
|
||||
inline G4int GetPartID() const { return fPartID; };
|
||||
|
||||
/// Gets the standard PDG code. Can be set only in the constructor.
|
||||
inline G4int GetPDG() const { return fPDG; };
|
||||
|
||||
private:
|
||||
|
||||
/// A particle unique ID.
|
||||
G4int fPartID;
|
||||
|
||||
/// A particle type (PDG code).
|
||||
G4int fPDG;
|
||||
|
||||
/// A particle initial momentum (from particle generator).
|
||||
G4ThreeVector fMomentumMC;
|
||||
|
||||
/// A particle momentum at the entrance to the tracking detector.
|
||||
G4ThreeVector fMomentumTracker;
|
||||
|
||||
/// A resolution of the tracking detector.
|
||||
G4double fResolutionTracker;
|
||||
|
||||
/// An efficiency of the tracking detector.
|
||||
/// Currently not used (equal to 1).
|
||||
G4double fEfficiencyTracker;
|
||||
|
||||
/// A position of the energy deposited in the electromagnetic calorimeter.
|
||||
G4ThreeVector fPositionEMCal;
|
||||
|
||||
/// An energy deposited in the electromagnetic calorimeter.
|
||||
G4double fEnergyEMCal;
|
||||
|
||||
/// The resolution of the electromagnetic calorimeter.
|
||||
G4double fResolutionEMCal;
|
||||
|
||||
/// The efficiency of the electromagnetic calorimeter.
|
||||
/// Currently not used (equal to 1).
|
||||
G4double fEfficiencyEMCal;
|
||||
|
||||
/// A position of the energy deposited in the hadronic calorimeter.
|
||||
G4ThreeVector fPositionHCal;
|
||||
|
||||
/// An energy deposited in the hadronic calorimeter.
|
||||
G4double fEnergyHCal;
|
||||
|
||||
/// The resolution of the hadronic calorimeter.
|
||||
G4double fResolutionHCal;
|
||||
|
||||
/// The efficiency of the hadronic calorimeter.
|
||||
/// Currently not used (equal to 1).
|
||||
G4double fEfficiencyHCal;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02RunAction.hh
|
||||
/// \brief Definition of the Par02RunAction class
|
||||
|
||||
#ifndef PAR02_RUN_ACTION_H
|
||||
#define PAR02_RUN_ACTION_H
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Run;
|
||||
|
||||
/// Run action (before/after run processing).
|
||||
///
|
||||
/// Defines the action at the beginning and at the end of each run.
|
||||
/// Content of G4Run cannot be changed.
|
||||
/// The class needs to be set in G4RunManager::SetUserAction().
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02RunAction : public G4UserRunAction {
|
||||
public:
|
||||
|
||||
/// A default constructor.
|
||||
/// @param OutName The output root file name
|
||||
/// (it will store all the events within one run).
|
||||
Par02RunAction( const G4String OutName = "SimpleOutput" );
|
||||
|
||||
virtual ~Par02RunAction();
|
||||
|
||||
/// Defines the actions at the beginning of the run.
|
||||
/// It starts the analysis (create output root file) and create all the
|
||||
/// histograms defined in Par02Output singleton class.
|
||||
virtual void BeginOfRunAction( const G4Run* );
|
||||
|
||||
/// Defines the actions at the end of the run.
|
||||
/// It ends the analysis (write and close output root file) via Par02Output
|
||||
/// singleton class.
|
||||
virtual void EndOfRunAction( const G4Run* );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02Smearer.hh
|
||||
/// \brief Definition of the Par02Smearer class
|
||||
|
||||
#ifndef PAR02_SMEARER_H
|
||||
#define PAR02_SMEARER_H
|
||||
|
||||
#include "Par02Output.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "CLHEP/Random/JamesRandom.h"
|
||||
#include "CLHEP/Random/RandGauss.h"
|
||||
|
||||
/// Smearing of the particle momentum or energy.
|
||||
///
|
||||
/// A singleton class used to smear (alter) the particle momentum (for tracking
|
||||
/// detectors) and energy (for calorimeters). In case the resolution is given,
|
||||
/// the momentum (energy) is smeared with Gaussian distribution.
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02Smearer {
|
||||
public:
|
||||
|
||||
/// Allows the access to the unique Par02Smearer class object.
|
||||
/// @return A pointer to the Par02Smearer class.
|
||||
static Par02Smearer* Instance();
|
||||
|
||||
/// Smears the momentum with a given resolution.
|
||||
/// @param aTrack A track to smear.
|
||||
/// @param aResolution A resolution. Gaussian smearing is done with a
|
||||
/// given resolution as a standard deviation.
|
||||
G4ThreeVector SmearMomentum( const G4Track* aTrack, G4double aResolution = -1 );
|
||||
|
||||
/// Smears the energy deposit with a given resolution.
|
||||
/// @param aTrack A track to smear.
|
||||
/// @param aResolution A resolution. Gaussian smearing is done with a
|
||||
/// given resolution as a standard deviation.
|
||||
G4double SmearEnergy( const G4Track* aTrack, G4double aResolution = -1 );
|
||||
|
||||
/// First possible type of smearing. Smears the momentum with a given resolution.
|
||||
/// @param aTrackOriginal A track to smear.
|
||||
/// @param aResolution A resolution taken as a standard deviation of a
|
||||
/// Gaussian distribution.
|
||||
G4ThreeVector SmearGaussian( const G4Track* aTrackOriginal, G4double aResolution );
|
||||
|
||||
/// Returns a random number from a Gaussian distribution.
|
||||
/// @param aMean The mean of the Gaussian distribution.
|
||||
/// @param aStandardDeviation The standard deviation of a Gaussian distribution.
|
||||
G4double Gauss( G4double aMean, G4double aStandardDeviation );
|
||||
|
||||
protected:
|
||||
|
||||
/// A default constructor.
|
||||
Par02Smearer();
|
||||
|
||||
~Par02Smearer();
|
||||
|
||||
private:
|
||||
|
||||
/// A pointer to Par02Smearer object.
|
||||
static Par02Smearer* fPar02Smearer;
|
||||
|
||||
/// CLHEP random engine.
|
||||
CLHEP::HepRandomEngine* fRandomEngine;
|
||||
|
||||
/// CLHEP random engine used in gaussian smearing.
|
||||
CLHEP::RandGauss* fRandomGauss;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
/// \file Par02TrackingAction.hh
|
||||
/// \brief Definition of the Par02TrackingAction class
|
||||
|
||||
#ifndef PAR02_TRACKING_ACTION_H
|
||||
#define PAR02_TRACKING_ACTION_H
|
||||
|
||||
#include "G4UserTrackingAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
/// Tracking action (before/after track processing).
|
||||
///
|
||||
/// Defines the action at the start and at the end of processing of each track.
|
||||
/// The class needs to be set in G4RunManager::SetUserAction().
|
||||
/// @author Anna Zaborowska
|
||||
|
||||
class Par02TrackingAction : public G4UserTrackingAction {
|
||||
public:
|
||||
|
||||
/// A default constructor.
|
||||
Par02TrackingAction();
|
||||
|
||||
virtual ~Par02TrackingAction();
|
||||
|
||||
/// Defines the actions at the start of processing the track.
|
||||
/// It checks the pseudorapidity range and if the particle is a primary.
|
||||
virtual void PreUserTrackingAction( const G4Track* track );
|
||||
|
||||
/// Defines the actions at the end of processing the track.
|
||||
/// It saves the information of MC data (PDG code, initial momentum),
|
||||
/// tracker (momentum), EMCal and HCal (energy deposit and its position)
|
||||
/// as well as resolution and efficiency for all the detectors.
|
||||
virtual void PostUserTrackingAction( const G4Track* track );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user