CMS 3D CMS Logo

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

#include <StandAloneMuonFilter.h>

Public Member Functions

void createDefaultTrajectory (const Trajectory &, Trajectory &)
 
MeasurementEstimatorestimator () const
 access at the estimator More...
 
NavigationDirection fitDirection () const
 Return the fit direction. More...
 
int getCSCChamberUsed () const
 
int getCSCCompatibleChambers () const
 
int getDTChamberUsed () const
 
int getDTCompatibleChambers () const
 
int getGEMChamberUsed () const
 
int getGEMCompatibleChambers () const
 
int getRPCChamberUsed () const
 
int getRPCCompatibleChambers () const
 
int getTotalChamberUsed () const
 
int getTotalCompatibleChambers () const
 
bool goodState () const
 
bool isCompatibilitySatisfied () const
 
FreeTrajectoryState lastButOneUpdatedFTS () const
 the last but one free trajectory state More...
 
TrajectoryStateOnSurface lastButOneUpdatedTSOS () const
 the Trajectory state on the last surface of the fitting More...
 
TrajectoryStateOnSurface lastCompatibleTSOS () const
 the Trajectory state on the last compatible surface More...
 
const DetLayerlastDetLayer () const
 return the last det layer More...
 
FreeTrajectoryState lastUpdatedFTS () const
 the last free trajectory state More...
 
TrajectoryStateOnSurface lastUpdatedTSOS () const
 the Trajectory state on the last surface of the fitting More...
 
std::vector< const DetLayer * > layers () const
 return the layer used for the refit More...
 
bool onlyRPC () const
 True if there are only the RPC measurements. More...
 
PropagationDirection propagationDirection () const
 Return the propagation direction. More...
 
const Propagatorpropagator () const
 access at the propagator More...
 
void refit (const TrajectoryStateOnSurface &initialState, const DetLayer *, Trajectory &trajectory)
 Perform the inner-outward fitting. More...
 
void reset ()
 
virtual void setEvent (const edm::Event &event)
 Pass the Event to the algo at each event. More...
 
 StandAloneMuonFilter (const edm::ParameterSet &par, const MuonServiceProxy *service, edm::ConsumesCollector &iC)
 Constructor. More...
 
MuonTrajectoryUpdatorupdator () const
 access at the muon updator More...
 
virtual ~StandAloneMuonFilter ()
 Destructor. More...
 

Private Member Functions

MuonBestMeasurementFinderbestMeasurementFinder () const
 Access to the best measurement finder. More...
 
std::vector< const DetLayer * > compatibleLayers (const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
 Set the rigth Navigation. More...
 
std::vector
< TrajectoryMeasurement
findBestMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &tsos)
 
void incrementChamberCounters (const DetLayer *layer)
 Increment the DT,CSC,RPC counters. More...
 
void incrementCompatibleChamberCounters (const DetLayer *layer)
 
void setLastButOneUpdatedTSOS (TrajectoryStateOnSurface tsos)
 Set the last but one TSOS. More...
 
void setLastCompatibleTSOS (TrajectoryStateOnSurface tsos)
 Set the last compatible TSOS. More...
 
void setLastUpdatedTSOS (TrajectoryStateOnSurface tsos)
 Set the last TSOS. More...
 
bool update (const DetLayer *layer, const TrajectoryMeasurement *meas, Trajectory &trajectory)
 

Private Attributes

int cscChambers
 
int cscCompatibleChambers
 
int dtChambers
 
int dtCompatibleChambers
 
int gemChambers
 
int gemCompatibleChambers
 
int rpcChambers
 
int rpcCompatibleChambers
 
MuonBestMeasurementFindertheBestMeasurementFinder
 The best measurement finder: search for the best measurement among the TMs available. More...
 
std::vector< const DetLayer * > theDetLayers
 the det layer used in the reconstruction More...
 
MeasurementEstimatortheEstimator
 The Estimator. More...
 
NavigationDirection theFitDirection
 the propagation direction More...
 
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
 the trajectory state on the last but one available surface More...
 
TrajectoryStateOnSurface theLastCompatibleTSOS
 the trajectory state on the last compatible surface More...
 
TrajectoryStateOnSurface theLastUpdatedTSOS
 the trajectory state on the last available surface More...
 
double theMaxChi2
 The max allowed chi2 to accept a rechit in the fit. More...
 
MuonDetLayerMeasurementstheMeasurementExtractor
 The Measurement extractor. More...
 
MuonTrajectoryUpdatortheMuonUpdator
 the muon updator (it doesn't inhert from an updator, but it has one!) More...
 
std::string theMuonUpdatorName
 its name More...
 
std::string theNavigationType
 
double theNSigma
 
bool theOverlappingChambersFlag
 
std::string thePropagatorName
 the propagator name More...
 
bool theRPCLoneliness
 True if there are only the RPC measurements. More...
 
const MuonServiceProxytheService
 
int totalChambers
 
int totalCompatibleChambers
 

Detailed Description

The inward-outward fitter (starts from seed state).

Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch D. Trocino - INFN Torino danie.nosp@m.le.t.nosp@m.rocin.nosp@m.o@to.nosp@m..infn.nosp@m..it

Modified by C. Calabria & A. Sharma

The inward-outward fitter (starts from seed state).

Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch D. Trocino - INFN Torino danie.nosp@m.le.t.nosp@m.rocin.nosp@m.o@to.nosp@m..infn.nosp@m..it Modified by C. Calabria

Definition at line 31 of file StandAloneMuonFilter.h.

Constructor & Destructor Documentation

StandAloneMuonFilter::StandAloneMuonFilter ( const edm::ParameterSet par,
const MuonServiceProxy service,
edm::ConsumesCollector iC 
)

Constructor.

Definition at line 41 of file StandAloneMuonFilter.cc.

References Chi2MeasurementEstimatorESProducer_cfi::Chi2MeasurementEstimator, Exception, fitDirection(), edm::ParameterSet::getParameter(), insideOut, outsideIn, theBestMeasurementFinder, theEstimator, theFitDirection, theMaxChi2, theMeasurementExtractor, theMuonUpdator, theNavigationType, theNSigma, thePropagatorName, and theRPCLoneliness.

44 :theService(service),
46 {
47  // Fit direction
48  string fitDirectionName = par.getParameter<string>("FitDirection");
49 
50  if (fitDirectionName == "insideOut" ) theFitDirection = insideOut;
51  else if (fitDirectionName == "outsideIn" ) theFitDirection = outsideIn;
52  else
53  throw cms::Exception("StandAloneMuonFilter constructor")
54  <<"Wrong fit direction chosen in StandAloneMuonFilter::StandAloneMuonFilter ParameterSet"
55  << "\n"
56  << "Possible choices are:"
57  << "\n"
58  << "FitDirection = insideOut or FitDirection = outsideIn";
59 
60  // The max allowed chi2 to accept a rechit in the fit
61  theMaxChi2 = par.getParameter<double>("MaxChi2");
62 
63  // The errors of the trajectory state are multiplied by nSigma
64  // to define acceptance of BoundPlane and maximalLocalDisplacement
65  theNSigma = par.getParameter<double>("NumberOfSigma"); // default = 3.
66 
67  // The navigation type:
68  // "Direct","Standard"
69  theNavigationType = par.getParameter<string>("NavigationType");
70 
71  // The estimator: makes the decision wheter a measure is good or not
72  // it isn't used by the updator which does the real fit. In fact, in principle,
73  // a looser request onto the measure set can be requested
74  // (w.r.t. the request on the accept/reject measure in the fit)
76 
77  thePropagatorName = par.getParameter<string>("Propagator");
78 
80 
81  // Muon trajectory updator parameters
82  ParameterSet muonUpdatorPSet = par.getParameter<ParameterSet>("MuonTrajectoryUpdatorParameters");
83 
84  // the updator needs the fit direction
85  theMuonUpdator = new MuonTrajectoryUpdator(muonUpdatorPSet,
86  fitDirection() );
87 
88  // Measurement Extractor: enable the measure for each muon sub detector
89  bool enableDTMeasurement = par.getParameter<bool>("EnableDTMeasurement");
90  bool enableCSCMeasurement = par.getParameter<bool>("EnableCSCMeasurement");
91  bool enableRPCMeasurement = par.getParameter<bool>("EnableRPCMeasurement");
92  bool enableGEMMeasurement = par.getParameter<bool>("EnableGEMMeasurement");
93 
95  par.getParameter<InputTag>("CSCRecSegmentLabel"),
96  par.getParameter<InputTag>("RPCRecSegmentLabel"),
97  par.getParameter<InputTag>("GEMRecSegmentLabel"),
98  iC,
99  enableDTMeasurement,
100  enableCSCMeasurement,
101  enableRPCMeasurement,
102  enableGEMMeasurement);
103 
104  theRPCLoneliness = (!(enableDTMeasurement && enableCSCMeasurement)) ? enableRPCMeasurement : false;
105 }
T getParameter(std::string const &) const
NavigationDirection fitDirection() const
Return the fit direction.
double theMaxChi2
The max allowed chi2 to accept a rechit in the fit.
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)
bool theRPCLoneliness
True if there are only the RPC measurements.
std::string thePropagatorName
the propagator name
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
NavigationDirection theFitDirection
the propagation direction
MeasurementEstimator * theEstimator
The Estimator.
MuonBestMeasurementFinder * theBestMeasurementFinder
The best measurement finder: search for the best measurement among the TMs available.
const MuonServiceProxy * theService
StandAloneMuonFilter::~StandAloneMuonFilter ( )
virtual

Destructor.

Definition at line 107 of file StandAloneMuonFilter.cc.

References LogTrace, theBestMeasurementFinder, theEstimator, theMeasurementExtractor, and theMuonUpdator.

107  {
108 
109  LogTrace("Muon|RecoMuon|StandAloneMuonFilter")
110  <<"StandAloneMuonFilter destructor called"<<endl;
111 
112  delete theEstimator;
113  delete theMuonUpdator;
116 }
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
#define LogTrace(id)
MeasurementEstimator * theEstimator
The Estimator.
MuonBestMeasurementFinder * theBestMeasurementFinder
The best measurement finder: search for the best measurement among the TMs available.

Member Function Documentation

MuonBestMeasurementFinder* StandAloneMuonFilter::bestMeasurementFinder ( ) const
inlineprivate

Access to the best measurement finder.

Definition at line 162 of file StandAloneMuonFilter.h.

References theBestMeasurementFinder.

Referenced by findBestMeasurements().

162 {return theBestMeasurementFinder;}
MuonBestMeasurementFinder * theBestMeasurementFinder
The best measurement finder: search for the best measurement among the TMs available.
vector< const DetLayer * > StandAloneMuonFilter::compatibleLayers ( const DetLayer initialLayer,
const FreeTrajectoryState fts,
PropagationDirection  propDir 
)
private

Set the rigth Navigation.

Definition at line 175 of file StandAloneMuonFilter.cc.

References DirectMuonNavigation::compatibleLayers(), theNavigationType, and theService.

Referenced by refit().

177  {
178  vector<const DetLayer*> detLayers;
179 
180  if(theNavigationType == "Standard"){
181  // ask for compatible layers
182  detLayers = theService->muonNavigationSchool()->compatibleLayers(*initialLayer,fts,propDir);
183  // I have to fit by hand the first layer until the seedTSOS is defined on the first rechit layer
184  // In fact the first layer is not returned by initialLayer->compatibleLayers.
185  detLayers.insert(detLayers.begin(),initialLayer);
186  }
187  else if (theNavigationType == "Direct"){
188  DirectMuonNavigation navigation(theService->detLayerGeometry());
189  detLayers = navigation.compatibleLayers(fts,propDir);
190  }
191  else
192  edm::LogError("Muon|RecoMuon|StandAloneMuonFilter") << "No Properly Navigation Selected!!"<<endl;
193 
194  return detLayers;
195 }
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
const MuonServiceProxy * theService
void StandAloneMuonFilter::createDefaultTrajectory ( const Trajectory oldTraj,
Trajectory defTraj 
)

Definition at line 366 of file StandAloneMuonFilter.cc.

References MuonTransientTrackingRecHit::invalidateHit(), Trajectory::measurements(), eostools::move(), Trajectory::push(), Trajectory::reserve(), and MuonTransientTrackingRecHit::specificBuild().

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

366  {
367 
368  Trajectory::DataContainer const & oldMeas = oldTraj.measurements();
369  defTraj.reserve(oldMeas.size());
370 
371  for (Trajectory::DataContainer::const_iterator itm = oldMeas.begin(); itm != oldMeas.end(); itm++) {
372  if( !(*itm).recHit()->isValid() )
373  defTraj.push( *itm, (*itm).estimate() );
374  else {
375  MuonTransientTrackingRecHit::MuonRecHitPointer invRhPtr = MuonTransientTrackingRecHit::specificBuild( (*itm).recHit()->det(), (*itm).recHit()->hit() );
376  invRhPtr->invalidateHit();
377  TrajectoryMeasurement invRhMeas( (*itm).forwardPredictedState(), (*itm).updatedState(), invRhPtr, (*itm).estimate(), (*itm).layer() );
378  defTraj.push( std::move(invRhMeas), (*itm).estimate() );
379  }
380 
381  } // end for
382 }
void reserve(unsigned int n)
Definition: Trajectory.h:155
DataContainer const & measurements() const
Definition: Trajectory.h:203
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:42
def move
Definition: eostools.py:510
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:30
MeasurementEstimator* StandAloneMuonFilter::estimator ( void  ) const
inline

access at the estimator

Definition at line 101 of file StandAloneMuonFilter.h.

References theEstimator.

Referenced by findBestMeasurements().

101 {return theEstimator;}
MeasurementEstimator * theEstimator
The Estimator.
std::vector< TrajectoryMeasurement > StandAloneMuonFilter::findBestMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface tsos 
)
private

Definition at line 292 of file StandAloneMuonFilter.cc.

References bestMeasurementFinder(), estimator(), MuonBestMeasurementFinder::findBestMeasurement(), MuonDetLayerMeasurements::groupedMeasurements(), GeometricSearchDet::hasGroups(), LogTrace, MuonDetLayerMeasurements::measurements(), metname, outsideIn, propagator(), query::result, AlCaHLTBitMon_QueryRunRegistry::string, theFitDirection, theMeasurementExtractor, and theOverlappingChambersFlag.

Referenced by refit().

293  {
294 
295  const std::string metname = "Muon|RecoMuon|StandAloneMuonFilter";
296 
297  std::vector<TrajectoryMeasurement> result;
298  std::vector<TrajectoryMeasurement> measurements;
299 
300  if(theOverlappingChambersFlag && layer->hasGroups()){
301 
302  std::vector<TrajectoryMeasurementGroup> measurementGroups =
304 
305  if(theFitDirection == outsideIn){
306  LogTrace(metname) << "Reversing the order of groupedMeasurements as the direction of the fit is outside-in";
307  reverse(measurementGroups.begin(),measurementGroups.end());
308  // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or
309  // RecoMuon/DetLayers/MuRingForwardDoubleLayer
310  }
311 
312 
313  for(std::vector<TrajectoryMeasurementGroup>::const_iterator tmGroupItr = measurementGroups.begin();
314  tmGroupItr != measurementGroups.end(); ++tmGroupItr){
315 
316  measurements = tmGroupItr->measurements();
317  LogTrace(metname) << "Number of Trajectory Measurement: " << measurements.size();
318 
319  const TrajectoryMeasurement* bestMeasurement
321 
322  if(bestMeasurement) result.push_back(*bestMeasurement);
323  }
324  }
325  else{
326  measurements = theMeasurementExtractor->measurements(layer, tsos, *propagator(), *estimator());
327  LogTrace(metname) << "Number of Trajectory Measurement: " << measurements.size();
328  const TrajectoryMeasurement* bestMeasurement
329  = bestMeasurementFinder()->findBestMeasurement(measurements,
330  propagator());
331  if(bestMeasurement) result.push_back(*bestMeasurement);
332  }
333  return result;
334 }
MeasurementEstimator * estimator() const
access at the estimator
const std::string metname
std::vector< TrajectoryMeasurementGroup > groupedMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
tuple result
Definition: query.py:137
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
#define LogTrace(id)
const Propagator * propagator() const
access at the propagator
NavigationDirection theFitDirection
the propagation direction
TrajectoryMeasurement * findBestMeasurement(std::vector< TrajectoryMeasurement > &measC, const Propagator *propagator)
return the Tm with the best chi2: no cut applied.
MuonBestMeasurementFinder * bestMeasurementFinder() const
Access to the best measurement finder.
NavigationDirection StandAloneMuonFilter::fitDirection ( ) const
inline

Return the fit direction.

Definition at line 95 of file StandAloneMuonFilter.h.

References theFitDirection.

Referenced by propagationDirection(), and StandAloneMuonFilter().

95 {return theFitDirection;}
NavigationDirection theFitDirection
the propagation direction
int StandAloneMuonFilter::getCSCChamberUsed ( ) const
inline

Definition at line 67 of file StandAloneMuonFilter.h.

References cscChambers.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

int StandAloneMuonFilter::getCSCCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getDTChamberUsed ( ) const
inline

Definition at line 66 of file StandAloneMuonFilter.h.

References dtChambers.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

int StandAloneMuonFilter::getDTCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getGEMChamberUsed ( ) const
inline

Definition at line 69 of file StandAloneMuonFilter.h.

References gemChambers.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

int StandAloneMuonFilter::getGEMCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getRPCChamberUsed ( ) const
inline

Definition at line 68 of file StandAloneMuonFilter.h.

References rpcChambers.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

int StandAloneMuonFilter::getRPCCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getTotalChamberUsed ( ) const
inline

Definition at line 65 of file StandAloneMuonFilter.h.

References totalChambers.

int StandAloneMuonFilter::getTotalCompatibleChambers ( ) const
inline
bool StandAloneMuonFilter::goodState ( ) const
inline

Definition at line 77 of file StandAloneMuonFilter.h.

References cscChambers, dtChambers, gemChambers, onlyRPC(), and totalChambers.

77  {return totalChambers >= 2 &&
79  onlyRPC());}
bool onlyRPC() const
True if there are only the RPC measurements.
void StandAloneMuonFilter::incrementChamberCounters ( const DetLayer layer)
private

Increment the DT,CSC,RPC counters.

Definition at line 146 of file StandAloneMuonFilter.cc.

References GeomDetEnumerators::CSC, cscChambers, GeomDetEnumerators::DT, dtChambers, GeomDetEnumerators::GEM, gemChambers, GeomDetEnumerators::RPCBarrel, rpcChambers, GeomDetEnumerators::RPCEndcap, DetLayer::subDetector(), and totalChambers.

Referenced by refit().

146  {
147 
149  else if(layer->subDetector()==GeomDetEnumerators::CSC) cscChambers++;
151  else if(layer->subDetector()==GeomDetEnumerators::GEM) gemChambers++;
152  else
153  LogError("Muon|RecoMuon|StandAloneMuonFilter")
154  << "Unrecognized module type in incrementChamberCounters";
155  // FIXME:
156  // << layer->module() << " " <<layer->Part() << endl;
157 
158  totalChambers++;
159 }
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
void StandAloneMuonFilter::incrementCompatibleChamberCounters ( const DetLayer layer)
private

Definition at line 161 of file StandAloneMuonFilter.cc.

References GeomDetEnumerators::CSC, cscCompatibleChambers, GeomDetEnumerators::DT, dtCompatibleChambers, GeomDetEnumerators::GEM, gemCompatibleChambers, GeomDetEnumerators::RPCBarrel, rpcCompatibleChambers, GeomDetEnumerators::RPCEndcap, DetLayer::subDetector(), and totalCompatibleChambers.

Referenced by refit().

161  {
162 
167  else
168  LogError("Muon|RecoMuon|StandAloneMuonFilter")
169  << "Unrecognized module type in incrementCompatibleChamberCounters";
170 
172 }
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
bool StandAloneMuonFilter::isCompatibilitySatisfied ( ) const
inline
FreeTrajectoryState StandAloneMuonFilter::lastButOneUpdatedFTS ( ) const
inline

the last but one free trajectory state

Definition at line 49 of file StandAloneMuonFilter.h.

References TrajectoryStateOnSurface::freeTrajectoryState(), and theLastButOneUpdatedTSOS.

FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface StandAloneMuonFilter::lastButOneUpdatedTSOS ( ) const
inline

the Trajectory state on the last surface of the fitting

Definition at line 58 of file StandAloneMuonFilter.h.

References theLastButOneUpdatedTSOS.

TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface StandAloneMuonFilter::lastCompatibleTSOS ( ) const
inline

the Trajectory state on the last compatible surface

Definition at line 52 of file StandAloneMuonFilter.h.

References theLastCompatibleTSOS.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

52 {return theLastCompatibleTSOS;}
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
const DetLayer* StandAloneMuonFilter::lastDetLayer ( ) const
inline

return the last det layer

Definition at line 89 of file StandAloneMuonFilter.h.

References theDetLayers.

89 {return theDetLayers.back();}
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
FreeTrajectoryState StandAloneMuonFilter::lastUpdatedFTS ( ) const
inline

the last free trajectory state

Definition at line 46 of file StandAloneMuonFilter.h.

References TrajectoryStateOnSurface::freeTrajectoryState(), and theLastUpdatedTSOS.

FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
TrajectoryStateOnSurface StandAloneMuonFilter::lastUpdatedTSOS ( ) const
inline

the Trajectory state on the last surface of the fitting

Definition at line 55 of file StandAloneMuonFilter.h.

References theLastUpdatedTSOS.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

55 {return theLastUpdatedTSOS;}
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
std::vector<const DetLayer*> StandAloneMuonFilter::layers ( ) const
inline

return the layer used for the refit

Definition at line 86 of file StandAloneMuonFilter.h.

References theDetLayers.

86 {return theDetLayers;}
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
bool StandAloneMuonFilter::onlyRPC ( ) const
inline

True if there are only the RPC measurements.

Definition at line 98 of file StandAloneMuonFilter.h.

References theRPCLoneliness.

Referenced by goodState(), and isCompatibilitySatisfied().

98 {return theRPCLoneliness;}
bool theRPCLoneliness
True if there are only the RPC measurements.
PropagationDirection StandAloneMuonFilter::propagationDirection ( void  ) const

Return the propagation direction.

Definition at line 123 of file StandAloneMuonFilter.cc.

References alongMomentum, anyDirection, fitDirection(), and oppositeToMomentum.

Referenced by refit().

123  {
124  if( fitDirection() == 0 ) return alongMomentum;
125  else if ( fitDirection() == 1 ) return oppositeToMomentum;
126  else return anyDirection;
127 }
NavigationDirection fitDirection() const
Return the fit direction.
const Propagator * StandAloneMuonFilter::propagator ( ) const

access at the propagator

Definition at line 118 of file StandAloneMuonFilter.cc.

References thePropagatorName, and theService.

Referenced by findBestMeasurements(), and update().

118  {
119  return &*theService->propagator(thePropagatorName);
120 }
std::string thePropagatorName
the propagator name
const MuonServiceProxy * theService
void StandAloneMuonFilter::refit ( const TrajectoryStateOnSurface initialState,
const DetLayer initialLayer,
Trajectory trajectory 
)

Perform the inner-outward fitting.

Definition at line 198 of file StandAloneMuonFilter.cc.

References compatibleLayers(), debug, MuonPatternRecoDumper::dumpLayer(), PV3DBase< T, PVType, FrameType >::eta(), findBestMeasurements(), TrajectoryStateOnSurface::freeTrajectoryState(), TrajectoryStateOnSurface::globalPosition(), incrementChamberCounters(), incrementCompatibleChamberCounters(), LogTrace, metname, FreeTrajectoryState::momentum(), propagationDirection(), reset(), AlCaHLTBitMon_QueryRunRegistry::string, theDetLayers, theLastButOneUpdatedTSOS, theLastCompatibleTSOS, theLastUpdatedTSOS, and update().

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

199  {
200 
201  const std::string metname = "Muon|RecoMuon|StandAloneMuonFilter";
202 
203  // reset the refitter each seed refinement
204  reset();
205 
207 
208  LogTrace(metname) << "Starting the refit"<<endl;
209 
210  // this is the most outward TSOS (updated or predicted) onto a DetLayer
212 
213  double eta0 = initialTSOS.freeTrajectoryState()->momentum().eta();
214  vector<const DetLayer*> detLayers = compatibleLayers(initialLayer,*initialTSOS.freeTrajectoryState(),
216 
217  LogTrace(metname)<<"compatible layers found: "<<detLayers.size()<<endl;
218 
219  vector<const DetLayer*>::const_iterator layer;
220 
221  // the layers are ordered in agreement with the fit/propagation direction
222  for ( layer = detLayers.begin(); layer!= detLayers.end(); ++layer ) {
223 
224  // bool firstTime = true;
225 
226  LogTrace(metname) << debug.dumpLayer(*layer);
227 
228  LogTrace(metname) << "search Trajectory Measurement from: " << lastTSOS.globalPosition();
229 
230  // pick the best measurement from each group
231  std::vector<TrajectoryMeasurement> bestMeasurements = findBestMeasurements(*layer, lastTSOS);
232 
233  // RB: Different ways can be choosen if no bestMeasurement is available:
234  // 1- check on lastTSOS-initialTSOS eta difference
235  // 2- check on lastTSOS-lastButOneUpdatedTSOS eta difference
236  // After this choice:
237  // A- extract the measurements compatible with the initialTSOS (seed)
238  // B- extract the measurements compatible with the lastButOneUpdatedTSOS
239  // In ORCA the choice was 1A. Here I will try 1B and if it fail I'll try 1A
240  // another possibility could be 2B and then 1A.
241 
242  // if no measurement found and the current TSOS has an eta very different
243  // wrt the initial one (i.e. seed), then try to find the measurements
244  // according to the lastButOne FTS. (1B)
245  double lastdEta = fabs(lastTSOS.freeTrajectoryState()->momentum().eta() - eta0);
246  if( bestMeasurements.empty() && lastdEta > 0.1) {
247  LogTrace(metname) << "No measurement and big eta variation wrt seed" << endl
248  << "trying with lastButOneUpdatedTSOS";
249  bestMeasurements = findBestMeasurements(*layer, theLastButOneUpdatedTSOS);
250  }
251 
252  //if no measurement found and the current FTS has an eta very different
253  //wrt the initial one (i.e. seed), then try to find the measurements
254  //according to the initial FTS. (1A)
255  if( bestMeasurements.empty() && lastdEta > 0.1) {
256  LogTrace(metname) << "No measurement and big eta variation wrt seed" << endl
257  << "tryng with seed TSOS";
258  bestMeasurements = findBestMeasurements(*layer, initialTSOS);
259  }
260 
261  // FIXME: uncomment this line!!
262  // if(!bestMeasurement && firstTime) break;
263 
264  if(!bestMeasurements.empty()) {
266  bool added = false;
267  for(std::vector<TrajectoryMeasurement>::const_iterator tmItr = bestMeasurements.begin();
268  tmItr != bestMeasurements.end(); ++tmItr){
269  added |= update(*layer, &(*tmItr), trajectory);
270  lastTSOS = theLastUpdatedTSOS;
271  }
272  if(added) {
273  incrementChamberCounters(*layer);
274  theDetLayers.push_back(*layer);
275  }
276  }
277  // SL in case no valid mesurement is found, still I want to use the predicted
278  // state for the following measurement serches. I take the first in the
279  // container. FIXME!!! I want to carefully check this!!!!!
280  else{
281  LogTrace(metname)<<"No best measurement found"<<endl;
282  // if (!theMeasurementCache.empty()){
283  // LogTrace(metname)<<"but the #of measurement is "<<theMeasurementCache.size()<<endl;
284  // lastTSOS = theMeasurementCache.front().predictedState();
285  // }
286  }
287  } // loop over layers
288 }
std::string dumpLayer(const DetLayer *layer) const
const std::string metname
void incrementCompatibleChamberCounters(const DetLayer *layer)
GlobalPoint globalPosition() const
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
void incrementChamberCounters(const DetLayer *layer)
Increment the DT,CSC,RPC counters.
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
GlobalVector momentum() const
#define LogTrace(id)
PropagationDirection propagationDirection() const
Return the propagation direction.
#define debug
Definition: HDRShower.cc:19
bool update(const DetLayer *layer, const TrajectoryMeasurement *meas, Trajectory &trajectory)
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
std::vector< const DetLayer * > compatibleLayers(const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
Set the rigth Navigation.
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
T eta() const
Definition: PV3DBase.h:76
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
std::vector< TrajectoryMeasurement > findBestMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &tsos)
void StandAloneMuonFilter::reset ( void  )

Definition at line 130 of file StandAloneMuonFilter.cc.

References cscChambers, cscCompatibleChambers, dtChambers, dtCompatibleChambers, gemChambers, gemCompatibleChambers, MuonTrajectoryUpdator::makeFirstTime(), rpcChambers, rpcCompatibleChambers, theDetLayers, theLastButOneUpdatedTSOS, theLastCompatibleTSOS, theLastUpdatedTSOS, theMuonUpdator, totalChambers, and totalCompatibleChambers.

Referenced by refit().

130  {
133 
135 
137 
138  theDetLayers.clear();
139 }
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)
void makeFirstTime()
reset the theFirstTSOSFlag
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
void StandAloneMuonFilter::setEvent ( const edm::Event event)
virtual

Pass the Event to the algo at each event.

Definition at line 141 of file StandAloneMuonFilter.cc.

References MuonDetLayerMeasurements::setEvent(), and theMeasurementExtractor.

Referenced by StandAloneMuonTrajectoryBuilder::setEvent().

141  {
143 }
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
void setEvent(const edm::Event &)
set event
void StandAloneMuonFilter::setLastButOneUpdatedTSOS ( TrajectoryStateOnSurface  tsos)
inlineprivate

Set the last but one TSOS.

Definition at line 123 of file StandAloneMuonFilter.h.

References theLastButOneUpdatedTSOS.

123 { theLastButOneUpdatedTSOS = tsos;}
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
void StandAloneMuonFilter::setLastCompatibleTSOS ( TrajectoryStateOnSurface  tsos)
inlineprivate

Set the last compatible TSOS.

Definition at line 117 of file StandAloneMuonFilter.h.

References theLastCompatibleTSOS.

117 { theLastCompatibleTSOS = tsos;}
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
void StandAloneMuonFilter::setLastUpdatedTSOS ( TrajectoryStateOnSurface  tsos)
inlineprivate

Set the last TSOS.

Definition at line 120 of file StandAloneMuonFilter.h.

References theLastUpdatedTSOS.

120 { theLastUpdatedTSOS = tsos;}
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
bool StandAloneMuonFilter::update ( const DetLayer layer,
const TrajectoryMeasurement meas,
Trajectory trajectory 
)
private

Definition at line 339 of file StandAloneMuonFilter.cc.

References debug, MuonPatternRecoDumper::dumpTSOS(), LogTrace, metname, propagator(), query::result, AlCaHLTBitMon_QueryRunRegistry::string, theLastButOneUpdatedTSOS, theLastCompatibleTSOS, theLastUpdatedTSOS, MuonTrajectoryUpdator::update(), and updator().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), refit(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

342 {
343  const std::string metname = "Muon|RecoMuon|StandAloneMuonFilter";
345 
346  LogTrace(metname)<<"best measurement found" << "\n"
347  <<"updating the trajectory..."<<endl;
348  pair<bool,TrajectoryStateOnSurface> result = updator()->update(meas,
349  trajectory,
350  propagator());
351  LogTrace(metname)<<"trajectory updated: "<<result.first<<endl;
352  LogTrace(metname) << debug.dumpTSOS(result.second);
353 
354  if(result.first){
356  theLastUpdatedTSOS = result.second;
357  }
358 
359  if(result.second.isValid())
360  theLastCompatibleTSOS = result.second;
361 
362  return result.first;
363 }
const std::string metname
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
tuple result
Definition: query.py:137
#define LogTrace(id)
const Propagator * propagator() const
access at the propagator
#define debug
Definition: HDRShower.cc:19
MuonTrajectoryUpdator * updator() const
access at the muon updator
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
virtual std::pair< bool, TrajectoryStateOnSurface > update(const TrajectoryMeasurement *measurement, Trajectory &trajectory, const Propagator *propagator)
update the Trajectory with the TrajectoryMeasurement
MuonTrajectoryUpdator* StandAloneMuonFilter::updator ( ) const
inline

access at the muon updator

Definition at line 107 of file StandAloneMuonFilter.h.

References theMuonUpdator.

Referenced by update().

107 {return theMuonUpdator;}
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)

Member Data Documentation

int StandAloneMuonFilter::cscChambers
private
int StandAloneMuonFilter::cscCompatibleChambers
private
int StandAloneMuonFilter::dtChambers
private
int StandAloneMuonFilter::dtCompatibleChambers
private
int StandAloneMuonFilter::gemChambers
private
int StandAloneMuonFilter::gemCompatibleChambers
private
int StandAloneMuonFilter::rpcChambers
private

Definition at line 189 of file StandAloneMuonFilter.h.

Referenced by getRPCChamberUsed(), incrementChamberCounters(), and reset().

int StandAloneMuonFilter::rpcCompatibleChambers
private
MuonBestMeasurementFinder* StandAloneMuonFilter::theBestMeasurementFinder
private

The best measurement finder: search for the best measurement among the TMs available.

Definition at line 160 of file StandAloneMuonFilter.h.

Referenced by bestMeasurementFinder(), StandAloneMuonFilter(), and ~StandAloneMuonFilter().

std::vector<const DetLayer*> StandAloneMuonFilter::theDetLayers
private

the det layer used in the reconstruction

Definition at line 174 of file StandAloneMuonFilter.h.

Referenced by lastDetLayer(), layers(), refit(), and reset().

MeasurementEstimator* StandAloneMuonFilter::theEstimator
private

The Estimator.

Definition at line 152 of file StandAloneMuonFilter.h.

Referenced by estimator(), StandAloneMuonFilter(), and ~StandAloneMuonFilter().

NavigationDirection StandAloneMuonFilter::theFitDirection
private

the propagation direction

Definition at line 171 of file StandAloneMuonFilter.h.

Referenced by findBestMeasurements(), fitDirection(), and StandAloneMuonFilter().

TrajectoryStateOnSurface StandAloneMuonFilter::theLastButOneUpdatedTSOS
private

the trajectory state on the last but one available surface

Definition at line 146 of file StandAloneMuonFilter.h.

Referenced by lastButOneUpdatedFTS(), lastButOneUpdatedTSOS(), refit(), reset(), setLastButOneUpdatedTSOS(), and update().

TrajectoryStateOnSurface StandAloneMuonFilter::theLastCompatibleTSOS
private

the trajectory state on the last compatible surface

Definition at line 142 of file StandAloneMuonFilter.h.

Referenced by lastCompatibleTSOS(), refit(), reset(), setLastCompatibleTSOS(), and update().

TrajectoryStateOnSurface StandAloneMuonFilter::theLastUpdatedTSOS
private

the trajectory state on the last available surface

Definition at line 144 of file StandAloneMuonFilter.h.

Referenced by lastUpdatedFTS(), lastUpdatedTSOS(), refit(), reset(), setLastUpdatedTSOS(), and update().

double StandAloneMuonFilter::theMaxChi2
private

The max allowed chi2 to accept a rechit in the fit.

Definition at line 165 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonFilter().

MuonDetLayerMeasurements* StandAloneMuonFilter::theMeasurementExtractor
private
MuonTrajectoryUpdator* StandAloneMuonFilter::theMuonUpdator
private

the muon updator (it doesn't inhert from an updator, but it has one!)

Definition at line 155 of file StandAloneMuonFilter.h.

Referenced by reset(), StandAloneMuonFilter(), updator(), and ~StandAloneMuonFilter().

std::string StandAloneMuonFilter::theMuonUpdatorName
private

its name

Definition at line 157 of file StandAloneMuonFilter.h.

std::string StandAloneMuonFilter::theNavigationType
private

Navigation type "Direct","Standard"

Definition at line 181 of file StandAloneMuonFilter.h.

Referenced by compatibleLayers(), and StandAloneMuonFilter().

double StandAloneMuonFilter::theNSigma
private

The errors of the trajectory state are multiplied by nSigma to define acceptance of BoundPlane and maximalLocalDisplacement

Definition at line 168 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonFilter().

bool StandAloneMuonFilter::theOverlappingChambersFlag
private

Definition at line 199 of file StandAloneMuonFilter.h.

Referenced by findBestMeasurements().

std::string StandAloneMuonFilter::thePropagatorName
private

the propagator name

Definition at line 177 of file StandAloneMuonFilter.h.

Referenced by propagator(), and StandAloneMuonFilter().

bool StandAloneMuonFilter::theRPCLoneliness
private

True if there are only the RPC measurements.

Definition at line 184 of file StandAloneMuonFilter.h.

Referenced by onlyRPC(), and StandAloneMuonFilter().

const MuonServiceProxy* StandAloneMuonFilter::theService
private

Definition at line 198 of file StandAloneMuonFilter.h.

Referenced by compatibleLayers(), and propagator().

int StandAloneMuonFilter::totalChambers
private
int StandAloneMuonFilter::totalCompatibleChambers
private