CMS 3D CMS Logo

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

Public Member Functions

 L1uGTTreeProducer (edm::ParameterSet const &)
 
 ~L1uGTTreeProducer () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcdl1GtMenuToken_
 
GlobalAlgBlk const * results_
 
TTree * tree_
 
const edm::EDGetTokenT< GlobalAlgBlkBxCollectionugtToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 28 of file L1uGTTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1uGTTreeProducer()

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

Definition at line 56 of file L1uGTTreeProducer.cc.

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

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

◆ ~L1uGTTreeProducer()

L1uGTTreeProducer::~L1uGTTreeProducer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 73 of file L1uGTTreeProducer.cc.

References BXVector< T >::at(), cache_id_, l1ctLayer2EG_cff::id, edm::HandleBase::isValid(), l1GtMenuToken_, optionsL1T::menu, Skims_PA_cff::name, edm::Handle< T >::product(), results_, singleTopDQM_cfi::setup, BXVector< T >::size(), AlCaHLTBitMon_QueryRunRegistry::string, tree_, and ugtToken_.

73  {
74  unsigned long long id = setup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
75  if (id != cache_id_) {
76  cache_id_ = id;
78  menu = setup.getHandle(l1GtMenuToken_);
79 
80  for (auto const &keyval : menu->getAlgorithmMap()) {
81  std::string const &name = keyval.second.getName();
82  unsigned int index = keyval.second.getIndex();
83  //std::cerr << fmt::sprintf("bit %4d: %s", index, name) << std::endl;
84  tree_->SetAlias(name.c_str(), fmt::sprintf("L1uGT.m_algoDecisionInitial[%d]", index).c_str());
85  }
86  }
87 
89  event.getByToken(ugtToken_, ugt);
90  if (ugt.isValid() && ugt.product()->size() != 0) {
91  results_ = &ugt->at(0, 0);
92  } else {
93  edm::LogWarning("MissingProduct")
94  << "L1uGTTree or L1uGTTestcrateTree GlobalAlgBlkBxCollection not found. Branch will not be filled.\n"
95  << "Please note that the L1uGTTestcrateTree is not expected to exist in MC, so this warning can be ignored!"
96  << std::endl;
97  }
98 
99  tree_->Fill();
100 }
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > l1GtMenuToken_
T const * product() const
Definition: Handle.h:70
GlobalAlgBlk const * results_
unsigned size(int bx) const
const T & at(int bx, unsigned i) const
unsigned long long cache_id_
bool isValid() const
Definition: HandleBase.h:70
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > ugtToken_
Log< level::Warning, false > LogWarning

◆ beginJob()

void L1uGTTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 103 of file L1uGTTreeProducer.cc.

103 {}

◆ endJob()

void L1uGTTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 106 of file L1uGTTreeProducer.cc.

106 {}

Member Data Documentation

◆ cache_id_

unsigned long long L1uGTTreeProducer::cache_id_
private

Definition at line 53 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().

◆ l1GtMenuToken_

const edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd> L1uGTTreeProducer::l1GtMenuToken_
private

Definition at line 50 of file L1uGTTreeProducer.cc.

Referenced by analyze().

◆ results_

GlobalAlgBlk const* 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().

◆ ugtToken_

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

Definition at line 49 of file L1uGTTreeProducer.cc.

Referenced by analyze().