62 layersToKeep_(iConfig.getParameter<int32_t>(
"layersToKeep")),
63 insideOut_(iConfig.getParameter<
bool>(
"insideOut")),
64 debug_(iConfig.getUntrackedParameter<
bool>(
"debug",
false)),
65 refitter_(iConfig, consumesCollector()) {
66 produces<std::vector<TrajectorySeed>>();
81 auto out = std::make_unique<std::vector<TrajectorySeed>>();
82 unsigned int nsrc =
src->size();
93 const std::vector<TrajectoryMeasurement> &tms = traj.
front().measurements();
98 std::cout <<
"Considering muon of pt " <<
mu.pt() <<
", eta = " <<
mu.eta() <<
", phi = " <<
mu.phi()
101 <<
" to momentum, so will start from " << (fromInside ?
"inside" :
"outside") << std::endl;
106 std::cout <<
"IN state: subdetector = " << tin.
recHit()->geographicalId().subdetId() << std::endl;
109 std::cout <<
"OU state: subdetector = " << tou.
recHit()->geographicalId().subdetId() << std::endl;
113 int lastSubdet = 0, lastLayer = -1;
114 for (
int i = (fromInside ? 0 : tms.size() - 1),
115 end = (fromInside ? tms.size() : -1),
116 step = (fromInside ? +1 : -1),
121 hit = tms[
i].recHit()->hit();
123 std::cout <<
" considering hit " <<
i <<
": rechit on " << (
hit ?
hit->geographicalId().rawId() : -1)
127 int subdet =
hit->geographicalId().subdetId();
128 int lay = tTopo.
layer(
hit->geographicalId());
129 if (subdet != lastSubdet || lay != lastLayer) {
141 tsos = tms[
i].updatedState().
isValid()
142 ? tms[
i].updatedState()
143 : (
abs(
i -
end) <
abs(
i) ? tms[
i].forwardPredictedState() : tms[
i].backwardPredictedState());
145 std::cout <<
" hit : subdetector = " << tms[
i].recHit()->geographicalId().subdetId() << std::endl;
146 if (
hit->isValid()) {
147 std::cout <<
" global pos Rho " << tms[
i].recHit()->globalPosition().perp() <<
", Z " 148 << tms[
i].recHit()->globalPosition().z() << std::endl;
150 std::cout <<
" invalid tracking rec hit, so no global position" << std::endl;
TrackTransformer refitter_
Track Transformer.
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
StringCutObjectSelector< reco::Muon > selector_
Muon selection.
bool debug_
Dump deug information.
int layersToKeep_
How many hits to keep from the muon trajectory.
unsigned int layer(const DetId &id) const
GlobalPoint globalPosition() const
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
bool insideOut_
Do inside-out.
edm::EDGetTokenT< edm::View< reco::Muon > > src_
Labels for input collections.
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
TrajectoryStateOnSurface const & updatedState() const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MuonReSeeder(const edm::ParameterSet &iConfig)
ConstRecHitPointer const & recHit() const