CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
MuonSeedFromRecHits Class Reference

#include <MuonSeedFromRecHits.h>

Inheritance diagram for MuonSeedFromRecHits:
MuonCSCSeedFromRecHits MuonDTSeedFromRecHits MuonOverlapSeedFromRecHits

Public Member Functions

void add (MuonTransientTrackingRecHit::MuonRecHitPointer hit)
 
void clear ()
 
TrajectorySeed createSeed (float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last) const
 
MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstRecHit () const
 
 MuonSeedFromRecHits ()
 
unsigned int nrhit () const
 
void setBField (const MagneticField *field)
 
void setPtExtractor (const MuonSeedPtExtractor *extractor)
 
virtual ~MuonSeedFromRecHits ()
 

Protected Types

typedef
MuonTransientTrackingRecHit::ConstMuonRecHitPointer 
ConstMuonRecHitPointer
 
typedef
MuonTransientTrackingRecHit::MuonRecHitContainer 
MuonRecHitContainer
 
typedef
MuonTransientTrackingRecHit::MuonRecHitPointer 
MuonRecHitPointer
 

Protected Attributes

const MagneticFieldtheField
 
const MuonSeedPtExtractorthePtExtractor
 
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
 

Detailed Description

Author
A. Vitelli - INFN Torino
porting R.Bellan - INFN Torino

Generate a seed starting from a list of RecHits

Definition at line 19 of file MuonSeedFromRecHits.h.

Member Typedef Documentation

Definition at line 39 of file MuonSeedFromRecHits.h.

Definition at line 37 of file MuonSeedFromRecHits.h.

Definition at line 38 of file MuonSeedFromRecHits.h.

Constructor & Destructor Documentation

MuonSeedFromRecHits::MuonSeedFromRecHits ( )

Definition at line 35 of file MuonSeedFromRecHits.cc.

36 : theField(0)
37 {
38 }
const MagneticField * theField
virtual MuonSeedFromRecHits::~MuonSeedFromRecHits ( )
inlinevirtual

Definition at line 23 of file MuonSeedFromRecHits.h.

23 {}

Member Function Documentation

void MuonSeedFromRecHits::add ( MuonTransientTrackingRecHit::MuonRecHitPointer  hit)
inline

Definition at line 28 of file MuonSeedFromRecHits.h.

References theRhits.

Referenced by MuonSeedFinder::seeds().

28 { theRhits.push_back(hit); }
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
void MuonSeedFromRecHits::clear ( void  )
inline

Definition at line 31 of file MuonSeedFromRecHits.h.

References theRhits.

Referenced by MuonSeedFinder::seeds().

31 {theRhits.clear();}
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
TrajectorySeed MuonSeedFromRecHits::createSeed ( float  ptmean,
float  sptmean,
MuonTransientTrackingRecHit::ConstMuonRecHitPointer  last 
) const

Definition at line 41 of file MuonSeedFromRecHits.cc.

References alongMomentum, DeDxDiscriminatorTools::charge(), clone(), debug, error, prof2calltree::l, metname, PV3DBase< T, PVType, FrameType >::perp(), trajectoryStateTransform::persistentState(), edm::OwnVector< T, P >::push_back(), funct::sqr(), AlCaHLTBitMon_QueryRunRegistry::string, lumiQTWidget::t, theField, theRhits, and PV3DBase< T, PVType, FrameType >::theta().

Referenced by MuonCSCSeedFromRecHits::createDefaultEndcapSeed(), MuonOverlapSeedFromRecHits::makeSeed(), MuonCSCSeedFromRecHits::makeSeed(), MuonDTSeedFromRecHits::seed(), and ExhaustiveMuonTrajectoryBuilder::trajectories().

44 {
45 
46  const std::string metname = "Muon|RecoMuon|MuonSeedFromRecHits";
47 
49 
50  // FIXME: put it into a parameter set!
51  double theMinMomentum = 3.0;
52  int charge=std::copysign(1,ptmean);
53 
54  // Minimal pt
55  if ( fabs(ptmean) < theMinMomentum ) ptmean = theMinMomentum * charge ;
56 
57  AlgebraicVector t(4);
58  AlgebraicSymMatrix mat(5,0) ;
59 
60  // Fill the LocalTrajectoryParameters
61  LocalPoint segPos=last->localPosition();
62  GlobalVector mom=last->globalPosition()-GlobalPoint();
64  last->globalDirection().phi(),
65  1.));
66  polar *=fabs(ptmean)/polar.perp();
67  LocalVector segDirFromPos=last->det()->toLocal(polar);
68 
69  LocalTrajectoryParameters param(segPos,segDirFromPos, charge);
70 
71  // this perform H.T() * parErr * H, which is the projection of the
72  // the measurement error (rechit rf) to the state error (TSOS rf)
73  // Legenda:
74  // H => is the 4x5 projection matrix
75  // parError the 4x4 parameter error matrix of the RecHit
76 
77  // LogTrace(metname) << "Projection matrix:\n" << last->projectionMatrix();
78  // LogTrace(metname) << "Error matrix:\n" << last->parametersError();
79 
80  mat = last->parametersError().similarityT( last->projectionMatrix() );
81 
82 
83  float p_err = sqr(sptmean/(ptmean*ptmean));
84  mat[0][0]= p_err;
85 
86 
87  LocalTrajectoryError error(asSMatrix<5>(mat));
88 
89  // Create the TrajectoryStateOnSurface
90  TrajectoryStateOnSurface tsos(param, error, last->det()->surface(), theField);
91 
92  // The following LogTraces must be moved somewhere else (StandAloneTrajectoryBuilder)
93  // Here the TSOS does not have the magnetic field set, so dumpTSOS causes a crash
94  // (when LogTrace/LogDebug is activated)
95  //LogTrace(metname) << "Trajectory State on Surface before the extrapolation"<<endl;
96  //LogTrace(metname) << debug.dumpTSOS(tsos);
97 
98  // Take the DetLayer on which relies the rechit
99  DetId id = last->geographicalId();
100  // Segment layer
101  //LogTrace(metname) << "The RecSegment relies on: "<<endl;
102  //LogTrace(metname) << debug.dumpMuonId(id);
103  //LogTrace(metname) << debug.dumpTSOS(tsos);
104 
105  // Transform it in a TrajectoryStateOnSurface
106 
107 
108  PTrajectoryStateOnDet const & seedTSOS =
110 
112  for (unsigned l=0; l<theRhits.size(); l++) {
113  container.push_back( theRhits[l]->hit()->clone() );
114  }
115 
116  TrajectorySeed theSeed(seedTSOS,container,alongMomentum);
117 
118  return theSeed;
119 }
T perp() const
Definition: PV3DBase.h:72
const std::string metname
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
const MagneticField * theField
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
double charge(const std::vector< uint8_t > &Ampls)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
void push_back(D *&d)
Definition: OwnVector.h:273
Definition: DetId.h:20
CLHEP::HepVector AlgebraicVector
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
Square< F >::type sqr(const F &f)
Definition: Square.h:13
CLHEP::HepSymMatrix AlgebraicSymMatrix
#define debug
Definition: MEtoEDMFormat.h:34
MuonTransientTrackingRecHit::ConstMuonRecHitPointer MuonSeedFromRecHits::firstRecHit ( ) const
inline

Definition at line 29 of file MuonSeedFromRecHits.h.

References theRhits.

Referenced by MuonSeedFinder::seeds().

29 { return theRhits.front(); }
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
unsigned int MuonSeedFromRecHits::nrhit ( ) const
inline

Definition at line 30 of file MuonSeedFromRecHits.h.

References theRhits.

30 { return theRhits.size(); }
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
void MuonSeedFromRecHits::setBField ( const MagneticField field)
inline

Definition at line 25 of file MuonSeedFromRecHits.h.

References theField.

Referenced by MuonSeedFinder::setBField().

25 {theField = field;}
const MagneticField * theField
void MuonSeedFromRecHits::setPtExtractor ( const MuonSeedPtExtractor extractor)
inline

Definition at line 26 of file MuonSeedFromRecHits.h.

References thePtExtractor.

Referenced by MuonSeedFinder::MuonSeedFinder().

26 {thePtExtractor = extractor;}
const MuonSeedPtExtractor * thePtExtractor

Member Data Documentation

const MagneticField* MuonSeedFromRecHits::theField
protected

Definition at line 42 of file MuonSeedFromRecHits.h.

Referenced by createSeed(), and setBField().

const MuonSeedPtExtractor* MuonSeedFromRecHits::thePtExtractor
protected
MuonTransientTrackingRecHit::MuonRecHitContainer MuonSeedFromRecHits::theRhits
protected