69 regressionInputFile_ = iConfig.
getParameter<std::string>(
"regressionInputFile");
70 energyRegressionType_ = iConfig.
getParameter<uint32_t>(
"energyRegressionType");
72 nameEnergyReg_ = iConfig.
getParameter<std::string>(
"nameEnergyReg");
73 nameEnergyErrorReg_ = iConfig.
getParameter<std::string>(
"nameEnergyErrorReg");
78 produces<edm::ValueMap<double> >(nameEnergyReg_);
79 produces<edm::ValueMap<double> >(nameEnergyErrorReg_);
91 regressionEvaluator->initialize(regressionInputFile_.c_str(),
type);
93 geomInitialized_ =
false;
100 delete regressionEvaluator;
106 assert(regressionEvaluator->isInitialized());
108 if (!geomInitialized_) {
111 ecalTopology_ = & (*theCaloTopology);
115 caloGeometry_ = & (*theCaloGeometry);
116 geomInitialized_ =
true;
129 std::vector<double> energyValues;
130 std::vector<double> energyErrorValues;
131 energyValues.reserve(egCollection->size());
132 energyErrorValues.reserve(egCollection->size());
139 iEvent.
getByLabel( recHitCollectionEB_, pEBRecHits );
140 iEvent.
getByLabel( recHitCollectionEE_, pEERecHits );
151 for (reco::VertexCollection::const_iterator inV = inVertices.begin();
152 inV != inVertices.end(); ++inV) {
156 && inV->position().Rho() <= 2.0
157 && fabs(inV->z()) <= 24.0
169 rho = (*hRhoKt6PFJets);
172 for ( reco::GsfElectronCollection::const_iterator egIter = egCandidates.begin();
173 egIter != egCandidates.end(); ++egIter) {
177 recHits = pEBRecHits.
product();
179 recHits = pEERecHits.
product();
183 double energy=regressionEvaluator->calculateRegressionEnergy(&(*egIter),
188 double error=regressionEvaluator->calculateRegressionEnergyUncertainty(&(*egIter),
193 energyValues.push_back(energy);
194 energyErrorValues.push_back(error);
198 energyFiller.
insert( egCollection, energyValues.begin(), energyValues.end() );
201 energyErrorFiller.
insert( egCollection, energyErrorValues.begin(), energyErrorValues.end() );
202 energyErrorFiller.
fill();
204 iEvent.
put(regrEnergyMap,nameEnergyReg_);
205 iEvent.
put(regrEnergyErrorMap,nameEnergyErrorReg_);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ElectronEnergyRegressionEvaluate * regressionEvaluator
~ElectronRegressionEnergyProducer()
uint32_t energyRegressionType_
#define DEFINE_FWK_MODULE(type)
virtual bool filter(edm::Event &, const edm::EventSetup &)
void insert(const H &h, I begin, I end)
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::InputTag recHitCollectionEB_
ElectronRegressionEnergyProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const CaloGeometry * caloGeometry_
std::string nameEnergyErrorReg_
std::string nameEnergyReg_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag recHitCollectionEE_
ElectronEnergyRegressionType
std::string regressionInputFile_
T const * product() const
edm::InputTag electronTag_
const CaloTopology * ecalTopology_