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";
50 stream <<
"instantiated with parameters\n"
53 stream <<
" mass windows =";
68 auto product = std::make_unique<reco::TrackCollection>();
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) {
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) {
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) {