39const G4int G4CollisionComposite::nPoints = 32;
41const G4double G4CollisionComposite::theT[nPoints] =
42{.01, .03, .05, .1, .15, .2, .3, .4, .5, .6, .7, .8, .9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10., 15, 20, 50, 100};
53 std::for_each(components.begin(), components.end(),
G4Delete());
73 crossSect = BufferedCrossSection(trk1,trk2);
82 std::vector<G4double> cxCache;
86 for (i=0; i<components.size(); i++)
92 partialCx = components[i]->CrossSection(trk1,trk2);
99 partialCxSum += partialCx;
100 cxCache.push_back(partialCx);
105 for (i=0; i<cxCache.size(); i++)
107 running += cxCache[i];
108 if (running > random)
110 return components[i]->FinalState(trk1, trk2);
124 G4bool isInCharge =
false;
131 G4CollisionVector::const_iterator iter;
132 for (iter = comps->begin(); iter != comps->end(); ++iter)
134 if ( ((*iter))->
IsInCharge(trk1,trk2) ) isInCharge =
true;
141void G4CollisionComposite::
146 for(i=0; i<theBuffer.size(); i++)
148 if(theBuffer[i].InCharge(aP, bP))
return;
155 for(
size_t tt=0; tt<maxE; tt++)
186 for (i=0; i<components.size(); i++)
190 crossSect += components[i]->CrossSection(a,b);
193 G4double sqrts = (a4Momentum+b4Momentum).mag();
194 aNewBuff.push_back(sqrts, crossSect);
196 theBuffer.push_back(aNewBuff);
204 for(
size_t i=0; i<theBuffer.size(); i++)
208 return theBuffer[i].CrossSection(trk1, trk2);
211 throw G4HadronicException(__FILE__, __LINE__,
"G4CollisionComposite::BufferedCrossSection - Blitz !!");
std::vector< G4VCollision * > G4CollisionVector
#define G4MUTEXDESTROY(mutex)
#define G4MUTEXINIT(mutex)
CLHEP::Hep3Vector G4ThreeVector
virtual G4bool IsInCharge(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
virtual const G4CollisionVector * GetComponents() const
virtual ~G4CollisionComposite()
virtual const G4VCrossSectionSource * GetCrossSectionSource() const
virtual G4KineticTrackVector * FinalState(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
const G4ParticleDefinition * GetDefinition() const
G4double GetPDGMass() const
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0