CMS 3D CMS Logo

DirectMuonNavigation Class Reference

#include <RecoMuon/Navigation/interface/DirectMuonNavigation.h>

List of all members.

Public Member Functions

DirectMuonNavigationclone () const
std::vector< const DetLayer * > compatibleEndcapLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
 DirectMuonNavigation (const edm::ESHandle< MuonDetLayerGeometry > &, const edm::ParameterSet &)
 DirectMuonNavigation (const edm::ESHandle< MuonDetLayerGeometry > &)
 ~DirectMuonNavigation ()

Private Member Functions

bool checkCompatible (const FreeTrajectoryState &fts, const ForwardDetLayer *) const
bool checkCompatible (const FreeTrajectoryState &fts, const BarrelDetLayer *) const
void inOutBackward (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void inOutBarrel (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void inOutForward (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void outInBackward (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void outInBarrel (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void outInForward (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
bool outward (const FreeTrajectoryState &fts) const

Private Attributes

float epsilon_
bool theBarrelFlag
bool theEndcapFlag
edm::ESHandle
< MuonDetLayerGeometry
theMuonDetLayerGeometry


Detailed Description

Definition at line 22 of file DirectMuonNavigation.h.


Constructor & Destructor Documentation

DirectMuonNavigation::DirectMuonNavigation ( const edm::ESHandle< MuonDetLayerGeometry > &  muonLayout  ) 

Definition at line 21 of file DirectMuonNavigation.cc.

Referenced by clone().

00021                                                                                               : theMuonDetLayerGeometry(muonLayout), epsilon_(100.), theEndcapFlag(true), theBarrelFlag(true) {
00022 }

DirectMuonNavigation::DirectMuonNavigation ( const edm::ESHandle< MuonDetLayerGeometry > &  muonLayout,
const edm::ParameterSet par 
)

Definition at line 24 of file DirectMuonNavigation.cc.

00024                                                                                                                           : theMuonDetLayerGeometry(muonLayout), epsilon_(100.), theEndcapFlag(par.getUntrackedParameter<bool>("Endcap", true)), theBarrelFlag(par.getUntrackedParameter<bool>("Barrel",true)) {
00025 
00026 }

DirectMuonNavigation::~DirectMuonNavigation (  )  [inline]

Definition at line 36 of file DirectMuonNavigation.h.

00036 {}


Member Function Documentation

bool DirectMuonNavigation::checkCompatible ( const FreeTrajectoryState fts,
const ForwardDetLayer dl 
) const [private]

Definition at line 223 of file DirectMuonNavigation.cc.

References epsilon_, BoundDisk::innerRadius(), FreeTrajectoryState::momentum(), BoundDisk::outerRadius(), outward(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), FreeTrajectoryState::position(), r1, slope, ForwardDetLayer::specificSurface(), PV3DBase< T, PVType, FrameType >::z(), and z.

00223                                                                                                          {
00224 
00225   float z0 = fts.position().z();
00226   float r0 = fts.position().perp();
00227   float zm = fts.momentum().z();
00228   float rm = fts.momentum().perp();
00229   float slope = rm/zm; 
00230 
00231   if (!outward(fts) ) slope = -slope;
00232 
00233   const BoundDisk bd = dl->specificSurface();
00234 
00235   float outRadius = bd.outerRadius();
00236   float inRadius = bd.innerRadius();
00237   float z = bd.position().z();
00238 
00239   float r1 = slope*(z - z0) + r0;
00240   return (r1 >= inRadius-epsilon_ && r1 <= outRadius+epsilon_);
00241 
00242 }

bool DirectMuonNavigation::checkCompatible ( const FreeTrajectoryState fts,
const BarrelDetLayer dl 
) const [private]

Definition at line 206 of file DirectMuonNavigation.cc.

References BoundSurface::bounds(), epsilon_, Bounds::length(), FreeTrajectoryState::momentum(), outward(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), Cylinder::radius(), radius(), slope, BarrelDetLayer::specificSurface(), and PV3DBase< T, PVType, FrameType >::z().

00206                                                                                                         {
00207 
00208   float z0 = fts.position().z();
00209   float r0 = fts.position().perp();
00210   float zm = fts.momentum().z();
00211   float rm = fts.momentum().perp();
00212   float slope = zm/rm; 
00213   if (!outward(fts) ) slope = -slope;
00214   const BoundCylinder bc = dl->specificSurface();
00215   float radius = bc.radius();
00216   float length = bc.bounds().length()/2.;
00217 
00218   float z1 = slope*(radius - r0) + z0;
00219   return ( fabs(z1) <= fabs(length)+epsilon_ );
00220 
00221 }

DirectMuonNavigation* DirectMuonNavigation::clone ( void   )  const [inline]

Definition at line 31 of file DirectMuonNavigation.h.

References DirectMuonNavigation().

00031                                         {
00032       return new DirectMuonNavigation(*this);
00033     }

vector< const DetLayer * > DirectMuonNavigation::compatibleEndcapLayers ( const FreeTrajectoryState fts,
PropagationDirection  timeDirection 
) const

Definition at line 83 of file DirectMuonNavigation.cc.

References alongMomentum, inOutForward(), FreeTrajectoryState::momentum(), oppositeToMomentum, outInBackward(), output(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by CosmicMuonTrajectoryBuilder::trajectories().

00084                                                                                {
00085 
00086   float zm = fts.momentum().z();
00087 
00088   vector<const DetLayer*> output;
00089 
00090   // collect all endcap layers on 2 sides
00091   outInBackward(fts,output);
00092   inOutForward(fts,output);
00093 
00094   // check direction FTS to get a correct order of DetLayers
00095   if ( ( zm > 0 && dir == oppositeToMomentum ) || 
00096        ( zm < 0 && dir == alongMomentum )  )
00097            std::reverse(output.begin(),output.end());
00098 
00099   return output;
00100 }

vector< const DetLayer * > DirectMuonNavigation::compatibleLayers ( const FreeTrajectoryState fts,
PropagationDirection  timeDirection 
) const

Definition at line 31 of file DirectMuonNavigation.cc.

References inOutBackward(), inOutBarrel(), inOutForward(), FreeTrajectoryState::momentum(), oppositeToMomentum, outInBackward(), outInBarrel(), outInForward(), output(), outward(), FreeTrajectoryState::position(), theBarrelFlag, theEndcapFlag, and PV3DBase< T, PVType, FrameType >::z().

Referenced by CosmicMuonTrajectoryBuilder::build(), and CosmicMuonTrajectoryBuilder::trajectories().

00032                                                                          {
00033 
00034   float z0 = fts.position().z();
00035   float zm = fts.momentum().z();
00036 
00037   bool inOut = outward(fts);
00038 
00039   vector<const DetLayer*> output;
00040 
00041   // check direction and position of FTS to get a correct order of DetLayers
00042 
00043   if (inOut) { 
00044      if ((zm * z0) >= 0) {
00045         if (theBarrelFlag) inOutBarrel(fts,output);
00046         if (theEndcapFlag) {
00047            if ( z0 >= 0 ) inOutForward(fts,output);
00048            else inOutBackward(fts,output);
00049         } 
00050       } else {
00051         if (theEndcapFlag) {
00052         if ( z0 >= 0 ) outInForward(fts,output);
00053            else outInBackward(fts,output);
00054         }
00055         if (theBarrelFlag) inOutBarrel(fts,output);
00056       } 
00057    } else {
00058      if ((zm * z0) >= 0) {
00059         if (theBarrelFlag) outInBarrel(fts,output);
00060         if (theEndcapFlag) {
00061           if ( z0 >= 0 ) inOutForward(fts,output);
00062           else inOutBackward(fts,output);
00063         }
00064       } else {
00065         if (theEndcapFlag) {
00066           if ( z0 >= 0 ) outInForward(fts,output);
00067           else outInBackward(fts,output);
00068         }
00069         if (theBarrelFlag) outInBarrel(fts,output);
00070       } 
00071    }
00072 
00073   if ( dir == oppositeToMomentum ) std::reverse(output.begin(),output.end());
00074 
00075   return output;
00076 }

void DirectMuonNavigation::inOutBackward ( const FreeTrajectoryState ,
std::vector< const DetLayer * > &   
) const [private]

Referenced by compatibleLayers().

void DirectMuonNavigation::inOutBarrel ( const FreeTrajectoryState ,
std::vector< const DetLayer * > &   
) const [private]

Referenced by compatibleLayers().

void DirectMuonNavigation::inOutForward ( const FreeTrajectoryState ,
std::vector< const DetLayer * > &   
) const [private]

Referenced by compatibleEndcapLayers(), and compatibleLayers().

void DirectMuonNavigation::outInBackward ( const FreeTrajectoryState ,
std::vector< const DetLayer * > &   
) const [private]

Referenced by compatibleEndcapLayers(), and compatibleLayers().

void DirectMuonNavigation::outInBarrel ( const FreeTrajectoryState ,
std::vector< const DetLayer * > &   
) const [private]

Referenced by compatibleLayers().

void DirectMuonNavigation::outInForward ( const FreeTrajectoryState ,
std::vector< const DetLayer * > &   
) const [private]

Referenced by compatibleLayers().

bool DirectMuonNavigation::outward ( const FreeTrajectoryState fts  )  const [private]

Definition at line 244 of file DirectMuonNavigation.cc.

References FreeTrajectoryState::momentum(), FreeTrajectoryState::position(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by checkCompatible(), and compatibleLayers().

00244                                                                        {
00245  
00246 //  return (fts.position().basicVector().dot(fts.momentum().basicVector())>0);
00247 
00248   float x0 = fts.position().x();
00249   float y0 = fts.position().y();
00250 
00251   float xm = fts.momentum().x();
00252   float ym = fts.momentum().y();
00253 
00254   return ((x0 * xm + y0 * ym ) > 0);
00255 
00256 
00257 }


Member Data Documentation

float DirectMuonNavigation::epsilon_ [private]

Definition at line 63 of file DirectMuonNavigation.h.

Referenced by checkCompatible().

bool DirectMuonNavigation::theBarrelFlag [private]

Definition at line 65 of file DirectMuonNavigation.h.

Referenced by compatibleLayers().

bool DirectMuonNavigation::theEndcapFlag [private]

Definition at line 64 of file DirectMuonNavigation.h.

Referenced by compatibleLayers().

edm::ESHandle<MuonDetLayerGeometry> DirectMuonNavigation::theMuonDetLayerGeometry [private]

Definition at line 62 of file DirectMuonNavigation.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:27 2009 for CMSSW by  doxygen 1.5.4