14 : srcSelectedMuons_(cfg.getParameter<edm::InputTag>(
"selectedMuons"))
22 produces<detIdToIntMap>(
"hitsMuPlus");
23 produces<detIdToIntMap>(
"hitsMuMinus");
37 std::auto_ptr<detIdToIntMap> hitsMuMinus(
new detIdToIntMap());
46 evt.
put(hitsMuPlus,
"hitsMuPlus");
47 evt.
put(hitsMuMinus,
"hitsMuMinus");
52 void fillHitMapRH(
const TrackingRecHit& rh, std::map<uint32_t, int>& hitMap,
int& numHits)
54 std::vector<const TrackingRecHit*> rh_components = rh.
recHits();
55 if ( rh_components.size() == 0 ) {
59 for ( std::vector<const TrackingRecHit*>::const_iterator rh_component = rh_components.begin();
60 rh_component != rh_components.end(); ++rh_component ) {
61 fillHitMapRH(**rh_component, hitMap, numHits);
66 void printHitMapRH(
const edm::EventSetup& es,
const std::map<uint32_t, int>& hitMap)
69 for ( std::map<uint32_t, int>::const_iterator rh = hitMap.begin();
70 rh != hitMap.end(); ++rh ) {
84 for ( std::vector<TAMuonChamberMatch>::const_iterator rh = trackDetMatchInfo.
chambers.begin();
85 rh != trackDetMatchInfo.
chambers.end(); ++rh ) {
86 ++hitMap[rh->id.
rawId()];
90 rh != muonOuterTrack->recHitsEnd(); ++rh ) {
91 fillHitMapRH(**rh, hitMap, numHits);
97 for ( std::vector<TAMuonChamberMatch>::const_iterator rh = trackDetMatchInfo.chambers.begin();
98 rh != trackDetMatchInfo.chambers.end(); ++rh ) {
99 ++hitMap[rh->id.
rawId()];
106 if ( muon->
charge() > +0.5 ) muonCharge_string =
"+";
107 else if ( muon->
charge() < -0.5 ) muonCharge_string =
"-";
108 std::cout <<
"Mu" << muonCharge_string <<
": Pt = " << muon->
pt() <<
", eta = " << muon->
eta() <<
", phi = " << muon->
phi()
109 <<
" --> #Hits = " << numHits << std::endl;
110 if (
verbosity_ >= 2 ) printHitMapRH(es, hitMap);
T getParameter(std::string const &) const
reco::CandidateBaseRef getTheMuMinus(const std::vector< reco::CandidateBaseRef > &)
bool isNonnull() const
Checks for non-null.
void fillHitMap(edm::Event &, const edm::EventSetup &, const reco::Candidate *, detIdToIntMap &)
TrackAssociatorParameters trackAssociatorParameters_
virtual float eta() const =0
momentum pseudorapidity
edm::InputTag srcSelectedMuons_
#define DEFINE_FWK_MODULE(type)
virtual double pz() const =0
z coordinate of momentum vector
void useDefaultPropagator()
use the default propagator
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
std::map< uint32_t, int > detIdToIntMap
virtual float phi() const =0
momentum azimuthal angle
bool isNonnull() const
Checks for non-null.
MuonDetCleaner(const edm::ParameterSet &)
virtual float pt() const =0
transverse momentum
TrackDetectorAssociator trackAssociator_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< TAMuonChamberMatch > chambers
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual double py() const =0
y coordinate of momentum vector
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
virtual double px() const =0
x coordinate of momentum vector
void printMuonDetId(const edm::EventSetup &, uint32_t)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
std::vector< reco::CandidateBaseRef > getSelMuons(const edm::Event &, const edm::InputTag &)
reco::CandidateBaseRef getTheMuPlus(const std::vector< reco::CandidateBaseRef > &)