74 caloJetPtCut(iConfig.getParameter<double>(
"caloJetPtCut")),
76 doMet(iConfig.getParameter<
bool>(
"doMet")),
81 produces<ScoutingCaloJetCollection>();
82 produces<double>(
"rho");
83 produces<double>(
"caloMetPt");
84 produces<double>(
"caloMetPhi");
101 bool haveJetBTags =
false;
106 bool haveJetIDTags =
false;
108 haveJetIDTags =
true;
111 for(
auto &
jet : *caloJetCollection){
114 float bTagValue = -20;
115 float bTagMinDR2 = 0.01;
117 for(
auto &
tag : *caloJetBTagCollection){
119 if(dR2 < bTagMinDR2){
121 bTagValue =
tag.second;
125 float idTagValue = -20;
126 float idTagMinDR2 = 0.01;
128 for(
auto &
tag : *caloJetIDTagCollection){
130 if(dR2 < idTagMinDR2){
132 idTagValue =
tag.second;
136 outCaloJets->emplace_back(
138 jet.jetArea(),
jet.maxEInEmTowers(),
jet.maxEInHadTowers(),
139 jet.hadEnergyInHB(),
jet.hadEnergyInHE(),
jet.hadEnergyInHF(),
140 jet.emEnergyInEB(),
jet.emEnergyInEE(),
jet.emEnergyInHF(),
141 jet.towersArea(), idTagValue, bTagValue
149 std::unique_ptr<double> outRho(
new double(-999));
151 outRho.reset(
new double(*rho));
156 std::unique_ptr<double> outMetPt(
new double(-999));
157 std::unique_ptr<double> outMetPhi(
new double(-999));
159 outMetPt.reset(
new double(metCollection->front().pt()));
160 outMetPhi.reset(
new double(metCollection->front().phi()));
181 desc.
add<
double>(
"caloJetPtCut", 20.0);
182 desc.
add<
double>(
"caloJetEtaCut", 3.0);
183 desc.
add<
bool>(
"doMet",
true);
184 desc.
add<
bool>(
"doJetBTags",
false);
185 desc.
add<
bool>(
"doJetIDTags",
false);
186 descriptions.
add(
"hltScoutingCaloProducer", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
const edm::EDGetTokenT< reco::CaloMETCollection > metCollection_
HLTScoutingCaloProducer(const edm::ParameterSet &)
def setup(process, global_tag, zero_tesla=False)
std::vector< Vertex > VertexCollection
collection of Vertex objects
JetFloatAssociation::Container JetTagCollection
std::vector< ScoutingCaloJet > ScoutingCaloJetCollection
const edm::EDGetTokenT< reco::CaloJetCollection > caloJetCollection_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
#define DEFINE_FWK_MODULE(type)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
~HLTScoutingCaloProducer() override
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
const edm::EDGetTokenT< double > rho_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double caloJetPtCut
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const double caloJetEtaCut
const edm::EDGetTokenT< reco::JetTagCollection > caloJetIDTagCollection_
const edm::EDGetTokenT< reco::JetTagCollection > caloJetBTagCollection_
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects