CMS 3D CMS Logo

SETFilter.h
Go to the documentation of this file.
1 #ifndef RecoMuon_MuonSeedGenerator_SETFilter_H
2 #define RecoMuon_MuonSeedGenerator_SETFilter_H
3 
12 
15 
16 //#include "CLHEP/Matrix/DiagMatrix.h"
18 #include "CLHEP/Matrix/Vector.h"
19 #include "CLHEP/Vector/ThreeVector.h"
20 
24 
26 
28 
31 
32 
33 // used in the SET algorithm
36  CLHEP::Hep3Vector momentum;
37  int charge;
38  double weight;
40 };
41 
42 class DetLayer;
43 class Trajectory;
44 //class MuonServiceProxy;
45 class TrajectoryFitter;
46 
47 namespace edm {class ParameterSet; class EventSetup; class Event;}
48 
49 class SETFilter {
50 
51  public:
54 
56  virtual ~SETFilter();
57 
58  // Operations
59 
61  void refit(const TrajectoryStateOnSurface& initialState, const DetLayer*, Trajectory& trajectory);
62 
64  FreeTrajectoryState lastUpdatedFTS() const {return *theLastUpdatedTSOS.freeTrajectoryState();}
65 
67  TrajectoryStateOnSurface lastUpdatedTSOS() const {return theLastUpdatedTSOS;}
68 
70  bool fwfit_SET( std::vector < SeedCandidate> & validSegmentsSet_in,
71  std::vector < SeedCandidate> & validSegmentsSet_out);
72 
74  bool buildTrajectoryMeasurements( SeedCandidate * validSegmentsSet,
75  Trajectory::DataContainer & finalCandidate);
76 
77 
79  bool transform(Trajectory::DataContainer &measurements_segments,
81  TrajectoryStateOnSurface & firstTSOS);
82 
84  bool transformLight(Trajectory::DataContainer &measurements_segments,
86  TrajectoryStateOnSurface & firstTSOS);
87 
88 
89 
90  void reset();
91 
93  virtual void setEvent(const edm::Event& event);
94 
95  int getTotalChamberUsed() const {return totalChambers;}
96  int getDTChamberUsed() const {return dtChambers;}
97  int getCSCChamberUsed() const {return cscChambers;}
98  int getRPCChamberUsed() const {return rpcChambers;}
99 
100  inline bool goodState() const {return totalChambers >= 2 &&
101  ((dtChambers + cscChambers) >0 );}
102 
104  std::vector<const DetLayer*> layers() const {return theDetLayers;}
105 
107  const DetLayer* lastDetLayer() const {return theDetLayers.back();}
108 
110  PropagationDirection propagationDirection() const;
111 
112 protected:
113 
114 private:
115 
117  void setLastUpdatedTSOS(TrajectoryStateOnSurface tsos) { theLastUpdatedTSOS = tsos;}
118 
120  void setLastButOneUpdatedTSOS(TrajectoryStateOnSurface tsos) { theLastButOneUpdatedTSOS = tsos;}
121 
123  void incrementChamberCounters(const DetLayer *layer);
124 
126  const Propagator *propagator() const;
127 
128 
129  // chi2 functions (calculate chi2)
130  double findChi2(double pX, double pY, double pZ,
131  const CLHEP::Hep3Vector& r3T,
132  SeedCandidate & muonCandidate,
133  TrajectoryStateOnSurface &lastUpdatedTSOS,
135  bool detailedOutput);
136 
137  double findMinChi2(unsigned int iSet, const CLHEP::Hep3Vector& r3T,
138  SeedCandidate & muonCandidate,
139  std::vector < TrajectoryStateOnSurface > &lastUpdatedTSOS_Vect,
140  Trajectory::DataContainer & trajectoryMeasurementsInTheSet);
141 
142  double chi2AtSpecificStep(CLHEP::Hep3Vector &foot,
143  const CLHEP::Hep3Vector& r3T,
144  SeedCandidate & muonCandidate,
145  TrajectoryStateOnSurface &lastUpdatedTSOS,
146  Trajectory::DataContainer & trajectoryMeasurementsInTheSet,
147  bool detailedOutput);
148 
149  // find initial points for the SIMPLEX minimization
150  std::vector <CLHEP::Hep3Vector> find3MoreStartingPoints(CLHEP::Hep3Vector &key_foot,
151  const CLHEP::Hep3Vector& r3T,
152  SeedCandidate & muonCandidate);
153 
154  std::pair <double,double> findParabolaMinimum(std::vector <double> &quadratic_var,
155  std::vector <double> &quadratic_chi2);
156 
157  // SIMPLEX minimization functions
158  void pickElements(std::vector <double> &chi2Feet,
159  unsigned int & high, unsigned int & second_high, unsigned int & low);
160 
161  CLHEP::Hep3Vector reflectFoot(std::vector <CLHEP::Hep3Vector> & feet,
162  unsigned int key_foot, double scale );
163 
164  void nDimContract(std::vector <CLHEP::Hep3Vector> & feet, unsigned int low);
165  //---- SET
166 
169 
172 
177 
179  std::vector<const DetLayer*> theDetLayers;
180 
185 
187 
191 
193  //bool theOverlappingChambersFlag;
194 };
195 #endif
196 
std::string thePropagatorName
the propagator name
Definition: SETFilter.h:168
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
Definition: SETFilter.h:174
FreeTrajectoryState lastUpdatedFTS() const
the last free trajectory state
Definition: SETFilter.h:64
CLHEP::Hep3Vector momentum
Definition: SETFilter.h:36
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
Definition: SETFilter.h:176
Trajectory::DataContainer trajectoryMeasurementsInTheSet
Definition: SETFilter.h:39
double weight
Definition: SETFilter.h:38
std::string theBWLightFitterName
Definition: SETFilter.h:190
PropagationDirection
void setLastButOneUpdatedTSOS(TrajectoryStateOnSurface tsos)
Set the last but one TSOS.
Definition: SETFilter.h:120
int cscChambers
Definition: SETFilter.h:183
TrajectoryStateOnSurface lastUpdatedTSOS() const
the Trajectory state on the last surface of the fitting
Definition: SETFilter.h:67
std::vector< const DetLayer * > layers() const
return the layer used for the refit
Definition: SETFilter.h:104
int getTotalChamberUsed() const
Definition: SETFilter.h:95
int getDTChamberUsed() const
Definition: SETFilter.h:96
const DetLayer * lastDetLayer() const
return the last det layer
Definition: SETFilter.h:107
int dtChambers
Definition: SETFilter.h:182
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:44
int totalChambers
Definition: SETFilter.h:181
NavigationDirection theFitDirection
the propagation direction
Definition: SETFilter.h:171
int getCSCChamberUsed() const
Definition: SETFilter.h:97
bool useSegmentsInTrajectory
Definition: SETFilter.h:186
std::vector< ConstRecHitPointer > ConstRecHitContainer
int getRPCChamberUsed() const
Definition: SETFilter.h:98
const MuonServiceProxy * theService
Definition: SETFilter.h:192
edm::ESHandle< TrajectoryFitter > theBWLightFitter
used in the SET BW fit
Definition: SETFilter.h:189
HLT enums.
int rpcChambers
Definition: SETFilter.h:184
MuonTransientTrackingRecHit::MuonRecHitContainer theSet
Definition: SETFilter.h:35
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
Definition: SETFilter.h:179
void reset(double vett[256])
Definition: TPedValues.cc:11
std::vector< MuonRecHitPointer > MuonRecHitContainer
void setLastUpdatedTSOS(TrajectoryStateOnSurface tsos)
Set the last TSOS.
Definition: SETFilter.h:117
Definition: event.py:1
bool goodState() const
Definition: SETFilter.h:100