24 muonTag_(iConfig.getParameter<edm::InputTag>(
"muonCandidates")),
25 trackTag_(iConfig.getParameter<edm::InputTag>(
"tracks")),
26 minMasses_(iConfig.getParameter< std::vector<double> >(
"MinMasses")),
27 maxMasses_(iConfig.getParameter< std::vector<double> >(
"MaxMasses")),
28 checkCharge_(iConfig.getParameter<bool>(
"checkCharge")),
29 minTrackPt_(iConfig.getParameter<double>(
"MinTrackPt")),
30 minTrackP_(iConfig.getParameter<double>(
"MinTrackP")),
31 maxTrackEta_(iConfig.getParameter<double>(
"MaxTrackEta"))
34 produces<reco::TrackCollection>();
46 edm::LogError(
"QuarkoniaTrackSelector") <<
"Inconsistency in definition of mass windows, "
47 <<
"no track will be selected";
52 std::ostringstream stream;
53 stream <<
"instantiated with parameters\n"
56 stream <<
" mass windows =";
62 stream <<
" MinTrackP = " <<
minTrackP_ <<
"\n";
64 LogDebug(
"QuarkoniaTrackSelector") << stream.str();
96 std::ostringstream stream;
97 stream <<
"\nInput muons: # / q / pt / p / eta\n";
98 for (
size_t im=0; im<muonHandle->size(); ++im ) {
100 stream <<
" " << im <<
" "
101 << muon.
charge() <<
" " << muon.
pt() <<
" "
102 << muon.
p() <<
" " << muon.
eta() <<
"\n";
104 stream <<
"Input tracks: # / q / pt / p / eta\n";
105 for (
size_t it=0; it<trackHandle->size(); ++it ) {
107 stream <<
" " << it <<
" "
108 << track.
charge() <<
" " << track.
pt() <<
" "
109 << track.
p() <<
" " << track.
eta() <<
"\n";
111 LogDebug(
"QuarkoniaTrackSelector") << stream.str();
118 unsigned int nComb(0);
119 std::vector<size_t> selectedTrackIndices;
120 selectedTrackIndices.reserve(muonHandle->size());
124 for (
size_t im=0; im<muonHandle->size(); ++im ) {
126 int qMuon = muon.
charge();
129 for (
size_t it=0; it<trackHandle->size(); ++it ) {
136 sqrt(track.
p()*track.
p()+0.0111636));
138 double mass = (p4Muon+p4Track).mass();
145 if (
find(selectedTrackIndices.begin(),selectedTrackIndices.end(),it)==
146 selectedTrackIndices.end() ) selectedTrackIndices.push_back(it);
157 for (
size_t i=0;
i<selectedTrackIndices.size(); ++
i )
158 product->push_back((*trackHandle)[selectedTrackIndices[
i]]);
163 std::ostringstream stream;
164 stream <<
"Total number of combinations = " << muonHandle->size()*trackHandle->size()
165 <<
" , after charge " << nQ <<
" , after mass " << nComb << std::endl;
166 stream <<
"Selected " << product->size() <<
" tracks with # / q / pt / eta\n";
167 for (
size_t i=0; i<product->size(); ++
i ) {
169 stream <<
" " << i <<
" " << track.
charge() <<
" "
170 << track.
pt() <<
" " << track.
eta() <<
"\n";
172 LogDebug(
"QuarkoniaTrackSelector") << stream.str();
virtual void produce(edm::Event &, const edm::EventSetup &)
double p() const
momentum vector magnitude
virtual double p() const GCC11_FINAL
magnitude of momentum vector
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
std::vector< double > minMasses_
lower mass limits
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 &)
double eta() const
pseudorapidity of momentum vector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double pt() const
track transverse momentum
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double pz() const
z coordinate of momentum vector
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
double minTrackP_
track p cut
virtual int charge() const GCC11_FINAL
electric charge
int charge() const
track electric charge
edm::InputTag trackTag_
tag for TrackCollection
virtual float pt() const GCC11_FINAL
transverse momentum
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