CMS 3D CMS Logo

MuonTransientTrackingRecHit Class Reference

A TransientTrackingRecHit for muons. More...

#include <RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h>

Inheritance diagram for MuonTransientTrackingRecHit:

GenericTransientTrackingRecHit TransientTrackingRecHit TrackingRecHit ReferenceCounted

List of all members.

Public Types

typedef std::vector
< ConstMuonRecHitPointer
ConstMuonRecHitContainer
typedef
ConstReferenceCountingPointer
< MuonTransientTrackingRecHit
ConstMuonRecHitPointer
typedef std::vector
< MuonRecHitPointer
MuonRecHitContainer
typedef
ReferenceCountingPointer
< MuonTransientTrackingRecHit
MuonRecHitPointer

Public Member Functions

virtual double chi2 () const
 Chi square of the fit for segments, else 0.
virtual int degreesOfFreedom () const
 Degrees of freedom for segments, else 0.
virtual GlobalVector globalDirection () const
 Direction in 3D for segments, otherwise (0,0,0).
virtual GlobalError globalDirectionError () const
 Error on the global direction.
bool isCSC () const
 if this rec hit is a CSC rec hit
bool isDT () const
 if this rec hit is a DT rec hit
bool isRPC () const
 if this rec hit is a RPC rec hit
virtual LocalVector localDirection () const
 Direction in 3D for segments, otherwise (0,0,0).
virtual LocalError localDirectionError () const
 Error on the local direction.
virtual AlgebraicSymMatrix parametersError () const
virtual ConstRecHitContainer transientHits () const
 return the sub components of this transient rechit
virtual ~MuonTransientTrackingRecHit ()

Static Public Member Functions

static RecHitPointer build (const GeomDet *geom, const TrackingRecHit *rh)
 FIXME virtual ConstMuonRecHitContainer specificTransientHits() const;.
static MuonRecHitPointer specificBuild (const GeomDet *geom, const TrackingRecHit *rh)

Private Member Functions

virtual
MuonTransientTrackingRecHit
clone () const
 MuonTransientTrackingRecHit (const MuonTransientTrackingRecHit &other)
 Copy ctor.
 MuonTransientTrackingRecHit (const GeomDet *geom, const TrackingRecHit *rh)
 Construct from a TrackingRecHit and its GeomDet.

Friends

class kkkwwwxxxyyyzzz


Detailed Description

A TransientTrackingRecHit for muons.

Date
2007/07/03 10:08:57
Revision
1.14

Author:
C. Liu Purdue University

Definition at line 19 of file MuonTransientTrackingRecHit.h.


Member Typedef Documentation

typedef std::vector<ConstMuonRecHitPointer> MuonTransientTrackingRecHit::ConstMuonRecHitContainer

Definition at line 24 of file MuonTransientTrackingRecHit.h.

typedef ConstReferenceCountingPointer<MuonTransientTrackingRecHit> MuonTransientTrackingRecHit::ConstMuonRecHitPointer

Definition at line 22 of file MuonTransientTrackingRecHit.h.

typedef std::vector<MuonRecHitPointer> MuonTransientTrackingRecHit::MuonRecHitContainer

Definition at line 23 of file MuonTransientTrackingRecHit.h.

typedef ReferenceCountingPointer<MuonTransientTrackingRecHit> MuonTransientTrackingRecHit::MuonRecHitPointer

Definition at line 21 of file MuonTransientTrackingRecHit.h.


Constructor & Destructor Documentation

virtual MuonTransientTrackingRecHit::~MuonTransientTrackingRecHit (  )  [inline, virtual]

Definition at line 26 of file MuonTransientTrackingRecHit.h.

00026 {}

MuonTransientTrackingRecHit::MuonTransientTrackingRecHit ( const GeomDet geom,
const TrackingRecHit rh 
) [private]

Construct from a TrackingRecHit and its GeomDet.

Definition at line 23 of file MuonTransientTrackingRecHit.cc.

Referenced by build(), clone(), and specificBuild().

00023                                                                                                       :
00024   GenericTransientTrackingRecHit(geom,*rh){}

MuonTransientTrackingRecHit::MuonTransientTrackingRecHit ( const MuonTransientTrackingRecHit other  )  [private]

Copy ctor.

Definition at line 26 of file MuonTransientTrackingRecHit.cc.

00026                                                                                                   :
00027   GenericTransientTrackingRecHit(other.det(), *(other.hit())) {}


Member Function Documentation

static RecHitPointer MuonTransientTrackingRecHit::build ( const GeomDet geom,
const TrackingRecHit rh 
) [inline, static]

FIXME virtual ConstMuonRecHitContainer specificTransientHits() const;.

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 62 of file MuonTransientTrackingRecHit.h.

References MuonTransientTrackingRecHit().

00062                                                                               {
00063     return RecHitPointer( new MuonTransientTrackingRecHit(geom, rh));
00064   }

double MuonTransientTrackingRecHit::chi2 ( void   )  const [virtual]

Chi square of the fit for segments, else 0.

Definition at line 88 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

00089 {
00090   if (dynamic_cast<const RecSegment*>(hit()))
00091     return dynamic_cast<const RecSegment*>(hit())->chi2();
00092   else return 0.;
00093 }

virtual MuonTransientTrackingRecHit* MuonTransientTrackingRecHit::clone ( void   )  const [inline, private, virtual]

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 80 of file MuonTransientTrackingRecHit.h.

References MuonTransientTrackingRecHit().

00080                                                      {
00081     return new MuonTransientTrackingRecHit(*this);
00082   }

int MuonTransientTrackingRecHit::degreesOfFreedom (  )  const [virtual]

Degrees of freedom for segments, else 0.

Definition at line 95 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

00096 {
00097   if (dynamic_cast<const RecSegment*>(hit()))
00098     return dynamic_cast<const RecSegment*>(hit())->degreesOfFreedom();
00099   else return 0;
00100 }

GlobalVector MuonTransientTrackingRecHit::globalDirection (  )  const [virtual]

Direction in 3D for segments, otherwise (0,0,0).

Definition at line 46 of file MuonTransientTrackingRecHit.cc.

References TransientTrackingRecHit::det(), localDirection(), and TransientTrackingRecHit::surface().

00047 {
00048   return  (det()->surface().toGlobal(localDirection()));
00049 }

GlobalError MuonTransientTrackingRecHit::globalDirectionError (  )  const [virtual]

Error on the global direction.

Definition at line 51 of file MuonTransientTrackingRecHit.cc.

References TransientTrackingRecHit::det(), localDirectionError(), and TransientTrackingRecHit::surface().

00052 {
00053   return ErrorFrameTransformer().transform( localDirectionError(), (det()->surface()));
00054 }

bool MuonTransientTrackingRecHit::isCSC (  )  const

if this rec hit is a CSC rec hit

Definition at line 106 of file MuonTransientTrackingRecHit.cc.

References MuonSubdetId::CSC, and TrackingRecHit::geographicalId().

00106                                              {
00107   return  (geographicalId().subdetId() == MuonSubdetId::CSC);
00108 }

bool MuonTransientTrackingRecHit::isDT (  )  const

if this rec hit is a DT rec hit

Definition at line 102 of file MuonTransientTrackingRecHit.cc.

References MuonSubdetId::DT, and TrackingRecHit::geographicalId().

Referenced by transientHits().

00102                                             {
00103   return  (geographicalId().subdetId() == MuonSubdetId::DT);
00104 }

bool MuonTransientTrackingRecHit::isRPC (  )  const

if this rec hit is a RPC rec hit

Definition at line 110 of file MuonTransientTrackingRecHit.cc.

References TrackingRecHit::geographicalId(), and MuonSubdetId::RPC.

00110                                              {
00111   return  (geographicalId().subdetId() == MuonSubdetId::RPC);
00112 }

LocalVector MuonTransientTrackingRecHit::localDirection (  )  const [virtual]

Direction in 3D for segments, otherwise (0,0,0).

Definition at line 30 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by globalDirection().

00030                                                               {
00031 
00032   if (dynamic_cast<const RecSegment*>(hit()) )
00033      return dynamic_cast<const RecSegment*>(hit())->localDirection(); 
00034   else return LocalVector(0.,0.,0.);
00035 
00036 }

LocalError MuonTransientTrackingRecHit::localDirectionError (  )  const [virtual]

Error on the local direction.

Definition at line 38 of file MuonTransientTrackingRecHit.cc.

References GenericTransientTrackingRecHit::hit().

Referenced by globalDirectionError().

00038                                                                   {
00039 
00040   if (dynamic_cast<const RecSegment*>(hit()))
00041      return dynamic_cast<const RecSegment*>(hit())->localDirectionError();
00042   else return LocalError(0.,0.,0.);
00043 
00044 }

AlgebraicSymMatrix MuonTransientTrackingRecHit::parametersError (  )  const [virtual]

Reimplemented from GenericTransientTrackingRecHit.

Definition at line 57 of file MuonTransientTrackingRecHit.cc.

References TransientTrackingRecHit::det(), lat::endl(), err, GenericTransientTrackingRecHit::parametersError(), GenericTransientTrackingRecHit::projectionMatrix(), TransientTrackingRecHit::surface(), LocalError::xx(), LocalError::xy(), and LocalError::yy().

00057                                                                       {
00058   
00059   AlgebraicSymMatrix err = GenericTransientTrackingRecHit::parametersError();
00060  
00061   if (det()->alignmentPositionError() != 0) {
00062 
00063     LocalError lape = ErrorFrameTransformer().transform(det()->alignmentPositionError()->globalError(), det()->surface());
00064 
00065     // Just for speed up the code, the "else" branch can handle also the case of dim = 1.
00066     if(err.num_row() == 1) err[0][0] += lape.xx();
00067     else{
00068       AlgebraicSymMatrix lapeMatrix(5,0);
00069       lapeMatrix[3][3] = lape.xx();
00070       lapeMatrix[3][4] = lape.xy();
00071       lapeMatrix[4][4] = lape.yy();
00072       
00073       AlgebraicSymMatrix lapeMatrixProj = lapeMatrix.similarity(projectionMatrix());
00074       
00075       if(err.num_row() != lapeMatrixProj.num_row())
00076         throw cms::Exception("MuonTransientTrackingRecHit::parametersError") 
00077           <<"Discrepancy between alignment error matrix and error matrix: APE " 
00078           << lapeMatrixProj.num_row()
00079           << ", error matrix " << err.num_row() 
00080           << std::endl;
00081       
00082       err += lapeMatrixProj;
00083     }
00084   }
00085   return err;
00086 }

static MuonRecHitPointer MuonTransientTrackingRecHit::specificBuild ( const GeomDet geom,
const TrackingRecHit rh 
) [inline, static]

Definition at line 66 of file MuonTransientTrackingRecHit.h.

References MuonTransientTrackingRecHit().

Referenced by SegmentsTrackAssociator::associate(), MuonTransientTrackingRecHitBuilder::build(), MuonSeedBuilder::NChi2OfSegment(), MuonSeedBuilder::NRecHitsFromSegment(), and MuonDetLayerMeasurements::recHits().

00066                                                                                          {
00067     return MuonRecHitPointer(new MuonTransientTrackingRecHit(geom, rh));
00068   }

TransientTrackingRecHit::ConstRecHitContainer MuonTransientTrackingRecHit::transientHits (  )  const [virtual]

return the sub components of this transient rechit

Reimplemented from TransientTrackingRecHit.

Definition at line 116 of file MuonTransientTrackingRecHit.cc.

References GeomDet::components(), edmNew::copy(), TransientTrackingRecHit::det(), GenericTransientTrackingRecHit::dimension(), GeomDet::geographicalId(), isDT(), GenericTransientTrackingRecHit::recHits(), sl, and tmp.

00116                                                                                             {
00117 
00118   ConstRecHitContainer theSubTransientRecHits;
00119   
00120   // the sub rec hit of this TransientRecHit
00121   std::vector<const TrackingRecHit*> ownRecHits = recHits();
00122 
00123   if(ownRecHits.size() == 0){
00124     theSubTransientRecHits.push_back(this);
00125     return theSubTransientRecHits;
00126   }
00127   
00128   // the components of the geom det on which reside this rechit
00129   std::vector<const GeomDet *> geomDets = det()->components();
00130 
00131   if(isDT() && dimension() == 2 && ownRecHits.front()->dimension() == 1 
00132      && (geomDets.size() == 3 || geomDets.size() == 2) ){ // it is a phi segment!!
00133     
00134     std::vector<const GeomDet *> subGeomDets;
00135 
00136     int sl = 1;
00137     for(std::vector<const GeomDet *>::const_iterator geoDet = geomDets.begin();
00138         geoDet != geomDets.end(); ++geoDet){
00139       if(sl != 3){ // FIXME!! this maybe is not always true
00140         std::vector<const GeomDet *> tmp = (*geoDet)->components();
00141         std::copy(tmp.begin(),tmp.end(),back_inserter(subGeomDets));
00142       }
00143       ++sl;
00144     }
00145     geomDets.clear();
00146     geomDets = subGeomDets;
00147   }
00148   
00149   // Fill the GeomDet map
00150   std::map<DetId,const GeomDet*> gemDetMap;
00151   
00152   for (std::vector<const GeomDet*>::const_iterator subDet = geomDets.begin(); 
00153        subDet != geomDets.end(); ++subDet)
00154     gemDetMap[ (*subDet)->geographicalId() ] = *subDet;
00155   
00156   std::map<DetId,const GeomDet*>::iterator gemDetMap_iter;
00157   
00158   // Loop in order to check the ids
00159   for (std::vector<const TrackingRecHit*>::const_iterator rechit = ownRecHits.begin(); 
00160        rechit != ownRecHits.end(); ++rechit){
00161     
00162     gemDetMap_iter = gemDetMap.find( (*rechit)->geographicalId() );
00163     
00164     if(gemDetMap_iter != gemDetMap.end() )
00165       theSubTransientRecHits.push_back(new MuonTransientTrackingRecHit(gemDetMap_iter->second, 
00166                                                                          *rechit) );
00167     else if( (*rechit)->geographicalId() == det()->geographicalId() ) // Phi in DT is on Chamber
00168       theSubTransientRecHits.push_back(new MuonTransientTrackingRecHit(det(), 
00169                                                                        *rechit) );
00170   }
00171   return theSubTransientRecHits;
00172 
00173 }


Friends And Related Function Documentation

friend class kkkwwwxxxyyyzzz [friend]

Definition at line 72 of file MuonTransientTrackingRecHit.h.


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