#include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtPatternGenerator.h"
#include <memory>
#include <iomanip>
#include <fstream>
#include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCollections.h"
#include "DataFormats/L1GlobalCaloTrigger/interface/L1GctHtMiss.h"
#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTCand.h"
#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GtFdlWord.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
#include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtPatternMap.h"
#include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtPatternWriter.h"
Go to the source code of this file.
Functions | |
static std::vector< uint32_t > | chopWords (const std::vector< bool > &aWord) |
static void | extractGlobalTriggerWord (const std::vector< bool > input, L1GtPatternLine &line, const std::string &prefix) |
template<class TRecord , typename TResult > | |
static void | extractRecordData (const edm::Event &iEvent, L1GtPatternMap &allPatterns, const std::string &label, const std::string &instance, TResult(TRecord::*rawFunctionPtr)() const, const std::string &prefix, uint32_t(*packingFunction)(uint32_t)=NULL) |
static std::vector<uint32_t> chopWords | ( | const std::vector< bool > & | aWord | ) | [static] |
Definition at line 135 of file L1GtPatternGenerator.cc.
References i, and query::result.
Referenced by extractGlobalTriggerWord().
static void extractGlobalTriggerWord | ( | const std::vector< bool > | input, |
L1GtPatternLine & | line, | ||
const std::string & | prefix | ||
) | [static] |
Split a vector<bool> of arbitrary size into uint32_t chunks and add them to a pattern file line with the given prefix.
Definition at line 150 of file L1GtPatternGenerator.cc.
References chopWords(), i, and L1GtPatternLine::push().
Referenced by L1GtPatternGenerator::extractGlobalTriggerData().
static void extractRecordData | ( | const edm::Event & | iEvent, |
L1GtPatternMap & | allPatterns, | ||
const std::string & | label, | ||
const std::string & | instance, | ||
TResult(TRecord::*)() const | rawFunctionPtr, | ||
const std::string & | prefix, | ||
uint32_t(*)(uint32_t) | packingFunction = NULL |
||
) | [static] |
Actual data extraction. The template parameters are neccessary because we have to handle multiple unrelated record types and call member functions of varying return type, but note that they don't need to be specified in practice because the rawFunctionPtr parameter defines them anyway.
iEvent | The event to get the records from. |
allPatterns | Destination object |
label | First half of the input tag that identifies our source in the event |
instance | Second half of the input tag that identifies our source in the event |
rawFunctionPtr | Pointer-to-member-function that specifies a getter function that extracts the information we want from the record object. |
prefix | The column name prefix that defines how the columns in the pattern map will be named ( |
packingFunction | an optional function that the raw value is passed through befor it is added to the pattern line |
Definition at line 98 of file L1GtPatternGenerator.cc.
References edm::EventID::event(), Exception, edm::Event::getByLabel(), L1GtPatternMap::getLine(), patZpeak::handle, edm::EventBase::id(), edm::HandleBase::isValid(), geometryCSVtoXML::line, AlCaRecoCosmics_cfg::name, NULL, L1GtPatternLine::push(), and relativeConstraints::value.
Referenced by L1GtPatternGenerator::analyze().
{ uint32_t valueCount; // Extract record from event. edm::Handle<std::vector<TRecord> > handle; iEvent.getByLabel(label, instance, handle); if(!handle.isValid()) { throw cms::Exception(__func__) << "Failed to extract record of type " << typeid(TRecord).name() << " labeled " << label << ", instance " << instance; } edm::EventNumber_t eventNr = iEvent.id().event(); // Then loop over collection and add each event to the map. for(typename std::vector<TRecord>::const_iterator it = handle->begin(); it != handle->end(); ++it) { int bx = it->bx(); L1GtPatternLine& line = allPatterns.getLine(eventNr, bx); uint32_t value = ((*it).*rawFunctionPtr)(); if(packingFunction != NULL) { value = packingFunction(value); } line.push(prefix, value); ++valueCount; } }