Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run2-hcx206 Take care of Phase2 situations for HCAL #26966

Merged
merged 2 commits into from Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc
Expand Up @@ -249,7 +249,7 @@ unsigned int CaloTPGTranscoderULUT::getOutputLUTSize(const HcalTrigTowerDetId& i
else
return QIE10_OUTPUT_LUT_SIZE;
case HcalTopologyMode::TriggerMode_2021:
if (id.ietaAbs() <= theTopology->lastHERing())
if (id.ietaAbs() <= theTopology->lastHBHERing())
return QIE11_OUTPUT_LUT_SIZE;
else
return QIE10_OUTPUT_LUT_SIZE;
Expand Down
Expand Up @@ -501,7 +501,7 @@ std::unique_ptr<HcalRespCorrs> HcalHardcodeCalibrations::produceRespCorrs(const
//set depth segmentation for HB/HE recalib - only happens once
if ((he_recalibration && !setHEdsegm) || (hb_recalibration && !setHBdsegm)) {
std::vector<std::vector<int>> m_segmentation;
int maxEta = std::max(topo->lastHERing(),topo->lastHBRing());
int maxEta = topo->lastHERing();
m_segmentation.resize(maxEta);
for (int i = 0; i < maxEta; i++) {
topo->getDepthSegmentation(i + 1, m_segmentation[i]);
Expand Down
28 changes: 17 additions & 11 deletions CalibCalorimetry/HcalPlugins/test/HBHEDarkeningAnalyzer.cc
Expand Up @@ -29,7 +29,7 @@
// class declaration
//

class HBHEDarkeningAnalyzer : public edm::one::EDAnalyzer<> {
class HBHEDarkeningAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit HBHEDarkeningAnalyzer(const edm::ParameterSet&);
~HBHEDarkeningAnalyzer();
Expand All @@ -38,9 +38,9 @@ class HBHEDarkeningAnalyzer : public edm::one::EDAnalyzer<> {

private:
void beginJob() override;
void doBeginRun_(const edm::Run&, const edm::EventSetup&) override;
void beginRun(const edm::Run&, const edm::EventSetup&) override;
void analyze(const edm::Event&, const edm::EventSetup&) override;
void doEndRun_(const edm::Run&, const edm::EventSetup&) override {}
void endRun(const edm::Run&, const edm::EventSetup&) override {}
void endJob() override {}
void print(int ieta_min,
int ieta_max,
Expand Down Expand Up @@ -76,7 +76,7 @@ HBHEDarkeningAnalyzer::~HBHEDarkeningAnalyzer() {}

void HBHEDarkeningAnalyzer::beginJob() {}

void HBHEDarkeningAnalyzer::doBeginRun_(const edm::Run& iRun, const edm::EventSetup& iSetup) {
void HBHEDarkeningAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
edm::ESHandle<HcalTopology> htopo;
iSetup.get<HcalRecNumberingRecord>().get(htopo);
theTopology = &*htopo;
Expand All @@ -91,11 +91,15 @@ void HBHEDarkeningAnalyzer::doBeginRun_(const edm::Run& iRun, const edm::EventSe

//initialize recalibration classes
std::vector<std::vector<int>> m_segmentation;
int maxEta = theTopology->lastHERing();
int maxEta = theTopology->lastHBHERing();
m_segmentation.resize(maxEta);
for (int i = 0; i < maxEta; i++) {
theTopology->getDepthSegmentation(i + 1, m_segmentation[i]);
}
std::cout << "HB: Eta " << theTopology->firstHBRing()
<< ":" << theTopology->lastHBRing() << " HE: Eta "
<< theTopology->firstHERing() << ":" << theTopology->lastHERing()
<< std::endl;
hb_recalibration.setup(m_segmentation, hb_darkening);
he_recalibration.setup(m_segmentation, he_darkening);
}
Expand All @@ -105,8 +109,8 @@ void HBHEDarkeningAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSe
std::cout << std::setprecision(2);

//HB tests
int hb_ieta_min = 1;
int hb_ieta_max = 16;
int hb_ieta_min = theTopology->firstHBRing();
int hb_ieta_max = theTopology->lastHBRing();
int hb_lay_min = 1;
int hb_lay_max = 17;
std::cout << "HB" << std::endl;
Expand All @@ -115,8 +119,8 @@ void HBHEDarkeningAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSe
std::cout << std::endl;

//HE tests
int he_ieta_min = 16;
int he_ieta_max = 29;
int he_ieta_min = theTopology->firstHERing();
int he_ieta_max = theTopology->lastHERing();
int he_lay_min = 1;
int he_lay_max = 19;
std::cout << "HE" << std::endl;
Expand All @@ -129,7 +133,8 @@ void HBHEDarkeningAnalyzer::print(int ieta_min,
int lay_max,
const HBHEDarkening* darkening,
const HBHERecalibration& recalibration) {
std::cout << "Darkening" << std::endl;
std::cout << "Darkening: ieta " << ieta_min << ":" << ieta_max << " layer "
<< lay_min << ":" << lay_max << std::endl;
for (int ieta = ieta_min; ieta <= ieta_max; ++ieta) {
std::cout << "Tower " << ieta << ": ";
for (int lay = lay_min; lay <= lay_max; ++lay) {
Expand All @@ -138,7 +143,8 @@ void HBHEDarkeningAnalyzer::print(int ieta_min,
std::cout << std::endl;
}

std::cout << "Recalibration" << std::endl;
std::cout << "Recalibration: ieta " << ieta_min << ":" << ieta_max
<< " layer " << lay_min << ":" << lay_max << std::endl;
for (int ieta = ieta_min; ieta <= ieta_max; ++ieta) {
std::cout << "Tower " << ieta << ": ";
for (int depth = 1; depth <= recalibration.maxDepth(); ++depth) {
Expand Down
Expand Up @@ -6,12 +6,8 @@
process.source = cms.Source("EmptySource")

process.load("Configuration.StandardSequences.Services_cff")
process.load("Configuration.Geometry.GeometryExtended2018_cff")
#process.load("Configuration.Geometry.GeometryExtended2023D4_cff")
process.load("Geometry.HcalCommonData.hcalParameters_cfi")
process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cfi")
process.load("Geometry.HcalCommonData.hcalDDDRecConstants_cfi")
process.load("Geometry.HcalEventSetup.hcalTopologyIdeal_cfi")
process.load("Configuration.Geometry.GeometryExtended2018Reco_cff")
#process.load("Configuration.Geometry.GeometryExtended2023D41Reco_cff")
process.load("CalibCalorimetry.HcalPlugins.HBHEDarkening_cff")

import CalibCalorimetry.HcalPlugins.Hcal_Conditions_forGlobalTag_cff
Expand Down
1 change: 1 addition & 0 deletions Geometry/CaloTopology/interface/HcalTopology.h
Expand Up @@ -90,6 +90,7 @@ class HcalTopology : public CaloSubdetectorTopology {
int lastHBRing() const {return lastHBRing_;}
int firstHERing() const {return firstHERing_;}
int lastHERing() const {return lastHERing_;}
int lastHBHERing() const {return std::max(lastHBRing_,lastHERing_);}
int firstHFRing() const {return firstHFRing_;}
int lastHFRing() const {return lastHFRing_;}
int firstHORing() const {return firstHORing_;}
Expand Down