Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -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. *
// ********************************************************************
//
//
//
// --------------------------------------------------------------------
// GEANT4 class header file
//
// Class Description:
// Manages a clipboard for communicatimg between quantum entangled tracks.
//
// ------------------ G4EntanglementAuxInfo ------------------
//
// Author: J.Allison, May 2017
//
// --------------------------------------------------------------------
// Usage:
//
// This is a concrete class based on G4VAuxiliaryTrackInformation. It is
// designed to hold a shared pointer to a "clip board". The idea is to
// provide an object - the clip board - that is common across all tracks
// that have this track information and is deleted only when all tracks
// have been tracked.
//
// See G4VEntanglementClipBoard.hh for more infromation.
#ifndef G4EntanglementAuxInfo_hh
#define G4EntanglementAuxInfo_hh
#include "G4VAuxiliaryTrackInformation.hh"
#include <memory>
#include "G4VEntanglementClipBoard.hh"
class G4EntanglementAuxInfo : public G4VAuxiliaryTrackInformation {
public:
G4EntanglementAuxInfo
(const std::shared_ptr<G4VEntanglementClipBoard>& clipBoard)
: fEntanglementClipBoard(clipBoard) {}
~G4EntanglementAuxInfo() {}
G4VEntanglementClipBoard* GetEntanglementClipBoard() const
{return fEntanglementClipBoard.get();}
private:
std::shared_ptr<G4VEntanglementClipBoard> fEntanglementClipBoard;
};
#endif
@@ -0,0 +1,134 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
// --------------------------------------------------------------------
// GEANT4 class header file
//
// Class Description:
// Base class for a clipboard for communicating between quantum entangled tracks.
//
// ------------------ G4VEntanglementClipBoard ------------------
//
// Author: J.Allison, May 2017
//
// --------------------------------------------------------------------
// Usage:
//
// In the method that generates entangled secondaries
// (See, for example, G4eplusAnnihilation::AtRestDoIt)
// Make a shared pointer to a clip board and attach it to the tracks through
// G4EntanglementAuxInfo. That way the clip board lasts the life of both tracks.
// (G4XXXEntanglementClipBoard is your class inherited from this class)
// (See, for example, G4eplusAnnihilationEntanglementClipBoard)
// auto clipBoard = std::make_shared<G4XXXEntanglementClipBoard>();
// For each secondary
// G4Track* track = new G4Track(...
// ...
// clipBoard->SetTrackA(track);
// track->SetAuxiliaryTrackInformation(0,new G4EntanglementAuxInfo(clipBoard));
// Then repeat for track B
//
// In the method that does the quantum "measurement"
// (See, for example, G4LivermorePolarizedComptonModel::SampleSecondaries)
// const auto* auxInfo = fParticleChange->GetCurrentTrack()->GetAuxiliaryTrackInformation(0);
// if (auxInfo) {
// const auto* entanglementAuxInfo = dynamic_cast<const G4EntanglementAuxInfo*>(auxInfo);
// if (entanglementAuxInfo) {
// auto* clipBoard = dynamic_cast<G4XXXEntanglementClipBoard*>
// (entanglementAuxInfo->GetEntanglementClipBoard());
// if (clipBoard) {
// if (clipBoard->IsTrack1Measurement()) {
// if (clipBoard->GetTrackB() == fParticleChange->GetCurrentTrack()) {
// clipBoard->ResetTrack1Measurement();
// // Store information
// ...
// }
// } else if (clipBoard->IsTrack2Measurement()) {
// if (clipBoard->GetTrackA() == fParticleChange->GetCurrentTrack()) {
// clipBoard->ResetTrack2Measurement();
// // Retrieve information and apply quantum mechanics
// ...
// }
// }
// }
// }
// }
#ifndef G4VEntanglementClipBoard_hh
#define G4VEntanglementClipBoard_hh
#include "globals.hh"
class G4ParticleDefinition;
class G4Track;
class G4VEntanglementClipBoard {
public:
G4VEntanglementClipBoard()
: fpParentParticleDefinition(0)
, fTrackA(0)
, fTrackB(0)
, fTrack1Measurement(true)
, fTrack2Measurement(true)
{}
virtual ~G4VEntanglementClipBoard() {}
void SetParentParticleDefinition(G4ParticleDefinition* p)
{fpParentParticleDefinition = p;}
G4ParticleDefinition* GetParentParticleDefinition() const
{return fpParentParticleDefinition;}
void SetTrackA(const G4Track* track) {fTrackA = track;}
void SetTrackB(const G4Track* track) {fTrackB = track;}
const G4Track* GetTrackA() const {return fTrackA;}
const G4Track* GetTrackB() const {return fTrackB;}
// The entanglement-sensitive process is responsible for setting this.
void ResetTrack1Measurement() {fTrack1Measurement = false;}
void ResetTrack2Measurement() {fTrack2Measurement = false;}
G4bool IsTrack1Measurement() const {return fTrack1Measurement;}
G4bool IsTrack2Measurement() const {return fTrack2Measurement;}
private:
G4ParticleDefinition* fpParentParticleDefinition;
// Use pointer values to identify tracks. We don't know in which order the
// tracks will be processed so let us call them A & B.
const G4Track* fTrackA;
const G4Track* fTrackB;
// False until first measurement...
G4bool fTrack1Measurement; // ...of the first encountered track
G4bool fTrack2Measurement; // ...of the second encountered track
};
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
// --------------------------------------------------------------------
// GEANT4 class header file
//
// Class Description:
// A clipboard for communicating between quantum entangled photons
// from e+ annihilation. Applies only to the two-gamma decay from the
// JP=0- state of e+e-, para-positronium. (This is the dominant process
// in materials such as human tissue, since the ortho-positronium JP=1-
// state, initially more likely, is "picked off" by a near-by electron
// and turned into para-positronium, because it has the much shorter
// meanlife.)
// Also applies to pi zero (JP=0-).
//
// ------------------ G4eplusAnnihilationEntanglementClipBoard ------------------
//
// Author: J.Allison, May 2017
//
// --------------------------------------------------------------------
// This is a concrete class based on G4VEntanglementClipBoard. Information
// specific to this type of entanglement can be posted here. See
// G4VEntanglementClipBoard.hh for more detail on how to use this class.
#ifndef G4eplusAnnihilationEntanglementClipBoard_hh
#define G4eplusAnnihilationEntanglementClipBoard_hh
#include "G4VEntanglementClipBoard.hh"
class G4eplusAnnihilationEntanglementClipBoard
: public G4VEntanglementClipBoard
{
public:
G4eplusAnnihilationEntanglementClipBoard()
: fComptonCosTheta1(0.)
, fComptonPhi1(0.)
{}
~G4eplusAnnihilationEntanglementClipBoard() {}
// Cos(theta) and phi of the first Compton scattering of the first photon
void SetComptonCosTheta1(G4double cosTheta1) {fComptonCosTheta1 = cosTheta1;}
void SetComptonPhi1(G4double phi1) {fComptonPhi1 = phi1;}
G4double GetComptonCosTheta1() const {return fComptonCosTheta1;}
G4double GetComptonPhi1() const {return fComptonPhi1;}
protected:
// Cos(theta) and phi of the first Compton scattering of the first photon
G4double fComptonCosTheta1, fComptonPhi1;
};
#endif