Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7941 from diguida/autoCond_733
Backport of ecal pfcluster corrections to 73x on top of new GT
- Loading branch information
Showing
13 changed files
with
406 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 30 additions & 27 deletions
57
RecoParticleFlow/PFClusterProducer/interface/PFClusterEMEnergyCorrector.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,47 @@ | ||
#ifndef __PFClusterEMEnergyCorrector_H__ | ||
#define __PFClusterEMEnergyCorrector_H__ | ||
|
||
#include "RecoParticleFlow/PFClusterProducer/interface/PFClusterEnergyCorrectorBase.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/ConsumesCollector.h" | ||
|
||
#include "DataFormats/ParticleFlowReco/interface/PFCluster.h" | ||
#include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h" | ||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||
#include "DataFormats/ParticleFlowReco/interface/PFRecHitFwd.h" | ||
#include "DataFormats/ParticleFlowReco/interface/PFRecHit.h" | ||
#include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h" | ||
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" | ||
|
||
class PFClusterEMEnergyCorrector : public PFClusterEnergyCorrectorBase { | ||
class PFClusterEMEnergyCorrector { | ||
public: | ||
PFClusterEMEnergyCorrector(const edm::ParameterSet& conf) : | ||
PFClusterEnergyCorrectorBase(conf), | ||
_applyCrackCorrections(conf.getParameter<bool>("applyCrackCorrections")), | ||
_assoc(NULL), | ||
_idx(0), | ||
_calibrator(new PFEnergyCalibration) { } | ||
PFClusterEMEnergyCorrector(const edm::ParameterSet& conf, edm::ConsumesCollector &&cc); | ||
PFClusterEMEnergyCorrector(const PFClusterEMEnergyCorrector&) = delete; | ||
PFClusterEMEnergyCorrector& operator=(const PFClusterEMEnergyCorrector&) = delete; | ||
|
||
void setEEtoPSAssociation(const reco::PFCluster::EEtoPSAssociation& assoc) { | ||
_assoc = &assoc; | ||
} | ||
void setClusterIndex(const unsigned i) { _idx = i; } | ||
|
||
void correctEnergy(reco::PFCluster& c) { correctEnergyActual(c,_idx); } | ||
void correctEnergies(reco::PFClusterCollection& cs) { | ||
for( unsigned i = 0; i < cs.size(); ++i ) correctEnergyActual(cs[i],i); | ||
} | ||
void correctEnergies(const edm::Event &evt, const edm::EventSetup &es, const reco::PFCluster::EEtoPSAssociation &assoc, reco::PFClusterCollection& cs); | ||
|
||
private: | ||
const bool _applyCrackCorrections; | ||
const reco::PFCluster::EEtoPSAssociation* _assoc; | ||
unsigned _idx; | ||
std::unique_ptr<PFEnergyCalibration> _calibrator; | ||
private: | ||
bool _applyCrackCorrections; | ||
bool _applyMVACorrections; | ||
|
||
bool autoDetectBunchSpacing_; | ||
int bunchSpacingManual_; | ||
|
||
edm::EDGetTokenT<int> bunchSpacing_; | ||
|
||
void correctEnergyActual(reco::PFCluster&, const unsigned) const; | ||
edm::EDGetTokenT<EcalRecHitCollection> _recHitsEB; | ||
edm::EDGetTokenT<EcalRecHitCollection> _recHitsEE; | ||
edm::EDGetTokenT<reco::VertexCollection> _vertices; | ||
|
||
std::vector<std::string> _condnames_mean_50ns; | ||
std::vector<std::string> _condnames_sigma_50ns; | ||
std::vector<std::string> _condnames_mean_25ns; | ||
std::vector<std::string> _condnames_sigma_25ns; | ||
|
||
std::unique_ptr<PFEnergyCalibration> _calibrator; | ||
|
||
}; | ||
|
||
DEFINE_EDM_PLUGIN(PFClusterEnergyCorrectorFactory, | ||
PFClusterEMEnergyCorrector, | ||
"PFClusterEMEnergyCorrector"); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.