** Warning **
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=lxr at /lxr/lib/LXR/Common.pm line 1113.
Last-Modified: Thu, 30 Apr 2025 02:33:22 GMT
Content-Type: text/html; charset=utf-8
/CMSSW_15_1_X_2025-04-29-2300/L1Trigger/L1TNtuples/plugins/L1UpgradeTfMuonShowerTreeProducer.cc
File indexing completed on 2024-04-06 12:21:14
0001
0002 #include <memory>
0003
0004
0005 #include "FWCore /Framework /interface /Frameworkfwd.h "
0006 #include "FWCore /Framework /interface /one /EDAnalyzer.h "
0007 #include "FWCore /Framework /interface /Event.h "
0008 #include "FWCore /Framework /interface /MakerMacros.h "
0009 #include "FWCore /ParameterSet /interface /ParameterSet.h "
0010 #include "FWCore /MessageLogger /interface /MessageLogger.h "
0011
0012
0013 #include "DataFormats /L1TMuon /interface /RegionalMuonShower.h "
0014
0015
0016 #include "FWCore /ServiceRegistry /interface /Service.h "
0017 #include "CommonTools /UtilAlgos /interface /TFileService.h "
0018 #include "TTree.h"
0019
0020 #include "L1Trigger /L1TNtuples /interface /L1AnalysisL1UpgradeTfMuonShower.h "
0021
0022
0023
0024
0025
0026 class L1UpgradeTfMuonShowerTreeProducer : public edm ::one ::EDAnalyzer <edm ::one ::SharedResources > {
0027 public :
0028 explicit L1UpgradeTfMuonShowerTreeProducer (const edm ::ParameterSet &);
0029 ~L1UpgradeTfMuonShowerTreeProducer() override = default ;
0030
0031 private :
0032 void beginJob (void ) override ;
0033 void analyze (const edm ::Event &, const edm ::EventSetup &) override ;
0034 void endJob () override ;
0035
0036 public :
0037 L1Analysis ::L1AnalysisL1UpgradeTfMuonShower l1UpgradeEmtf ;
0038 L1Analysis ::L1AnalysisL1UpgradeTfMuonShowerDataFormat * l1UpgradeEmtfData ;
0039
0040 private :
0041 unsigned maxL1UpgradeTfMuonShower_ ;
0042
0043
0044 edm ::Service <TFileService > fs_ ;
0045
0046
0047 TTree * tree_ ;
0048
0049
0050 edm ::EDGetTokenT <l1t ::RegionalMuonShowerBxCollection > emtfMuonShowerToken_ ;
0051 };
0052
0053 L1UpgradeTfMuonShowerTreeProducer ::L1UpgradeTfMuonShowerTreeProducer (const edm ::ParameterSet & iConfig ) {
0054 emtfMuonShowerToken_ = consumes <l1t ::RegionalMuonShowerBxCollection >(
0055 iConfig .getUntrackedParameter <edm ::InputTag >("emtfMuonShowerToken" ));
0056
0057 maxL1UpgradeTfMuonShower_ = iConfig .getParameter <unsigned int >("maxL1UpgradeTfMuonShower" );
0058
0059 l1UpgradeEmtfData = l1UpgradeEmtf .getData ();
0060
0061 usesResource (TFileService ::kSharedResource );
0062
0063
0064 tree_ = fs_ ->make <TTree >("L1UpgradeTfMuonShowerTree" , "L1UpgradeTfMuonShowerTree" );
0065 tree_ ->Branch (
0066 "L1UpgradeEmtfMuonShower" , "L1Analysis::L1AnalysisL1UpgradeTfMuonShowerDataFormat" , &l1UpgradeEmtfData , 32000, 3);
0067 }
0068
0069
0070
0071
0072
0073
0074 void L1UpgradeTfMuonShowerTreeProducer ::analyze (const edm ::Event & iEvent , const edm ::EventSetup & iSetup ) {
0075 l1UpgradeEmtf .Reset ();
0076
0077 edm ::Handle <l1t ::RegionalMuonShowerBxCollection > emtfMuonShower ;
0078
0079 iEvent .getByToken (emtfMuonShowerToken_ , emtfMuonShower );
0080
0081 if (emtfMuonShower .isValid ()) {
0082 l1UpgradeEmtf .SetTfMuonShower (*emtfMuonShower , maxL1UpgradeTfMuonShower_ );
0083 } else {
0084 edm ::LogWarning ("MissingProduct" ) << "L1Upgrade EMTF muons not found. Branch will not be filled" << std ::endl ;
0085 }
0086
0087 tree_ ->Fill ();
0088 }
0089
0090
0091 void L1UpgradeTfMuonShowerTreeProducer ::beginJob (void ) {}
0092
0093
0094 void L1UpgradeTfMuonShowerTreeProducer ::endJob () {}
0095
0096
0097 DEFINE_FWK_MODULE (L1UpgradeTfMuonShowerTreeProducer );