CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1uGTTreeProducer Class Reference
Inheritance diagram for L1uGTTreeProducer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1uGTTreeProducer (edm::ParameterSet const &)
 
 ~L1uGTTreeProducer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

unsigned long long cache_id_
 
edm::Service< TFileServicefs_
 
const GlobalAlgBlkresults_
 
TTree * tree_
 
const edm::EDGetTokenT< GlobalAlgBlkBxCollectionugt_token_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 28 of file L1uGTTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1uGTTreeProducer()

L1uGTTreeProducer::L1uGTTreeProducer ( edm::ParameterSet const &  config)
explicit

Definition at line 55 of file L1uGTTreeProducer.cc.

56  : results_(nullptr),
57  tree_(nullptr),
58  ugt_token_(consumes<GlobalAlgBlkBxCollection>(config.getParameter<edm::InputTag>("ugtToken"))),
59  cache_id_(0) {
60  // set up the TTree and its branches
61  tree_ = fs_->make<TTree>("L1uGTTree", "L1uGTTree");
62  tree_->Branch("L1uGT", "GlobalAlgBlk", &results_, 32000, 3);
63 }

References fs_, TFileService::make(), results_, and tree_.

◆ ~L1uGTTreeProducer()

L1uGTTreeProducer::~L1uGTTreeProducer ( )
override

Definition at line 65 of file L1uGTTreeProducer.cc.

65  {
66  //if (tree_) { delete tree_; tree_ = NULL; }
67  //if (results_) { delete results_; results_ = NULL; } // It seems TTree owns this pointer...
68 }

Member Function Documentation

◆ analyze()

void L1uGTTreeProducer::analyze ( edm::Event const &  event,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 75 of file L1uGTTreeProducer.cc.

75  {
76  unsigned long long id = setup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
77  if (id != cache_id_) {
78  cache_id_ = id;
81 
82  for (auto const &keyval : menu->getAlgorithmMap()) {
83  std::string const &name = keyval.second.getName();
84  unsigned int index = keyval.second.getIndex();
85  //std::cerr << (boost::format("bit %4d: %s") % index % name).str() << std::endl;
86  tree_->SetAlias(name.c_str(), (boost::format("L1uGT.m_algoDecisionInitial[%d]") % index).str().c_str());
87  }
88  }
89 
91 
92  event.getByToken(ugt_token_, ugt);
93 
94  if (ugt.isValid()) {
95  results_ = &ugt->at(0, 0);
96  }
97 
98  tree_->Fill();
99 }

References BXVector< T >::at(), cache_id_, dqm-mbProfile::format, get, triggerObjects_cff::id, edm::HandleBase::isValid(), optionsL1T::menu, Skims_PA_cff::name, results_, singleTopDQM_cfi::setup, str, AlCaHLTBitMon_QueryRunRegistry::string, tree_, and ugt_token_.

◆ beginJob()

void L1uGTTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 102 of file L1uGTTreeProducer.cc.

102 {}

◆ endJob()

void L1uGTTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 105 of file L1uGTTreeProducer.cc.

105 {}

Member Data Documentation

◆ cache_id_

unsigned long long L1uGTTreeProducer::cache_id_
private

Definition at line 52 of file L1uGTTreeProducer.cc.

Referenced by analyze().

◆ fs_

edm::Service<TFileService> L1uGTTreeProducer::fs_
private

Definition at line 40 of file L1uGTTreeProducer.cc.

Referenced by L1uGTTreeProducer().

◆ results_

const GlobalAlgBlk* L1uGTTreeProducer::results_
private

Definition at line 43 of file L1uGTTreeProducer.cc.

Referenced by analyze(), and L1uGTTreeProducer().

◆ tree_

TTree* L1uGTTreeProducer::tree_
private

Definition at line 46 of file L1uGTTreeProducer.cc.

Referenced by analyze(), and L1uGTTreeProducer().

◆ ugt_token_

const edm::EDGetTokenT<GlobalAlgBlkBxCollection> L1uGTTreeProducer::ugt_token_
private

Definition at line 49 of file L1uGTTreeProducer.cc.

Referenced by analyze().

L1TUtmTriggerMenuRcd
Definition: L1TUtmTriggerMenuRcd.h:11
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
config
Definition: config.py:1
L1uGTTreeProducer::results_
const GlobalAlgBlk * results_
Definition: L1uGTTreeProducer.cc:43
dqm-mbProfile.format
format
Definition: dqm-mbProfile.py:16
str
#define str(s)
Definition: TestProcessor.cc:48
edm::ESHandle
Definition: DTSurvey.h:22
L1uGTTreeProducer::ugt_token_
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugt_token_
Definition: L1uGTTreeProducer.cc:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
optionsL1T.menu
menu
Definition: optionsL1T.py:29
BXVector::at
const T & at(int bx, unsigned i) const
get
#define get
L1uGTTreeProducer::cache_id_
unsigned long long cache_id_
Definition: L1uGTTreeProducer.cc:52
L1uGTTreeProducer::fs_
edm::Service< TFileService > fs_
Definition: L1uGTTreeProducer.cc:40
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
L1uGTTreeProducer::tree_
TTree * tree_
Definition: L1uGTTreeProducer.cc:46
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64