61 : geometry_(&geometry)
65 , previousForwardLayer_(
nullptr)
77 throw cms::Exception(
"FastSimulation") <<
"If layer is provided, particle must be on layer." 78 <<
"\n Layer: " << *layer
79 <<
"\n Particle: " << particle;
108 if(particleMovesInwards){
116 if(particle.
position().Pt() < layer->getRadius())
138 if(particle.
position().Z() < layer->getZ())
157 if(!particleMovesInwards)
165 if(particleMovesInwards)
204 std::vector<const fastsim::SimplifiedGeometry*>
layers;
231 double deltaTimeC = -1;
232 for(
auto _layer : layers)
234 double tempDeltaTime = trajectory->nextCrossingTimeC(*_layer, particle.
isOnLayer(_layer->isForward(), _layer->index()));
236 if(tempDeltaTime > 0 && (layer ==
nullptr || tempDeltaTime<deltaTimeC || deltaTimeC < 0))
239 deltaTimeC = tempDeltaTime;
244 double properDeltaTimeC = deltaTimeC / particle.
gamma();
250 trajectory->move(deltaTimeC);
251 particle.
position() = trajectory->getPosition();
252 particle.
momentum() = trajectory->getMomentum();
265 trajectory->move(deltaTimeC);
266 particle.
position() = trajectory->getPosition();
267 particle.
momentum() = trajectory->getMomentum();
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Implementation of a generic detector layer (base class for forward/barrel layers).
const BarrelSimplifiedGeometry * previousBarrelLayer_
Pointer to the previous (opposite direction of the particle's momentum) barrel layer.
const math::XYZTLorentzVector & position() const
Return position of the particle.
LayerNavigator(const Geometry &geometry)
Constructor.
const std::vector< std::unique_ptr< ForwardSimplifiedGeometry > > & forwardLayers() const
Return the vector of forward layers (disks).
const BarrelSimplifiedGeometry * nextLayer(const BarrelSimplifiedGeometry *layer) const
Helps to navigate through the vector of barrel layers.
double remainingProperLifeTimeC() const
Return the particle's remaining proper lifetime[in ct].
virtual bool isForward() const =0
Returns false/true depending if the object is a (non-abstract) barrel/forward layer.
void setRemainingProperLifeTimeC(double remainingProperLifeTimeC)
Set the particle's remaining proper lifetime if not stable [in ct].
bool moveParticleToNextLayer(Particle &particle, const SimplifiedGeometry *&layer)
Move particle along its trajectory to the next intersection with any of the tracker layers...
const BarrelSimplifiedGeometry * nextBarrelLayer_
Pointer to the next (direction of the particle's momentum) barrel layer.
const Geometry *const geometry_
The geometry of the tracker material.
void resetOnLayer()
Reset layer this particle is currently on (i.e. particle is not on a layer anyomre) ...
virtual const double getMagneticFieldZ(const math::XYZTLorentzVector &position) const =0
Return magnetic field (field only has Z component!) on the layer.
Abs< T >::type abs(const T &t)
const BarrelSimplifiedGeometry * previousLayer(const BarrelSimplifiedGeometry *layer) const
Helps to navigate through the vector of barrel layers.
const ForwardSimplifiedGeometry * previousForwardLayer_
Pointer to the previous (opposite direction of the particle's momentum) forward layer.
Definition the tracker geometry (vectors of forward/barrel layers).
const std::vector< std::unique_ptr< BarrelSimplifiedGeometry > > & barrelLayers() const
Return the vector of barrel layers.
const ForwardSimplifiedGeometry * nextForwardLayer_
Pointer to the next (direction of the particle's momentum) forward layer.
int index() const
Return index of this layer (layers are numbered according to their position in the detector)...
bool isStable() const
Returns true if particle is considered stable.
void setOnLayer(bool isForward, int index)
Set layer this particle is currently on.
static std::unique_ptr< Trajectory > createTrajectory(const fastsim::Particle &particle, const double magneticFieldZ)
Calls constructor of derived classes.
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
double gamma() const
Return Lorentz' gamma factor.
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
bool isOnLayer(bool isForward, int index)
Check if particle is on layer.
double getMagneticFieldZ(const math::XYZTLorentzVector &position) const
Initializes the tracker geometry.
static const std::string MESSAGECATEGORY