Skip to content

Commit

Permalink
Merge pull request #11918 from igv4321/HcalSimpleReconstructor-with-m…
Browse files Browse the repository at this point in the history
…ethod3

Hcal simple reconstructor with method3
  • Loading branch information
cmsbuild committed Oct 21, 2015
2 parents ae198fc + 37620ae commit 91a38ca
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
10 changes: 10 additions & 0 deletions RecoLocalCalo/HcalRecProducers/python/HBHEMethod3Parameters_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import FWCore.ParameterSet.Config as cms

# Configuration parameters for Method 3
m3Parameters = cms.PSet(
pedestalSubtractionType = cms.int32(1),
pedestalUpperLimit = cms.double(2.7),
timeSlewParsType = cms.int32(1), # 0: TestStand, 1:Data, 2:MC, 3:InputPars. Parametrization function is par0 + par1*log(fC+par2).
timeSlewPars = cms.vdouble(12.2999, -2.19142, 0, 12.2999, -2.19142, 0, 12.2999, -2.19142, 0), # HB par0, HB par1, HB par2, BE par0, BE par1, BE par2, HE par0, HE par1, HE par2
respCorrM3 = cms.double(0.95) # This factor is used to align the the Method3 with the Method2 response
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.HcalRecProducers.HBHEMethod3Parameters_cfi as method3

hbheprereco = cms.EDProducer(
"HcalHitReconstructor",
method3.m3Parameters,
correctionPhaseNS = cms.double(6.0),
digiLabel = cms.InputTag("hcalDigis"),
Subdetector = cms.string('HBHE'),
Expand Down Expand Up @@ -129,13 +131,5 @@
ts4chi2 = cms.double(15.), #chi2 for triple pulse
ts345chi2 = cms.double(100.), #chi2 (not used)
chargeMax = cms.double(6.), #Charge cut (fC) for uncstrianed Fit
fitTimes = cms.int32(1), # -1 means no constraint on number of fits per channel
# Configuration parameters for Method 3
pedestalSubtractionType = cms.int32(1),
pedestalUpperLimit = cms.double(2.7),
timeSlewParsType = cms.int32(1), # 0: TestStand, 1:Data, 2:MC, 3:InputPars. Parametrization function is par0 + par1*log(fC+par2).
timeSlewPars = cms.vdouble( 12.2999, -2.19142, 0, 12.2999, -2.19142, 0, 12.2999, -2.19142, 0 ),# HB par0, HB par1, HB par2, BE par0, BE par1, BE par2, HE par0, HE par1, HE par2
respCorrM3 = cms.double(0.95)# This factor is used to align the the Method3 with the Method2 response
)


fitTimes = cms.int32(1) # -1 means no constraint on number of fits per channel
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.HcalRecProducers.HBHEMethod3Parameters_cfi as method3

hbheprereco = cms.EDProducer("HcalSimpleReconstructor",
method3.m3Parameters,
correctionPhaseNS = cms.double(13.0),
digiLabel = cms.InputTag("hcalDigis"),
Subdetector = cms.string('HBHE'),
Expand All @@ -11,5 +13,3 @@
samplesToAdd = cms.int32(4),
tsFromDB = cms.bool(True)
)


21 changes: 21 additions & 0 deletions RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "CalibFormats/HcalObjects/interface/HcalCoderDb.h"
#include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
#include "CalibFormats/HcalObjects/interface/HcalDbService.h"
Expand All @@ -25,6 +27,14 @@ HcalSimpleReconstructor::HcalSimpleReconstructor(edm::ParameterSet const& conf):
paramTS(0),
theTopology(0)
{
// Intitialize "method 3"
reco_.setMeth3Params(
conf.getParameter<int> ("pedestalSubtractionType"),
conf.getParameter<double> ("pedestalUpperLimit"),
conf.getParameter<int> ("timeSlewParsType"),
conf.getParameter<std::vector<double> >("timeSlewPars"),
conf.getParameter<double> ("respCorrM3")
);

// register for data access
tok_hbheUp_ = consumes<HBHEUpgradeDigiCollection>(inputLabel_);
Expand Down Expand Up @@ -66,6 +76,17 @@ HcalSimpleReconstructor::HcalSimpleReconstructor(edm::ParameterSet const& conf):

}

void HcalSimpleReconstructor::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.setAllowAnything();
desc.add<int>("pedestalSubtractionType", 1);
desc.add<double>("pedestalUpperLimit", 2.7);
desc.add<int>("timeSlewParsType",3);
desc.add<std::vector<double>>("timeSlewPars", { 12.2999, -2.19142, 0, 12.2999, -2.19142, 0, 12.2999, -2.19142, 0 });
desc.add<double>("respCorrM3", 0.95);
descriptions.add("simpleHbhereco",desc);
}

HcalSimpleReconstructor::~HcalSimpleReconstructor() {
delete paramTS;
delete theTopology;
Expand Down
6 changes: 6 additions & 0 deletions RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"

namespace edm {
class ConfigurationDescriptions;
}

/** \class HcalSimpleReconstructor
Expand All @@ -27,6 +30,9 @@ class HcalTopology;
virtual void produce(edm::Event& e, const edm::EventSetup& c) override final;
virtual void beginRun(edm::Run const&r, edm::EventSetup const & es) override final;
virtual void endRun(edm::Run const&r, edm::EventSetup const & es) override final;

static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);

private:
template<class DIGICOLL, class RECHITCOLL> void process(edm::Event& e, const edm::EventSetup& c, const edm::EDGetTokenT<DIGICOLL> &tok);
void processUpgrade(edm::Event& e, const edm::EventSetup& c);
Expand Down

0 comments on commit 91a38ca

Please sign in to comment.