28 produces<edm::ValueMap<unsigned int> >().setBranchAlias(
"cosmicsVeto");
29 produces<edm::ValueMap<reco::MuonCosmicCompatibility> >().setBranchAlias(
"cosmicCompatibility");
46 std::vector<edm::EDGetTokenT<reco::TrackCollection> >
trackTokens_;
58 std::vector<unsigned int>
values;
59 values.reserve(muons->size());
61 std::vector<reco::MuonCosmicCompatibility> compValues;
62 compValues.reserve(muons->size());
64 for(reco::MuonCollection::const_iterator
muon = muons->begin();
67 unsigned int foundPartner(0);
68 if (
muon->innerTrack().isNonnull() ){
79 values.push_back(foundPartner);
85 auto out = std::make_unique<edm::ValueMap<unsigned int>>();
87 filler.insert(muons, values.begin(), values.end());
91 auto outC = std::make_unique<edm::ValueMap<reco::MuonCosmicCompatibility>>();
93 fillerC.insert(muons, compValues.begin(), compValues.end());
void produce(edm::Event &, const edm::EventSetup &) override
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< reco::TrackCollection > > trackTokens_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
reco::TrackRef findOppositeTrack(const edm::Handle< reco::TrackCollection > &collection, const reco::Track &muon, double angleMatch=0.01, double momentumMatch=0.05)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~CosmicsMuonIdProducer() override
std::vector< edm::InputTag > inputTrackCollections_
#define DEFINE_FWK_MODULE(type)
MuonCosmicCompatibilityFiller * compatibilityFiller_
edm::InputTag inputMuonCollection_
reco::MuonCosmicCompatibility fillCompatibility(const reco::Muon &muon, edm::Event &, const edm::EventSetup &)
fill cosmic compatibility variables
edm::EDGetTokenT< reco::MuonCollection > muonToken_
CosmicsMuonIdProducer(const edm::ParameterSet &iConfig)