21 bool applyFiducialThresholdForFractions,
26 mkSpecificGenMETData(particles, globalThreshold, onlyFiducial, applyFiducialThresholdForFractions, usePt);
29 const Point vtx(0.0, 0.0, 0.0);
47 iParticle != (particles.product())->
end();
49 if ((onlyFiducial &&
TMath::Abs(iParticle->eta()) >= 5.0))
56 double phi = iParticle->phi();
57 double et = iParticle->pt();
58 sum_ez += iParticle->pz();
60 sum_ex += et *
cos(phi);
61 sum_ey += et *
sin(phi);
63 double phi = iParticle->phi();
64 double theta = iParticle->theta();
65 double e = iParticle->energy();
66 double et = e *
sin(theta);
67 sum_ez += e *
cos(theta);
69 sum_ex += et *
cos(phi);
70 sum_ey += et *
sin(phi);
77 met->
met =
sqrt(sum_ex * sum_ex + sum_ey * sum_ey);
85 bool applyFiducialThresholdForFractions,
87 const static int neutralEMpdgId[] = {22 };
88 const static std::set<int> neutralEMpdgIdSet(neutralEMpdgId, neutralEMpdgId +
sizeof(neutralEMpdgId) /
sizeof(
int));
90 const static int chargedEMpdgId[] = {11 };
91 const static std::set<int> chargedEMpdgIdSet(chargedEMpdgId, chargedEMpdgId +
sizeof(chargedEMpdgId) /
sizeof(
int));
93 const static int muonpdgId[] = {13 };
94 const static std::set<int> muonpdgIdSet(muonpdgId, muonpdgId +
sizeof(muonpdgId) /
sizeof(
int));
96 const static int neutralHADpdgId[] = {
103 const static std::set<int> neutralHADpdgIdSet(neutralHADpdgId,
104 neutralHADpdgId +
sizeof(neutralHADpdgId) /
sizeof(
int));
106 const static int chargedHADpdgId[] = {
115 const static std::set<int> chargedHADpdgIdSet(chargedHADpdgId,
116 chargedHADpdgId +
sizeof(chargedHADpdgId) /
sizeof(
int));
118 const static int invisiblepdgId[] = {
120 1000022 , 1000012 , 1000014 ,
121 1000016 , 2000012 , 2000014 ,
122 2000016 , 39 , 1000039 ,
123 5100039 , 4000012 , 4000014 ,
124 4000016 , 9900012 , 9900014 ,
127 const static std::set<int> invisiblepdgIdSet(invisiblepdgId, invisiblepdgId +
sizeof(invisiblepdgId) /
sizeof(
int));
130 double Et_unclassified = 0.0;
133 iParticle != (particles.product())->
end();
135 if (applyFiducialThresholdForFractions)
136 if (onlyFiducial && (
TMath::Abs(iParticle->eta()) >= 5.0))
138 if (applyFiducialThresholdForFractions)
143 double pt = (
usePt) ? iParticle->pt() : iParticle->et();
144 if (neutralEMpdgIdSet.count(pdgId))
146 else if (chargedEMpdgIdSet.count(pdgId))
148 else if (muonpdgIdSet.count(pdgId))
150 else if (neutralHADpdgIdSet.count(pdgId))
152 else if (chargedHADpdgIdSet.count(pdgId))
154 else if (invisiblepdgIdSet.count(pdgId))
157 Et_unclassified += pt;
float InvisibleEtFraction
reco::GenMET addInfo(edm::Handle< edm::View< reco::Candidate > > particles, CommonMETData *met, double globalThreshold=0, bool onlyFiducial=false, bool applyFiducialThresholdForFractions=false, bool usePt=false)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
if(conf_.getParameter< bool >("UseStripCablingDB"))
void fillCommonMETData(CommonMETData *met, edm::Handle< edm::View< reco::Candidate > > &particles, double globalThreshold, bool onlyFiducial, bool usePt)
Cos< T >::type cos(const T &t)
Structure containing data common to all types of MET.
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
float ChargedEMEtFraction
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
SpecificGenMETData mkSpecificGenMETData(edm::Handle< edm::View< reco::Candidate > > &particles, double globalThreshold, bool onlyFiducial, bool applyFiducialThresholdForFractions, bool usePt)
float NeutralEMEtFraction
Structure Point Contains parameters of Gaussian fits to DMRs.
float ChargedHadEtFraction
math::XYZTLorentzVector LorentzVector
float NeutralHadEtFraction