25 const Point vtx( 0.0, 0.0, 0.0 );
41 if( (onlyFiducial && TMath::Abs(iParticle->eta()) >= 5.0))
continue;
43 if( iParticle->et() <= globalThreshold )
continue;
47 double phi = iParticle->phi();
48 double et = iParticle->pt();
49 sum_ez += iParticle->pz();
51 sum_ex += et*
cos(phi);
52 sum_ey += et*
sin(phi);
56 double phi = iParticle->phi();
57 double theta = iParticle->theta();
58 double e = iParticle->energy();
59 double et = e*
sin(theta);
60 sum_ez += e*
cos(theta);
62 sum_ex += et*
cos(phi);
63 sum_ey += et*
sin(phi);
70 met->
met =
sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
72 met->
phi = atan2( -sum_ey, -sum_ex );
78 const static int neutralEMpdgId[] = { 22 };
79 const static std::set<int> neutralEMpdgIdSet(neutralEMpdgId, neutralEMpdgId +
sizeof(neutralEMpdgId)/
sizeof(
int));
81 const static int chargedEMpdgId[] = { 11 };
82 const static std::set<int> chargedEMpdgIdSet(chargedEMpdgId, chargedEMpdgId +
sizeof(chargedEMpdgId)/
sizeof(
int));
84 const static int muonpdgId[] = { 13 };
85 const static std::set<int> muonpdgIdSet(muonpdgId, muonpdgId +
sizeof(muonpdgId)/
sizeof(
int));
87 const static int neutralHADpdgId[] = {
94 const static std::set<int> neutralHADpdgIdSet(neutralHADpdgId, neutralHADpdgId +
sizeof(neutralHADpdgId)/
sizeof(
int));
96 const static int chargedHADpdgId[] = {
105 const static std::set<int> chargedHADpdgIdSet(chargedHADpdgId, chargedHADpdgId +
sizeof(chargedHADpdgId)/
sizeof(
int));
107 const static int invisiblepdgId[] = {
128 const static std::set<int> invisiblepdgIdSet(invisiblepdgId, invisiblepdgId +
sizeof(invisiblepdgId)/
sizeof(
int));
137 double Et_unclassified = 0.0;
141 if(applyFiducialThresholdForFractions)
if( onlyFiducial && (TMath::Abs(iParticle->eta()) >= 5.0) )
continue;
142 if(applyFiducialThresholdForFractions)
if( iParticle->et() <= globalThreshold )
continue;
144 int pdgId = TMath::Abs( iParticle->pdgId() ) ;
145 double pt = (usePt) ? iParticle->pt() : iParticle->et();
152 else Et_unclassified += pt;
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
reco::GenMET addInfo(edm::Handle< edm::View< reco::Candidate > > particles, CommonMETData *met, double globalThreshold=0, bool onlyFiducial=false, bool applyFiducialThresholdForFractions=false, bool usePt=false)
double InvisibleEtFraction
double NeutralHadEtFraction
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
double NeutralEMEtFraction
void fillCommonMETData(CommonMETData *met, edm::Handle< edm::View< reco::Candidate > > &particles, double globalThreshold, bool onlyFiducial, bool usePt)
Cos< T >::type cos(const T &t)
MET made from CaloTowers.
Structure containing data common to all types of MET.
double ChargedHadEtFraction
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
double ChargedEMEtFraction
SpecificGenMETData mkSpecificGenMETData(edm::Handle< edm::View< reco::Candidate > > &particles, double globalThreshold, bool onlyFiducial, bool applyFiducialThresholdForFractions, bool usePt)
math::XYZTLorentzVector LorentzVector