I fill the dau1 with positive and dau2 with negatove values for the pt, in order to flag the muons used for building zMassSa
68 bool isMCMatchTrue=
false;
76 auto_ptr<vector<pat::CompositeCandidate> > dimuonColl(
new vector<pat::CompositeCandidate> () );
79 for (
unsigned int i = 0;
i< dimuons->size();++
i){
85 float trueMass,truePt,trueEta,truePhi,trueY;
104 dimuon.addUserFloat(
"TrueMass",trueMass);
105 dimuon.addUserFloat(
"TruePt",truePt);
106 dimuon.addUserFloat(
"TrueEta",trueEta);
107 dimuon.addUserFloat(
"TruePhi",truePhi);
108 dimuon.addUserFloat(
"TrueY",trueY);
130 float zDau1SaEta = stAloneTrack1->eta();
131 float zDau2SaEta = stAloneTrack2->eta();
132 float zDau1SaPhi = stAloneTrack1->phi();
133 float zDau2SaPhi = stAloneTrack2->phi();
134 float zDau1SaPt,zDau2SaPt;
136 momentum = stAloneTrack1->momentum();
138 mu_mass = dau1->
mass();
140 zDau1SaPt = stAloneTrack1->pt();
141 zDau2SaPt = - stAloneTrack2->pt();
143 momentum = stAloneTrack2->momentum();
145 mu_mass = dau2->
mass();
147 zDau1SaPt = - stAloneTrack1->pt();
148 zDau2SaPt = stAloneTrack2->pt();
152 double mass = (p4_1+p4_2).mass();
153 float zMassSa = mass;
155 dimuon.addUserFloat(
"MassSa",zMassSa);
156 dimuon.addUserFloat(
"Dau1SaPt",zDau1SaPt);
157 dimuon.addUserFloat(
"Dau2SaPt",zDau2SaPt);
158 dimuon.addUserFloat(
"Dau1SaPhi",zDau1SaPhi);
159 dimuon.addUserFloat(
"Dau2SaPhi",zDau2SaPhi);
160 dimuon.addUserFloat(
"Dau1SaEta",zDau1SaEta);
161 dimuon.addUserFloat(
"Dau2SaEta",zDau2SaEta);
164 dimuonColl->push_back(dimuon);
169 evt.
put( dimuonColl);
Analysis-level particle class.
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual float mass() const =0
mass
virtual float eta() const =0
momentum pseudorapidity
stand alone muon component tag
bool isGlobalMuon() const
virtual float phi() const =0
momentum azimuthal angle
virtual double rapidity() const =0
rapidity
virtual const PolarLorentzVector & polarP4() const =0
four-momentum Lorentz vector
bool isNonnull() const
Checks for non-null.
InputTag primaryVertices_
virtual float pt() const =0
transverse momentum
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
InputTag zGenParticlesMatch_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T get() const
get a component
Analysis-level muon class.
virtual const CandidateBaseRef & masterClone() const =0
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.