Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // 28 // ------------------------------------------- 29 // GEANT4 class header file 30 // 31 // Class Description: 32 // Base class for a clipboard for communicatin 33 // 34 // ------------------ G4VEntanglementClipBoard 35 // 36 // Author: J.Allison, May 2017 37 // 38 // ------------------------------------------- 39 40 // Usage: 41 // 42 // In the method that generates entangled seco 43 // (See, for example, G4eplusAnnihilation::AtR 44 // Make a shared pointer to a clip board and a 45 // G4EntanglementAuxInfo. That way the clip bo 46 // (G4XXXEntanglementClipBoard is your class i 47 // (See, for example, G4eplusAnnihilationEntan 48 // auto clipBoard = std::make_shared<G4XXXEnt 49 // For each secondary 50 // G4Track* track = new G4Track(... 51 // ... 52 // clipBoard->SetTrackA(track); 53 // track->SetAuxiliaryTrackInformation(0,new 54 // Then repeat for track B 55 // 56 // In the method that does the quantum "measur 57 // (See, for example, G4LivermorePolarizedComp 58 // const auto* auxInfo = fParticleChange->Get 59 // if (auxInfo) { 60 // const auto* entanglementAuxInfo = dynami 61 // if (entanglementAuxInfo) { 62 // auto* clipBoard = dynamic_cast<G4XXXEn 63 // (entanglementAuxInfo->GetEntanglementC 64 // if (clipBoard) { 65 // if (clipBoard->IsTrack1Measurement() 66 // if (clipBoard->GetTrackB() == fPar 67 // clipBoard->ResetTrack1Measuremen 68 // // Store information 69 // ... 70 // } 71 // } else if (clipBoard->IsTrack2Measur 72 // if (clipBoard->GetTrackA() == fPar 73 // clipBoard->ResetTrack2Measuremen 74 // // Retrieve information and appl 75 // ... 76 // } 77 // } 78 // } 79 // } 80 // } 81 82 #ifndef G4VEntanglementClipBoard_hh 83 #define G4VEntanglementClipBoard_hh 84 85 #include "globals.hh" 86 87 class G4ParticleDefinition; 88 class G4Track; 89 90 class G4VEntanglementClipBoard { 91 92 public: 93 94 G4VEntanglementClipBoard() 95 : fpParentParticleDefinition(0) 96 , fTrackA(0) 97 , fTrackB(0) 98 , fTrack1Measurement(true) 99 , fTrack2Measurement(true) 100 {} 101 virtual ~G4VEntanglementClipBoard() {} 102 103 void SetParentParticleDefinition(G4ParticleD 104 {fpParentParticleDefinition = p;} 105 G4ParticleDefinition* GetParentParticleDefin 106 {return fpParentParticleDefinition;} 107 108 void SetTrackA(const G4Track* track) {fTrack 109 void SetTrackB(const G4Track* track) {fTrack 110 const G4Track* GetTrackA() const {return fTr 111 const G4Track* GetTrackB() const {return fTr 112 113 // The entanglement-sensitive process is res 114 void ResetTrack1Measurement() {fTrack1Measur 115 void ResetTrack2Measurement() {fTrack2Measur 116 G4bool IsTrack1Measurement() const {return f 117 G4bool IsTrack2Measurement() const {return f 118 119 private: 120 121 G4ParticleDefinition* fpParentParticleDefini 122 123 // Use pointer values to identify tracks. We 124 // tracks will be processed so let us call t 125 const G4Track* fTrackA; 126 const G4Track* fTrackB; 127 128 // False until first measurement... 129 G4bool fTrack1Measurement; // ...of the fir 130 G4bool fTrack2Measurement; // ...of the sec 131 132 }; 133 134 #endif 135