Skip to content

Commit

Permalink
Merge pull request #46036 from aloeliger/CICADA_L1TNtuples_dataformat
Browse files Browse the repository at this point in the history
CICADA L1TTtuples Data Format Update
  • Loading branch information
cmsbuild authored Sep 18, 2024
2 parents 79c1e01 + b1a0a08 commit 6426a97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions L1Trigger/L1TNtuples/plugins/L1CaloSummaryTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
#include "DataFormats/L1CaloTrigger/interface/L1CaloRegion.h"
#include "DataFormats/L1CaloTrigger/interface/CICADA.h"

class L1CaloSummaryTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
Expand All @@ -36,14 +37,14 @@ class L1CaloSummaryTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedRe
L1Analysis::L1AnalysisCaloSummaryDataFormat* caloSummaryData_;

private:
const edm::EDGetTokenT<float> scoreToken_;
const edm::EDGetTokenT<l1t::CICADABxCollection> scoreToken_;
const edm::EDGetTokenT<L1CaloRegionCollection> regionToken_;
edm::Service<TFileService> fs_;
TTree* tree_;
};

L1CaloSummaryTreeProducer::L1CaloSummaryTreeProducer(const edm::ParameterSet& iConfig)
: scoreToken_(consumes<float>(iConfig.getUntrackedParameter<edm::InputTag>("scoreToken"))),
: scoreToken_(consumes<l1t::CICADABxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("scoreToken"))),
regionToken_(consumes<L1CaloRegionCollection>(iConfig.getUntrackedParameter<edm::InputTag>("regionToken"))) {
usesResource(TFileService::kSharedResource);
tree_ = fs_->make<TTree>("L1CaloSummaryTree", "L1CaloSummaryTree");
Expand All @@ -67,10 +68,10 @@ void L1CaloSummaryTreeProducer::analyze(const edm::Event& iEvent, const edm::Eve
edm::LogWarning("L1Ntuple") << "Could not find region regions. CICADA model input will not be filled";
}

edm::Handle<float> score;
edm::Handle<l1t::CICADABxCollection> score;
iEvent.getByToken(scoreToken_, score);
if (score.isValid())
caloSummaryData_->CICADAScore = *score;
caloSummaryData_->CICADAScore = score->at(0, 0);
else
edm::LogWarning("L1Ntuple") << "Could not find a proper CICADA score. CICADA score will not be filled.";

Expand Down

0 comments on commit 6426a97

Please sign in to comment.