74 caloJetPtCut(iConfig.getParameter<double>(
"caloJetPtCut")),
76 doMet(iConfig.getParameter<bool>(
"doMet")),
77 doJetBTags(iConfig.getParameter<bool>(
"doJetBTags")),
78 doJetIDTags(iConfig.getParameter<bool>(
"doJetIDTags"))
81 produces<ScoutingCaloJetCollection>();
82 produces<double>(
"rho");
83 produces<double>(
"caloMetPt");
84 produces<double>(
"caloMetPhi");
102 bool haveJetBTags =
false;
107 bool haveJetIDTags =
false;
109 haveJetIDTags =
true;
112 for(
auto &
jet : *caloJetCollection){
115 float bTagValue = -20;
116 float bTagMinDR2 = 0.01;
118 for(
auto &
tag : *caloJetBTagCollection){
120 if(dR2 < bTagMinDR2){
122 bTagValue =
tag.second;
126 float idTagValue = -20;
127 float idTagMinDR2 = 0.01;
129 for(
auto &
tag : *caloJetIDTagCollection){
131 if(dR2 < idTagMinDR2){
133 idTagValue =
tag.second;
137 outCaloJets->emplace_back(
139 jet.jetArea(),
jet.maxEInEmTowers(),
jet.maxEInHadTowers(),
140 jet.hadEnergyInHB(),
jet.hadEnergyInHE(),
jet.hadEnergyInHF(),
141 jet.emEnergyInEB(),
jet.emEnergyInEE(),
jet.emEnergyInHF(),
142 jet.towersArea(), idTagValue, bTagValue
150 std::unique_ptr<double> outRho(
new double(-999));
152 outRho.reset(
new double(*rho));
157 std::unique_ptr<double> outMetPt(
new double(-999));
158 std::unique_ptr<double> outMetPhi(
new double(-999));
160 outMetPt.reset(
new double(metCollection->front().pt()));
161 outMetPhi.reset(
new double(metCollection->front().phi()));
182 desc.
add<
double>(
"caloJetPtCut", 20.0);
183 desc.
add<
double>(
"caloJetEtaCut", 3.0);
184 desc.
add<
bool>(
"doMet",
true);
185 desc.
add<
bool>(
"doJetBTags",
false);
186 desc.
add<
bool>(
"doJetIDTags",
false);
187 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_
#define DEFINE_FWK_MODULE(type)
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)
virtual void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const override final
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< double > rho_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double caloJetPtCut
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
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
~HLTScoutingCaloProducer()