I fill the dau1 with positive and dau2 with negatove values for the pt, in order to flag the muons used for building zMassSa
71 bool isMCMatchTrue=
false;
79 unique_ptr<vector<pat::CompositeCandidate> > dimuonColl(
new vector<pat::CompositeCandidate> () );
82 for (
unsigned int i = 0;
i< dimuons->size();++
i){
88 float trueMass,truePt,trueEta,truePhi,trueY;
107 dimuon.addUserFloat(
"TrueMass",trueMass);
108 dimuon.addUserFloat(
"TruePt",truePt);
109 dimuon.addUserFloat(
"TrueEta",trueEta);
110 dimuon.addUserFloat(
"TruePhi",truePhi);
111 dimuon.addUserFloat(
"TrueY",trueY);
133 float zDau1SaEta = stAloneTrack1->eta();
134 float zDau2SaEta = stAloneTrack2->eta();
135 float zDau1SaPhi = stAloneTrack1->phi();
136 float zDau2SaPhi = stAloneTrack2->phi();
137 float zDau1SaPt,zDau2SaPt;
139 momentum = stAloneTrack1->momentum();
141 mu_mass = dau1->
mass();
143 zDau1SaPt = stAloneTrack1->pt();
144 zDau2SaPt = - stAloneTrack2->pt();
146 momentum = stAloneTrack2->momentum();
148 mu_mass = dau2->
mass();
150 zDau1SaPt = - stAloneTrack1->pt();
151 zDau2SaPt = stAloneTrack2->pt();
156 float zMassSa =
mass;
158 dimuon.addUserFloat(
"MassSa",zMassSa);
159 dimuon.addUserFloat(
"Dau1SaPt",zDau1SaPt);
160 dimuon.addUserFloat(
"Dau2SaPt",zDau2SaPt);
161 dimuon.addUserFloat(
"Dau1SaPhi",zDau1SaPhi);
162 dimuon.addUserFloat(
"Dau2SaPhi",zDau2SaPhi);
163 dimuon.addUserFloat(
"Dau1SaEta",zDau1SaEta);
164 dimuon.addUserFloat(
"Dau2SaEta",zDau2SaEta);
167 dimuonColl->push_back(dimuon);
Analysis-level particle class.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
virtual const PolarLorentzVector & polarP4() const =0
four-momentum Lorentz vector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
stand alone muon component tag
EDGetTokenT< BeamSpot > beamSpotToken_
EDGetTokenT< VertexCollection > primaryVerticesToken_
bool isGlobalMuon() const override
virtual const CandidateBaseRef & masterClone() const =0
EDGetTokenT< GenParticleMatch > zGenParticlesMatchToken_
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
virtual double mass() const =0
mass
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
EDGetTokenT< std::vector< reco::CompositeCandidate > > srcToken_
virtual double rapidity() const =0
rapidity
T get() const
get a component
virtual double phi() const =0
momentum azimuthal angle
Analysis-level muon class.
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.