21 if ( type_string ==
"pf" )
type_ =
kPF;
22 else if ( type_string ==
"calo" )
type_ =
kCalo;
24 <<
"Invalid Configuration Parameter 'type' = " << type_string <<
" !!\n";
27 int numCollections = 0;
29 if ( srcGenParticles2_.
label() !=
"" ) ++numCollections;
30 if ( numCollections != 2 &&
isMC_ )
32 <<
"Collections 'srcGenParticles1' and 'srcGenParticles2' must both be specified in case Embedding is run on Monte Carlo !!\n";
33 if ( numCollections != 1 && !
isMC_ )
35 <<
"Either collection 'srcGenParticles1' or 'srcGenParticles2' must be specified in case Embedding is run on Data !!\n";
37 produces<reco::GenMETCollection>();
45 for ( reco::GenParticleCollection::const_iterator genParticle = genParticles.begin();
46 genParticle != genParticles.end(); ++genParticle ) {
47 if ( genParticle->status() == 1 ) {
48 int absPdgId =
TMath::Abs(genParticle->pdgId());
49 if ( absPdgId == 12 || absPdgId == 14 || absPdgId == 16 ) sumNeutrinoP4 += genParticle->p4();
50 else if ( isCaloMEt && absPdgId == 13 ) sumNeutrinoP4 += genParticle->p4();
51 else sumEt += genParticle->et();
66 sumNeutrinoP4s(*genParticles1,
type_ ==
kCalo, genMEtP4, genSumEt);
71 sumNeutrinoP4s(*genParticles2,
type_ ==
kCalo, genMEtP4, genSumEt);
79 removedMuon != removedMuons->end(); ++removedMuon ) {
80 if (
type_ ==
kCalo ) genMEtP4 -= removedMuon->p4();
81 genSumEt -= removedMuon->et();
94 genMETs->push_back(
reco::GenMET(genMEtData, genSumEt, genMEtP4, vtx));
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
float InvisibleEtFraction
edm::InputTag srcRemovedMuons_
std::vector< reco::GenMET > GenMETCollection
collection of GenMET objects
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::View< reco::Candidate > CandidateView
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag srcGenParticles2_
MixedGenMEtProducer(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
float ChargedEMEtFraction
math::XYZTLorentzVector LorentzVector
Lorentz vector.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
float NeutralEMEtFraction
math::XYZPoint Point
point in the space
float ChargedHadEtFraction
float NeutralHadEtFraction
edm::InputTag srcGenParticles1_