File indexing completed on 2024-04-06 12:27:14
0001 #ifndef RecoMuon_StandAloneTrackFinder_StandAloneMuonFilter_H
0002 #define RecoMuon_StandAloneTrackFinder_StandAloneMuonFilter_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0015 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0016 #include "TrackingTools/DetLayers/interface/NavigationDirection.h"
0017 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0018
0019 #include "RecoMuon/TrackingTools/interface/MuonBestMeasurementFinder.h"
0020 #include "FWCore/Framework/interface/ConsumesCollector.h"
0021
0022 class Propagator;
0023 class DetLayer;
0024 class MuonTrajectoryUpdator;
0025 class Trajectory;
0026 class MuonDetLayerMeasurements;
0027 class MeasurementEstimator;
0028 class MuonServiceProxy;
0029
0030 namespace edm {
0031 class ParameterSet;
0032 class EventSetup;
0033 class Event;
0034 }
0035
0036 class StandAloneMuonFilter {
0037 public:
0038
0039 StandAloneMuonFilter(const edm::ParameterSet &par, const MuonServiceProxy *service, edm::ConsumesCollector &iC);
0040
0041
0042 virtual ~StandAloneMuonFilter();
0043
0044
0045
0046
0047 void refit(const TrajectoryStateOnSurface &initialState, const DetLayer *, Trajectory &trajectory);
0048
0049
0050 FreeTrajectoryState lastUpdatedFTS() const { return *theLastUpdatedTSOS.freeTrajectoryState(); }
0051
0052
0053 FreeTrajectoryState lastButOneUpdatedFTS() const { return *theLastButOneUpdatedTSOS.freeTrajectoryState(); }
0054
0055
0056 TrajectoryStateOnSurface lastCompatibleTSOS() const { return theLastCompatibleTSOS; }
0057
0058
0059 TrajectoryStateOnSurface lastUpdatedTSOS() const { return theLastUpdatedTSOS; }
0060
0061
0062 TrajectoryStateOnSurface lastButOneUpdatedTSOS() const { return theLastButOneUpdatedTSOS; }
0063
0064 void reset();
0065
0066
0067 virtual void setEvent(const edm::Event &event);
0068
0069 int getTotalChamberUsed() const { return totalChambers; }
0070 int getDTChamberUsed() const { return dtChambers; }
0071 int getCSCChamberUsed() const { return cscChambers; }
0072 int getRPCChamberUsed() const { return rpcChambers; }
0073 int getGEMChamberUsed() const { return gemChambers; }
0074 int getME0ChamberUsed() const { return me0Chambers; }
0075
0076 int getTotalCompatibleChambers() const { return totalCompatibleChambers; }
0077 int getDTCompatibleChambers() const { return dtCompatibleChambers; }
0078 int getCSCCompatibleChambers() const { return cscCompatibleChambers; }
0079 int getRPCCompatibleChambers() const { return rpcCompatibleChambers; }
0080 int getGEMCompatibleChambers() const { return gemCompatibleChambers; }
0081 int getME0CompatibleChambers() const { return me0CompatibleChambers; }
0082
0083 inline bool goodState() const {
0084 return totalChambers >= 2 && ((dtChambers + cscChambers + gemChambers + me0Chambers) > 0 || onlyRPC());
0085 }
0086
0087 inline bool isCompatibilitySatisfied() const {
0088 return totalCompatibleChambers >= 2 &&
0089 ((dtCompatibleChambers + cscCompatibleChambers + gemCompatibleChambers + me0CompatibleChambers) > 0 ||
0090 onlyRPC());
0091 }
0092
0093
0094 std::vector<const DetLayer *> layers() const { return theDetLayers; }
0095
0096
0097 const DetLayer *lastDetLayer() const { return theDetLayers.back(); }
0098
0099
0100 PropagationDirection propagationDirection() const;
0101
0102
0103 NavigationDirection fitDirection() const { return theFitDirection; }
0104
0105
0106 bool onlyRPC() const { return theRPCLoneliness; }
0107
0108
0109 MeasurementEstimator *estimator() const { return theEstimator; }
0110
0111
0112 const Propagator *propagator() const;
0113
0114
0115 MuonTrajectoryUpdator *updator() const { return theMuonUpdator; }
0116
0117 void createDefaultTrajectory(const Trajectory &, Trajectory &);
0118
0119 protected:
0120 private:
0121
0122 void setLastCompatibleTSOS(TrajectoryStateOnSurface tsos) { theLastCompatibleTSOS = tsos; }
0123
0124
0125 void setLastUpdatedTSOS(TrajectoryStateOnSurface tsos) { theLastUpdatedTSOS = tsos; }
0126
0127
0128 void setLastButOneUpdatedTSOS(TrajectoryStateOnSurface tsos) { theLastButOneUpdatedTSOS = tsos; }
0129
0130
0131 void incrementChamberCounters(const DetLayer *layer);
0132 void incrementCompatibleChamberCounters(const DetLayer *layer);
0133
0134
0135 std::vector<const DetLayer *> compatibleLayers(const DetLayer *initialLayer,
0136 const FreeTrajectoryState &fts,
0137 PropagationDirection propDir);
0138
0139 bool update(const DetLayer *layer, const TrajectoryMeasurement *meas, Trajectory &trajectory);
0140
0141 std::vector<TrajectoryMeasurement> findBestMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &tsos);
0142
0143
0144 TrajectoryStateOnSurface theLastCompatibleTSOS;
0145
0146 TrajectoryStateOnSurface theLastUpdatedTSOS;
0147
0148 TrajectoryStateOnSurface theLastButOneUpdatedTSOS;
0149
0150
0151 MuonDetLayerMeasurements *theMeasurementExtractor;
0152
0153
0154 MeasurementEstimator *theEstimator;
0155
0156
0157 MuonTrajectoryUpdator *theMuonUpdator;
0158
0159 std::string theMuonUpdatorName;
0160
0161
0162 MuonBestMeasurementFinder *theBestMeasurementFinder;
0163
0164 MuonBestMeasurementFinder *bestMeasurementFinder() const { return theBestMeasurementFinder; }
0165
0166
0167 double theMaxChi2;
0168
0169
0170 double theNSigma;
0171
0172
0173 NavigationDirection theFitDirection;
0174
0175
0176 std::vector<const DetLayer *> theDetLayers;
0177
0178
0179 std::string thePropagatorName;
0180
0181
0182
0183 std::string theNavigationType;
0184
0185
0186 bool theRPCLoneliness;
0187
0188 int totalChambers;
0189 int dtChambers;
0190 int cscChambers;
0191 int rpcChambers;
0192 int gemChambers;
0193 int me0Chambers;
0194
0195 int totalCompatibleChambers;
0196 int dtCompatibleChambers;
0197 int cscCompatibleChambers;
0198 int rpcCompatibleChambers;
0199 int gemCompatibleChambers;
0200 int me0CompatibleChambers;
0201
0202 const MuonServiceProxy *theService;
0203 bool theOverlappingChambersFlag;
0204 };
0205 #endif