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.4.p3 ] [ 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/molecules/management/src/G4MolecularDissociationChannel.cc (Version 11.3.0) and /processes/electromagnetic/dna/molecules/management/src/G4MolecularDissociationChannel.cc (Version 10.5.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 // -------------------------------------------     27 // ----------------------------------------------------------------------
 28 //      GEANT 4 class implementation file          28 //      GEANT 4 class implementation file
 29 //                                                 29 //
 30 //      History: first implementation by Alfon     30 //      History: first implementation by Alfonso Mantero 4 Mar 2009
 31 //                                                 31 //
 32 // *******************************************     32 // **********************************************************************
 33                                                    33 
 34 #include "G4MolecularDissociationChannel.hh"       34 #include "G4MolecularDissociationChannel.hh"
 35 #include "G4VMolecularDissociationDisplacer.hh <<  35 #include "G4Molecule.hh"
                                                   >>  36 #include "G4MoleculeHandleManager.hh"
                                                   >>  37 #include "G4MoleculeTable.hh"
 36                                                    38 
 37 using namespace std;                               39 using namespace std;
 38                                                    40 
                                                   >>  41 // -----------------------------------------------------------------------------
                                                   >>  42 // ###                      MolecularDecayChannel                            ###
                                                   >>  43 // -----------------------------------------------------------------------------
                                                   >>  44 
                                                   >>  45 //struct CompMoleculePointer
                                                   >>  46 //{
                                                   >>  47 //  bool operator()(const G4Molecule* mol1, const G4Molecule* mol2) const
                                                   >>  48 //  {
                                                   >>  49 //    return (*mol1) < (*mol2);
                                                   >>  50 //  }
                                                   >>  51 //};
                                                   >>  52 
 39 //____________________________________________     53 //______________________________________________________________________________
 40                                                    54 
 41 G4MolecularDissociationChannel::G4MolecularDis <<  55 G4MolecularDissociationChannel::G4MolecularDissociationChannel(G4String aName) :
 42     : G4MolecularDissociationChannel()         <<  56     fName(aName)
 43 {                                              <<  57 {
 44     fName = aName;                             <<  58   //pointer
                                                   >>  59   fProductsVector = 0;
                                                   >>  60   //double
                                                   >>  61   fDecayTime = 0;
                                                   >>  62   fProbability = 0;
                                                   >>  63   fReleasedEnergy = 0;
                                                   >>  64   fRMSMotherMoleculeDisplacement = 0;
                                                   >>  65   fDisplacementType = 0; // meaning no displacement cf G4VMolecularDisplacer
 45 }                                                  66 }
 46                                                    67 
 47 //____________________________________________     68 //______________________________________________________________________________
 48                                                    69 
 49 G4MolecularDissociationChannel::G4MolecularDis     70 G4MolecularDissociationChannel::G4MolecularDissociationChannel()
 50     : fDisplacementType(G4VMolecularDissociati << 
 51     , fReleasedEnergy(0.)                      << 
 52     , fProbability(0.)                         << 
 53     , fDecayTime(0.)                           << 
 54     , fRMSMotherMoleculeDisplacement(0.)       << 
 55 {                                                  71 {
                                                   >>  72   // pointer
                                                   >>  73   fProductsVector = 0;
                                                   >>  74   // double
                                                   >>  75   fReleasedEnergy = 0;
                                                   >>  76   fDecayTime = 0;
                                                   >>  77   fProbability = 0;
                                                   >>  78   fRMSMotherMoleculeDisplacement = 0;
                                                   >>  79   fDisplacementType = 0; // meaning no displacement cf G4VMolecularDisplacer
                                                   >>  80 }
                                                   >>  81 
                                                   >>  82 //______________________________________________________________________________
                                                   >>  83 
                                                   >>  84 G4MolecularDissociationChannel::~G4MolecularDissociationChannel()
                                                   >>  85 {
                                                   >>  86   if(fProductsVector)
                                                   >>  87   {
                                                   >>  88     fProductsVector->clear();
                                                   >>  89     delete fProductsVector;
                                                   >>  90   }
                                                   >>  91 }
                                                   >>  92 
                                                   >>  93 //______________________________________________________________________________
                                                   >>  94 
                                                   >>  95 G4MolecularDissociationChannel::
                                                   >>  96   G4MolecularDissociationChannel(const G4MolecularDissociationChannel& right)
                                                   >>  97 {
                                                   >>  98   *this = right;
                                                   >>  99 }
                                                   >> 100 
                                                   >> 101 //______________________________________________________________________________
                                                   >> 102 
                                                   >> 103 G4MolecularDissociationChannel&
                                                   >> 104 G4MolecularDissociationChannel::operator=(const G4MolecularDissociationChannel& right)
                                                   >> 105 {
                                                   >> 106   if(&right == this) return *this;
                                                   >> 107 
                                                   >> 108   // string
                                                   >> 109   fName = right.fName;
                                                   >> 110   //displacement type
                                                   >> 111   fDisplacementType = right.fDisplacementType;
                                                   >> 112   // pointer
                                                   >> 113   if(right.fProductsVector)
                                                   >> 114   {
                                                   >> 115 //    fProductsVector = new vector<const G4Molecule*>(*(right.fProductsVector));
                                                   >> 116     fProductsVector = new vector<G4MolecularConfiguration*>(*(right.fProductsVector));
                                                   >> 117   }
                                                   >> 118   else fProductsVector = 0;
                                                   >> 119 
                                                   >> 120   // double
                                                   >> 121   fReleasedEnergy = right.fReleasedEnergy;
                                                   >> 122   fDecayTime = right.fDecayTime;
                                                   >> 123   fProbability = right.fProbability;
                                                   >> 124   // vector
                                                   >> 125   fRMSMotherMoleculeDisplacement = right.fRMSMotherMoleculeDisplacement;
                                                   >> 126   fRMSProductsDisplacementVector = right.fRMSProductsDisplacementVector;
                                                   >> 127   return *this;
                                                   >> 128 }
                                                   >> 129 
                                                   >> 130 //______________________________________________________________________________
                                                   >> 131 
                                                   >> 132 void G4MolecularDissociationChannel::AddProduct(const G4Molecule* molecule,
                                                   >> 133                                                 G4double displacement)
                                                   >> 134 {
                                                   >> 135   if(!fProductsVector) fProductsVector = new vector<G4MolecularConfiguration*>;
                                                   >> 136 
                                                   >> 137   fProductsVector->push_back(molecule->GetMolecularConfiguration());
                                                   >> 138   fRMSProductsDisplacementVector.push_back(displacement);
                                                   >> 139 }
                                                   >> 140 
                                                   >> 141 //______________________________________________________________________________
                                                   >> 142 
                                                   >> 143 void
                                                   >> 144 G4MolecularDissociationChannel::AddProduct(G4MolecularConfiguration* molecule,
                                                   >> 145                                            G4double displacement)
                                                   >> 146 {
                                                   >> 147   if(!fProductsVector) fProductsVector = new vector<G4MolecularConfiguration*>;
                                                   >> 148 
                                                   >> 149   fProductsVector->push_back(molecule);
                                                   >> 150   fRMSProductsDisplacementVector.push_back(displacement);
 56 }                                                 151 }
 57                                                   152 
 58 //____________________________________________    153 //______________________________________________________________________________
 59                                                   154 
 60 void G4MolecularDissociationChannel::AddProduc << 155 void G4MolecularDissociationChannel::AddProduct(const G4String& molecule,
 61                                                   156                                                 G4double displacement)
 62 {                                                 157 {
 63     fProductsVector.push_back(pProduct);       << 158 //  if(!fProductsVector) fProductsVector = new vector<const G4Molecule*>;
 64     fRMSProductsDisplacementVector.push_back(d << 159   if(!fProductsVector) fProductsVector = new vector<G4MolecularConfiguration*>;
                                                   >> 160 
                                                   >> 161   fProductsVector->push_back(
                                                   >> 162       G4MoleculeTable::Instance()->GetConfiguration(molecule));
                                                   >> 163   fRMSProductsDisplacementVector.push_back(displacement);
 65 }                                                 164 }
 66                                                   165 
 67 //____________________________________________    166 //______________________________________________________________________________
 68                                                   167 
 69 G4int G4MolecularDissociationChannel::GetNbPro    168 G4int G4MolecularDissociationChannel::GetNbProducts() const
 70 {                                                 169 {
 71     return (G4int)fProductsVector.size();      << 170   if(fProductsVector) return fProductsVector->size();
                                                   >> 171   return 0;
 72 }                                                 172 }
 73                                                   173 
 74 //____________________________________________    174 //______________________________________________________________________________
 75                                                   175 
 76 G4MolecularDissociationChannel::Product* G4Mol << 176 G4MolecularConfiguration* G4MolecularDissociationChannel::GetProduct(int index) const
 77 {                                                 177 {
 78     return fProductsVector[index];             << 178   if(fProductsVector)
                                                   >> 179     return ((*fProductsVector)[index]);
                                                   >> 180 
                                                   >> 181   return 0;
 79 }                                                 182 }
 80                                                   183 
 81 //____________________________________________    184 //______________________________________________________________________________
 82                                                   185 
 83 G4double                                          186 G4double
 84 G4MolecularDissociationChannel::GetRMSRadialDi << 187 G4MolecularDissociationChannel::
                                                   >> 188   GetRMSRadialDisplacementOfProduct(const G4Molecule* product)
 85 {                                                 189 {
 86     if (fProductsVector.empty())               << 190   if(!fProductsVector) return -1.;
 87     {                                          << 
 88         return -1.;                            << 
 89     }                                          << 
 90                                                << 
 91     auto it = std::find_if(fProductsVector.beg << 
 92                            [pProduct](Product* << 
 93                                return _pProduc << 
 94                            });                 << 
 95                                                   191 
 96     if (it == fProductsVector.end())           << 192   G4int sz = fProductsVector->size();
                                                   >> 193   G4double value = DBL_MAX;
                                                   >> 194   for(G4int i = 0; i < sz; i++)
                                                   >> 195   {
                                                   >> 196     if(product->GetMolecularConfiguration() != ((*fProductsVector)[i]))
 97     {                                             197     {
 98         return -1.;                            << 198       value = fRMSProductsDisplacementVector[i];
 99     }                                             199     }
100     auto index = std::distance(fProductsVector << 200   }
101     return fRMSProductsDisplacementVector[inde << 201   return value;
102 }                                                 202 }
103                                                   203 
104                                                   204