61 if(m_columnLengths.size() != m_columnNames.size()) {
63 <<
"Length of PatternFileColumns does not match length of PatternFileLenghts, " <<
64 m_columnNames.size() <<
" vs " << m_columnLengths.size() << std::endl;
68 <<
"\nL1 GCT record: "
70 <<
"\nL1 GMT record: "
73 << m_gtTag << std::endl;
100 const std::string&
label,
102 TResult (TRecord::*rawFunctionPtr)()
const,
103 const std::string&
prefix,
104 uint32_t (*packingFunction)(uint32_t) =
NULL)
113 throw cms::Exception(__func__) <<
"Failed to extract record of type " <<
typeid(TRecord).
name() <<
114 " labeled " << label <<
", instance " <<
instance;
120 for(
typename std::vector<TRecord>::const_iterator it = handle->begin(); it != handle->end(); ++it) {
123 uint32_t
value = ((*it).*rawFunctionPtr)();
124 if(packingFunction !=
NULL) {
125 value = packingFunction(value);
128 line.
push(prefix, value);
135 static std::vector<uint32_t>
chopWords(
const std::vector<bool>& aWord) {
136 std::vector<uint32_t>
result;
138 result.resize((aWord.size()+31)/32, 0);
140 for(
unsigned i = 0 ;
i < aWord.size(); ++
i) {
141 result[
i/32] |= aWord[
i] << (
i%32);
152 std::vector<uint32_t> resultWords =
chopWords(input);
156 for(
unsigned i = resultWords.size() ;
i > 0; --
i) {
157 line.
push(prefix, resultWords[
i-1]);
165 uint32_t invertMask = 0x0000FF00;
166 uint32_t toKeep = rawData & (~invertMask);
167 return toKeep | (~rawData & invertMask);
180 throw cms::Exception(__func__) <<
"Failed to extract GT readout record labeled "
187 const std::vector<L1GtFdlWord>& fdlWords = handle->gtFdlVector();
188 for(std::vector<L1GtFdlWord>::const_iterator it = fdlWords.begin();
189 it != fdlWords.end() ; ++it) {
191 int bx = it->bxInEvent();
200 line.
push(
"gtFinalOr", it->finalOR());
210 for(L1GtPatternMap::LineMap::iterator it = allPatterns.
begin();
211 it != allPatterns.
end(); ++it) {
213 uint32_t counts = it->second.get(
"hfBitCounts1");
214 uint32_t sums = it->second.get(
"hfRingEtSums1");
218 uint32_t hfPsbValue = (counts & 0xFFF) |
226 it->second.push(resultName, hfPsbValue);
240 const unsigned int eventNumber = iEvent.
id().
event();
242 LogTrace(
"L1GtPatternGenerator") <<
"\n\nL1GtPatternGenerator::analyze: Run: " << runNumber <<
" LS: " << lsNumber <<
" Event: "
243 << eventNumber <<
"\n\n" << std::endl;
279 m_writer->writePatterns(allPatterns);
uint32_t raw() const
get the data
T getParameter(std::string const &) const
EventNumber_t event() const
L1GtPatternLine & getLine(int eventNr, int bxNr)
uint16_t raw() const
get the data
LineMap::const_iterator begin() const
edm::InputTag m_dtTag
input tags for regional muon data
virtual void endJob()
end of job
std::auto_ptr< L1GtPatternWriter > m_writer
uint16_t raw() const
get the raw data
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)
unsigned int EventNumber_t
static PFTauRenderPlugin instance
std::vector< uint32_t > m_columnDefaults
edm::LuminosityBlockNumber_t luminosityBlock() const
unsigned phi() const
get the Et
std::vector< uint32_t > m_columnLengths
edm::InputTag m_gmtTag
input tag for GMT data
void extractGlobalTriggerData(const edm::Event &iEvent, L1GtPatternMap &patterns)
unsigned getDataWord() const
get muon data word
std::string m_header
formatting instructions
std::string m_fileName
output file name
std::ofstream m_fileStream
unsigned getDataWord() const
return data word
LineMap::const_iterator end() const
edm::InputTag m_gctTag
input tag for GCT data
static void extractGlobalTriggerWord(const std::vector< bool > input, L1GtPatternLine &line, const std::string &prefix)
void packHfRecords(const std::string &resultName, L1GtPatternMap &allPatterns)
edm::InputTag m_gtTag
input tag for GT data
virtual void beginJob()
analyze
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void push(const std::string &prefix, boost::uint32_t value)
unsigned et() const
get the magnitude
L1GtPatternGenerator(const edm::ParameterSet &)
uint16_t raw() const
get the data
uint16_t raw() const
get the raw data
virtual void analyze(const edm::Event &, const edm::EventSetup &)
analyze each event
uint16_t raw() const
the raw data
static uint32_t packRegionalMuons(uint32_t rawValue)
static std::vector< uint32_t > chopWords(const std::vector< bool > &aWord)
uint16_t raw() const
get the raw data
std::vector< std::string > m_columnNames