19 : muonTag_(iConfig.getParameter<
edm::
InputTag>(
"muonCandidates")),
20 trackTag_(iConfig.getParameter<
edm::
InputTag>(
"tracks")),
21 minMasses_(iConfig.getParameter<
std::vector<double> >(
"MinMasses")),
22 maxMasses_(iConfig.getParameter<
std::vector<double> >(
"MaxMasses")),
23 checkCharge_(iConfig.getParameter<
bool>(
"checkCharge")),
24 minTrackPt_(iConfig.getParameter<double>(
"MinTrackPt")),
25 minTrackP_(iConfig.getParameter<double>(
"MinTrackP")),
26 maxTrackEta_(iConfig.getParameter<double>(
"MaxTrackEta")) {
31 produces<reco::TrackCollection>();
43 edm::LogError(
"QuarkoniaTrackSelector") <<
"Inconsistency in definition of mass windows, " 44 <<
"no track will be selected";
49 std::ostringstream stream;
50 stream <<
"instantiated with parameters\n" 53 stream <<
" mass windows =";
59 stream <<
" MinTrackP = " <<
minTrackP_ <<
"\n";
61 LogDebug(
"QuarkoniaTrackSelector") << stream.str();
68 auto product = std::make_unique<reco::TrackCollection>();
90 std::ostringstream stream;
91 stream <<
"\nInput muons: # / q / pt / p / eta\n";
92 for (
size_t im = 0; im < muonHandle->size(); ++im) {
94 stream <<
" " << im <<
" " << muon.
charge() <<
" " << muon.
pt() <<
" " << muon.
p() <<
" " << muon.
eta() <<
"\n";
96 stream <<
"Input tracks: # / q / pt / p / eta\n";
97 for (
size_t it = 0; it < trackHandle->size(); ++it) {
99 stream <<
" " << it <<
" " << track.
charge() <<
" " << track.
pt() <<
" " << track.
p() <<
" " << track.
eta()
102 LogDebug(
"QuarkoniaTrackSelector") << stream.str();
109 unsigned int nComb(0);
110 std::vector<size_t> selectedTrackIndices;
111 selectedTrackIndices.reserve(muonHandle->size());
115 for (
size_t im = 0; im < muonHandle->size(); ++im) {
117 int qMuon = muon.
charge();
120 for (
size_t it = 0; it < trackHandle->size(); ++it) {
128 track.
px(), track.
py(), track.
pz(),
sqrt(track.
p() * track.
p() + 0.0111636));
130 double mass = (p4Muon + p4Track).
mass();
137 if (
find(selectedTrackIndices.begin(), selectedTrackIndices.end(), it) == selectedTrackIndices.end())
138 selectedTrackIndices.push_back(it);
149 for (
size_t i = 0;
i < selectedTrackIndices.size(); ++
i)
150 product->push_back((*trackHandle)[selectedTrackIndices[
i]]);
155 std::ostringstream stream;
156 stream <<
"Total number of combinations = " << muonHandle->size() * trackHandle->size() <<
" , after charge " << nQ
157 <<
" , after mass " << nComb << std::endl;
158 stream <<
"Selected " << product->size() <<
" tracks with # / q / pt / eta\n";
159 for (
size_t i = 0; i < product->size(); ++
i) {
161 stream <<
" " << i <<
" " << track.
charge() <<
" " << track.
pt() <<
" " << track.
eta() <<
"\n";
163 LogDebug(
"QuarkoniaTrackSelector") << stream.str();
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muonToken_
double p() const
momentum vector magnitude
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< double > minMasses_
lower mass limits
double pt() const final
transverse momentum
int charge() const final
electric charge
double px() const
x coordinate of momentum vector
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< double > maxMasses_
upper mass limits
QuarkoniaTrackSelector(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
double eta() const
pseudorapidity of momentum vector
double pt() const
track transverse momentum
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const LorentzVector & p4() const final
four-momentum Lorentz vector
double pz() const
z coordinate of momentum vector
double p() const final
magnitude of momentum vector
edm::EDGetTokenT< reco::TrackCollection > trackToken_
double minTrackP_
track p cut
int charge() const
track electric charge
edm::InputTag trackTag_
tag for TrackCollection
math::XYZTLorentzVector LorentzVector
Lorentz vector.
double minTrackPt_
track pt cut
edm::InputTag muonTag_
tag for RecoChargedCandidateCollection
double py() const
y coordinate of momentum vector
bool checkCharge_
check opposite charge?
double maxTrackEta_
track |eta| cut