Go to the documentation of this file.00001 #ifndef GroupedCkfTrajectoryBuilder_H
00002 #define GroupedCkfTrajectoryBuilder_H
00003
00004 #include "FWCore/Framework/interface/ESHandle.h"
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 #include "FWCore/Framework/interface/EventSetup.h"
00007
00008 #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h"
00009 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00010
00011 #include "TrackingTools/PatternTools/interface/TempTrajectory.h"
00012
00013 #include <vector>
00014
00015
00016 #include "FWCore/Utilities/interface/Visibility.h"
00017
00018
00024 class GroupedCkfTrajectoryBuilder : public BaseCkfTrajectoryBuilder {
00025
00026 public:
00028 GroupedCkfTrajectoryBuilder(const edm::ParameterSet& conf,
00029 const TrajectoryStateUpdator* updator,
00030 const Propagator* propagatorAlong,
00031 const Propagator* propagatorOpposite,
00032 const Chi2MeasurementEstimatorBase* estimator,
00033 const TransientTrackingRecHitBuilder* RecHitBuilder,
00034 const MeasurementTracker* measurementTracker,
00035 const TrajectoryFilter* filter,
00036 const TrajectoryFilter* inOutFilter);
00037
00039 virtual ~GroupedCkfTrajectoryBuilder(){}
00040
00042
00043
00045 TrajectoryContainer trajectories(const TrajectorySeed&) const;
00046
00048 void trajectories(const TrajectorySeed&, TrajectoryContainer &ret) const;
00049
00051 TrajectoryContainer trajectories(const TrajectorySeed&, const TrackingRegion&) const;
00052
00054 void trajectories(const TrajectorySeed&, TrajectoryContainer &ret, const TrackingRegion&) const;
00055
00057
00058 TempTrajectory buildTrajectories (const TrajectorySeed&seed,
00059 TrajectoryContainer &ret,
00060 const TrajectoryFilter*) const;
00061
00062
00063
00070 void rebuildSeedingRegion(const TrajectorySeed&,
00071 TrajectoryContainer& result) const ;
00072
00073
00074 void rebuildTrajectories(TempTrajectory const & startingTraj, const TrajectorySeed&,
00075 TrajectoryContainer& result) const ;
00076
00077
00078
00079 const TrajectoryStateUpdator& updator() const {return *theUpdator;}
00080 const Chi2MeasurementEstimatorBase& estimator() const {return *theEstimator;}
00081
00082
00083
00085 double chiSquareCut() {return theChiSquareCut;}
00086
00088 int maxCand() {return theMaxCand;}
00089
00090
00092 float lostHitPenalty() {return theLostHitPenalty;}
00093
00094
00095
00096
00098 double ptCut() {return theptCut;}
00099
00101 double mass() {return theMass;}
00102
00103 protected:
00104
00105 virtual void analyseSeed(const TrajectorySeed& seed) const{}
00106
00107 virtual void analyseMeasurements( const std::vector<TM>& meas,
00108 const Trajectory& traj) const{}
00109 virtual void analyseResult( const TrajectoryContainer& result) const {}
00110
00111 private :
00113 GroupedCkfTrajectoryBuilder (const GroupedCkfTrajectoryBuilder&) dso_internal;
00114
00116 GroupedCkfTrajectoryBuilder& operator= (const GroupedCkfTrajectoryBuilder&) dso_internal;
00117
00118
00119 inline bool tkxor(bool a, bool b) const dso_internal {return (a||b) && !(a&&b);}
00120
00121
00122 bool advanceOneLayer( TempTrajectory& traj,
00123 const TrajectoryFilter* regionalCondition,
00124 const Propagator* propagator,
00125 bool inOut,
00126 TempTrajectoryContainer& newCand,
00127 TempTrajectoryContainer& result) const dso_internal;
00128
00129 void groupedLimitedCandidates( TempTrajectory const& startingTraj,
00130 const TrajectoryFilter* regionalCondition,
00131 const Propagator* propagator,
00132 bool inOut,
00133 TempTrajectoryContainer& result) const dso_internal;
00134
00136 void rebuildSeedingRegion (const TrajectorySeed&seed,
00137 TempTrajectory const& startingTraj,
00138 TempTrajectoryContainer& result) const dso_internal;
00139
00140
00141
00142 int rebuildSeedingRegion (const TrajectorySeed&seed,
00143 const std::vector<const TrackingRecHit*>& seedHits,
00144 TempTrajectory& candidate,
00145 TempTrajectoryContainer& result) const dso_internal;
00146
00147
00148
00149 TempTrajectory backwardFit (TempTrajectory& candidate, unsigned int nSeed,
00150 const TrajectoryFitter& fitter,
00151 std::vector<const TrackingRecHit*>& remainingHits) const dso_internal;
00152
00154 bool verifyHits (TempTrajectory::DataContainer::const_iterator rbegin,
00155 size_t maxDepth,
00156 const std::vector<const TrackingRecHit*>& hits) const dso_internal;
00157
00159 void groupedIntermediaryClean(TempTrajectoryContainer& theTrajectories) const dso_internal;
00160
00161
00163 static inline PropagationDirection oppositeDirection (PropagationDirection dir) {
00164 if ( dir==alongMomentum ) return oppositeToMomentum;
00165 if ( dir==oppositeToMomentum ) return alongMomentum;
00166 return dir;
00167 }
00168
00169
00170 private:
00171 TrajectoryFilter* theConfigurableCondition;
00172
00173
00174
00175
00176 double theChiSquareCut;
00178 double theptCut;
00180 double theMass;
00182 int theMaxCand;
00184 float theLostHitPenalty;
00185 float theFoundHitBonus;
00187 bool theIntermediateCleaning;
00190 bool theAlwaysUseInvalid;
00191
00192 bool theLockHits;
00193 bool theBestHitOnly;
00195 bool theRequireSeedHitsInRebuild;
00197 unsigned int theMinNrOfHitsForRebuild;
00200 unsigned int theMinNrOf2dHitsForRebuild;
00202 bool theKeepOriginalIfRebuildFails;
00207 float maxPt2ForLooperReconstruction;
00208
00209 float maxDPhiForLooperReconstruction;
00210
00211 mutable TempTrajectoryContainer work_;
00212 enum work_MaxSize_Size_ { work_MaxSize_ = 50 };
00213 };
00214
00215 #endif