CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
53  SETFilter(const edm::ParameterSet& par, const MuonServiceProxy* service);
54 
56  virtual ~SETFilter();
57 
58  // Operations
59 
61  void refit(const TrajectoryStateOnSurface& initialState, const DetLayer*, Trajectory& trajectory);
62 
65 
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 
111 
112 protected:
113 
114 private:
115 
118 
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,
134  Trajectory::DataContainer & trajectoryMeasurementsInTheSet,
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,
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 
168  std::string thePropagatorName;
169 
172 
177 
179  std::vector<const DetLayer*> theDetLayers;
180 
185 
187 
190  std::string theBWLightFitterName;
191 
193  //bool theOverlappingChambersFlag;
194 };
195 #endif
196 
void nDimContract(std::vector< CLHEP::Hep3Vector > &feet, unsigned int low)
Definition: SETFilter.cc:739
std::string thePropagatorName
the propagator name
Definition: SETFilter.h:168
bool transform(Trajectory::DataContainer &measurements_segments, TransientTrackingRecHit::ConstRecHitContainer &hitContainer, TrajectoryStateOnSurface &firstTSOS)
transforms &quot;segment trajectory&quot; to &quot;rechit container&quot;
Definition: SETFilter.cc:166
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
Definition: SETFilter.h:174
double chi2AtSpecificStep(CLHEP::Hep3Vector &foot, const CLHEP::Hep3Vector &r3T, SeedCandidate &muonCandidate, TrajectoryStateOnSurface &lastUpdatedTSOS, Trajectory::DataContainer &trajectoryMeasurementsInTheSet, bool detailedOutput)
Definition: SETFilter.cc:494
bool transformLight(Trajectory::DataContainer &measurements_segments, TransientTrackingRecHit::ConstRecHitContainer &hitContainer, TrajectoryStateOnSurface &firstTSOS)
transforms &quot;segment trajectory&quot; to &quot;segment container&quot;
Definition: SETFilter.cc:214
const Propagator * propagator() const
access at the propagator
Definition: SETFilter.cc:77
FreeTrajectoryState lastUpdatedFTS() const
the last free trajectory state
Definition: SETFilter.h:64
CLHEP::Hep3Vector momentum
Definition: SETFilter.h:36
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
Definition: SETFilter.h:176
void reset()
Definition: SETFilter.cc:68
Trajectory::DataContainer trajectoryMeasurementsInTheSet
Definition: SETFilter.h:39
bool buildTrajectoryMeasurements(SeedCandidate *validSegmentsSet, Trajectory::DataContainer &finalCandidate)
from SeedCandidate to DataContainer only
Definition: SETFilter.cc:132
double weight
Definition: SETFilter.h:38
double findMinChi2(unsigned int iSet, const CLHEP::Hep3Vector &r3T, SeedCandidate &muonCandidate, std::vector< TrajectoryStateOnSurface > &lastUpdatedTSOS_Vect, Trajectory::DataContainer &trajectoryMeasurementsInTheSet)
Definition: SETFilter.cc:352
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:42
bool fwfit_SET(std::vector< SeedCandidate > &validSegmentsSet_in, std::vector< SeedCandidate > &validSegmentsSet_out)
Perform the SET inner-outward fitting.
Definition: SETFilter.cc:97
int totalChambers
Definition: SETFilter.h:181
NavigationDirection theFitDirection
the propagation direction
Definition: SETFilter.h:171
PropagationDirection propagationDirection() const
Return the propagation direction.
virtual ~SETFilter()
Destructor.
Definition: SETFilter.cc:58
void refit(const TrajectoryStateOnSurface &initialState, const DetLayer *, Trajectory &trajectory)
Perform the inner-outward fitting.
int getCSCChamberUsed() const
Definition: SETFilter.h:97
bool useSegmentsInTrajectory
Definition: SETFilter.h:186
SETFilter(const edm::ParameterSet &par, const MuonServiceProxy *service)
Constructor.
Definition: SETFilter.cc:49
std::vector< CLHEP::Hep3Vector > find3MoreStartingPoints(CLHEP::Hep3Vector &key_foot, const CLHEP::Hep3Vector &r3T, SeedCandidate &muonCandidate)
Definition: SETFilter.cc:520
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
void pickElements(std::vector< double > &chi2Feet, unsigned int &high, unsigned int &second_high, unsigned int &low)
Definition: SETFilter.cc:703
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
double findChi2(double pX, double pY, double pZ, const CLHEP::Hep3Vector &r3T, SeedCandidate &muonCandidate, TrajectoryStateOnSurface &lastUpdatedTSOS, Trajectory::DataContainer &trajectoryMeasurementsInTheSet, bool detailedOutput)
Definition: SETFilter.cc:239
void incrementChamberCounters(const DetLayer *layer)
Increment the DT,CSC,RPC counters.
Definition: SETFilter.cc:82
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
std::vector< MuonRecHitPointer > MuonRecHitContainer
std::pair< double, double > findParabolaMinimum(std::vector< double > &quadratic_var, std::vector< double > &quadratic_chi2)
Definition: SETFilter.cc:640
void setLastUpdatedTSOS(TrajectoryStateOnSurface tsos)
Set the last TSOS.
Definition: SETFilter.h:117
virtual void setEvent(const edm::Event &event)
Pass the Event to the algo at each event.
Definition: SETFilter.cc:65
CLHEP::Hep3Vector reflectFoot(std::vector< CLHEP::Hep3Vector > &feet, unsigned int key_foot, double scale)
Definition: SETFilter.cc:718
bool goodState() const
Definition: SETFilter.h:100