CMS 3D CMS Logo

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

Public Member Functions

 L1O2OTestAnalyzerExt (const edm::ParameterSet &)
 
 ~L1O2OTestAnalyzerExt () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 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 (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcdl1TriggerKeyExtToken_
 
bool m_printESRecords
 
bool m_printL1TriggerKeyExt
 
bool m_printL1TriggerKeyListExt
 
bool m_printPayloadTokens
 
std::vector< std::string > m_recordsToPrint
 

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 L1O2OTestAnalyzerExt.cc.

Constructor & Destructor Documentation

◆ L1O2OTestAnalyzerExt()

L1O2OTestAnalyzerExt::L1O2OTestAnalyzerExt ( const edm::ParameterSet iConfig)
explicit

Definition at line 47 of file L1O2OTestAnalyzerExt.cc.

References edm::EDConsumerBase::esConsumes(), and l1TriggerKeyExtToken_.

48  : m_printL1TriggerKeyExt(iConfig.getParameter<bool>("printL1TriggerKeyExt")),
49  m_printL1TriggerKeyListExt(iConfig.getParameter<bool>("printL1TriggerKeyListExt")),
50  m_printESRecords(iConfig.getParameter<bool>("printESRecords")),
51  m_printPayloadTokens(iConfig.getParameter<bool>("printPayloadTokens")),
52  m_recordsToPrint(iConfig.getParameter<std::vector<std::string> >("recordsToPrint")) {
53  //now do what ever initialization is needed
55 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< std::string > m_recordsToPrint
edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcd > l1TriggerKeyExtToken_

◆ ~L1O2OTestAnalyzerExt()

L1O2OTestAnalyzerExt::~L1O2OTestAnalyzerExt ( )
override

Definition at line 57 of file L1O2OTestAnalyzerExt.cc.

57  {
58  // do anything here that needs to be done at desctruction time
59  // (e.g. close files, deallocate resources etc.)
60 }

Member Function Documentation

◆ analyze()

void L1O2OTestAnalyzerExt::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 63 of file L1O2OTestAnalyzerExt.cc.

References l1t::DataWriterExt::fillLastTriggerKeyList(), edm::EventSetup::getHandle(), iEvent, crabWrapper::key, L1TriggerKeyExt::kuGT, l1TriggerKeyExtToken_, dqm-mbProfile::log, m_printESRecords, m_printL1TriggerKeyExt, m_printL1TriggerKeyListExt, m_printPayloadTokens, m_recordsToPrint, L1TriggerKeyListExt::objectKey(), L1TriggerKeyExt::recordToKeyMap(), L1TriggerKeyListExt::recordTypeToKeyToTokenMap(), python.rootplot.root2matplotlib::replace(), writedatasetfile::run, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, L1TriggerKeyExt::subsystemKey(), L1TriggerKeyListExt::tscKey(), L1TriggerKeyExt::tscKey(), L1TriggerKeyListExt::tscKeyToTokenMap(), and convertToRaw::writer.

63  {
64  using namespace edm;
65 
67  // ESHandle< L1TriggerKeyListExt > pList ;
68  // iSetup.get< L1TriggerKeyListExtRcd >().get( pList ) ;
69  L1TriggerKeyListExt pList;
70  l1t::DataWriterExt dataWriter;
71  if (!dataWriter.fillLastTriggerKeyList(pList)) {
72  edm::LogError("L1-O2O") << "Problem getting last L1TriggerKeyListExt";
73  }
74 
75  edm::LogInfo("L1-O2O") << "Found " << pList.tscKeyToTokenMap().size() << " TSC keys:";
76 
77  L1TriggerKeyListExt::KeyToToken::const_iterator iTSCKey = pList.tscKeyToTokenMap().begin();
78  L1TriggerKeyListExt::KeyToToken::const_iterator eTSCKey = pList.tscKeyToTokenMap().end();
79  for (; iTSCKey != eTSCKey; ++iTSCKey) {
80  edm::LogInfo("L1-O2O") << iTSCKey->first;
82  edm::LogInfo("L1-O2O") << " " << iTSCKey->second;
83  }
84  }
85 
86  L1TriggerKeyListExt::RecordToKeyToToken::const_iterator iRec = pList.recordTypeToKeyToTokenMap().begin();
87  L1TriggerKeyListExt::RecordToKeyToToken::const_iterator eRec = pList.recordTypeToKeyToTokenMap().end();
88  for (; iRec != eRec; ++iRec) {
89  const L1TriggerKeyListExt::KeyToToken& keyTokenMap = iRec->second;
90  edm::LogInfo("L1-O2O") << "For record@type " << iRec->first << ", found " << keyTokenMap.size() << " keys:";
91 
92  L1TriggerKeyListExt::KeyToToken::const_iterator iKey = keyTokenMap.begin();
93  L1TriggerKeyListExt::KeyToToken::const_iterator eKey = keyTokenMap.end();
94  for (; iKey != eKey; ++iKey) {
95  edm::LogInfo("L1-O2O") << iKey->first;
97  edm::LogInfo("L1-O2O") << " " << iKey->second;
98  }
99  }
100  }
101  }
102 
104  try {
106 
107  edm::LogInfo("L1-O2O") << "Current TSC key = " << pKey->tscKey();
108 
109  edm::LogInfo("L1-O2O") << "Current subsystem keys:";
110  edm::LogInfo("L1-O2O") << "TSP0 " << pKey->subsystemKey(L1TriggerKeyExt::kuGT);
111 
112  edm::LogInfo("L1-O2O") << "Object keys:";
113  const L1TriggerKeyExt::RecordToKey& recKeyMap = pKey->recordToKeyMap();
114  L1TriggerKeyExt::RecordToKey::const_iterator iRec = recKeyMap.begin();
115  L1TriggerKeyExt::RecordToKey::const_iterator eRec = recKeyMap.end();
116  for (; iRec != eRec; ++iRec) {
117  edm::LogInfo("L1-O2O") << iRec->first << " " << iRec->second;
118  }
119  } catch (cms::Exception& ex) {
120  edm::LogInfo("L1-O2O") << "No L1TriggerKeyExt found.";
121  }
122  }
123 
124  if (m_printESRecords) {
125  L1TriggerKeyListExt pList;
126  l1t::DataWriterExt dataWriter;
127  if (!dataWriter.fillLastTriggerKeyList(pList)) {
128  edm::LogError("L1-O2O") << "Problem getting last L1TriggerKeyListExt";
129  }
130 
131  // Start log string, convert run number into string
132  unsigned long long run = iEvent.id().run();
133  std::stringstream ss;
134  ss << run;
135  std::string log = "runNumber=" + ss.str();
136 
138 
139  edm::LogInfo("L1-O2O") << "Run Settings keys:";
140 
141  std::vector<std::string>::const_iterator iRec = m_recordsToPrint.begin();
142  std::vector<std::string>::const_iterator iEnd = m_recordsToPrint.end();
143  for (; iRec != iEnd; ++iRec) {
144  std::string payloadToken = writer.payloadToken(*iRec, iEvent.id().run());
146 
147  if (*iRec == "L1TriggerKeyExtRcd") {
148  key = pList.tscKey(payloadToken);
149  } else {
150  key = pList.objectKey(*iRec, payloadToken);
151  }
152 
153  edm::LogInfo("L1-O2O") << *iRec << " " << key;
154  if (m_printPayloadTokens) {
155  edm::LogInfo("L1-O2O") << " " << payloadToken;
156  }
157 
158  // Replace spaces in key with ?s. Do reverse substitution when
159  // making L1TriggerKeyExt.
160  replace(key.begin(), key.end(), ' ', '?');
161  log += " " + *iRec + "Key=" + key;
162  }
163 
164  edm::LogInfo("L1-O2O") << log;
165  }
166 }
const std::string & tscKey() const
const std::string & subsystemKey(L1Subsystems subsystem) const
bool fillLastTriggerKeyList(L1TriggerKeyListExt &output)
std::string tscKey(const std::string &triggerKeyPayloadToken) const
const RecordToKey & recordToKeyMap() const
def replace(string, replacements)
std::vector< std::string > m_recordsToPrint
Log< level::Error, false > LogError
int iEvent
Definition: GenABIO.cc:224
const RecordToKeyToToken & recordTypeToKeyToTokenMap() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
std::map< std::string, std::string > RecordToKey
Log< level::Info, false > LogInfo
const KeyToToken & tscKeyToTokenMap() const
HLT enums.
std::string objectKey(const std::string &recordName, const std::string &payloadToken) const
std::map< std::string, std::string > KeyToToken
edm::ESGetToken< L1TriggerKeyExt, L1TriggerKeyExtRcd > l1TriggerKeyExtToken_

◆ beginJob()

void L1O2OTestAnalyzerExt::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 169 of file L1O2OTestAnalyzerExt.cc.

169 {}

◆ endJob()

void L1O2OTestAnalyzerExt::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 172 of file L1O2OTestAnalyzerExt.cc.

172 {}

Member Data Documentation

◆ l1TriggerKeyExtToken_

edm::ESGetToken<L1TriggerKeyExt, L1TriggerKeyExtRcd> L1O2OTestAnalyzerExt::l1TriggerKeyExtToken_
private

Definition at line 44 of file L1O2OTestAnalyzerExt.cc.

Referenced by analyze(), and L1O2OTestAnalyzerExt().

◆ m_printESRecords

bool L1O2OTestAnalyzerExt::m_printESRecords
private

Definition at line 41 of file L1O2OTestAnalyzerExt.cc.

Referenced by analyze().

◆ m_printL1TriggerKeyExt

bool L1O2OTestAnalyzerExt::m_printL1TriggerKeyExt
private

Definition at line 39 of file L1O2OTestAnalyzerExt.cc.

Referenced by analyze().

◆ m_printL1TriggerKeyListExt

bool L1O2OTestAnalyzerExt::m_printL1TriggerKeyListExt
private

Definition at line 40 of file L1O2OTestAnalyzerExt.cc.

Referenced by analyze().

◆ m_printPayloadTokens

bool L1O2OTestAnalyzerExt::m_printPayloadTokens
private

Definition at line 42 of file L1O2OTestAnalyzerExt.cc.

Referenced by analyze().

◆ m_recordsToPrint

std::vector<std::string> L1O2OTestAnalyzerExt::m_recordsToPrint
private

Definition at line 43 of file L1O2OTestAnalyzerExt.cc.

Referenced by analyze().