14 : srcSelectedMuons_(cfg.getParameter<edm::InputTag>(
"selectedMuons"))
21 produces<detIdToIntMap>(
"hitsMuPlus");
22 produces<detIdToIntMap>(
"hitsMuMinus");
36 std::auto_ptr<detIdToIntMap> hitsMuMinus(
new detIdToIntMap());
45 evt.
put(hitsMuPlus,
"hitsMuPlus");
46 evt.
put(hitsMuMinus,
"hitsMuMinus");
51 void fillHitMapRH(
const TrackingRecHit& rh, std::map<uint32_t, int>& hitMap,
int& numHits)
53 std::vector<const TrackingRecHit*> rh_components = rh.
recHits();
54 if ( rh_components.size() == 0 ) {
58 for ( std::vector<const TrackingRecHit*>::const_iterator rh_component = rh_components.begin();
59 rh_component != rh_components.end(); ++rh_component ) {
60 fillHitMapRH(**rh_component, hitMap, numHits);
65 void printHitMapRH(
const edm::EventSetup& es,
const std::map<uint32_t, int>& hitMap)
68 for ( std::map<uint32_t, int>::const_iterator rh = hitMap.begin();
69 rh != hitMap.end(); ++rh ) {
83 for ( std::vector<TAMuonChamberMatch>::const_iterator rh = trackDetMatchInfo.
chambers.begin();
84 rh != trackDetMatchInfo.
chambers.end(); ++rh ) {
85 ++hitMap[rh->id.
rawId()];
89 rh != muonOuterTrack->recHitsEnd(); ++rh ) {
90 fillHitMapRH(**rh, hitMap, numHits);
96 for ( std::vector<TAMuonChamberMatch>::const_iterator rh = trackDetMatchInfo.chambers.begin();
97 rh != trackDetMatchInfo.chambers.end(); ++rh ) {
98 ++hitMap[rh->id.
rawId()];
105 if ( muon->
charge() > +0.5 ) muonCharge_string =
"+";
106 else if ( muon->
charge() < -0.5 ) muonCharge_string =
"-";
107 std::cout <<
"Mu" << muonCharge_string <<
": Pt = " << muon->
pt() <<
", eta = " << muon->
eta() <<
", phi = " << muon->
phi()
108 <<
" --> #Hits = " << numHits << std::endl;
109 if (
verbosity_ >= 2 ) printHitMapRH(es, hitMap);
T getParameter(std::string const &) const
reco::CandidateBaseRef getTheMuMinus(const std::vector< reco::CandidateBaseRef > &)
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
std::map< uint32_t, int > detIdToIntMap
virtual float phi() const =0
momentum azimuthal angle
MuonDetCleaner(const edm::ParameterSet &)
bool isNonnull() const
Checks for non-null.
virtual float pt() const =0
transverse momentum
TrackDetectorAssociator trackAssociator_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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 > &)
bool isNonnull() const
Checks for non-null.
void loadParameters(const edm::ParameterSet &)