File indexing completed on 2024-05-23 03:13:33
0001 #ifndef GroupedCkfTrajectoryBuilder_H
0002 #define GroupedCkfTrajectoryBuilder_H
0003
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007
0008 #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h"
0009 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0010
0011 #include "TrackingTools/PatternTools/interface/TempTrajectory.h"
0012
0013 #include <vector>
0014
0015 #include "FWCore/Utilities/interface/Visibility.h"
0016
0017
0018
0019
0020
0021
0022 class dso_internal GroupedCkfTrajectoryBuilder final : public BaseCkfTrajectoryBuilder {
0023 public:
0024
0025 GroupedCkfTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector& iC);
0026
0027
0028 ~GroupedCkfTrajectoryBuilder() override {}
0029
0030 static void fillPSetDescription(edm::ParameterSetDescription& iDesc);
0031
0032
0033
0034
0035
0036 TrajectoryContainer trajectories(const TrajectorySeed&) const override;
0037
0038
0039 void trajectories(const TrajectorySeed&, TrajectoryContainer& ret) const override;
0040
0041
0042 TrajectoryContainer trajectories(const TrajectorySeed&, const TrackingRegion&) const;
0043
0044
0045 void trajectories(const TrajectorySeed&, TrajectoryContainer& ret, const TrackingRegion&) const;
0046
0047
0048 void buildTrajectories(const TrajectorySeed& seed,
0049 TrajectoryContainer& ret,
0050 unsigned int& nCandPerSeed,
0051 const TrajectoryFilter*) const override;
0052
0053
0054
0055
0056
0057
0058
0059 void rebuildSeedingRegion(const TrajectorySeed&, TrajectoryContainer& result) const override;
0060
0061 void rebuildTrajectories(const TrajectorySeed&, TrajectoryContainer& result) const override;
0062
0063
0064 const TrajectoryStateUpdator& updator() const { return *theUpdator; }
0065 const Chi2MeasurementEstimatorBase& estimator() const { return *theEstimator; }
0066
0067
0068
0069
0070 double chiSquareCut() { return theChiSquareCut; }
0071
0072
0073 int maxCand() { return theMaxCand; }
0074
0075
0076 float lostHitPenalty() { return theLostHitPenalty; }
0077
0078
0079
0080
0081
0082 double ptCut() { return theptCut; }
0083
0084
0085 double mass() { return theMass; }
0086
0087 protected:
0088 void setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0089
0090 virtual void analyseSeed(const TrajectorySeed& seed) const {}
0091
0092 virtual void analyseMeasurements(const std::vector<TM>& meas, const Trajectory& traj) const {}
0093 virtual void analyseResult(const TrajectoryContainer& result) const {}
0094
0095 private:
0096
0097
0098
0099
0100
0101
0102 inline bool tkxor(bool a, bool b) const dso_internal { return (a || b) && !(a && b); }
0103
0104
0105 bool advanceOneLayer(const TrajectorySeed& seed,
0106 TempTrajectory& traj,
0107 const TrajectoryFilter* regionalCondition,
0108 const Propagator* propagator,
0109 bool inOut,
0110 TempTrajectoryContainer& newCand,
0111 TempTrajectoryContainer& result) const dso_internal;
0112
0113 unsigned int groupedLimitedCandidates(const TrajectorySeed& seed,
0114 TempTrajectory const& startingTraj,
0115 const TrajectoryFilter* regionalCondition,
0116 const Propagator* propagator,
0117 bool inOut,
0118 TempTrajectoryContainer& result) const dso_internal;
0119
0120
0121 void rebuildSeedingRegion(const TrajectorySeed& seed, TempTrajectoryContainer& result) const dso_internal;
0122
0123
0124
0125 int rebuildSeedingRegion(const TrajectorySeed& seed,
0126 const std::vector<const TrackingRecHit*>& seedHits,
0127 TempTrajectory& candidate,
0128 TempTrajectoryContainer& result) const dso_internal;
0129
0130
0131
0132 TempTrajectory backwardFit(TempTrajectory& candidate,
0133 unsigned int nSeed,
0134 const TrajectoryFitter& fitter,
0135 std::vector<const TrackingRecHit*>& remainingHits) const dso_internal;
0136
0137
0138 bool verifyHits(TempTrajectory::DataContainer::const_iterator rbegin,
0139 size_t maxDepth,
0140 const std::vector<const TrackingRecHit*>& hits) const dso_internal;
0141
0142
0143 void groupedIntermediaryClean(TempTrajectoryContainer& theTrajectories) const dso_internal;
0144
0145
0146 static inline PropagationDirection oppositeDirection(PropagationDirection dir) {
0147 if (dir == alongMomentum)
0148 return oppositeToMomentum;
0149 if (dir == oppositeToMomentum)
0150 return alongMomentum;
0151 return dir;
0152 }
0153
0154 private:
0155 TrajectoryFilter* theConfigurableCondition;
0156
0157
0158
0159
0160 double theChiSquareCut;
0161
0162 double theptCut;
0163
0164 double theMass;
0165
0166 int theMaxCand;
0167
0168 float theLostHitPenalty;
0169 float theFoundHitBonus;
0170
0171 bool theIntermediateCleaning;
0172
0173
0174 bool theAlwaysUseInvalid;
0175
0176 bool theLockHits;
0177 bool theBestHitOnly;
0178
0179 bool theRequireSeedHitsInRebuild;
0180
0181 unsigned int theMinNrOfHitsForRebuild;
0182
0183
0184 unsigned int theMinNrOf2dHitsForRebuild;
0185
0186 bool theKeepOriginalIfRebuildFails;
0187
0188
0189
0190
0191 float maxPt2ForLooperReconstruction;
0192
0193 float maxDPhiForLooperReconstruction;
0194
0195
0196 enum work_MaxSize_Size_ {
0197 work_MaxSize_ = 50
0198 };
0199 };
0200
0201 #endif