Skip to content

Commit

Permalink
Addressed first part of Slava's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-kaspar committed Jul 1, 2020
1 parent 420c925 commit 3ce5d59
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
19 changes: 9 additions & 10 deletions RecoPPS/Local/plugins/CTPPSLocalTrackLiteReAligner.cc
Expand Up @@ -29,18 +29,18 @@ class CTPPSLocalTrackLiteReAligner : public edm::stream::EDProducer<> {
static void fillDescriptions(edm::ConfigurationDescriptions &);

private:
edm::EDGetTokenT<CTPPSLocalTrackLiteCollection> inputTrackToken_;
const edm::EDGetTokenT<CTPPSLocalTrackLiteCollection> inputTrackToken_;

std::string alignmentLabel_;
const edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord> alignmentToken_;

std::string outputTrackTag_;
const std::string outputTrackTag_;
};

//----------------------------------------------------------------------------------------------------

CTPPSLocalTrackLiteReAligner::CTPPSLocalTrackLiteReAligner(const edm::ParameterSet &iConfig)
: inputTrackToken_(consumes<CTPPSLocalTrackLiteCollection>(iConfig.getParameter<edm::InputTag>("inputTrackTag"))),
alignmentLabel_(iConfig.getParameter<std::string>("alignmentLabel")),
alignmentToken_(esConsumes<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord>(iConfig.getParameter<edm::ESInputTag>("alignmentTag"))),
outputTrackTag_(iConfig.getParameter<std::string>("outputTrackTag")) {
produces<CTPPSLocalTrackLiteCollection>(outputTrackTag_);
}
Expand All @@ -53,7 +53,7 @@ void CTPPSLocalTrackLiteReAligner::fillDescriptions(edm::ConfigurationDescriptio
desc.add<edm::InputTag>("inputTrackTag", edm::InputTag("ctppsLocalTrackLiteProducer"))
->setComment("tag of the input CTPPSLocalTrackLiteCollection");

desc.add<std::string>("alignmentLabel", "")->setComment("label of the alignment data");
desc.add<edm::ESInputTag>("alignmentTag", edm::ESInputTag(""))->setComment("tag of the alignment data");

desc.add<std::string>("outputTrackTag", "")->setComment("tag of the output CTPPSLocalTrackLiteCollection");

Expand All @@ -63,9 +63,8 @@ void CTPPSLocalTrackLiteReAligner::fillDescriptions(edm::ConfigurationDescriptio
//----------------------------------------------------------------------------------------------------

void CTPPSLocalTrackLiteReAligner::produce(edm::Event &iEvent, const edm::EventSetup &iSetup) {
// get alignment correction
edm::ESHandle<CTPPSRPAlignmentCorrectionsData> hAlignment;
iSetup.get<RPRealAlignmentRecord>().get(alignmentLabel_, hAlignment);
// get alignment corrections
auto const& alignment = iSetup.getData(alignmentToken_);

// get input
edm::Handle<CTPPSLocalTrackLiteCollection> hInputTracks;
Expand All @@ -76,8 +75,8 @@ void CTPPSLocalTrackLiteReAligner::produce(edm::Event &iEvent, const edm::EventS

// apply alignment correction
for (const auto &tr : *hInputTracks) {
auto it = hAlignment->getRPMap().find(tr.rpId());
if (it == hAlignment->getRPMap().end()) {
auto it = alignment.getRPMap().find(tr.rpId());
if (it == alignment.getRPMap().end()) {
edm::LogError("CTPPSLocalTrackLiteReAligner::produce")
<< "Cannot find alignment correction for RP " << tr.rpId() << ". The track will be skipped.";
} else {
Expand Down
4 changes: 2 additions & 2 deletions RecoPPS/Local/test/re_alignment/reco_base_align_cfg.py
Expand Up @@ -14,8 +14,8 @@

# raw data source
process.source = cms.Source("PoolSource",
#fileNames = cms.untracked.vstring(/store/data/Run2018D/ZeroBias/RAW/v1/000/320/688/00000/601A721D-AD95-E811-B21A-FA163E28A50A.root),
fileNames = cms.untracked.vstring("root://eoscms.cern.ch//eos/cms/store/group/phys_pps/sw_test_input/601A721D-AD95-E811-B21A-FA163E28A50A.root"),
fileNames = cms.untracked.vstring("/store/data/Run2018D/ZeroBias/RAW/v1/000/320/688/00000/601A721D-AD95-E811-B21A-FA163E28A50A.root"),
#fileNames = cms.untracked.vstring("root://eoscms.cern.ch//eos/cms/store/group/phys_pps/sw_test_input/601A721D-AD95-E811-B21A-FA163E28A50A.root"),

inputCommands = cms.untracked.vstring(
'drop *',
Expand Down
4 changes: 2 additions & 2 deletions RecoPPS/Local/test/re_alignment/reco_full_align_cfg.py
Expand Up @@ -14,8 +14,8 @@

# raw data source
process.source = cms.Source("PoolSource",
#fileNames = cms.untracked.vstring(/store/data/Run2018D/ZeroBias/RAW/v1/000/320/688/00000/601A721D-AD95-E811-B21A-FA163E28A50A.root),
fileNames = cms.untracked.vstring("root://eoscms.cern.ch//eos/cms/store/group/phys_pps/sw_test_input/601A721D-AD95-E811-B21A-FA163E28A50A.root"),
fileNames = cms.untracked.vstring("/store/data/Run2018D/ZeroBias/RAW/v1/000/320/688/00000/601A721D-AD95-E811-B21A-FA163E28A50A.root"),
#fileNames = cms.untracked.vstring("root://eoscms.cern.ch//eos/cms/store/group/phys_pps/sw_test_input/601A721D-AD95-E811-B21A-FA163E28A50A.root"),

inputCommands = cms.untracked.vstring(
'drop *',
Expand Down

0 comments on commit 3ce5d59

Please sign in to comment.