CMS 3D CMS Logo

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

#include <GlobalTrajectoryBuilderBase.h>

Inheritance diagram for GlobalTrajectoryBuilderBase:
MuonTrajectoryBuilder GlobalMuonTrajectoryBuilder L3MuonTrajectoryBuilder

Classes

struct  ComparatorInOut
 

Public Types

typedef
MuonTransientTrackingRecHit::ConstMuonRecHitContainer 
ConstMuonRecHitContainer
 
typedef
MuonTransientTrackingRecHit::ConstMuonRecHitPointer 
ConstMuonRecHitPointer
 
typedef
TransientTrackingRecHit::ConstRecHitContainer 
ConstRecHitContainer
 
typedef
TransientTrackingRecHit::ConstRecHitPointer 
ConstRecHitPointer
 
typedef
MuonTransientTrackingRecHit::MuonRecHitContainer 
MuonRecHitContainer
 
typedef
MuonTransientTrackingRecHit::MuonRecHitPointer 
MuonRecHitPointer
 
typedef
TransientTrackingRecHit::RecHitContainer 
RecHitContainer
 
typedef
TransientTrackingRecHit::RecHitPointer 
RecHitPointer
 
typedef std::vector< TrajectoryTC
 
typedef TC::const_iterator TI
 
- Public Types inherited from MuonTrajectoryBuilder
typedef
MuonCandidate::CandidateContainer 
CandidateContainer
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 
typedef
MuonCandidate::TrajectoryContainer 
TrajectoryContainer
 

Public Member Functions

 GlobalTrajectoryBuilderBase (const edm::ParameterSet &, const MuonServiceProxy *)
 constructor with Parameter Set and MuonServiceProxy More...
 
virtual void setEvent (const edm::Event &)
 pass the Event to the algo at each event More...
 
MuonTrajectoryBuilder::TrajectoryContainer trajectories (const TrajectorySeed &)
 dummy implementation, unused in this class More...
 
virtual ~GlobalTrajectoryBuilderBase ()
 destructor More...
 
- Public Member Functions inherited from MuonTrajectoryBuilder
 MuonTrajectoryBuilder ()
 constructor More...
 
virtual CandidateContainer trajectories (const TrackCand &)=0
 return a container reconstructed muons starting from a given track More...
 
virtual ~MuonTrajectoryBuilder ()
 destructor More...
 

Protected Types

enum  RefitDirection { inToOut, outToIn, undetermined }
 

Protected Member Functions

void addTraj (TrackCand &)
 if TrackCand has only a TrackRef, attempt to add Trajectory* More...
 
MuonTrajectoryBuilder::CandidateContainer build (const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
 build combined trajectory from sta Track and tracker RecHits More...
 
void checkMuonHits (const reco::Track &, ConstRecHitContainer &, ConstRecHitContainer &, std::vector< int > &) const
 check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit More...
 
RefitDirection checkRecHitsOrdering (const ConstRecHitContainer &) const
 This does nothing now. More...
 
std::vector< TrackCandchooseRegionalTrackerTracks (const TrackCand &, const std::vector< TrackCand > &)
 choose tracker tracks within region of interest More...
 
const TrajectorychooseTrajectory (const std::vector< Trajectory * > &, int) const
 choose final trajectory More...
 
RectangularEtaPhiTrackingRegion defineRegionOfInterest (const reco::TrackRef &) const
 define region of interest with tracker More...
 
void fixTEC (ConstRecHitContainer &all, double scl_x, double scl_y) const
 rescale errors of outermost TEC RecHit More...
 
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits (const reco::Track &) const
 get transient RecHits of a Track More...
 
virtual std::vector< TrackCandmakeTkCandCollection (const TrackCand &)=0
 make a TrackCand collection using tracker Track, Trajectory information More...
 
void printHits (const ConstRecHitContainer &) const
 print all RecHits of a trajectory More...
 
ConstRecHitContainer selectMuonHits (const Trajectory &, const std::vector< int > &) const
 select muon hits compatible with trajectory; check hits in chambers with showers More...
 
ConstRecHitContainer selectTrackerHits (const ConstRecHitContainer &) const
 select tracker hits; exclude some tracker hits in the global trajectory More...
 
const MuonServiceProxyservice () const
 
GlobalMuonTrackMatchertrackMatcher () const
 
double trackProbability (const Trajectory &) const
 calculate chi2 probability (-ln(P)) More...
 

Protected Attributes

std::string theCategory
 
float thePCut
 
float thePtCut
 

Private Attributes

unsigned long long theCacheId_TRH
 
const edm::EventtheEvent
 
GlobalMuonRefittertheGlbRefitter
 
MuonDetLayerMeasurementstheLayerMeasurements
 
int theMuonHitsOption
 
edm::ESHandle
< TransientTrackingRecHitBuilder
theMuonRecHitBuilder
 
std::string theMuonRecHitBuilderName
 
MuonTrackingRegionBuildertheRegionBuilder
 
bool theRPCInTheFit
 
const MuonServiceProxytheService
 
float theTECxScale
 
float theTECyScale
 
std::string theTrackerPropagatorName
 
edm::ESHandle
< TransientTrackingRecHitBuilder
theTrackerRecHitBuilder
 
std::string theTrackerRecHitBuilderName
 
GlobalMuonTrackMatchertheTrackMatcher
 
TrackTransformertheTrackTransformer
 

Detailed Description

Base class for GlobalMuonTrajectoryBuilder and L3MuonTrajectoryBuilder Provide common tools and interface to reconstruct muons starting from a muon track reconstructed in the standalone muon system (with DT, CSC and RPC information). It tries to reconstruct the corresponding track in the tracker and performs matching between the reconstructed tracks in the muon system and the tracker.

Date:
2010/02/26 21:35:49
Revision:
1.22
Author
N. Neumeister Purdue University
C. Liu Purdue University
A. Everett Purdue University

Definition at line 49 of file GlobalTrajectoryBuilderBase.h.

Member Typedef Documentation

Definition at line 61 of file GlobalTrajectoryBuilderBase.h.

Definition at line 59 of file GlobalTrajectoryBuilderBase.h.

Definition at line 54 of file GlobalTrajectoryBuilderBase.h.

Definition at line 56 of file GlobalTrajectoryBuilderBase.h.

Definition at line 60 of file GlobalTrajectoryBuilderBase.h.

Definition at line 58 of file GlobalTrajectoryBuilderBase.h.

Definition at line 53 of file GlobalTrajectoryBuilderBase.h.

Definition at line 55 of file GlobalTrajectoryBuilderBase.h.

Definition at line 63 of file GlobalTrajectoryBuilderBase.h.

typedef TC::const_iterator GlobalTrajectoryBuilderBase::TI

Definition at line 64 of file GlobalTrajectoryBuilderBase.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

GlobalTrajectoryBuilderBase::GlobalTrajectoryBuilderBase ( const edm::ParameterSet par,
const MuonServiceProxy service 
)

constructor with Parameter Set and MuonServiceProxy

Definition at line 90 of file GlobalTrajectoryBuilderBase.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), GlobalMuonRefitter_cff::GlobalMuonRefitter, GlobalMuonTrackMatcher_cff::GlobalMuonTrackMatcher, theCacheId_TRH, theCategory, theGlbRefitter, theMuonHitsOption, theMuonRecHitBuilderName, thePCut, thePtCut, theRegionBuilder, theRPCInTheFit, theService, theTECxScale, theTECyScale, theTrackerPropagatorName, theTrackerRecHitBuilderName, theTrackMatcher, and theTrackTransformer.

91  :
93 
94  theCategory = par.getUntrackedParameter<string>("Category", "Muon|RecoMuon|GlobalMuon|GlobalTrajectoryBuilderBase");
95 
96 
97  ParameterSet trackMatcherPSet = par.getParameter<ParameterSet>("GlobalMuonTrackMatcher");
98  theTrackMatcher = new GlobalMuonTrackMatcher(trackMatcherPSet,theService);
99 
100  theTrackerPropagatorName = par.getParameter<string>("TrackerPropagator");
101 
102  ParameterSet trackTransformerPSet = par.getParameter<ParameterSet>("TrackTransformer");
103  theTrackTransformer = new TrackTransformer(trackTransformerPSet);
104 
105  ParameterSet regionBuilderPSet = par.getParameter<ParameterSet>("MuonTrackingRegionBuilder");
106 
107  theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet,theService);
108 
109  // TrackRefitter parameters
110  ParameterSet refitterParameters = par.getParameter<ParameterSet>("GlbRefitterParameters");
111  theGlbRefitter = new GlobalMuonRefitter(refitterParameters, theService);
112 
113  theMuonHitsOption = refitterParameters.getParameter<int>("MuonHitsOption");
114 
115  theTrackerRecHitBuilderName = par.getParameter<string>("TrackerRecHitBuilder");
116  theMuonRecHitBuilderName = par.getParameter<string>("MuonRecHitBuilder");
117 
118  theRPCInTheFit = par.getParameter<bool>("RefitRPCHits");
119 
120  theTECxScale = par.getParameter<double>("ScaleTECxFactor");
121  theTECyScale = par.getParameter<double>("ScaleTECyFactor");
122  thePtCut = par.getParameter<double>("PtCut");
123  thePCut = par.getParameter<double>("PCut");
124 
125  theCacheId_TRH = 0;
126 
127 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MuonDetLayerMeasurements * theLayerMeasurements
const MuonServiceProxy * service() const
GlobalMuonTrackMatcher * theTrackMatcher
MuonTrackingRegionBuilder * theRegionBuilder
GlobalTrajectoryBuilderBase::~GlobalTrajectoryBuilderBase ( )
virtual

destructor

Definition at line 133 of file GlobalTrajectoryBuilderBase.cc.

References theGlbRefitter, theRegionBuilder, theTrackMatcher, and theTrackTransformer.

133  {
134 
135  if (theTrackMatcher) delete theTrackMatcher;
138  if (theGlbRefitter) delete theGlbRefitter;
139 }
GlobalMuonTrackMatcher * theTrackMatcher
MuonTrackingRegionBuilder * theRegionBuilder

Member Function Documentation

void GlobalTrajectoryBuilderBase::addTraj ( TrackCand )
inlineprotected

if TrackCand has only a TrackRef, attempt to add Trajectory*

Definition at line 126 of file GlobalTrajectoryBuilderBase.h.

126 {}
MuonCandidate::CandidateContainer GlobalTrajectoryBuilderBase::build ( const TrackCand staCand,
MuonTrajectoryBuilder::CandidateContainer tkTrajs 
) const
protected

build combined trajectory from sta Track and tracker RecHits

Definition at line 170 of file GlobalTrajectoryBuilderBase.cc.

References checkRecHitsOrdering(), fixTEC(), getTransientRecHits(), LogDebug, LogTrace, MuonCandidate::muonTrack(), outToIn, GlobalMuonRefitter::refit(), selectTrackerHits(), Trajectory::setSeedRef(), theCategory, theGlbRefitter, theMuonHitsOption, thePCut, thePtCut, theService, theTECxScale, theTECyScale, theTrackTransformer, MuonCandidate::trackerTrack(), MuonCandidate::trackerTrajectory(), trackProbability(), MuonCandidate::trajectory(), and TrackTransformer::transform().

Referenced by GlobalMuonTrajectoryBuilder::trajectories(), and L3MuonTrajectoryBuilder::trajectories().

171  {
172 
173  LogTrace(theCategory) << " Begin Build" << endl;
174 
175  // tracker trajectory should be built and refit before this point
176  if ( tkTrajs.empty() ) return CandidateContainer();
177 
178  // add muon hits and refit/smooth trajectories
179  CandidateContainer refittedResult;
180  ConstRecHitContainer muonRecHits = getTransientRecHits(*(staCand.second));
181 
182  // check order of muon measurements
183  if ( (muonRecHits.size() > 1) &&
184  ( muonRecHits.front()->globalPosition().mag() >
185  muonRecHits.back()->globalPosition().mag() ) ) {
186  LogTrace(theCategory)<< " reverse order: ";
187  }
188 
189  for ( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); it++ ) {
190 
191  // cut on tracks with low momenta
192  LogTrace(theCategory)<< " Track p and pT " << (*it)->trackerTrack()->p() << " " << (*it)->trackerTrack()->pt();
193  if( (*it)->trackerTrack()->p() < thePCut || (*it)->trackerTrack()->pt() < thePtCut ) continue;
194 
195  ConstRecHitContainer trackerRecHits;
196  if ((*it)->trackerTrack().isNonnull()) {
197  trackerRecHits = getTransientRecHits(*(*it)->trackerTrack());
198  } else {
199  LogDebug(theCategory)<<" NEED HITS FROM TRAJ";
200  //trackerRecHits = (*it)->trackerTrajectory()->recHits();
201  }
202 
203  // check for single TEC RecHits in trajectories in the overalp region
204  if ( fabs((*it)->trackerTrack()->eta()) > 0.95 && fabs((*it)->trackerTrack()->eta()) < 1.15 && (*it)->trackerTrack()->pt() < 60 ) {
205  if ( theTECxScale < 0 || theTECyScale < 0 )
206  trackerRecHits = selectTrackerHits(trackerRecHits);
207  else
208  fixTEC(trackerRecHits,theTECxScale,theTECyScale);
209  }
210 
211  RefitDirection recHitDir = checkRecHitsOrdering(trackerRecHits);
212  if ( recHitDir == outToIn ) reverse(trackerRecHits.begin(),trackerRecHits.end());
213 
214  reco::TransientTrack tTT((*it)->trackerTrack(),&*theService->magneticField(),theService->trackingGeometry());
215  TrajectoryStateOnSurface innerTsos = tTT.innermostMeasurementState();
216 
218  if((*it)->trackerTrack()->seedRef().isAvailable()) tmpSeed = (*it)->trackerTrack()->seedRef();
219 
220  if ( !innerTsos.isValid() ) {
221  LogTrace(theCategory) << " inner Trajectory State is invalid. ";
222  continue;
223  }
224 
225  innerTsos.rescaleError(100.);
226 
227  TC refitted0,refitted1;
228  MuonCandidate* finalTrajectory = 0;
229  Trajectory *tkTrajectory = 0;
230 
231  // tracker only track
232  if ( ! ((*it)->trackerTrajectory() && (*it)->trackerTrajectory()->isValid()) ) {
233  refitted0 = theTrackTransformer->transform((*it)->trackerTrack()) ;
234  if (!refitted0.empty()) tkTrajectory = new Trajectory(*(refitted0.begin()));
235  else LogWarning(theCategory)<< " Failed to load tracker track trajectory";
236  } else tkTrajectory = (*it)->trackerTrajectory();
237  if (tkTrajectory) tkTrajectory->setSeedRef(tmpSeed);
238 
239  // full track with all muon hits using theGlbRefitter
240  ConstRecHitContainer allRecHits = trackerRecHits;
241  allRecHits.insert(allRecHits.end(), muonRecHits.begin(),muonRecHits.end());
242  refitted1 = theGlbRefitter->refit( *(*it)->trackerTrack(), tTT, allRecHits,theMuonHitsOption);
243  LogTrace(theCategory)<<" This track-sta refitted to " << refitted1.size() << " trajectories";
244 
245  Trajectory *glbTrajectory1 = 0;
246  if (!refitted1.empty()) glbTrajectory1 = new Trajectory(*(refitted1.begin()));
247  else LogDebug(theCategory)<< " Failed to load global track trajectory 1";
248  if (glbTrajectory1) glbTrajectory1->setSeedRef(tmpSeed);
249 
250  finalTrajectory = 0;
251  if(glbTrajectory1 && tkTrajectory) finalTrajectory = new MuonCandidate(glbTrajectory1, (*it)->muonTrack(), (*it)->trackerTrack(),
252  tkTrajectory? new Trajectory(*tkTrajectory) : 0);
253 
254  if ( finalTrajectory )
255  refittedResult.push_back(finalTrajectory);
256 
257  if(tkTrajectory) delete tkTrajectory;
258  }
259 
260  // choose the best global fit for this Standalone Muon based on the track probability
261  CandidateContainer selectedResult;
262  MuonCandidate* tmpCand = 0;
263  if ( refittedResult.size() > 0 ) tmpCand = *(refittedResult.begin());
264  double minProb = 9999;
265 
266  for (CandidateContainer::const_iterator iter=refittedResult.begin(); iter != refittedResult.end(); iter++) {
267  double prob = trackProbability(*(*iter)->trajectory());
268  LogTrace(theCategory)<<" refitted-track-sta with pT " << (*iter)->trackerTrack()->pt() << " has probability " << prob;
269 
270  if (prob < minProb) {
271  minProb = prob;
272  tmpCand = (*iter);
273  }
274  }
275 
276  if ( tmpCand ) selectedResult.push_back(new MuonCandidate(new Trajectory(*(tmpCand->trajectory())), tmpCand->muonTrack(), tmpCand->trackerTrack(),
277  (tmpCand->trackerTrajectory())? new Trajectory( *(tmpCand->trackerTrajectory()) ):0 ) );
278 
279  for (CandidateContainer::const_iterator it = refittedResult.begin(); it != refittedResult.end(); ++it) {
280  if ( (*it)->trajectory() ) delete (*it)->trajectory();
281  if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory();
282  if ( *it ) delete (*it);
283  }
284  refittedResult.clear();
285 
286  return selectedResult;
287 
288 }
#define LogDebug(id)
const reco::TrackRef muonTrack() const
return muon track
Definition: MuonCandidate.h:45
MuonCandidate::CandidateContainer CandidateContainer
ConstRecHitContainer selectTrackerHits(const ConstRecHitContainer &) const
select tracker hits; exclude some tracker hits in the global trajectory
const reco::TrackRef trackerTrack() const
return tracker track
Definition: MuonCandidate.h:48
void fixTEC(ConstRecHitContainer &all, double scl_x, double scl_y) const
rescale errors of outermost TEC RecHit
double trackProbability(const Trajectory &) const
calculate chi2 probability (-ln(P))
Trajectory * trackerTrajectory() const
return tracker trajectory
Definition: MuonCandidate.h:51
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits(const reco::Track &) const
get transient RecHits of a Track
#define LogTrace(id)
std::vector< Trajectory > refit(const reco::Track &globalTrack, const int theMuonHitsOption) const
build combined trajectory from sta Track and tracker RecHits
void setSeedRef(const edm::RefToBase< TrajectorySeed > &seedRef)
Definition: Trajectory.h:264
virtual std::vector< Trajectory > transform(const reco::Track &) const
Convert a reco::Track into Trajectory.
RefitDirection checkRecHitsOrdering(const ConstRecHitContainer &) const
This does nothing now.
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Trajectory * trajectory() const
return trajectory
Definition: MuonCandidate.h:42
void GlobalTrajectoryBuilderBase::checkMuonHits ( const reco::Track ,
ConstRecHitContainer ,
ConstRecHitContainer ,
std::vector< int > &   
) const
protected

check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit

GlobalTrajectoryBuilderBase::RefitDirection GlobalTrajectoryBuilderBase::checkRecHitsOrdering ( const ConstRecHitContainer recHits) const
protected

This does nothing now.

check order of RechIts on a trajectory

Definition at line 400 of file GlobalTrajectoryBuilderBase.cc.

References inToOut, outToIn, theCategory, and undetermined.

Referenced by build().

400  {
401 
402  if ( !recHits.empty() ) {
403  ConstRecHitContainer::const_iterator frontHit = recHits.begin();
404  ConstRecHitContainer::const_iterator backHit = recHits.end() - 1;
405  while ( !(*frontHit)->isValid() && frontHit != backHit ) {frontHit++;}
406  while ( !(*backHit)->isValid() && backHit != frontHit ) {backHit--;}
407 
408  double rFirst = (*frontHit)->globalPosition().mag();
409  double rLast = (*backHit) ->globalPosition().mag();
410 
411  if ( rFirst < rLast ) return inToOut;
412  else if (rFirst > rLast) return outToIn;
413  else {
414  LogError(theCategory) << "Impossible to determine the rechits order" << endl;
415  return undetermined;
416  }
417  }
418  else {
419  LogError(theCategory) << "Impossible to determine the rechits order" << endl;
420  return undetermined;
421  }
422 }
vector< GlobalTrajectoryBuilderBase::TrackCand > GlobalTrajectoryBuilderBase::chooseRegionalTrackerTracks ( const TrackCand staCand,
const std::vector< TrackCand > &  tkTs 
)
protected

choose tracker tracks within region of interest

Definition at line 295 of file GlobalTrajectoryBuilderBase.cc.

References defineRegionOfInterest(), deltaR(), TrackingRegionBase::direction(), PV3DBase< T, PVType, FrameType >::eta(), MuonErrorMatrixValues_cff::etaRange, RectangularEtaPhiTrackingRegion::etaRange(), PV3DBase< T, PVType, FrameType >::phi(), RectangularEtaPhiTrackingRegion::phiMargin(), and query::result.

Referenced by GlobalMuonTrajectoryBuilder::makeTkCandCollection().

296  {
297 
298  // define eta-phi region
299  RectangularEtaPhiTrackingRegion regionOfInterest = defineRegionOfInterest(staCand.second);
300 
301  // get region's etaRange and phiMargin
302  PixelRecoRange<float> etaRange = regionOfInterest.etaRange();
303  TkTrackingRegionsMargin<float> phiMargin = regionOfInterest.phiMargin();
304 
305  vector<TrackCand> result;
306 
307  double deltaR_max = 1.0;
308 
309  for ( vector<TrackCand>::const_iterator is = tkTs.begin(); is != tkTs.end(); ++is ) {
310  // check if each trackCand is in region of interest
311 // bool inEtaRange = etaRange.inside(is->second->eta());
312 // bool inPhiRange = (fabs(Geom::Phi<float>(is->second->phi()) - Geom::Phi<float>(regionOfInterest.direction().phi())) < phiMargin.right() ) ? true : false ;
313 
314  double deltaR_tmp = deltaR(static_cast<double>(regionOfInterest.direction().eta()),
315  static_cast<double>(regionOfInterest.direction().phi()),
316  is->second->eta(), is->second->phi());
317 
318  // for each trackCand in region, add trajectory and add to result
319  //if ( inEtaRange && inPhiRange ) {
320  if (deltaR_tmp < deltaR_max) {
321  TrackCand tmpCand = TrackCand(*is);
322  result.push_back(tmpCand);
323  }
324  }
325 
326  return result;
327 
328 }
std::pair< const Trajectory *, reco::TrackRef > TrackCand
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
virtual GlobalVector direction() const
the direction around which region is constructed
tuple result
Definition: query.py:137
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
RectangularEtaPhiTrackingRegion defineRegionOfInterest(const reco::TrackRef &) const
define region of interest with tracker
T eta() const
Definition: PV3DBase.h:70
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval
const Trajectory* GlobalTrajectoryBuilderBase::chooseTrajectory ( const std::vector< Trajectory * > &  ,
int   
) const
protected

choose final trajectory

RectangularEtaPhiTrackingRegion GlobalTrajectoryBuilderBase::defineRegionOfInterest ( const reco::TrackRef staTrack) const
protected

define region of interest with tracker

Definition at line 335 of file GlobalTrajectoryBuilderBase.cc.

References TrackingRegionBase::direction(), RectangularEtaPhiTrackingRegion::etaRange(), PixelRecoRange< T >::max(), PixelRecoRange< T >::mean(), PixelRecoRange< T >::min(), TrackingRegionBase::origin(), TrackingRegionBase::originRBound(), TrackingRegionBase::originZBound(), RectangularEtaPhiTrackingRegion::phiMargin(), TrackingRegionBase::ptMin(), MuonTrackingRegionBuilder::region(), and theRegionBuilder.

Referenced by chooseRegionalTrackerTracks().

335  {
336 
338 
339  TkTrackingRegionsMargin<float> etaMargin(fabs(region1->etaRange().min() - region1->etaRange().mean()),
340  fabs(region1->etaRange().max() - region1->etaRange().mean()));
341 
342  RectangularEtaPhiTrackingRegion region2(region1->direction(),
343  region1->origin(),
344  region1->ptMin(),
345  region1->originRBound(),
346  region1->originZBound(),
347  etaMargin,
348  region1->phiMargin());
349 
350  delete region1;
351  return region2;
352 
353 }
RectangularEtaPhiTrackingRegion * region(const reco::TrackRef &) const
define tracking region
T max() const
virtual GlobalPoint origin() const
virtual GlobalVector direction() const
the direction around which region is constructed
T min() const
virtual float ptMin() const
minimal pt of interest
T mean() const
MuonTrackingRegionBuilder * theRegionBuilder
virtual float originZBound() const
bounds the particle vertex in the longitudinal plane
virtual float originRBound() const
bounds the particle vertex in the transverse plane
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval
void GlobalTrajectoryBuilderBase::fixTEC ( ConstRecHitContainer all,
double  scl_x,
double  scl_y 
) const
protected

rescale errors of outermost TEC RecHit

Definition at line 453 of file GlobalTrajectoryBuilderBase.cc.

References angle(), MuonTransientTrackingRecHit::build(), SiStripRecHit2D::cluster(), SiStripRecHit2D::cluster_regional(), TransientTrackingRecHit::det(), error, i, edm::Ref< C, T, F >::isNonnull(), TSiStripRecHit2DLocalPos::localPosition(), TSiStripRecHit2DLocalPos::localPositionError(), pos, LocalError::rotate(), strip(), StripTopology::strip(), StripTopology::stripAngle(), StripSubdetector::TEC, DetId::Tracker, LocalError::xx(), and LocalError::yy().

Referenced by build().

455  {
456 
457  int nTEC(0);
458  ConstRecHitContainer::iterator lone_tec;
459 
460  for ( ConstRecHitContainer::iterator i = all.begin(); i != all.end(); i++) {
461  if ( !(*i)->isValid() ) continue;
462 
463  if ( (*i)->det()->geographicalId().det() == DetId::Tracker &&
464  (*i)->det()->geographicalId().subdetId() == StripSubdetector::TEC) {
465  lone_tec = i;
466  nTEC++;
467 
468  if ( (i+1) != all.end() && (*(i+1))->isValid() &&
469  (*(i+1))->det()->geographicalId().det() == DetId::Tracker &&
470  (*(i+1))->det()->geographicalId().subdetId() == StripSubdetector::TEC) {
471  nTEC++;
472  break;
473  }
474  }
475 
476  if (nTEC > 1) break;
477  }
478 
479  if ( nTEC == 1 && (*lone_tec)->hit()->isValid() &&
480  (*lone_tec)->hit()->geographicalId().det() == DetId::Tracker &&
481  (*lone_tec)->hit()->geographicalId().subdetId() == StripSubdetector::TEC) {
482 
483  // rescale the TEC rechit error matrix in its rotated frame
484  const SiStripRecHit2D* strip = dynamic_cast<const SiStripRecHit2D*>((*lone_tec)->hit());
485  const TSiStripRecHit2DLocalPos* Tstrip = dynamic_cast<const TSiStripRecHit2DLocalPos*>((*lone_tec).get());
486  if (strip && Tstrip->det() && Tstrip) {
487  LocalPoint pos = Tstrip->localPosition();
488  if ((*lone_tec)->detUnit()) {
489  const StripTopology* topology = dynamic_cast<const StripTopology*>(&(*lone_tec)->detUnit()->topology());
490  if (topology) {
491  // rescale the local error along/perp the strip by a factor
492  float angle = topology->stripAngle(topology->strip((*lone_tec)->hit()->localPosition()));
493  LocalError error = Tstrip->localPositionError();
494  LocalError rotError = error.rotate(angle);
495  LocalError scaledError(rotError.xx() * scl_x * scl_x, 0, rotError.yy() * scl_y * scl_y);
496  error = scaledError.rotate(-angle);
497  MuonTransientTrackingRecHit* mtt_rechit;
498  if (strip->cluster().isNonnull()) {
502  SiStripRecHit2D* st = new SiStripRecHit2D(pos,error,
503  (*lone_tec)->geographicalId().rawId(),
504  strip->cluster());
505  *lone_tec = mtt_rechit->build((*lone_tec)->det(),st);
506  }
507  else {
508  SiStripRecHit2D* st = new SiStripRecHit2D(pos,error,
509  (*lone_tec)->geographicalId().rawId(),
510  strip->cluster_regional());
511  *lone_tec = mtt_rechit->build((*lone_tec)->det(),st);
512  }
513  }
514  }
515  }
516  }
517 
518 }
virtual LocalPoint localPosition() const
int i
Definition: DBlmapReader.cc:9
float xx() const
Definition: LocalError.h:19
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
virtual float stripAngle(float strip) const =0
ClusterRegionalRef const & cluster_regional() const
virtual float strip(const LocalPoint &) const =0
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:249
float yy() const
Definition: LocalError.h:21
virtual LocalError localPositionError() const
ClusterRef const & cluster() const
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:34
static RecHitPointer build(const GeomDet *geom, const TrackingRecHit *rh)
FIXME virtual ConstMuonRecHitContainer specificTransientHits() const;.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
TransientTrackingRecHit::ConstRecHitContainer GlobalTrajectoryBuilderBase::getTransientRecHits ( const reco::Track track) const
protected

get transient RecHits of a Track

Definition at line 525 of file GlobalTrajectoryBuilderBase.cc.

References DetId::det(), LogDebug, DetId::Muon, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), query::result, theCategory, theMuonRecHitBuilder, theRPCInTheFit, theTrackerRecHitBuilder, and DetId::Tracker.

Referenced by build().

525  {
526 
528 
529  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
530  if((*hit)->isValid()) {
531  DetId recoid = (*hit)->geographicalId();
532  if ( recoid.det() == DetId::Tracker ) {
533  result.push_back(theTrackerRecHitBuilder->build(&**hit));
534  } else if ( recoid.det() == DetId::Muon ) {
535  if ( (*hit)->geographicalId().subdetId() == 3 && !theRPCInTheFit) {
536  LogDebug(theCategory) << "RPC Rec Hit discarded";
537  continue;
538  }
539  result.push_back(theMuonRecHitBuilder->build(&**hit));
540  }
541  }
542  }
543 
544  return result;
545 }
#define LogDebug(id)
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
tuple result
Definition: query.py:137
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:63
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:20
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:65
virtual std::vector<TrackCand> GlobalTrajectoryBuilderBase::makeTkCandCollection ( const TrackCand )
protectedpure virtual

make a TrackCand collection using tracker Track, Trajectory information

Implemented in L3MuonTrajectoryBuilder, and GlobalMuonTrajectoryBuilder.

void GlobalTrajectoryBuilderBase::printHits ( const ConstRecHitContainer hits) const
protected

print all RecHits of a trajectory

Definition at line 374 of file GlobalTrajectoryBuilderBase.cc.

References LogTrace, pos, mathSSE::sqrt(), theCategory, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

374  {
375 
376  LogTrace(theCategory) << "Used RecHits: " << hits.size();
377  for (ConstRecHitContainer::const_iterator ir = hits.begin(); ir != hits.end(); ir++ ) {
378  if ( !(*ir)->isValid() ) {
379  LogTrace(theCategory) << "invalid RecHit";
380  continue;
381  }
382 
383  const GlobalPoint& pos = (*ir)->globalPosition();
384 
386  << "r = " << sqrt(pos.x() * pos.x() + pos.y() * pos.y())
387  << " z = " << pos.z()
388  << " dimension = " << (*ir)->dimension()
389  << " " << (*ir)->det()->geographicalId().det()
390  << " " << (*ir)->det()->subDetector();
391 
392  }
393 
394 }
T y() const
Definition: PV3DBase.h:57
T sqrt(T t)
Definition: SSEVec.h:28
T z() const
Definition: PV3DBase.h:58
#define LogTrace(id)
T x() const
Definition: PV3DBase.h:56
ConstRecHitContainer GlobalTrajectoryBuilderBase::selectMuonHits ( const Trajectory ,
const std::vector< int > &   
) const
protected

select muon hits compatible with trajectory; check hits in chambers with showers

GlobalTrajectoryBuilderBase::ConstRecHitContainer GlobalTrajectoryBuilderBase::selectTrackerHits ( const ConstRecHitContainer all) const
protected

select tracker hits; exclude some tracker hits in the global trajectory

Definition at line 429 of file GlobalTrajectoryBuilderBase.cc.

References cond::ecalcond::all, i, StripSubdetector::TEC, and DetId::Tracker.

Referenced by build().

429  {
430 
431  int nTEC(0);
432 
434  for (ConstRecHitContainer::const_iterator i = all.begin(); i != all.end(); i++) {
435  if ( !(*i)->isValid() ) continue;
436  if ( (*i)->det()->geographicalId().det() == DetId::Tracker &&
437  (*i)->det()->geographicalId().subdetId() == StripSubdetector::TEC) {
438  nTEC++;
439  } else {
440  hits.push_back((*i).get());
441  }
442  if ( nTEC > 1 ) return all;
443  }
444 
445  return hits;
446 
447 }
int i
Definition: DBlmapReader.cc:9
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
const MuonServiceProxy* GlobalTrajectoryBuilderBase::service ( ) const
inlineprotected

Definition at line 139 of file GlobalTrajectoryBuilderBase.h.

References theService.

139 { return theService; }
void GlobalTrajectoryBuilderBase::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Reimplemented in L3MuonTrajectoryBuilder, and GlobalMuonTrajectoryBuilder.

Definition at line 145 of file GlobalTrajectoryBuilderBase.cc.

References event(), LogDebug, MuonTrackingRegionBuilder::setEvent(), GlobalMuonRefitter::setEvent(), TrackTransformer::setServices(), GlobalMuonRefitter::setServices(), theCacheId_TRH, theCategory, theEvent, theGlbRefitter, theMuonRecHitBuilder, theMuonRecHitBuilderName, theRegionBuilder, theService, theTrackerRecHitBuilder, theTrackerRecHitBuilderName, and theTrackTransformer.

Referenced by GlobalMuonTrajectoryBuilder::setEvent(), and L3MuonTrajectoryBuilder::setEvent().

145  {
146 
147  theEvent = &event;
148 
150  theRegionBuilder->setEvent(event);
151 
152  theGlbRefitter->setEvent(event);
153  theGlbRefitter->setServices(theService->eventSetup());
154 
155  unsigned long long newCacheId_TRH = theService->eventSetup().get<TransientRecHitRecord>().cacheIdentifier();
156  if ( newCacheId_TRH != theCacheId_TRH ) {
157  LogDebug(theCategory) << "TransientRecHitRecord changed!";
158  theCacheId_TRH = newCacheId_TRH;
161  }
162 
163 }
#define LogDebug(id)
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
void setServices(const edm::EventSetup &)
set the services needed by the TrackTransformer
virtual void setServices(const edm::EventSetup &)
set the services needed by the TrackTransformer
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
MuonTrackingRegionBuilder * theRegionBuilder
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
GlobalMuonTrackMatcher* GlobalTrajectoryBuilderBase::trackMatcher ( ) const
inlineprotected
double GlobalTrajectoryBuilderBase::trackProbability ( const Trajectory track) const
protected

calculate chi2 probability (-ln(P))

Definition at line 360 of file GlobalTrajectoryBuilderBase.cc.

References Trajectory::chiSquared(), LnChiSquaredProbability(), and Trajectory::ndof().

Referenced by build().

360  {
361 
362  if ( track.ndof() > 0 && track.chiSquared() > 0 ) {
363  return -LnChiSquaredProbability(track.chiSquared(), track.ndof());
364  } else {
365  return 0.0;
366  }
367 
368 }
float LnChiSquaredProbability(double chiSquared, double nrDOF)
int ndof(bool bon=true) const
Definition: Trajectory.cc:74
double chiSquared() const
Definition: Trajectory.h:208
MuonTrajectoryBuilder::TrajectoryContainer GlobalTrajectoryBuilderBase::trajectories ( const TrajectorySeed )
inlinevirtual

dummy implementation, unused in this class

Implements MuonTrajectoryBuilder.

Definition at line 75 of file GlobalTrajectoryBuilderBase.h.

MuonCandidate::TrajectoryContainer TrajectoryContainer

Member Data Documentation

unsigned long long GlobalTrajectoryBuilderBase::theCacheId_TRH
private

Definition at line 175 of file GlobalTrajectoryBuilderBase.h.

Referenced by GlobalTrajectoryBuilderBase(), and setEvent().

std::string GlobalTrajectoryBuilderBase::theCategory
protected
const edm::Event* GlobalTrajectoryBuilderBase::theEvent
private

Definition at line 183 of file GlobalTrajectoryBuilderBase.h.

Referenced by setEvent().

GlobalMuonRefitter* GlobalTrajectoryBuilderBase::theGlbRefitter
private
MuonDetLayerMeasurements* GlobalTrajectoryBuilderBase::theLayerMeasurements
private

Definition at line 170 of file GlobalTrajectoryBuilderBase.h.

int GlobalTrajectoryBuilderBase::theMuonHitsOption
private

Definition at line 178 of file GlobalTrajectoryBuilderBase.h.

Referenced by build(), and GlobalTrajectoryBuilderBase().

edm::ESHandle<TransientTrackingRecHitBuilder> GlobalTrajectoryBuilderBase::theMuonRecHitBuilder
private

Definition at line 189 of file GlobalTrajectoryBuilderBase.h.

Referenced by getTransientRecHits(), and setEvent().

std::string GlobalTrajectoryBuilderBase::theMuonRecHitBuilderName
private

Definition at line 188 of file GlobalTrajectoryBuilderBase.h.

Referenced by GlobalTrajectoryBuilderBase(), and setEvent().

float GlobalTrajectoryBuilderBase::thePCut
protected

Definition at line 165 of file GlobalTrajectoryBuilderBase.h.

Referenced by build(), and GlobalTrajectoryBuilderBase().

float GlobalTrajectoryBuilderBase::thePtCut
protected
MuonTrackingRegionBuilder* GlobalTrajectoryBuilderBase::theRegionBuilder
private
bool GlobalTrajectoryBuilderBase::theRPCInTheFit
private
const MuonServiceProxy* GlobalTrajectoryBuilderBase::theService
private
float GlobalTrajectoryBuilderBase::theTECxScale
private

Definition at line 179 of file GlobalTrajectoryBuilderBase.h.

Referenced by build(), and GlobalTrajectoryBuilderBase().

float GlobalTrajectoryBuilderBase::theTECyScale
private

Definition at line 180 of file GlobalTrajectoryBuilderBase.h.

Referenced by build(), and GlobalTrajectoryBuilderBase().

std::string GlobalTrajectoryBuilderBase::theTrackerPropagatorName
private

Definition at line 181 of file GlobalTrajectoryBuilderBase.h.

Referenced by GlobalTrajectoryBuilderBase().

edm::ESHandle<TransientTrackingRecHitBuilder> GlobalTrajectoryBuilderBase::theTrackerRecHitBuilder
private

Definition at line 186 of file GlobalTrajectoryBuilderBase.h.

Referenced by getTransientRecHits(), and setEvent().

std::string GlobalTrajectoryBuilderBase::theTrackerRecHitBuilderName
private

Definition at line 185 of file GlobalTrajectoryBuilderBase.h.

Referenced by GlobalTrajectoryBuilderBase(), and setEvent().

GlobalMuonTrackMatcher* GlobalTrajectoryBuilderBase::theTrackMatcher
private
TrackTransformer* GlobalTrajectoryBuilderBase::theTrackTransformer
private