CMS 3D CMS Logo

Public Member Functions | Private Attributes

FSimTrack Class Reference

#include <FSimTrack.h>

Inheritance diagram for FSimTrack:
SimTrack CoreSimTrack

List of all members.

Public Member Functions

void addDaughter (int i)
 Add a RecHit for a track on a layer.
float charge () const
 charge
int closestDaughterId () const
 Get the index of the closest charged daughter.
const FSimTrackdaughter (int i) const
 Ith daughter.
const std::vector< int > & daughters () const
 Vector of daughter indices.
double decayTime () const
 Return the pre-defined decay time.
const RawParticleecalEntrance () const
 The particle at ECAL entrance.
const FSimVertexendVertex () const
 end vertex
 FSimTrack ()
 Default constructor.
 FSimTrack (const RawParticle *p, int iv, int ig, int id, FBaseSimEvent *mom, double dt=-1.)
 Constructor from the EmmbSimTrack index in the FBaseSimEvent.
const HepMC::GenParticle * genParticle () const
 The original GenParticle.
const RawParticlehcalEntrance () const
 The particle at HCAL entrance.
int id () const
 the index in FBaseSimEvent and other vectors
const RawParticlelayer1Entrance () const
 The particle at Preshower Layer 1.
const RawParticlelayer2Entrance () const
 The particle at Preshower Layer 2.
const XYZTLorentzVectormomentum () const
 Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
const FSimTrackmother () const
 mother
int nDaughters () const
 Number of daughters.
bool noDaughter () const
 no daughters
bool noEndVertex () const
 no end vertex
bool noMother () const
 no mother particle
bool notYetToEndVertex (const XYZTLorentzVector &pos) const
 Compare the end vertex position with another position.
int onEcal () const
int onHcal () const
int onLayer1 () const
int onLayer2 () const
int onVFcal () const
const HepPDT::ParticleDataparticleInfo () const
 particle info...
bool propagated () const
 The particle was tentatively propagated to calorimeters.
void setClosestDaughterId (int id)
 Set the index of the closest charged daughter.
void setEcal (const RawParticle &pp, int success)
 Set the ecal variables.
void setEndVertex (int endv)
 Set the end vertex.
void setHcal (const RawParticle &pp, int success)
 Set the hcal variables.
void setLayer1 (const RawParticle &pp, int success)
 Set the preshower layer1 variables.
void setLayer2 (const RawParticle &pp, int success)
 Set the preshower layer2 variables.
void setMomentum (const math::XYZTLorentzVector &newMomentum)
 Reset the momentum (to be used with care)
void setPropagate ()
 The particle has been propgated through the tracker.
void setVFcal (const RawParticle &pp, int success)
 Set the hcal variables.
const SimTracksimTrack () const
 Simply returns the SimTrack.
const FSimVertexvertex () const
 Origin vertex.
const RawParticlevfcalEntrance () const
 The particle at VFCAL entrance.
virtual ~FSimTrack ()
 Destructor.

Private Attributes

int closestDaughterId_
std::vector< int > daugh_
int ecal
RawParticle ECAL_Entrance
int endv_
int hcal
RawParticle HCAL_Entrance
int id_
const HepPDT::ParticleDatainfo_
int layer1
RawParticle Layer1_Entrance
int layer2
RawParticle Layer2_Entrance
FBaseSimEventmom_
XYZTLorentzVector momentum_
bool prop
double properDecayTime
int vfcal
RawParticle VFCAL_Entrance

Detailed Description

A class that mimics SimTrack, with enhanced features. Essentially an interface to SimTrack.

Author:
Patrick Janot, CERN $Date: 9-Dec-2003

Definition at line 29 of file FSimTrack.h.


Constructor & Destructor Documentation

FSimTrack::FSimTrack ( )

Default constructor.

Definition at line 9 of file FSimTrack.cc.

                      : 
  SimTrack(), mom_(0), id_(-1), endv_(-1),
  layer1(0), layer2(0), ecal(0), hcal(0), vfcal(0), 
  prop(false), closestDaughterId_(-1), info_(0),
  properDecayTime(1E99) {;}
FSimTrack::FSimTrack ( const RawParticle p,
int  iv,
int  ig,
int  id,
FBaseSimEvent mom,
double  dt = -1. 
)

Constructor from the EmmbSimTrack index in the FBaseSimEvent.

Definition at line 15 of file FSimTrack.cc.

References info_, mom_, RecoTau_DiTaus_pt_20-420_cfg::ParticleID, CoreSimTrack::setTrackId(), FBaseSimEvent::theTable(), and CoreSimTrack::type().

                                :
  //  SimTrack(p->pid(),*p,iv,ig),   // to uncomment once Mathcore is installed 
  SimTrack(p->pid(),p->momentum(),iv,ig), 
  mom_(mom), id_(id), endv_(-1),
  layer1(0), layer2(0), ecal(0), hcal(0), vfcal(0), prop(false),
  closestDaughterId_(-1), momentum_(p->momentum()),
  properDecayTime(dt)
{ 
  setTrackId(id);
  info_ = mom_->theTable()->particle(HepPDT::ParticleID(type()));
}
FSimTrack::~FSimTrack ( ) [virtual]

Destructor.

Definition at line 30 of file FSimTrack.cc.

{;}

Member Function Documentation

void FSimTrack::addDaughter ( int  i) [inline]

Add a RecHit for a track on a layer.

Add a RecHit for a track on a layer Update the vactors of daughter's id

Definition at line 159 of file FSimTrack.h.

References daugh_.

Referenced by FBaseSimEvent::addSimTrack().

{ daugh_.push_back(i); }
float FSimTrack::charge ( void  ) const [inline]

charge

Reimplemented from CoreSimTrack.

Definition at line 47 of file FSimTrack.h.

References particleInfo().

Referenced by FBaseSimEvent::fill(), CalorimetryManager::HDShowerSimulation(), CalorimetryManager::MuonMipSimulation(), and PFSimParticleProducer::produce().

                              { 
    return particleInfo()->charge();
  }
int FSimTrack::closestDaughterId ( ) const [inline]

Get the index of the closest charged daughter.

Definition at line 165 of file FSimTrack.h.

References closestDaughterId_.

Referenced by FSimEvent::load(), and TrajectoryManager::makeSinglePSimHit().

{ return closestDaughterId_; }
const FSimTrack& FSimTrack::daughter ( int  i) const [inline]

Ith daughter.

Referenced by TrajectoryManager::moveAllDaughters(), and operator<<().

const std::vector<int>& FSimTrack::daughters ( ) const [inline]

Vector of daughter indices.

Referenced by PFSimParticleProducer::produce().

double FSimTrack::decayTime ( ) const [inline]

Return the pre-defined decay time.

Definition at line 177 of file FSimTrack.h.

References properDecayTime.

Referenced by ParticlePropagator::ParticlePropagator().

{ return properDecayTime; }
const RawParticle& FSimTrack::ecalEntrance ( ) const [inline]
const FSimVertex& FSimTrack::endVertex ( ) const [inline]
const HepMC::GenParticle* FSimTrack::genParticle ( ) const [inline]

The original GenParticle.

const RawParticle& FSimTrack::hcalEntrance ( ) const [inline]
int FSimTrack::id ( void  ) const [inline]
const RawParticle& FSimTrack::layer1Entrance ( ) const [inline]
const RawParticle& FSimTrack::layer2Entrance ( ) const [inline]

The particle at Preshower Layer 2.

Definition at line 120 of file FSimTrack.h.

References Layer2_Entrance.

Referenced by EcalHitMaker::cellLine(), CalorimetryManager::EMShowerSimulation(), EcalHitMaker::preshowerCellLine(), and PFSimParticleProducer::produce().

{ return Layer2_Entrance; }
const XYZTLorentzVector& FSimTrack::momentum ( ) const [inline]
const FSimTrack& FSimTrack::mother ( ) const [inline]
int FSimTrack::nDaughters ( ) const [inline]
bool FSimTrack::noDaughter ( ) const [inline]

no daughters

bool FSimTrack::noEndVertex ( ) const [inline]
bool FSimTrack::noMother ( ) const [inline]

no mother particle

Referenced by PFSimParticleProducer::produce().

bool FSimTrack::notYetToEndVertex ( const XYZTLorentzVector pos) const

Compare the end vertex position with another position.

Definition at line 33 of file FSimTrack.cc.

References endVertex(), noEndVertex(), position, vertex(), and Gflash::Z.

Referenced by FBaseSimEvent::fill(), TrajectoryManager::propagateToCalorimeters(), and TrajectoryManager::reconstruct().

                                                               {
  // If there is no end vertex, nothing to compare to
  if ( noEndVertex() ) return true;
  // If the particle immediately decays, no need to propagate
  if ( (endVertex().position()-vertex().position()).Vect().Mag2() < 1e-4 )
    return false;
  // If the end vertex has a larger radius, not yet there
  if ( endVertex().position().Perp2() > pos.Perp2()+1e-10 ) return true;
  // If the end vertex has a larger z, not yet there
  if ( fabs(endVertex().position().Z()) > fabs(pos.Z())+1e-5 ) return true;
  // Otherwise, the end vertex is overtaken already
  return false;
}
int FSimTrack::onEcal ( ) const [inline]

The particle was propagated to the ECAL front face 1 : on the barrel; 2 : on the EndCaps; 3 : no propagation possible 0 : not yet propagated

Definition at line 101 of file FSimTrack.h.

References ecal.

Referenced by EcalHitMaker::cellLine(), CalorimetryManager::EMShowerSimulation(), CalorimetryManager::HDShowerSimulation(), CalorimetryManager::MuonMipSimulation(), operator<<(), PFSimParticleProducer::produce(), CalorimetryManager::reconstruct(), and CalorimetryManager::reconstructECAL().

{ return ecal; }
int FSimTrack::onHcal ( ) const [inline]

The particle was propagated to the HCAL front face 1 : on the barrel; 2 : on the EndCaps; 3 : no propagation possible 0 : not yet propagated

Definition at line 106 of file FSimTrack.h.

References hcal.

Referenced by EcalHitMaker::cellLine(), CalorimetryManager::EMShowerSimulation(), HcalHitMaker::getSubHcalDet(), EcalHitMaker::hcalCellLine(), CalorimetryManager::HDShowerSimulation(), CalorimetryManager::MuonMipSimulation(), PFSimParticleProducer::produce(), CalorimetryManager::reconstruct(), and CalorimetryManager::reconstructHCAL().

{ return hcal; }
int FSimTrack::onLayer1 ( ) const [inline]

The particle was propagated to the Preshower Layer1 2 : on the EndCaps; (no Barrel Preshower); no propagation possible 0 : not yet propagated or no pe

Definition at line 91 of file FSimTrack.h.

References layer1.

Referenced by EcalHitMaker::cellLine(), CalorimetryManager::EMShowerSimulation(), operator<<(), EcalHitMaker::preshowerCellLine(), and PFSimParticleProducer::produce().

{ return layer1; }
int FSimTrack::onLayer2 ( ) const [inline]

The particle was propagated to the Preshower Layer2 2 : on the EndCaps; (no Barrel Preshower); 3 : No propagation possible 0 : not yet propagated

Definition at line 96 of file FSimTrack.h.

References layer2.

Referenced by EcalHitMaker::cellLine(), CalorimetryManager::EMShowerSimulation(), EcalHitMaker::preshowerCellLine(), and PFSimParticleProducer::produce().

{ return layer2; }
int FSimTrack::onVFcal ( ) const [inline]

The particle was propagated to the VFCAL front face 2 : on the EndCaps (No VFCAL Barrel); 3 : no propagation possible 0 : not yet propagated

Definition at line 111 of file FSimTrack.h.

References vfcal.

Referenced by EcalHitMaker::cellLine(), HcalHitMaker::getSubHcalDet(), EcalHitMaker::hcalCellLine(), CalorimetryManager::HDShowerSimulation(), CalorimetryManager::MuonMipSimulation(), and CalorimetryManager::reconstruct().

{ return vfcal; }
const HepPDT::ParticleData* FSimTrack::particleInfo ( ) const [inline]

particle info...

Definition at line 42 of file FSimTrack.h.

References info_.

Referenced by charge(), and operator<<().

                                                        {
    return info_;
  }
bool FSimTrack::propagated ( ) const [inline]

The particle was tentatively propagated to calorimeters.

Definition at line 114 of file FSimTrack.h.

References prop.

{ return prop; }
void FSimTrack::setClosestDaughterId ( int  id) [inline]

Set the index of the closest charged daughter.

Definition at line 162 of file FSimTrack.h.

References closestDaughterId_, and id().

Referenced by MaterialEffects::interact(), and TrajectoryManager::updateWithDaughters().

void FSimTrack::setEcal ( const RawParticle pp,
int  success 
)
void FSimTrack::setEndVertex ( int  endv) [inline]

Set the end vertex.

Definition at line 132 of file FSimTrack.h.

References endv_.

Referenced by FBaseSimEvent::addSimVertex().

{ endv_ = endv; } 
void FSimTrack::setHcal ( const RawParticle pp,
int  success 
)
void FSimTrack::setLayer1 ( const RawParticle pp,
int  success 
)

Set the preshower layer1 variables.

Definition at line 55 of file FSimTrack.cc.

References layer1, Layer1_Entrance, createTree::pp, and summarizeEdmComparisonLogfiles::success.

Referenced by FBaseSimEvent::fill(), and TrajectoryManager::propagateToCalorimeters().

void FSimTrack::setLayer2 ( const RawParticle pp,
int  success 
)

Set the preshower layer2 variables.

Definition at line 62 of file FSimTrack.cc.

References layer2, Layer2_Entrance, createTree::pp, and summarizeEdmComparisonLogfiles::success.

Referenced by FBaseSimEvent::fill(), and TrajectoryManager::propagateToCalorimeters().

void FSimTrack::setMomentum ( const math::XYZTLorentzVector newMomentum) [inline]

Reset the momentum (to be used with care)

Definition at line 171 of file FSimTrack.h.

References momentum_.

Referenced by TrajectoryManager::moveAllDaughters().

{momentum_ = newMomentum; }
void FSimTrack::setPropagate ( )

The particle has been propgated through the tracker.

Set the variable at the beginning of the propagation.

Definition at line 49 of file FSimTrack.cc.

References prop.

Referenced by TrajectoryManager::reconstruct().

                        { 
  prop=true; 
}
void FSimTrack::setVFcal ( const RawParticle pp,
int  success 
)
const SimTrack& FSimTrack::simTrack ( ) const [inline]

Simply returns the SimTrack.

Definition at line 174 of file FSimTrack.h.

{ return *this; }
const FSimVertex& FSimTrack::vertex ( ) const [inline]
const RawParticle& FSimTrack::vfcalEntrance ( ) const [inline]

Member Data Documentation

Definition at line 204 of file FSimTrack.h.

Referenced by closestDaughterId(), and setClosestDaughterId().

std::vector<int> FSimTrack::daugh_ [private]

Definition at line 203 of file FSimTrack.h.

Referenced by addDaughter().

int FSimTrack::ecal [private]

Definition at line 191 of file FSimTrack.h.

Referenced by onEcal(), and setEcal().

Definition at line 199 of file FSimTrack.h.

Referenced by ecalEntrance(), and setEcal().

int FSimTrack::endv_ [private]

Definition at line 187 of file FSimTrack.h.

Referenced by setEndVertex().

int FSimTrack::hcal [private]

Definition at line 192 of file FSimTrack.h.

Referenced by onHcal(), and setHcal().

Definition at line 200 of file FSimTrack.h.

Referenced by hcalEntrance(), and setHcal().

int FSimTrack::id_ [private]

Definition at line 185 of file FSimTrack.h.

Referenced by id().

Definition at line 206 of file FSimTrack.h.

Referenced by FSimTrack(), and particleInfo().

int FSimTrack::layer1 [private]

Definition at line 189 of file FSimTrack.h.

Referenced by onLayer1(), and setLayer1().

Definition at line 197 of file FSimTrack.h.

Referenced by layer1Entrance(), and setLayer1().

int FSimTrack::layer2 [private]

Definition at line 190 of file FSimTrack.h.

Referenced by onLayer2(), and setLayer2().

Definition at line 198 of file FSimTrack.h.

Referenced by layer2Entrance(), and setLayer2().

Definition at line 183 of file FSimTrack.h.

Referenced by FSimTrack().

Definition at line 208 of file FSimTrack.h.

Referenced by momentum(), and setMomentum().

bool FSimTrack::prop [private]

Definition at line 195 of file FSimTrack.h.

Referenced by propagated(), and setPropagate().

double FSimTrack::properDecayTime [private]

Definition at line 210 of file FSimTrack.h.

Referenced by decayTime().

int FSimTrack::vfcal [private]

Definition at line 193 of file FSimTrack.h.

Referenced by onVFcal(), and setVFcal().

Definition at line 201 of file FSimTrack.h.

Referenced by setVFcal(), and vfcalEntrance().