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

bsunanda:Run2-hcx28 Make the topology tester up-to-date with the geometry changes for HCAL #11423

Merged
merged 4 commits into from Sep 29, 2015
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 7 additions & 4 deletions Geometry/CaloTopology/test/BuildFile.xml
@@ -1,7 +1,10 @@
<use name="DataFormats/HcalDetId"/>
<use name="DataFormats/CaloTowers"/>
<use name="Geometry/CaloTopology"/>
<bin file="testCaloTowerTopology.cpp">
</bin>
<bin file="testHcalTopology.cpp">
</bin>
<use name="Geometry/Records"/>
<use name="Geometry/HcalCommonData"/>
<use name="CoralBase"/>

<flags EDM_PLUGIN="1"/>
<library file="HcalTopologyTester.cc" name="testGeometryHcalTopology"> </library>

Expand Up @@ -2,18 +2,61 @@
#include <string>
#include <vector>

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "DetectorDescription/Core/interface/DDCompactView.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/Records/interface/HcalRecNumberingRecord.h"
#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h"
#include "Geometry/CaloTopology/interface/HcalTopology.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "CoralBase/Exception.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this dependency here? (and in the buildfile?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed dependency


From: David Lange [notifications@github.com]
Sent: 26 September 2015 13:54
To: cms-sw/cmssw
Cc: Sunanda Banerjee
Subject: Re: [cmssw] bsunanda:Run2-hcx28 Make the topology tester up-to-date with the geometry changes for HCAL (#11423)

In Geometry/CaloTopology/test/HcalTopologyTester.cchttps://github.com//pull/11423#discussion_r40492941:

#include "Geometry/CaloTopology/interface/HcalTopology.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
+#include "CoralBase/Exception.h"

why is this dependency here? (and in the buildfile?)


Reply to this email directly or view it on GitHubhttps://github.com//pull/11423/files#r40492941.


class HcalTopologyTester : public edm::EDAnalyzer {
public:
explicit HcalTopologyTester(const edm::ParameterSet& );
~HcalTopologyTester();


virtual void analyze(const edm::Event&, const edm::EventSetup& );
void doTest(const HcalTopology& topology);

private:
// ----------member data ---------------------------
};

HcalTopologyTester::HcalTopologyTester(const edm::ParameterSet& ) {}

int main(int /*argc*/, char** /*argv*/) {

// FIXME: for SLHC
HcalTopologyMode::Mode mode = HcalTopologyMode::LHC;
int maxDepthHB = 2;
int maxDepthHE = 3;
HcalTopologyTester::~HcalTopologyTester() {}

void HcalTopologyTester::analyze(const edm::Event& ,
const edm::EventSetup& iSetup ) {


edm::ESTransientHandle<DDCompactView> pDD;
iSetup.get<IdealGeometryRecord>().get( pDD );
std::cout << "Gets Compact View\n";
edm::ESHandle<HcalDDDRecConstants> pHSNDC;
iSetup.get<HcalRecNumberingRecord>().get( pHSNDC );
std::cout << "Gets RecNumbering Record\n";
edm::ESHandle<HcalTopology> topo;
iSetup.get<HcalRecNumberingRecord>().get(topo);
if (topo.isValid()) doTest(*topo);
else std::cout << "Cannot get a valid HcalTopology Object\n";
}

void HcalTopologyTester::doTest(const HcalTopology& topology) {

HcalTopology topology(mode, maxDepthHB, maxDepthHE);
for (int idet=0; idet<4; idet++) {
HcalSubdetector subdet = HcalBarrel;
if (idet == 1) subdet = HcalOuter;
Expand Down Expand Up @@ -55,5 +98,8 @@ int main(int /*argc*/, char** /*argv*/) {
}
}
}
return 0;

}

//define this as a plug-in
DEFINE_FWK_MODULE(HcalTopologyTester);
40 changes: 0 additions & 40 deletions Geometry/CaloTopology/test/testCaloTowerTopology.cpp

This file was deleted.

51 changes: 51 additions & 0 deletions Geometry/CaloTopology/test/testHcalTopology_cfg.py
@@ -0,0 +1,51 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("PROD")
process.load("SimGeneral.HepPDTESSource.pdt_cfi")

process.load("Geometry.HcalCommonData.testHcalOnlyGeometryXML_cfi")
process.load("Geometry.HcalCommonData.hcalDDConstants_cff")
process.load("Geometry.HcalEventSetup.hcalTopologyIdeal_cfi")

process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('cout'),
categories = cms.untracked.vstring('HCalGeom'),
debugModules = cms.untracked.vstring('*'),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('DEBUG'),
default = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
HCalGeom = cms.untracked.PSet(
limit = cms.untracked.int32(0)
)
),
)

process.load("IOMC.RandomEngine.IOMC_cff")
process.RandomNumberGeneratorService.generator.initialSeed = 456789

process.source = cms.Source("EmptySource")

process.generator = cms.EDProducer("FlatRandomEGunProducer",
PGunParameters = cms.PSet(
PartID = cms.vint32(14),
MinEta = cms.double(-3.5),
MaxEta = cms.double(3.5),
MinPhi = cms.double(-3.14159265359),
MaxPhi = cms.double(3.14159265359),
MinE = cms.double(9.99),
MaxE = cms.double(10.01)
),
AddAntiParticle = cms.bool(False),
Verbosity = cms.untracked.int32(0),
firstRun = cms.untracked.uint32(1)
)

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.prod = cms.EDAnalyzer("HcalTopologyTester")

process.p1 = cms.Path(process.generator*process.prod)