Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead assignments inside CSCRawToDigi #26574

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 0 additions & 19 deletions EventFilter/CSCRawToDigi/src/CSCDCCExaminer.cc
Expand Up @@ -273,18 +273,14 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length)


/// Check for presence of data blocks inside TMB data
bool fTMB_Scope_Start = false;
bool fTMB_MiniScope_Start = false;
bool fTMB_RPC_Start = false;
bool fTMB_BlockedCFEBs_Start = false;

bool fTMB_Scope = false;
bool fTMB_MiniScope = false;
bool fTMB_RPC = false;
bool fTMB_BlockedCFEBs = false;

fTMB_Scope = fTMB_Scope && true; // WARNING in 5_0_X
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the original intention of this line?


while( length>0 )
{
// == Store last 4 read buffers in pipeline-like memory (note that memcpy works quite slower!)
Expand Down Expand Up @@ -633,12 +629,10 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length)
uniqueALCT = true;
uniqueTMB = true;

fTMB_Scope_Start = false;
fTMB_MiniScope_Start = false;
fTMB_RPC_Start = false;
fTMB_BlockedCFEBs_Start = false;

fTMB_Scope = false;
fTMB_MiniScope = false;
fTMB_RPC = false;
fTMB_BlockedCFEBs = false;
Expand Down Expand Up @@ -1031,12 +1025,6 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length)
fTMB_RPC_Start = true;
}

// Check for Scope data
if ( fTMB_Header && (scanbuf(buf0,4, 0x6B05)>=0) )
{
fTMB_Scope_Start = true;
}

// Check for Mini-Scope data
if ( fTMB_Header && (scanbuf(buf0,4, 0x6B07)>=0) )
{
Expand All @@ -1057,13 +1045,6 @@ int32_t CSCDCCExaminer::check(const uint16_t* &buffer, int32_t length)
fTMB_RPC = true;
}

// Check for end of Scope data
if ( fTMB_Header && fTMB_Scope_Start
&& (scanbuf(buf0,4, 0x6E05)>=0) )
{
fTMB_Scope = true;
}

// Check for end of Mini-Scope data
if ( fTMB_Header && fTMB_MiniScope_Start
&& (scanbuf(buf0,4, 0x6E07)>=0) )
Expand Down
8 changes: 0 additions & 8 deletions EventFilter/CSCRawToDigi/src/CSCDDUEventData.cc
Expand Up @@ -172,7 +172,6 @@ void CSCDDUEventData::unpack_data(const uint16_t *buf, CSCDCCExaminer* examiner)
std::cout << i << " " << std::hex << buf[4*i+3] << " " << buf[4*i+2] << " "
<< buf[4*i+1] << " " << buf[4*i] << std::endl;
}
//std::cout << "DDU Size: " << std::dec << theDDUHeader.sizeInWords() << std::endl;

theDDUHeader.setFromBuffer(buf);

Expand All @@ -196,10 +195,6 @@ void CSCDDUEventData::unpack_data(const uint16_t *buf, CSCDCCExaminer* examiner)
{
theFormatVersion = 2013;
}

// std::cout << "Format Version: " << theFormatVersion << std::endl;
//std::cout << "sandrik dduID =" << theDDUHeader.source_id() << std::endl;
//int i=-1;


// we really don't want to copy CSCEventData's while filling the vec
Expand Down Expand Up @@ -246,7 +241,6 @@ void CSCDDUEventData::unpack_data(const uint16_t *buf, CSCDCCExaminer* examiner)
{
LogTrace ("CSCDDUEventData|CSCRawToDigi") << "size of vector of cscData = " << theData.size();
}
// std::cout << std::dec << theDDUTrailer.sizeInWords() << std::endl;
// decode ddu tail
theDDUTrailer.setFromBuffer(inputBuf+dduBufSize);
// memcpy(&theDDUTrailer, dduBlock+(dduBufSize-theDDUTrailer.sizeInWords())*2, theDDUTrailer.sizeInWords()*2);
Expand Down Expand Up @@ -277,7 +271,6 @@ void CSCDDUEventData::unpack_data(const uint16_t *buf, CSCDCCExaminer* examiner)

}
theSizeInWords = dduBufSize+12;
buf=inputBuf+dduBufSize;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the intention was to modify the pointer passed to this function, then it should have been passed by reference.
Otherwise, I agree with the static analyzer that this is a dead assignment as such, and it can be removed


} else {

Expand Down Expand Up @@ -326,7 +319,6 @@ void CSCDDUEventData::unpack_data(const uint16_t *buf, CSCDCCExaminer* examiner)
theSizeInWords = buf - inputBuf;
}

//std::cout << "DDUevData Size: " << theSizeInWords << " BUFlast: " << std::hex << inputBuf0[theSizeInWords-4] << //std::endl;
/// Pack Trailer 0 (to access TTS)
theDDUTrailer0 = inputBuf0[theSizeInWords-4];
}
Expand Down
5 changes: 0 additions & 5 deletions EventFilter/CSCRawToDigi/src/CSCTMBData.cc
Expand Up @@ -166,26 +166,21 @@ int CSCTMBData::UnpackTMB(const uint16_t *buf) {
///determine 2007 or 2006 version
unsigned short int firmwareVersion=0;
int Ntbins = 0 ;
int NHeaderFrames = 0; //WARNING in 5_0_X
int NRPCtbins = 0; // =VB= number of RPC tbins

int b0cLine=0;///assumes that buf starts at the tmb data
///this is not true if something is wrong in the data
///before TMB - then we skip the whole event

NHeaderFrames++; NHeaderFrames--;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the original intention of this line?


if (buf[b0cLine]==0xdb0c) {
firmwareVersion=2007;
Ntbins = buf[b0cLine+19]&0xF8;
NRPCtbins = (buf[b0cLine+36]>>5)&0x1F; // =VB= get RPC tbins
NHeaderFrames = buf[b0cLine+5]&0x3F; //WARNING in 5_0_X
}
else if (buf[b0cLine]==0x6b0c) {
firmwareVersion=2006;
Ntbins = buf[b0cLine+1]&0x1f ;
NRPCtbins = Ntbins;
NHeaderFrames = buf[b0cLine+4]&0x1f; //WARNING in 5_0_X
}
else {
LogTrace("CSCTMBData|CSCRawToDigi") << "+++ Can't find b0C flag";
Expand Down