Geant4  10.01.p03
G4MolecularDissociationChannel.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4MolecularDissociationChannel.cc 84858 2014-10-21 16:08:22Z gcosmo $
27 //
28 // ----------------------------------------------------------------------
29 // GEANT 4 class implementation file
30 //
31 // History: first implementation by Alfonso Mantero 4 Mar 2009
32 //
33 // **********************************************************************
34 
36 #include "G4Molecule.hh"
38 #include "G4MoleculeTable.hh"
39 
40 using namespace std;
41 
42 // ######################################################################
43 // ### MolecularDecayChannel ###
44 // ######################################################################
45 
47 {
48  bool operator()(const G4Molecule* mol1, const G4Molecule* mol2) const
49  {
50  return (*mol1) < (*mol2);
51  }
52 };
53 
55  fName(aName)
56 {
57  //pointer
58  fProductsVector = 0;
59  //double
60  fDecayTime = 0;
61  fProbability = 0;
62  fReleasedEnergy = 0;
64  fDisplacementType = 0; // meaning no displacement cf G4VMolecularDisplacer
65 }
66 
68 {
69  // pointer
70  fProductsVector = 0;
71  // double
72  fReleasedEnergy = 0;
73  fDecayTime = 0;
74  fProbability = 0;
76  fDisplacementType = 0; // meaning no displacement cf G4VMolecularDisplacer
77 }
78 
80 {
81  if (fProductsVector)
82  {
83  fProductsVector->clear();
84  delete fProductsVector;
85  }
86 }
87 
89 {
90  *this = right;
91 }
92 
94 {
95  if (&right == this) return *this;
96 
97  // string
98  fName = right.fName;
99  //displacement type
101  // pointer
102  if (right.fProductsVector)
103  {
104 // fProductsVector = new vector<G4MoleculeHandle>(*(right.fProductsVector));
105  fProductsVector = new vector<const G4Molecule*>(*(right.fProductsVector));
106  }
107  else fProductsVector = 0;
108 
109  // double
111  fDecayTime = right.fDecayTime;
112  fProbability = right.fProbability;
113  // vector
116  return *this;
117 
118 }
119 
121  G4double displacement)
122 {
123 // if(!fProductsVector) fProductsVector = new vector<G4MoleculeHandle> ;
124  if (!fProductsVector) fProductsVector = new vector<const G4Molecule*>;
125 
126 // G4MoleculeHandle molHandle(G4MoleculeHandleManager::Instance()->GetMoleculeHandle(molecule));
127 // fProductsVector->push_back(molHandle);
128 
129  fProductsVector->push_back(molecule);
130  fRMSProductsDisplacementVector.push_back(displacement);
131 }
132 
134  G4double displacement)
135 {
136 // if(!fProductsVector) fProductsVector = new vector<G4MoleculeHandle> ;
137  if (!fProductsVector) fProductsVector = new vector<const G4Molecule*>;
138 
139  fProductsVector->push_back(
140  G4MoleculeTable::Instance()->GetMoleculeModel(molecule));
141  fRMSProductsDisplacementVector.push_back(displacement);
142 }
143 
145 {
146  if (fProductsVector) return fProductsVector->size();
147  return 0;
148 }
149 
151 {
152  if (fProductsVector)
153 // return ((*fProductsVector)[index]).get();
154  return ((*fProductsVector)[index]);
155 
156  return 0;
157 }
158 
160 {
161  if (!fProductsVector) return -1.;
162 
163  G4int sz = fProductsVector->size();
164  G4double value = DBL_MAX;
165  for (G4int i = 0; i < sz; i++)
166  {
167 // if(*product != *((*fProductsVector)[i]).get())
168  if (*product != *((*fProductsVector)[i]))
169  {
171  }
172  }
173  return value;
174 }
175 
G4double GetRMSRadialDisplacementOfProduct(const G4Molecule *)
bool operator()(const G4Molecule *mol1, const G4Molecule *mol2) const
G4String fName
Definition: G4AttUtils.hh:55
int G4int
Definition: G4Types.hh:78
void AddProduct(const G4Molecule *, G4double=0)
std::vector< G4double > fRMSProductsDisplacementVector
static G4MoleculeTable * Instance()
const G4Molecule * GetProduct(int) const
Class Description The dynamic molecule holds all the data that change for a molecule It has a pointer...
Definition: G4Molecule.hh:93
double G4double
Definition: G4Types.hh:76
std::vector< const G4Molecule * > * fProductsVector
G4MolecularDissociationChannel & operator=(const G4MolecularDissociationChannel &right)
#define DBL_MAX
Definition: templates.hh:83