45 produces<reco::CandSoftLeptonTagInfoCollection>();
52 auto theMuonTagInfo = std::make_unique<reco::CandSoftLeptonTagInfoCollection>();
65 if(!theVertexCollection.
isValid() || theVertexCollection->empty())
return;
66 const reco::Vertex* vertex=&theVertexCollection->front();
74 for(
unsigned int ij=0, nj=theJetCollection->size(); ij<nj; ij++) {
92 for(
unsigned int im=0, nm=theMuonCollection->size(); im<nm; ++im) {
93 const reco::Muon* recomuon=&theMuonCollection->at(im);
98 muon=theMuonCollection->refAt(im).get();
105 muon=theMuonCollection->refAt(im).get();
124 properties.sip2d = ip2d.
value();
125 properties.sip3d = ip3d.
value();
127 properties.ptRel = ( (jetvect-muonvect).Cross(muonvect) ).
R() / jetvect.R();
128 float mag = muonvect.R()*jetvect.R();
129 float dot = muon->
p4().Dot(jetRef->
p4());
130 properties.etaRel = -
log((mag - dot)/(mag + dot)) / 2.;
131 properties.ratio = muon->
pt() / jetRef->
pt();
132 properties.ratioRel = muon->
p4().Dot(jetRef->
p4()) / jetvect.Mag2();
134 properties.charge = muon->
charge();
142 tagInfo.
insert(lepPtr, properties);
147 theMuonTagInfo->push_back(tagInfo);
157 static const double lepton_mass = 0.00;
158 static const double jet_mass = 5.279;
159 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > lepton(vector.Dot(axis) / axis.r(), ROOT::Math::VectorUtil::Perp(vector, axis), 0., lepton_mass);
160 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> >
jet( axis.r(), 0., 0., jet_mass );
161 ROOT::Math::BoostX
boost( -
jet.Beta() );
162 return boost(lepton).x();
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
math::XYZVector Vector
point in the space
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
~SoftPFMuonTagInfoProducer() override
T const * get() const
Returns C++ pointer to the item.
double px() const final
x coordinate of momentum vector
reco::TransientTrack build(const reco::Track *p) const
double pt() const final
transverse momentum
int charge() const final
electric charge
void produce(edm::Event &, const edm::EventSetup &) override
void setJetRef(const edm::Ref< T > &jetRef)
bool isLooseMuon(const reco::Muon &)
size_t numberOfDaughters() const override
number of daughters
Vector momentum() const final
spatial momentum vector
double pz() const final
z coordinate of momentum vector
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken
const LorentzVector & p4() const final
four-momentum Lorentz vector
T const * get() const
Returns C++ pointer to the item.
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
virtual float boostedPPar(const math::XYZVector &, const math::XYZVector &)
reco::MuonRef muonRef() const
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void insert(const REF &lepton, const SoftLeptonProperties &properties)
double significance() const
virtual double pt() const =0
transverse momentum
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
double py() const final
y coordinate of momentum vector
Particle reconstructed by the particle flow algorithm.
edm::EDGetTokenT< reco::VertexCollection > vertexToken
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
SoftPFMuonTagInfoProducer(const edm::ParameterSet &conf)
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken
T const * product() const
Analysis-level muon class.
Global3DVector GlobalVector