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 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/dna/models/src/G4DNAMolecularReaction.cc (Version 11.3.0) and /processes/electromagnetic/dna/models/src/G4DNAMolecularReaction.cc (Version 9.4)


  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 // Author: Mathieu Karamitros (kara@cenbg.in2p    
 28 //                                                
 29 // WARNING : This class is released as a proto    
 30 // It might strongly evolve or even disapear i    
 31 //                                                
 32 // History:                                       
 33 // -----------                                    
 34 // 10 Oct 2011 M.Karamitros created               
 35 //                                                
 36 // -------------------------------------------    
 37                                                   
 38 #include "G4DNAMolecularReaction.hh"              
 39 #include "G4DNAMolecularReactionTable.hh"         
 40 #include "G4VDNAReactionModel.hh"                 
 41 #include "G4MolecularConfiguration.hh"            
 42 #include "G4Molecule.hh"                          
 43 #include "G4MoleculeFinder.hh"                    
 44 #include "G4ITReactionChange.hh"                  
 45 #include "G4ITReaction.hh"                        
 46                                                   
 47 #include "G4ITTrackHolder.hh"                     
 48                                                   
 49 G4DNAMolecularReaction::G4DNAMolecularReaction    
 50     :                                             
 51      fMolReactionTable(reference_cast<const G4    
 52     , fpReactionModel(nullptr)                    
 53 {                                                 
 54 }                                                 
 55                                                   
 56 G4DNAMolecularReaction::G4DNAMolecularReaction    
 57     : G4DNAMolecularReaction()                    
 58 {                                                 
 59     fpReactionModel = pReactionModel;             
 60 }                                                 
 61                                                   
 62 G4bool G4DNAMolecularReaction::TestReactibilit    
 63                                                   
 64                                                   
 65                                                   
 66 {                                                 
 67     const auto pMoleculeA = GetMolecule(trackA    
 68     const auto pMoleculeB = GetMolecule(trackB    
 69                                                   
 70     const G4double reactionRadius = fpReaction    
 71                                                   
 72     G4double separationDistance = -1.;            
 73                                                   
 74     if (currentStepTime == 0.)                    
 75     {                                             
 76         userStepTimeLimit = false;                
 77     }                                             
 78                                                   
 79     G4bool output = fpReactionModel->FindReact    
 80                                                   
 81     return output;                                
 82 }                                                 
 83                                                   
 84 std::unique_ptr<G4ITReactionChange> G4DNAMolec    
 85                                                   
 86 {                                                 
 87     std::unique_ptr<G4ITReactionChange> pChang    
 88     pChanges->Initialize(trackA, trackB);         
 89                                                   
 90     const auto pMoleculeA = GetMolecule(trackA    
 91     const auto pMoleculeB = GetMolecule(trackB    
 92                                                   
 93     const auto pReactionData = fMolReactionTab    
 94                                                   
 95     const G4int nbProducts = pReactionData->Ge    
 96                                                   
 97     if (nbProducts != 0)                          
 98     {                                             
 99         const G4double D1 = pMoleculeA->GetDif    
100         const G4double D2 = pMoleculeB->GetDif    
101         const G4double sqrD1 = D1 == 0. ? 0. :    
102         const G4double sqrD2 = D2 == 0. ? 0. :    
103         const G4double inv_numerator = 1./(sqr    
104         const G4ThreeVector reactionSite = sqr    
105                                          + sqr    
106                                                   
107         for (G4int j = 0; j < nbProducts; ++j)    
108         {                                         
109             auto pProduct = new G4Molecule(pRe    
110             auto pProductTrack = pProduct->Bui    
111                                                   
112             pProductTrack->SetTrackStatus(fAli    
113                                                   
114             G4ITTrackHolder::Instance()->Push(    
115                                                   
116             pChanges->AddSecondary(pProductTra    
117             G4MoleculeFinder::Instance()->Push    
118         }                                         
119     }                                             
120                                                   
121     pChanges->KillParents(true);                  
122     return pChanges;                              
123 }                                                 
124                                                   
125 void G4DNAMolecularReaction::SetReactionModel(    
126 {                                                 
127     fpReactionModel = pReactionModel;             
128 }                                                 
129                                                   
130 std::vector<std::unique_ptr<G4ITReactionChange    
131     G4ITReactionSet* pReactionSet,                
132     const double currentStepTime,                 
133     const double /*fGlobalTime*/,                 
134     const bool reachedUserStepTimeLimit)          
135 {                                                 
136     std::vector<std::unique_ptr<G4ITReactionCh    
137     fReactionInfo.clear();                        
138                                                   
139     if (pReactionSet == nullptr)                  
140     {                                             
141         return fReactionInfo;                     
142     }                                             
143                                                   
144     G4ITReactionPerTrackMap& reactionPerTrackM    
145     for (auto tracks_i = reactionPerTrackMap.c    
146          tracks_i != reactionPerTrackMap.cend(    
147          tracks_i = reactionPerTrackMap.cbegin    
148     {                                             
149         G4Track* pTrackA = tracks_i->first;       
150         if (pTrackA->GetTrackStatus() == fStop    
151         {                                         
152             continue;                             
153         }                                         
154                                                   
155         G4ITReactionPerTrackPtr reactionPerTra    
156         G4ITReactionList& reactionList = react    
157                                                   
158         assert(reactionList.cbegin() != reacti    
159                                                   
160         for (auto it = reactionList.cbegin();     
161         {                                         
162             G4ITReactionPtr reaction(*it);        
163             G4Track* pTrackB = reaction->GetRe    
164             if (pTrackB->GetTrackStatus() == f    
165             {                                     
166                 continue;                         
167             }                                     
168                                                   
169             if (pTrackB == pTrackA)               
170             {                                     
171                 G4ExceptionDescription excepti    
172                 exceptionDescription              
173                     << "The IT reaction proces    
174                 exceptionDescription << "The p    
175                 G4Exception("G4ITModelProcesso    
176                             "ITModelProcessor0    
177                             FatalErrorInArgume    
178                             exceptionDescripti    
179             }                                     
180                                                   
181             pReactionSet->SelectThisReaction(s    
182                                                   
183             if (TestReactibility(*pTrackA, *pT    
184             {                                     
185                 auto pReactionChange = MakeRea    
186                                                   
187                 if (pReactionChange)              
188                 {                                 
189                     fReactionInfo.push_back(st    
190                     break;                        
191                 }                                 
192             }                                     
193         }                                         
194     }                                             
195                                                   
196     pReactionSet->CleanAllReaction();             
197     return fReactionInfo;                         
198 }                                                 
199