diff --git a/EventFilter/CSCRawToDigi/src/CSCDCCExaminer.cc b/EventFilter/CSCRawToDigi/src/CSCDCCExaminer.cc index 8772f43391f94..05ec6bc936713 100644 --- a/EventFilter/CSCRawToDigi/src/CSCDCCExaminer.cc +++ b/EventFilter/CSCRawToDigi/src/CSCDCCExaminer.cc @@ -2,9 +2,19 @@ #include #include -#include "FWCore/MessageLogger/interface/MessageLogger.h" #include +#ifdef CSC_DEBUG +#include +#define COUT std::cout +#define CERR std::cerr +#else +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#define COUT LogTrace("CSCDCCExaminer") +#define CERR edm::LogWarning("CSCDCCExaminer") +#endif + + using namespace std; @@ -301,8 +311,8 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ bERROR|=0x2000000; fERROR[0]=true; bERROR|=0x1; - edm::LogWarning("CSCDCCExaminer")<<"\n\nDCC Header Occurrence "; - edm::LogWarning("CSCDCCExaminer")<<" ERROR 25 "<>8); @@ -457,14 +467,14 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ if( (buf_1[3]&0xF000)!=0x5000 ){ fWARNING[1]=true; bWARNING|=0x2; - edm::LogWarning("CSCDCCExaminer")<<"\nDDU Header Occurrence = "<>5)<<" "<<((buf0[0]&0x0040)>>6)<<" "; - LogTrace("CSCDCCExaminer")<>9)<<" "<<((buf0[0]&0x0800)>>11)<<" "; //change of format 16.09.05 + //COUT<>5)<<" "<<((buf0[0]&0x0040)>>6)<<" "; + COUT<>9)<<" "<<((buf0[0]&0x0800)>>11)<<" "; //change of format 16.09.05 // Print CFEB_DAV from DMB Header - LogTrace("CSCDCCExaminer")<>4)<<((buf0[0]&0x0008)>>3)<<((buf0[0]&0x0004)>>2)<<((buf0[0]&0x0002)>>1)<<(buf0[0]&0x0001); + COUT<>4)<<((buf0[0]&0x0008)>>3)<<((buf0[0]&0x0004)>>2)<<((buf0[0]&0x0002)>>1)<<(buf0[0]&0x0001); // Print DMB Header Tag - LogTrace("CSCDCCExaminer") << " {"; + COUT << " {"; // Set variables if we are waiting ALCT, TMB and CFEB records to be present in event DAV_ALCT = (buf0[0]&0x0200)>>9; @@ -607,10 +617,10 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ } } -// LogTrace("CSCDCCExaminer") << " Number of Wire Groups: " << nWG_round_up << std::endl; -/// LogTrace("CSCDCCExaminer") << " ALCT_ZSE: " << ALCT_ZSE << std::endl; -// LogTrace("CSCDCCExaminer") << " raw_tbins: " << std::dec << raw_tbins << std::endl; -// LogTrace("CSCDCCExaminer") << " LCT Tbins: " << lct_tbins << std::endl; +// COUT << " Number of Wire Groups: " << nWG_round_up << std::endl; +/// COUT << " ALCT_ZSE: " << ALCT_ZSE << std::endl; +// COUT << " raw_tbins: " << std::dec << raw_tbins << std::endl; +// COUT << " LCT Tbins: " << lct_tbins << std::endl; // Data block sizes: // 3 words of Vertex ID register + 5 words of config. register bits: @@ -624,11 +634,11 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ // raw hit dump size: int raw_hit_dump_size=(!raw_overflow ? nWG_round_up*6*raw_tbins : 0 ); - //LogTrace("CSCDCCExaminer") << " Raw Hit Dump: " << std::dec << raw_hit_dump_size << std::endl; + //COUT << " Raw Hit Dump: " << std::dec << raw_hit_dump_size << std::endl; ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size; - LogTrace("CSCDCCExaminer")<<" >4)+((buf0[3]&0x0020)>>5)+ ((buf0[3]&0x0040)>>6) ) * 12 + 12; } - LogTrace("CSCDCCExaminer")<<" >5) * 6; } - LogTrace("CSCDCCExaminer") << " very long header Find Firmware revision @@ -745,9 +755,9 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ /// Print Out ALCT word counting /* - LogTrace("CSCDCCExaminer") << " ALCT Word Since Last Header: " << ALCT_WordsSinceLastHeader << std::endl; - LogTrace("CSCDCCExaminer") << " ALCT Word Expected: " << ALCT_WordsExpected << std::endl; - LogTrace("CSCDCCExaminer") << " ALCT Word Since Last Header Zero Supressed: " << ALCT_WordsSinceLastHeaderZeroSuppressed << + COUT << " ALCT Word Since Last Header: " << ALCT_WordsSinceLastHeader << std::endl; + COUT << " ALCT Word Expected: " << ALCT_WordsExpected << std::endl; + COUT << " ALCT Word Since Last Header Zero Supressed: " << ALCT_WordsSinceLastHeaderZeroSuppressed << std::endl; */ /// Check calculated CRC sum against reported @@ -771,7 +781,7 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ ALCT_WordCount = (buf0[3]&0x07FF); //ALCT_WordCount = (buf0[3]&0x0FFF); CFEB_SampleWordCount = 0; - LogTrace("CSCDCCExaminer") << "A> "; + COUT << "A> "; } // Calculation of CRC sum ( algorithm is written by Madorsky ) @@ -937,7 +947,7 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ TMB_WordsExpected += 22; CFEB_SampleWordCount = 0; - LogTrace("CSCDCCExaminer") << "T> "; + COUT << "T> "; } if( fTMB_Header && checkCrcTMB ){ @@ -964,9 +974,9 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ ( (buf0[3]&buf0[0])==0x0000 && (buf0[3]+buf0[0])==0x7FFF ) // 2007 format ) ){ - if((CFEB_SampleCount%8) == 0 ){ LogTrace("CSCDCCExaminer")<<" <"; } - if( CFEB_SampleWordCount == 100 ){ LogTrace("CSCDCCExaminer")<<"+"; } - if( CFEB_SampleWordCount != 100 ){ LogTrace("CSCDCCExaminer")<<"-"; + if((CFEB_SampleCount%8) == 0 ){ COUT<<" <"; } + if( CFEB_SampleWordCount == 100 ){ COUT<<"+"; } + if( CFEB_SampleWordCount != 100 ){ COUT<<"-"; fERROR[16] = true; bERROR |= 0x10000; fCHAMB_ERR[16].insert(currentChamber); @@ -978,7 +988,7 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ ++CFEB_SampleCount; if( (CFEB_SampleCount%8)==0 ){ - LogTrace("CSCDCCExaminer")<<">"; + COUT<<">"; CFEB_BSampleCount=0; // Count CFEBs DAV_CFEB--; @@ -1003,14 +1013,14 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ if( (buf0[0]&0xF000)==0xB000 && (buf0[1]&0xF000)==0xB000 && (buf0[2]&0xF000)==0xB000 && (buf0[3]&0xF000)==0xB000 ){ bCHAMB_STATUS[currentChamber] |= 0x400000; - if( (CFEB_SampleCount%8)==0 ){ LogTrace("CSCDCCExaminer")<<" <"; } - LogTrace("CSCDCCExaminer")<<"B"; + if( (CFEB_SampleCount%8)==0 ){ COUT<<" <"; } + COUT<<"B"; ++CFEB_SampleCount; ++CFEB_BSampleCount; if( (CFEB_SampleCount%8)==0 ){ - LogTrace("CSCDCCExaminer") << ">"; + COUT << ">"; CFEB_BSampleCount=0; DAV_CFEB--; } @@ -1071,7 +1081,7 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ } // Print DMB F-Trailer marker - LogTrace("CSCDCCExaminer") << " }"; + COUT << " }"; } // == DMB E-Trailer found @@ -1124,8 +1134,8 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ fDMB_Trailer = false; // Print DMB E-Trailer marker - LogTrace("CSCDCCExaminer")<<" DMB="<<(buf0[1]&0x000F); - LogTrace("CSCDCCExaminer") << "; " + COUT<<" DMB="<<(buf0[1]&0x000F); + COUT << "; " << ALCT_WordsSinceLastHeader << "-" << ALCT_WordCount << "-" << ALCT_WordsExpected @@ -1160,8 +1170,8 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ currentChamber=-1; /* // Print DMB E-Trailer marker - LogTrace("CSCDCCExaminer")<<" DMB="<<(buf0[1]&0x000F); - LogTrace("CSCDCCExaminer") << "; " + COUT<<" DMB="<<(buf0[1]&0x000F); + COUT << "; " << ALCT_WordsSinceLastHeader << "-" << ALCT_WordCount << "-" << ALCT_WordsExpected @@ -1181,7 +1191,7 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length){ // fERROR[0] = true; // fERROR[21] = true; // bERROR|=0x200000; - // //edm::LogWarning("CSCDCCExaminer")<<" ERROR 21 "<