17 : moduleLabel_(cfg.getParameter<std::string>(
"@module_label")),
24 std::string corrFunctionName = std::string(
moduleLabel_).append(
"correction");
25 std::string corrFunctionFormula = cfgCorrection_function.
getParameter<std::string>(
"formula");
26 correction_ =
new TFormula(corrFunctionName.data(), corrFunctionFormula.data());
27 int numParameter = correction_->GetNpar();
28 for (
int iParameter = 0; iParameter < numParameter; ++iParameter ) {
29 std::string parName = Form(
"par%i", iParameter);
30 double parValue = cfgCorrection_function.getParameter<
double>(parName);
31 correction_->SetParameter(iParameter, parValue);
36 produces<CorrMETData>();
52 std::auto_ptr<CorrMETData> pfMEtCorrection(
new CorrMETData());
59 bool isHardScatterVertex =
false;
60 for ( reco::VertexCollection::const_iterator hardScatterVertex_i = hardScatterVertex->begin();
61 hardScatterVertex_i != hardScatterVertex->end(); ++hardScatterVertex_i ) {
62 if ( TMath::Abs(vertex->position().z() - hardScatterVertex_i->position().z()) <
minDz_ ) {
63 isHardScatterVertex =
true;
68 if ( !isHardScatterVertex ) {
70 for ( PFCandQualityPairVector::const_iterator pfCandidate_vertex = pfCandidates_vertex.begin();
71 pfCandidate_vertex != pfCandidates_vertex.end(); ++pfCandidate_vertex ) {
76 sumChargedPFCandP4_vertex += pfCandidate.
p4();
80 double pt = sumChargedPFCandP4_vertex.pt();
81 double phi = sumChargedPFCandP4_vertex.phi();
83 double pxCorr = TMath::Cos(phi)*ptCorr;
84 double pyCorr = TMath::Sin(phi)*ptCorr;
86 pfMEtCorrection->mex += pxCorr;
87 pfMEtCorrection->mey += pyCorr;
91 evt.
put(pfMEtCorrection);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
tuple pfCandidateToVertexAssociation
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< PFCandQualityPair > PFCandQualityPairVector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.
virtual ParticleType particleId() const
virtual const LorentzVector & p4() const
four-momentum Lorentz vector