95 double evtWeight = 1.0;
96 for ( vInputTag::const_iterator srcWeight =
srcWeights_.begin();
100 evtWeight *= (*weight);
103 if ( evtWeight < 1.e-3 || evtWeight > 1.
e+3 || TMath::IsNaN(evtWeight) )
return;
112 bool genMuonPlus_found =
false;
115 bool genMuonMinus_found =
false;
117 std::vector<int> muonPdgIds;
118 muonPdgIds.push_back(-13);
119 muonPdgIds.push_back(+13);
121 for ( std::vector<reco::CandidateBaseRef>::const_iterator selectedMuon = selectedMuons.begin();
122 selectedMuon != selectedMuons.end(); ++selectedMuon ) {
124 if ( genMuon_matched && genMuon_matched->
charge() > +0.5 ) {
125 genMuonPlusP4_beforeRad = genMuon_matched->
p4();
126 genMuonPlusP4_afterRad = genMuonPlusP4_beforeRad;
128 genMuonPlus_found =
true;
130 if ( genMuon_matched && genMuon_matched->
charge() < -0.5 ) {
131 genMuonMinusP4_beforeRad = genMuon_matched->
p4();
132 genMuonMinusP4_afterRad = genMuonMinusP4_beforeRad;
134 genMuonMinus_found =
true;
138 if ( !(genMuonPlus_found && genMuonMinus_found) )
return;
140 double muonPlusRad = 0.;
141 int muonPlusRad_error = 0;
142 double muonMinusRad = 0.;
143 int muonMinusRad_error = 0;
146 muonMinusRad =
muonRadiationAlgo_->
compFSR(genMuonMinusP4_beforeRad, -1, genMuonPlusP4_beforeRad, muonMinusRad_error).E();
148 muonPlusRad = genMuonPlusP4_beforeRad.E() - genMuonPlusP4_afterRad.E();
149 muonMinusRad = genMuonMinusP4_beforeRad.E() - genMuonMinusP4_afterRad.E();
152 if ( muonPlusRad_error || muonMinusRad_error )
return;
154 for ( std::vector<plotEntryType*>::iterator plotEntry =
plotEntries_.begin();
156 (*plotEntry)->fillHistograms(genMuonPlusP4_afterRad.E(), muonPlusRad, genMuonMinusP4_afterRad.E(), muonMinusRad, evtWeight);
edm::InputTag srcGenParticles_
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
GenMuonRadiationAlgorithm * muonRadiationAlgo_
edm::InputTag srcSelectedMuons_
const reco::GenParticle * findGenParticleForMCEmbedding(const reco::Candidate::LorentzVector &, const reco::GenParticleCollection &, double, int, const std::vector< int > *, bool)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void compGenMuonP4afterRad(const reco::GenParticle *, reco::Candidate::LorentzVector &)
reco::Candidate::LorentzVector compFSR(const reco::Candidate::LorentzVector &, int, const reco::Candidate::LorentzVector &, int &)
virtual int charge() const GCC11_FINAL
electric charge
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< reco::CandidateBaseRef > getSelMuons(const edm::Event &, const edm::InputTag &)
std::vector< plotEntryType * > plotEntries_