Skip to content

Commit

Permalink
Use thread friendly modules in L1Trigger/L1TNtuples
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr15Jones committed Jul 27, 2022
1 parent d274e60 commit 4147990
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 29 deletions.
5 changes: 3 additions & 2 deletions L1Trigger/L1TNtuples/plugins/L1ElectronRecoTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// framework
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -40,7 +40,7 @@
// class declaration
//

class L1ElectronRecoTreeProducer : public edm::EDAnalyzer {
class L1ElectronRecoTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit L1ElectronRecoTreeProducer(const edm::ParameterSet&);
~L1ElectronRecoTreeProducer() override;
Expand Down Expand Up @@ -99,6 +99,7 @@ L1ElectronRecoTreeProducer::L1ElectronRecoTreeProducer(const edm::ParameterSet&
electron = new L1Analysis::L1AnalysisRecoElectron();
electron_data = electron->getData();

usesResource(TFileService::kSharedResource);
tree_ = fs_->make<TTree>("ElectronRecoTree", "ElectronRecoTree");
tree_->Branch("Electron", "L1Analysis::L1AnalysisRecoElectronDataFormat", &electron_data, 32000, 3);
}
Expand Down
5 changes: 3 additions & 2 deletions L1Trigger/L1TNtuples/plugins/L1ExtraTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Description: Produce L1 Extra tree

// framework
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand Down Expand Up @@ -52,7 +52,7 @@ Description: Produce L1 Extra tree
// class declaration
//

class L1ExtraTreeProducer : public edm::EDAnalyzer {
class L1ExtraTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit L1ExtraTreeProducer(const edm::ParameterSet&);
~L1ExtraTreeProducer() override;
Expand Down Expand Up @@ -115,6 +115,7 @@ L1ExtraTreeProducer::L1ExtraTreeProducer(const edm::ParameterSet& iConfig) {
l1Extra = new L1Analysis::L1AnalysisL1Extra();
l1ExtraData = l1Extra->getData();

usesResource(TFileService::kSharedResource);
// set up output
tree_ = fs_->make<TTree>("L1ExtraTree", "L1ExtraTree");
tree_->Branch("L1Extra", "L1Analysis::L1AnalysisL1ExtraDataFormat", &l1ExtraData, 32000, 3);
Expand Down
5 changes: 3 additions & 2 deletions L1Trigger/L1TNtuples/plugins/L1GenTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Description: Produce L1 Extra tree

// framework
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand Down Expand Up @@ -51,7 +51,7 @@ Description: Produce L1 Extra tree
// class declaration
//

class L1GenTreeProducer : public edm::EDAnalyzer {
class L1GenTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit L1GenTreeProducer(const edm::ParameterSet&);
~L1GenTreeProducer() override;
Expand Down Expand Up @@ -90,6 +90,7 @@ L1GenTreeProducer::L1GenTreeProducer(const edm::ParameterSet& iConfig) {

l1GenData_ = std::make_unique<L1Analysis::L1AnalysisGeneratorDataFormat>();

usesResource(TFileService::kSharedResource);
// set up output
tree_ = fs_->make<TTree>("L1GenTree", "L1GenTree");
tree_->Branch("Generator", "L1Analysis::L1AnalysisGeneratorDataFormat", l1GenData_.get(), 32000, 3);
Expand Down
21 changes: 4 additions & 17 deletions L1Trigger/L1TNtuples/plugins/L1MenuTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Description: Produce L1 Extra tree

// framework
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand All @@ -42,17 +42,13 @@ Description: Produce L1 Extra tree
// class declaration
//

class L1MenuTreeProducer : public edm::EDAnalyzer {
class L1MenuTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit L1MenuTreeProducer(const edm::ParameterSet&);
~L1MenuTreeProducer() override;

private:
void beginJob(void) override;
void beginRun(const edm::Run&, const edm::EventSetup&) override;
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endRun(const edm::Run&, const edm::EventSetup&) override {}
void endJob() override;

public:
L1Analysis::L1AnalysisL1Menu* l1Menu;
Expand All @@ -73,6 +69,8 @@ class L1MenuTreeProducer : public edm::EDAnalyzer {
L1MenuTreeProducer::L1MenuTreeProducer(const edm::ParameterSet& iConfig)
: // l1MenuInputTag_(iConfig.getParameter<edm::InputTag>("L1MenuInputTag")),
l1GtUtils_(iConfig, consumesCollector(), true, L1GtUtils::UseEventSetupIn::Event) {
usesResource(TFileService::kSharedResource);

l1Menu = new L1Analysis::L1AnalysisL1Menu();
l1MenuData = l1Menu->getData();

Expand Down Expand Up @@ -107,16 +105,5 @@ void L1MenuTreeProducer::analyze(const edm::Event& iEvent, const edm::EventSetup
tree_->Fill();
}

// ------------ method called once each job just before starting event loop ------------
void L1MenuTreeProducer::beginJob(void) {}

void L1MenuTreeProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& evSetup) {
// L1GtTriggerMenuLite input tag from provenance
//l1GtUtils_.getL1GtRunCache(iRun, evSetup, true, true);
}

// ------------ method called once each job just after ending the event loop ------------
void L1MenuTreeProducer::endJob() {}

//define this as a plug-in
DEFINE_FWK_MODULE(L1MenuTreeProducer);
6 changes: 4 additions & 2 deletions L1Trigger/L1TNtuples/plugins/L1MetFilterRecoTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// framework
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down Expand Up @@ -45,7 +45,7 @@
// class declaration
//

class L1MetFilterRecoTreeProducer : public edm::EDAnalyzer {
class L1MetFilterRecoTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit L1MetFilterRecoTreeProducer(const edm::ParameterSet&);
~L1MetFilterRecoTreeProducer() override;
Expand Down Expand Up @@ -87,6 +87,8 @@ L1MetFilterRecoTreeProducer::L1MetFilterRecoTreeProducer(const edm::ParameterSet
: triggerResultsMissing_(false)
//hbheNoiseFilterResultMissing_(false)
{
usesResource(TFileService::kSharedResource);

triggerResultsToken_ = consumes<edm::TriggerResults>(
iConfig.getUntrackedParameter("triggerResultsToken", edm::InputTag("TriggerResults")));

Expand Down
5 changes: 3 additions & 2 deletions L1Trigger/L1TNtuples/plugins/L1RecoTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// framework
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -38,7 +38,7 @@
// class declaration
//

class L1RecoTreeProducer : public edm::EDAnalyzer {
class L1RecoTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit L1RecoTreeProducer(const edm::ParameterSet&);
~L1RecoTreeProducer() override;
Expand Down Expand Up @@ -72,6 +72,7 @@ L1RecoTreeProducer::L1RecoTreeProducer(const edm::ParameterSet& iConfig) {

vtxData_ = new L1Analysis::L1AnalysisRecoVertexDataFormat();

usesResource(TFileService::kSharedResource);
// set up output
tree_ = fs_->make<TTree>("RecoTree", "RecoTree");
tree_->Branch("Vertex", "L1Analysis::L1AnalysisRecoVertexDataFormat", &vtxData_, 32000, 3);
Expand Down
5 changes: 3 additions & 2 deletions L1Trigger/L1TNtuples/plugins/L1TauRecoTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// framework
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down Expand Up @@ -59,7 +59,7 @@
// class declaration
//

class L1TauRecoTreeProducer : public edm::EDAnalyzer {
class L1TauRecoTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit L1TauRecoTreeProducer(const edm::ParameterSet&);
~L1TauRecoTreeProducer() override;
Expand Down Expand Up @@ -173,6 +173,7 @@ L1TauRecoTreeProducer::L1TauRecoTreeProducer(const edm::ParameterSet& iConfig) :
tau = new L1Analysis::L1AnalysisRecoTau();
tau_data = tau->getData();

usesResource(TFileService::kSharedResource);
/*
// set up output
*/
Expand Down

0 comments on commit 4147990

Please sign in to comment.