CMS 3D CMS Logo

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

◆ ConstMuonRecHitPointer

Definition at line 39 of file MuonSeedFromRecHits.h.

◆ MuonRecHitContainer

Definition at line 37 of file MuonSeedFromRecHits.h.

◆ MuonRecHitPointer

Definition at line 38 of file MuonSeedFromRecHits.h.

Constructor & Destructor Documentation

◆ MuonSeedFromRecHits()

MuonSeedFromRecHits::MuonSeedFromRecHits ( )

Definition at line 36 of file MuonSeedFromRecHits.cc.

36 : theField(nullptr) {}

◆ ~MuonSeedFromRecHits()

virtual MuonSeedFromRecHits::~MuonSeedFromRecHits ( )
inlinevirtual

Definition at line 22 of file MuonSeedFromRecHits.h.

22 {}

Member Function Documentation

◆ add()

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

Definition at line 27 of file MuonSeedFromRecHits.h.

27 { theRhits.push_back(hit); }

References theRhits.

Referenced by counter.Counter::register(), and MuonSeedFinder::seeds().

◆ clear()

void MuonSeedFromRecHits::clear ( void  )
inline

Definition at line 30 of file MuonSeedFromRecHits.h.

30 { theRhits.clear(); }

References theRhits.

Referenced by MuonSeedFinder::seeds().

◆ createSeed()

TrajectorySeed MuonSeedFromRecHits::createSeed ( float  ptmean,
float  sptmean,
MuonTransientTrackingRecHit::ConstMuonRecHitPointer  last 
) const

Definition at line 38 of file MuonSeedFromRecHits.cc.

38  {
39  const std::string metname = "Muon|RecoMuon|MuonSeedFromRecHits";
40 
42 
43  // FIXME: put it into a parameter set!
44  double theMinMomentum = 3.0;
45  int charge = std::copysign(1, ptmean);
46 
47  // Minimal pt
48  if (fabs(ptmean) < theMinMomentum)
49  ptmean = theMinMomentum * charge;
50 
51  AlgebraicVector t(4);
52  AlgebraicSymMatrix mat(5, 0);
53 
54  // Fill the LocalTrajectoryParameters
55  LocalPoint segPos = last->localPosition();
56  GlobalVector mom = last->globalPosition() - GlobalPoint();
57  GlobalVector polar(GlobalVector::Spherical(mom.theta(), last->globalDirection().phi(), 1.));
58  polar *= fabs(ptmean) / polar.perp();
59  LocalVector segDirFromPos = last->det()->toLocal(polar);
60 
61  LocalTrajectoryParameters param(segPos, segDirFromPos, charge);
62 
63  // this perform H.T() * parErr * H, which is the projection of the
64  // the measurement error (rechit rf) to the state error (TSOS rf)
65  // Legenda:
66  // H => is the 4x5 projection matrix
67  // parError the 4x4 parameter error matrix of the RecHit
68 
69  // LogTrace(metname) << "Projection matrix:\n" << last->projectionMatrix();
70  // LogTrace(metname) << "Error matrix:\n" << last->parametersError();
71 
72  mat = last->parametersError().similarityT(last->projectionMatrix());
73 
74  float p_err = sqr(sptmean / (ptmean * ptmean));
75  mat[0][0] = p_err;
76 
77  LocalTrajectoryError error(asSMatrix<5>(mat));
78 
79  // Create the TrajectoryStateOnSurface
80  TrajectoryStateOnSurface tsos(param, error, last->det()->surface(), theField);
81 
82  // The following LogTraces must be moved somewhere else (StandAloneTrajectoryBuilder)
83  // Here the TSOS does not have the magnetic field set, so dumpTSOS causes a crash
84  // (when LogTrace/LogDebug is activated)
85  //LogTrace(metname) << "Trajectory State on Surface before the extrapolation"<<endl;
86  //LogTrace(metname) << debug.dumpTSOS(tsos);
87 
88  // Take the DetLayer on which relies the rechit
89  DetId id = last->geographicalId();
90  // Segment layer
91  //LogTrace(metname) << "The RecSegment relies on: "<<endl;
92  //LogTrace(metname) << debug.dumpMuonId(id);
93  //LogTrace(metname) << debug.dumpTSOS(tsos);
94 
95  // Transform it in a TrajectoryStateOnSurface
96 
97  PTrajectoryStateOnDet const& seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId());
98 
100  for (unsigned l = 0; l < theRhits.size(); l++) {
101  container.push_back(theRhits[l]->hit()->clone());
102  }
103 
104  TrajectorySeed theSeed(seedTSOS, container, alongMomentum);
105 
106  return theSeed;
107 }

References alongMomentum, ALCARECOTkAlJpsiMuMu_cff::charge, clone(), debug, relativeConstraints::error, cmsLHEtoEOSManager::l, dqmdumpme::last, metname, PV3DBase< T, PVType, FrameType >::perp(), trajectoryStateTransform::persistentState(), edm::OwnVector< T, P >::push_back(), sqr(), AlCaHLTBitMon_QueryRunRegistry::string, submitPVValidationJobs::t, theField, theRhits, and PV3DBase< T, PVType, FrameType >::theta().

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

◆ firstRecHit()

MuonTransientTrackingRecHit::ConstMuonRecHitPointer MuonSeedFromRecHits::firstRecHit ( ) const
inline

Definition at line 28 of file MuonSeedFromRecHits.h.

28 { return theRhits.front(); }

References theRhits.

Referenced by MuonSeedFinder::seeds().

◆ nrhit()

unsigned int MuonSeedFromRecHits::nrhit ( ) const
inline

Definition at line 29 of file MuonSeedFromRecHits.h.

29 { return theRhits.size(); }

References theRhits.

◆ setBField()

void MuonSeedFromRecHits::setBField ( const MagneticField field)
inline

Definition at line 24 of file MuonSeedFromRecHits.h.

24 { theField = field; }

References theField.

Referenced by MuonSeedFinder::setBField().

◆ setPtExtractor()

void MuonSeedFromRecHits::setPtExtractor ( const MuonSeedPtExtractor extractor)
inline

Definition at line 25 of file MuonSeedFromRecHits.h.

25 { thePtExtractor = extractor; }

References thePtExtractor.

Referenced by MuonSeedFinder::MuonSeedFinder().

Member Data Documentation

◆ theField

const MagneticField* MuonSeedFromRecHits::theField
protected

Definition at line 42 of file MuonSeedFromRecHits.h.

Referenced by createSeed(), and setBField().

◆ thePtExtractor

const MuonSeedPtExtractor* MuonSeedFromRecHits::thePtExtractor
protected

◆ theRhits

MuonTransientTrackingRecHit::MuonRecHitContainer MuonSeedFromRecHits::theRhits
protected
Vector3DBase
Definition: Vector3DBase.h:8
MuonSeedFromRecHits::thePtExtractor
const MuonSeedPtExtractor * thePtExtractor
Definition: MuonSeedFromRecHits.h:43
MuonSeedFromRecHits::theRhits
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
Definition: MuonSeedFromRecHits.h:41
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
Geom::Spherical2Cartesian
Definition: CoordinateSets.h:58
relativeConstraints.error
error
Definition: relativeConstraints.py:53
sqr
T sqr(const T &t)
Definition: MuonSeedFromRecHits.cc:32
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
DetId
Definition: DetId.h:17
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
dqmdumpme.last
last
Definition: dqmdumpme.py:56
debug
#define debug
Definition: HDRShower.cc:19
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
MuonPatternRecoDumper
Definition: MuonPatternRecoDumper.h:18
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, LocalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
LocalTrajectoryError
Definition: LocalTrajectoryError.h:20
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
TrajectorySeed
Definition: TrajectorySeed.h:18
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
MuonSeedFromRecHits::theField
const MagneticField * theField
Definition: MuonSeedFromRecHits.h:42
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
alongMomentum
Definition: PropagationDirection.h:4
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40