40 edm::LogInfo(
"L1GtPackUnpackAnalyzer") <<
"\nInput tag for the initial GT DAQ record: "
42 <<
"\nInput tag for the initial GMT readout collection: "
43 << m_initialMuGmtInputTag <<
" \n"
44 <<
"\nInput tag for the final GT DAQ and GMT records: "
45 << m_finalGtGmtInputTag <<
" \n"
65 std::ostringstream myCoutStream;
71 if (!gtReadoutRecordInitial.
isValid()) {
72 edm::LogError(
"L1GtTrigReport") <<
"Initial L1GlobalTriggerReadoutRecord with input tag \n "
82 if (!gtReadoutRecordFinal.
isValid()) {
90 const L1GtfeWord& gtfeWordInitial = gtReadoutRecordInitial->gtfeWord();
91 const L1GtfeWord& gtfeWordFinal = gtReadoutRecordFinal->gtfeWord();
93 if (gtfeWordInitial == gtfeWordFinal) {
94 myCoutStream <<
"\nInitial and final GTFE blocks: identical.\n";
95 gtfeWordInitial.
print(myCoutStream);
97 myCoutStream <<
"\nInitial and final GTFE blocks: different.\n";
99 myCoutStream <<
"\nInitial GTFE block\n";
100 gtfeWordInitial.
print(myCoutStream);
102 myCoutStream <<
"\nFinal GTFE block\n";
103 gtfeWordFinal.
print(myCoutStream);
106 edm::LogInfo(
"L1GtPackUnpackAnalyzer") << myCoutStream.str() << std::endl;
108 myCoutStream.str(
"");
109 myCoutStream.clear();
112 const std::vector<L1GtFdlWord>& gtFdlVectorInitial = gtReadoutRecordInitial->gtFdlVector();
113 const std::vector<L1GtFdlWord>& gtFdlVectorFinal = gtReadoutRecordFinal->gtFdlVector();
115 int gtFdlVectorInitialSize = gtFdlVectorInitial.size();
116 int gtFdlVectorFinalSize = gtFdlVectorFinal.size();
118 if (gtFdlVectorInitialSize == gtFdlVectorFinalSize) {
119 myCoutStream <<
"\nInitial and final FDL vector size: identical.\n";
120 myCoutStream <<
" Size: " << gtFdlVectorInitialSize << std::endl;
122 for (
int iFdl = 0; iFdl < gtFdlVectorInitialSize; ++iFdl) {
123 const L1GtFdlWord& fdlWordInitial = gtFdlVectorInitial[iFdl];
124 const L1GtFdlWord& fdlWordFinal = gtFdlVectorFinal[iFdl];
126 if (fdlWordInitial == fdlWordFinal) {
127 myCoutStream <<
"\nInitial and final FDL blocks: identical.\n";
128 fdlWordInitial.
print(myCoutStream);
131 myCoutStream <<
"\nInitial and final FDL blocks: different.\n";
133 myCoutStream <<
"\nInitial FDL block\n";
134 fdlWordInitial.
print(myCoutStream);
136 myCoutStream <<
"\nFinal FDL block\n";
137 fdlWordFinal.
print(myCoutStream);
141 myCoutStream <<
"\nInitial and final FDL vector size: different.\n";
142 myCoutStream <<
" Initial size: " << gtFdlVectorInitialSize << std::endl;
143 myCoutStream <<
" Final size: " << gtFdlVectorFinalSize << std::endl;
146 edm::LogInfo(
"L1GtPackUnpackAnalyzer") << myCoutStream.str() << std::endl;
148 myCoutStream.str(
"");
149 myCoutStream.clear();
152 const std::vector<L1GtPsbWord>& gtPsbVectorInitial = gtReadoutRecordInitial->gtPsbVector();
153 const std::vector<L1GtPsbWord>& gtPsbVectorFinal = gtReadoutRecordFinal->gtPsbVector();
155 int gtPsbVectorInitialSize = gtPsbVectorInitial.size();
156 int gtPsbVectorFinalSize = gtPsbVectorFinal.size();
158 if (gtPsbVectorInitialSize == gtPsbVectorFinalSize) {
159 myCoutStream <<
"\nInitial and final PSB vector size: identical.\n";
160 myCoutStream <<
" Size: " << gtPsbVectorInitialSize << std::endl;
164 for (
int iPsb = 0; iPsb < gtPsbVectorInitialSize; ++iPsb) {
165 const L1GtPsbWord& psbWordInitial = gtPsbVectorInitial[iPsb];
166 const uint16_t boardIdInitial = psbWordInitial.
boardId();
167 const int bxInEventInitial = psbWordInitial.
bxInEvent();
172 bool foundPSB =
false;
174 for (
int iPsbF = 0; iPsbF < gtPsbVectorFinalSize; ++iPsbF) {
175 const L1GtPsbWord& psbWordFinal = gtPsbVectorFinal[iPsbF];
176 const uint16_t boardIdFinal = psbWordFinal.
boardId();
177 const int bxInEventFinal = psbWordFinal.
bxInEvent();
179 if ((boardIdFinal == boardIdInitial) && (bxInEventInitial == bxInEventFinal)) {
183 if (psbWordInitial == psbWordFinal) {
184 myCoutStream <<
"\nInitial and final PSB blocks: identical.\n";
185 psbWordInitial.
print(myCoutStream);
188 myCoutStream <<
"\nInitial and final PSB blocks: different.\n";
190 myCoutStream <<
"\nInitial PSB block\n";
191 psbWordInitial.
print(myCoutStream);
193 myCoutStream <<
"\nFinal PSB block\n";
194 psbWordFinal.
print(myCoutStream);
200 myCoutStream <<
"\nNo final PSB with boardID = " << boardIdInitial <<
" and BxINEvent = " << bxInEventInitial
202 <<
"\nInitial and final PSB vectors: different";
206 myCoutStream <<
"\nInitial and final PSB vector size: different.\n";
207 myCoutStream <<
" Initial size: " << gtPsbVectorInitialSize << std::endl;
208 myCoutStream <<
" Final size: " << gtPsbVectorFinalSize << std::endl;
211 edm::LogInfo(
"L1GtPackUnpackAnalyzer") << myCoutStream.str() << std::endl;
213 myCoutStream.str(
"");
214 myCoutStream.clear();
221 if (muCollRefProdInitial == muCollRefProdFinal) {
222 myCoutStream <<
"\nInitial and final RefProd<L1MuGMTReadoutCollection>: identical.\n";
224 myCoutStream <<
"\nInitial and final RefProd<L1MuGMTReadoutCollection>: different.\n";
227 edm::LogInfo(
"L1GtPackUnpackAnalyzer") << myCoutStream.str() << std::endl;
229 myCoutStream.str(
"");
230 myCoutStream.clear();
237 std::ostringstream myCoutStream;
250 std::vector<L1MuGMTReadoutRecord> muRecordsInitial = gmtRcInitial->getRecords();
258 <<
"Final L1MuGMTReadoutCollection with input tag \n " <<
m_finalGtGmtInputTag <<
" not found.\n\n"
263 std::vector<L1MuGMTReadoutRecord> muRecordsFinal = gmtRcFinal->getRecords();
265 int muRecordsInitialSize = muRecordsInitial.size();
266 int muRecordsFinalSize = muRecordsFinal.size();
268 if (muRecordsInitialSize == muRecordsFinalSize) {
269 myCoutStream <<
"\nInitial and final L1MuGMTReadoutCollection record size: identical.\n";
270 myCoutStream <<
" Size: " << muRecordsInitialSize << std::endl;
272 myCoutStream <<
"\nInitial and final L1MuGMTReadoutCollection record size: different.\n";
273 myCoutStream <<
" Initial size: " << muRecordsInitialSize << std::endl;
274 myCoutStream <<
" Final size: " << muRecordsFinalSize << std::endl;
277 edm::LogInfo(
"L1GtPackUnpackAnalyzer") << myCoutStream.str() << std::endl;
279 myCoutStream.str(
"");
280 myCoutStream.clear();
const cms_uint16_t boardId() const
get/set board ID
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
L1GtPackUnpackAnalyzer(const edm::ParameterSet &)
virtual void analyzeGMT(const edm::Event &, const edm::EventSetup &)
GMT comparison.
void analyze(const edm::Event &, const edm::EventSetup &) override
analyze each event
Log< level::Error, false > LogError
edm::InputTag m_initialMuGmtInputTag
input tag for the initial GMT readout collection:
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
void print(std::ostream &myCout) const
pretty print
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
const int bxInEvent() const
get/set bunch cross in the GT event record
virtual void analyzeGT(const edm::Event &, const edm::EventSetup &)
GT comparison.
~L1GtPackUnpackAnalyzer() override
edm::InputTag m_initialDaqGtInputTag
input tag for the initial GT DAQ record:
edm::InputTag m_finalGtGmtInputTag
input tag for the final GT DAQ and GMT records:
void endJob() override
end of job