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

[14.0.X] update HLTPPSJetComparisonFilter to use LHCInfoCombined #43954

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HLTrigger/special/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/EcalObjects"/>
<use name="CondFormats/RunInfo"/>
<use name="CondTools/RunInfo"/>
<use name="DataFormats/CSCDigi"/>
<use name="DataFormats/CSCRecHit"/>
<use name="DataFormats/CTPPSDetId"/>
Expand Down
27 changes: 16 additions & 11 deletions HLTrigger/special/plugins/HLTPPSJetComparisonFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Matching can be done on the xi and/or mass+rapidity variables, using the do_xi a
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/ProtonReco/interface/ForwardProton.h"

#include "CondFormats/RunInfo/interface/LHCInfo.h"
#include "CondFormats/DataRecord/interface/LHCInfoRcd.h"
#include "CondTools/RunInfo/interface/LHCInfoCombined.h"

#include "FWCore/Framework/interface/MakerMacros.h"

Expand All @@ -37,7 +36,10 @@ class HLTPPSJetComparisonFilter : public edm::global::EDFilter<> {

private:
// ----------member data ---------------------------
edm::ESGetToken<LHCInfo, LHCInfoRcd> const lhcInfoRcdToken_;
const edm::ESGetToken<LHCInfo, LHCInfoRcd> lhcInfoToken_;
const edm::ESGetToken<LHCInfoPerLS, LHCInfoPerLSRcd> lhcInfoPerLSToken_;
const edm::ESGetToken<LHCInfoPerFill, LHCInfoPerFillRcd> lhcInfoPerFillToken_;
const bool useNewLHCInfo_;

edm::ParameterSet param_;

Expand All @@ -47,8 +49,6 @@ class HLTPPSJetComparisonFilter : public edm::global::EDFilter<> {
edm::InputTag forwardProtonInputTag_; // Input tag identifying the forward proton collection
edm::EDGetTokenT<std::vector<reco::ForwardProton>> recoProtonSingleRPToken_;

std::string lhcInfoLabel_;

double maxDiffxi_;
double maxDiffm_;
double maxDiffy_;
Expand All @@ -69,7 +69,10 @@ void HLTPPSJetComparisonFilter::fillDescriptions(edm::ConfigurationDescriptions
desc.add<edm::InputTag>("forwardProtonInputTag", edm::InputTag("ctppsProtons", "singleRP"))
->setComment("input tag of the forward proton collection");

desc.add<std::string>("lhcInfoLabel", std::string(""))->setComment("label used for LHCInfo");
desc.add<std::string>("lhcInfoLabel", "")->setComment("label used for LHCInfo");
desc.add<std::string>("lhcInfoPerLSLabel", "")->setComment("label of the LHCInfoPerLS record");
desc.add<std::string>("lhcInfoPerFillLabel", "")->setComment("label of the LHCInfoPerFill record");
desc.add<bool>("useNewLHCInfo", true)->setComment("flag whether to use new LHCInfoPer* records or old LHCInfo");

desc.add<double>("maxDiffxi", 1.)
->setComment("maximum relative deviation of RP xi from dijet xi. Used with do_xi option");
Expand All @@ -92,15 +95,17 @@ void HLTPPSJetComparisonFilter::fillDescriptions(edm::ConfigurationDescriptions
HLTPPSJetComparisonFilter::~HLTPPSJetComparisonFilter() = default;

HLTPPSJetComparisonFilter::HLTPPSJetComparisonFilter(const edm::ParameterSet &iConfig)
: lhcInfoRcdToken_(esConsumes()),
: lhcInfoToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoLabel")))),
lhcInfoPerLSToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoPerLSLabel")))),
lhcInfoPerFillToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoPerFillLabel")))),
useNewLHCInfo_(iConfig.getParameter<bool>("useNewLHCInfo")),

jetInputTag_(iConfig.getParameter<edm::InputTag>("jetInputTag")),
jet_token_(consumes<reco::PFJetCollection>(jetInputTag_)),

forwardProtonInputTag_(iConfig.getParameter<edm::InputTag>("forwardProtonInputTag")),
recoProtonSingleRPToken_(consumes<std::vector<reco::ForwardProton>>(forwardProtonInputTag_)),

lhcInfoLabel_(iConfig.getParameter<std::string>("lhcInfoLabel")),

maxDiffxi_(iConfig.getParameter<double>("maxDiffxi")),
maxDiffm_(iConfig.getParameter<double>("maxDiffm")),
maxDiffy_(iConfig.getParameter<double>("maxDiffy")),
Expand All @@ -113,8 +118,8 @@ HLTPPSJetComparisonFilter::HLTPPSJetComparisonFilter(const edm::ParameterSet &iC
// member functions
//
bool HLTPPSJetComparisonFilter::filter(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const {
auto const &hLHCInfo = iSetup.getHandle(lhcInfoRcdToken_);
float sqs = 2. * hLHCInfo->energy(); // get sqrt(s)
LHCInfoCombined lhcInfoCombined(iSetup, lhcInfoPerLSToken_, lhcInfoPerFillToken_, lhcInfoToken_, useNewLHCInfo_);
float sqs = 2. * lhcInfoCombined.energy; // get sqrt(s)

edm::Handle<reco::PFJetCollection> jets;
iEvent.getByToken(jet_token_, jets); // get jet collection
Expand Down