14 : moduleLabel_(cfg.getParameter<
std::
string>(
"@module_label")),
23 correction_ =
new TFormula(corrFunctionName.data(), corrFunctionFormula.data());
24 int numParameter = correction_->GetNpar();
25 for (
int iParameter = 0; iParameter < numParameter; ++iParameter ) {
27 double parValue = cfgCorrection_function.
getParameter<
double>(parName);
28 correction_->SetParameter(iParameter, parValue);
33 produces<CorrMETData>();
49 std::unique_ptr<CorrMETData> pfMEtCorrection(
new CorrMETData());
52 pfCandidateToVertexAssociation != pfCandidateToVertexAssociations->
end(); ++pfCandidateToVertexAssociation ) {
56 bool isHardScatterVertex =
false;
57 for ( reco::VertexCollection::const_iterator hardScatterVertex_i = hardScatterVertex->begin();
58 hardScatterVertex_i != hardScatterVertex->end(); ++hardScatterVertex_i ) {
59 if (
TMath::Abs(vertex->position().z() - hardScatterVertex_i->position().z()) <
minDz_ ) {
60 isHardScatterVertex =
true;
65 if ( !isHardScatterVertex ) {
67 for ( PFCandQualityPairVector::const_iterator pfCandidate_vertex = pfCandidates_vertex.begin();
68 pfCandidate_vertex != pfCandidates_vertex.end(); ++pfCandidate_vertex ) {
73 sumChargedPFCandP4_vertex += pfCandidate.
p4();
77 double pt = sumChargedPFCandP4_vertex.pt();
78 double phi = sumChargedPFCandP4_vertex.phi();
80 double pxCorr = TMath::Cos(phi)*ptCorr;
81 double pyCorr = TMath::Sin(phi)*ptCorr;
83 pfMEtCorrection->mex += pxCorr;
84 pfMEtCorrection->mey += pyCorr;
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
key_type key() const
Accessor for product key.
#define DEFINE_FWK_MODULE(type)
std::vector< PFCandQualityPair > PFCandQualityPairVector
const LorentzVector & p4() const final
four-momentum Lorentz vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.
const_iterator begin() const
first iterator over the map (read only)
virtual ParticleType particleId() const