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.
const RawParticlehcalExit () const
 The particle at HCAL exir.
const RawParticlehoEntrance () const
 The particle at HCAL exir.
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 onHO () const
int onLayer1 () const
int onLayer2 () const
int onVFcal () const
int outHcal () 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 setHcalExit (const RawParticle &pp, int success)
 Set the hcal exit variables.
void setHO (const RawParticle &pp, int success)
 Set the ho 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
RawParticle HCAL_Exit
int hcalexit
RawParticle HO_Entrance
int hoentr
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), hcalexit(0), hoentr(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), hcalexit(0), hoentr(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 181 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 187 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 199 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]
const RawParticle& FSimTrack::hcalExit ( ) const [inline]

The particle at HCAL exir.

Definition at line 142 of file FSimTrack.h.

References HCAL_Exit.

Referenced by PFSimParticleProducer::produce().

{ return HCAL_Exit; }
const RawParticle& FSimTrack::hoEntrance ( ) const [inline]

The particle at HCAL exir.

Definition at line 145 of file FSimTrack.h.

References HO_Entrance.

Referenced by PFSimParticleProducer::produce().

{ return HO_Entrance; }
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 130 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 alignCSCRings::e, 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::onHO ( ) const [inline]

1 : on the barrel; 2 : on the EndCaps; 3 : no propagation possible 0 : not yet propagated

Definition at line 121 of file FSimTrack.h.

References hoentr.

{ return hoentr; }
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; }
int FSimTrack::outHcal ( ) const [inline]

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

Definition at line 116 of file FSimTrack.h.

References hcalexit.

{ return hcalexit; }
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 124 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 184 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 148 of file FSimTrack.h.

References endv_.

Referenced by FBaseSimEvent::addSimVertex().

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

Set the hcal exit variables.

Set the hcal variables.

Definition at line 90 of file FSimTrack.cc.

References HCAL_Exit, hcalexit, createTree::pp, and summarizeEdmComparisonLogfiles::success.

Referenced by FBaseSimEvent::fill().

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

Set the ho variables.

Definition at line 96 of file FSimTrack.cc.

References HO_Entrance, hoentr, createTree::pp, and summarizeEdmComparisonLogfiles::success.

Referenced by FBaseSimEvent::fill().

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 193 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 
)

Set the hcal variables.

Set the vcal variables.

Definition at line 83 of file FSimTrack.cc.

References createTree::pp, summarizeEdmComparisonLogfiles::success, vfcal, and VFCAL_Entrance.

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

const SimTrack& FSimTrack::simTrack ( ) const [inline]

Simply returns the SimTrack.

Definition at line 196 of file FSimTrack.h.

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

Member Data Documentation

Definition at line 232 of file FSimTrack.h.

Referenced by closestDaughterId(), and setClosestDaughterId().

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

Definition at line 231 of file FSimTrack.h.

Referenced by addDaughter().

int FSimTrack::ecal [private]

Definition at line 213 of file FSimTrack.h.

Referenced by onEcal(), and setEcal().

Definition at line 224 of file FSimTrack.h.

Referenced by ecalEntrance(), and setEcal().

int FSimTrack::endv_ [private]

Definition at line 209 of file FSimTrack.h.

Referenced by setEndVertex().

int FSimTrack::hcal [private]

Definition at line 214 of file FSimTrack.h.

Referenced by onHcal(), and setHcal().

Definition at line 225 of file FSimTrack.h.

Referenced by hcalEntrance(), and setHcal().

Definition at line 227 of file FSimTrack.h.

Referenced by hcalExit(), and setHcalExit().

int FSimTrack::hcalexit [private]

Definition at line 216 of file FSimTrack.h.

Referenced by outHcal(), and setHcalExit().

Definition at line 228 of file FSimTrack.h.

Referenced by hoEntrance(), and setHO().

int FSimTrack::hoentr [private]

Definition at line 217 of file FSimTrack.h.

Referenced by onHO(), and setHO().

int FSimTrack::id_ [private]

Definition at line 207 of file FSimTrack.h.

Referenced by id().

Definition at line 234 of file FSimTrack.h.

Referenced by FSimTrack(), and particleInfo().

int FSimTrack::layer1 [private]

Definition at line 211 of file FSimTrack.h.

Referenced by onLayer1(), and setLayer1().

Definition at line 222 of file FSimTrack.h.

Referenced by layer1Entrance(), and setLayer1().

int FSimTrack::layer2 [private]

Definition at line 212 of file FSimTrack.h.

Referenced by onLayer2(), and setLayer2().

Definition at line 223 of file FSimTrack.h.

Referenced by layer2Entrance(), and setLayer2().

Definition at line 205 of file FSimTrack.h.

Referenced by FSimTrack().

Definition at line 236 of file FSimTrack.h.

Referenced by momentum(), and setMomentum().

bool FSimTrack::prop [private]

Definition at line 220 of file FSimTrack.h.

Referenced by propagated(), and setPropagate().

double FSimTrack::properDecayTime [private]

Definition at line 238 of file FSimTrack.h.

Referenced by decayTime().

int FSimTrack::vfcal [private]

Definition at line 215 of file FSimTrack.h.

Referenced by onVFcal(), and setVFcal().

Definition at line 226 of file FSimTrack.h.

Referenced by setVFcal(), and vfcalEntrance().