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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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_
 
GlobalAlgBlk const * results_
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 28 of file L1uGTTreeProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 58 of file L1uGTTreeProducer.cc.

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

58  :
59  results_(nullptr), tree_(nullptr),
60  ugt_token_( consumes<GlobalAlgBlkBxCollection>(config.getParameter<edm::InputTag>("ugtToken"))),
61  cache_id_( 0 )
62 {
63  // set up the TTree and its branches
64  tree_ = fs_->make<TTree>("L1uGTTree", "L1uGTTree");
65  tree_->Branch("L1uGT", "GlobalAlgBlk", & results_, 32000, 3);
66 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
Definition: config.py:1
GlobalAlgBlk const * results_
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugt_token_
unsigned long long cache_id_
edm::Service< TFileService > fs_
L1uGTTreeProducer::~L1uGTTreeProducer ( )
override

Definition at line 69 of file L1uGTTreeProducer.cc.

70 {
71  //if (tree_) { delete tree_; tree_ = NULL; }
72  //if (results_) { delete results_; results_ = NULL; } // It seems TTree owns this pointer...
73 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 82 of file L1uGTTreeProducer.cc.

References BXVector< T >::at(), cache_id_, cmsPerfStripChart::format, edm::EventSetup::get(), L1TUtmTriggerMenu::getAlgorithmMap(), triggerObjects_cff::id, edm::HandleBase::isValid(), dataset::name, results_, str, AlCaHLTBitMon_QueryRunRegistry::string, tree_, and ugt_token_.

83 {
84  unsigned long long id = setup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
85  if (id != cache_id_) {
86  cache_id_ = id;
88  setup.get<L1TUtmTriggerMenuRcd>().get(menu);
89 
90  for (auto const & keyval: menu->getAlgorithmMap()) {
91  std::string const & name = keyval.second.getName();
92  unsigned int index = keyval.second.getIndex();
93  //std::cerr << (boost::format("bit %4d: %s") % index % name).str() << std::endl;
94  tree_->SetAlias(name.c_str(), (boost::format("L1uGT.m_algoDecisionInitial[%d]") % index).str().c_str());
95  }
96  }
97 
99 
100  event.getByToken(ugt_token_, ugt);
101 
102  if (ugt.isValid()) {
103  results_ = & ugt->at(0, 0);
104  }
105 
106  tree_->Fill();
107 }
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
GlobalAlgBlk const * results_
format
Some error handling for the usage.
bool isValid() const
Definition: HandleBase.h:74
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugt_token_
unsigned long long cache_id_
const std::map< std::string, L1TUtmAlgorithm > & getAlgorithmMap() const
#define str(s)
const T & at(int bx, unsigned i) const
void L1uGTTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 111 of file L1uGTTreeProducer.cc.

112 {
113 }
void L1uGTTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file L1uGTTreeProducer.cc.

References DEFINE_FWK_MODULE.

117  {
118 }

Member Data Documentation

unsigned long long L1uGTTreeProducer::cache_id_
private

Definition at line 53 of file L1uGTTreeProducer.cc.

Referenced by analyze().

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

Definition at line 41 of file L1uGTTreeProducer.cc.

Referenced by L1uGTTreeProducer().

GlobalAlgBlk const* L1uGTTreeProducer::results_
private

Definition at line 44 of file L1uGTTreeProducer.cc.

Referenced by analyze(), and L1uGTTreeProducer().

TTree* L1uGTTreeProducer::tree_
private

Definition at line 47 of file L1uGTTreeProducer.cc.

Referenced by analyze(), and L1uGTTreeProducer().

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

Definition at line 50 of file L1uGTTreeProducer.cc.

Referenced by analyze().