63 insideOut_(iConfig.getParameter<bool>(
"insideOut")),
64 debug_(iConfig.getUntrackedParameter<bool>(
"debug",
false)),
67 produces<std::vector<TrajectorySeed> >();
84 auto out = std::make_unique<std::vector<TrajectorySeed>>();
85 unsigned int nsrc = src->size();
92 if (traj.size() != 1)
continue;
94 const std::vector<TrajectoryMeasurement> & tms = traj.
front().measurements();
98 std::cout <<
"Considering muon of pt " << mu.
pt() <<
", eta = " << mu.
eta() <<
", phi = " << mu.
phi() << std::endl;
99 std::cout <<
"Trajectory is " << (traj.front().direction() ==
alongMomentum ?
"along" :
"opposite") <<
" to momentum, so will start from " << (fromInside ?
"inside" :
"outside") << std::endl;
104 std::cout <<
"IN state: subdetector = " << tin.
recHit()->geographicalId().subdetId() << std::endl;
106 std::cout <<
"OU state: subdetector = " << tou.
recHit()->geographicalId().subdetId() << std::endl;
109 int lastSubdet = 0, lastLayer = -1;
110 for (
int i = (fromInside ? 0 : tms.size()-1),
111 end = (fromInside ? tms.size() : -1),
112 step = (fromInside ? +1 : -1),
115 hit = tms[
i].recHit()->
hit();
120 if (subdet != lastSubdet || lay != lastLayer) {
127 lastSubdet = subdet; lastLayer = lay;
131 tsos = tms[
i].updatedState().
isValid() ? tms[
i].updatedState() :
132 (
abs(
i-
end) <
abs(
i) ? tms[
i].forwardPredictedState() : tms[
i].backwardPredictedState());
134 std::cout <<
" hit : subdetector = " << tms[
i].recHit()->geographicalId().subdetId() << std::endl;
136 std::cout <<
" global pos Rho " << tms[
i].recHit()->globalPosition().perp() <<
", Z " << tms[
i].recHit()->globalPosition().z() << std::endl;
138 std::cout <<
" invalid tracking rec hit, so no global position" << std::endl;
146 out->push_back(seed);
virtual double pt() const final
transverse momentum
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TrackTransformer refitter_
Track Transformer.
ConstRecHitPointer const & recHit() const
virtual double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
StringCutObjectSelector< reco::Muon > selector_
Muon selection.
virtual TrackRef track() const
reference to a Track
GlobalPoint globalPosition() const
bool debug_
Dump deug information.
int layersToKeep_
How many hits to keep from the muon trajectory.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
uint32_t rawId() const
get the raw id
virtual double phi() const final
momentum azimuthal angle
Abs< T >::type abs(const T &t)
bool insideOut_
Do inside-out.
edm::EDGetTokenT< edm::View< reco::Muon > > src_
Labels for input collections.
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool isNull() const
Checks for null.
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
virtual TrackingRecHit const * hit() const
unsigned int layer(const DetId &id) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
TrajectoryStateOnSurface const & updatedState() const
DetId geographicalId() const
MuonReSeeder(const edm::ParameterSet &iConfig)