CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

unsigned long long cache_id_
 
edm::Service< TFileServicefs_
 
GlobalAlgBlk const * results_
 
TTree * tree_
 
const edm::EDGetTokenT
< GlobalAlgBlkBxCollection
ugt_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 &)
 
- 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  :
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 }
#define NULL
Definition: scimark2.h:8
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
GlobalAlgBlk const * results_
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugt_token_
unsigned long long cache_id_
edm::Service< TFileService > fs_
L1uGTTreeProducer::~L1uGTTreeProducer ( )

Definition at line 69 of file L1uGTTreeProducer.cc.

References NULL, and tree_.

70 {
71  if (tree_) { delete tree_; tree_ = NULL; }
72  //if (results_) { delete results_; results_ = NULL; } // It seems TTree owns this pointer...
73 }
#define NULL
Definition: scimark2.h:8

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 cache_id_, cmsPerfStripChart::format, edm::EventSetup::get(), cmsHarvester::index, relval_steps::menu, mergeVDriftHistosByStation::name, results_, 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  results_ = & ugt->at(0, 0);
102  tree_->Fill();
103 }
string format
Some error handling for the usage.
GlobalAlgBlk const * results_
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugt_token_
unsigned long long cache_id_
void L1uGTTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 107 of file L1uGTTreeProducer.cc.

108 {
109 }
void L1uGTTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 113 of file L1uGTTreeProducer.cc.

113  {
114 }

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(), L1uGTTreeProducer(), and ~L1uGTTreeProducer().

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

Definition at line 50 of file L1uGTTreeProducer.cc.

Referenced by analyze().