Message: Re: Proposed G4PhysicsOrderedFreeVector reverse or order methods Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning Re: Proposed G4PhysicsOrderedFreeVector reverse or order methods 

Forum: Geometry
Re: Question Proposed G4PhysicsOrderedFreeVector reverse or order methods (Phil Jones)
Re: News Re: Proposed G4PhysicsOrderedFreeVector reverse or order methods (Michael H. Kelsey)
Re: None Re: Proposed G4PhysicsOrderedFreeVector reverse or order methods (Phil Jones)
Date: 14 Jun, 2012
From: Gumplinger Peter <Gumplinger Peter>

You'll find attached the modified G4PhysicsOrderedFreeVector.cc. (I don't know exactly when the next patch to 9.5 will be released - but soon I guess).

Please, try it out and let us know if it isn't working to your satisfaction. That'll help us make sure it definitely is doing now what it is supposed to be doing. This issue also came up in this thread:

http://hypernews.slac.stanford.edu/HyperNews/geant4/get/opticalphotons/433/1/2/1/1.html

The relevant code is in the constructor:

G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector(G4double *Energies,
                                                       G4double *Values,
                                                       size_t VectorLength)
  : G4PhysicsVector()
{
  type = T_G4PhysicsOrderedFreeVector;

  for (size_t i = 0 ; i < VectorLength ; i++)
    {
      InsertValues(Energies[i], Values[i]);
    }
}

and in InsertValues:

void G4PhysicsOrderedFreeVector::InsertValues(G4double energy, G4double value)
{
        std::vector<G4double>::iterator binLoc =
                 std::lower_bound(binVector.begin(), binVector.end(), energy);

        size_t binIdx = binLoc - binVector.begin();     // Iterator difference!

        std::vector<G4double>::iterator dataLoc = dataVector.begin() + binIdx;

        binVector.insert(binLoc, energy);
        dataVector.insert(dataLoc, value);

        numberOfNodes++;
        edgeMin = binVector.front();
        edgeMax = binVector.back();
}

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2012/06/14/12.44-45749-ysicsOrderedFreeVector.cc

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Proposed G4PhysicsOrderedFreeVector reverse or order methods   (Peter Gumplinger - 15 Jun, 2012)
 Add Message Add Message
to: "Re: Proposed G4PhysicsOrderedFreeVector reverse or order methods"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]