Commit 83d04c8a authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (MuonRPC_Cabling-00-02-26)

	* tagged as MuonRPC_Cabling-00-02-26
	* addressing coverity defects 11604, 11617 (again ...)

2015-05-24 Jochen Meyer <jomeyer@mail.cern.ch>
	* tagged as MuonRPC_Cabling-00-02-25
	* removing gcc 2.95 specific code

2015-05-21 Jochen Meyer <jomeyer@mail.cern.ch>
	* tagged as MuonRPC_Cabling-00-02-24
	* addressing coverity defects 11604, 11919, 11921, 11998 (again ...)

2015-05-15 Jochen Meyer <jomeyer@mail.cern.ch>
	* tagged as MuonRPC_Cabling-00-02-23
	* addressing coverity defects 11921 again (help of Scott Snyder - ATLASRECTS-2115)

2015-05-11 Jochen Meyer <jomeyer@mail.cern.ch>
	* tagged as MuonRPC_Cabling-00-02-22
	* addressing coverity defects 11553, 11604, 11617, 11775, 11921, 11998, 17501, 29235

2015-05-01 Jochen Meyer <jomeyer@mail.cern.ch>
...
(Long ChangeLog diff - truncated)
parent 127e8940
################################################################################
# Package: MuonRPC_Cabling
################################################################################
# Declare the package name:
atlas_subdir( MuonRPC_Cabling )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
Control/AthenaKernel
DetectorDescription/Identifier
GaudiKernel
MuonSpectrometer/MuonCablings/MuonCablingTools
MuonSpectrometer/MuonCablings/RPCcablingInterface
MuonSpectrometer/MuonIdHelpers
PRIVATE
Control/StoreGate
Database/AthenaPOOL/AthenaPoolUtilities
MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface
Tools/PathResolver )
# Component(s) in the package:
atlas_add_component( MuonRPC_Cabling
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps AthenaKernel Identifier GaudiKernel MuonCablingTools CablingTools RPCcablingInterfaceLib MuonIdHelpersLib StoreGateLib SGtests AthenaPoolUtilities MuonCondInterface PathResolver )
# Install files from the package:
atlas_install_headers( MuonRPC_Cabling )
atlas_install_python_modules( python/*.py )
atlas_install_runtime( share/LVL1confAtlas.data share/LVL1confAtlas.corr share/ATLAS.data share/LVL1confAtlasRUN2_ver016.corr share/LVL1confAtlasRUN2_ver016.data )
......@@ -247,15 +247,7 @@ std::list<RPCofflineId> give_strip_id (unsigned short int SubsystemId,
inline std::ostream&
operator<<(std::ostream& stream,const CablingRPC& logic)
{
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream display;
#else
// put your gcc 2.95 specific code here
char buffer[1000];
for (int i=0;i<1000;++i) buffer[i] = '\0';
__osstream display(buffer,1000);
#endif
logic.PrintMap(display);
stream << display.str();
......@@ -299,15 +291,7 @@ class ShowCabling
inline std::ostream&
operator<<(std::ostream& stream,const ShowCabling& request)
{
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream display;
#else
// put your gcc 2.95 specific code here
char buffer[5000000];
for (int i=0;i<5000000;++i) buffer[i] = '\0';
__osstream display(buffer,5000000);
#endif
const CablingRPCBase* cabling = CablingRPC::instance();
......
......@@ -68,7 +68,7 @@ class RPCchamber : public CablingObject
RPCchamber(const RPCchamber&);
~RPCchamber();
RPCchamber operator=(const RPCchamber&);
RPCchamber& operator=(const RPCchamber&);
void set_eta_st_global(int);
void set_eta_co_global(int);
......
......@@ -22,7 +22,9 @@ CMAcablingdata::CMAcablingdata(DBline& data, int type) :
BaseObject(Logic,"CMA Cabling Data")
{
m_type = type;
m_station = 0;
m_station = 0;
m_number = -1;
m_coverage = AllSectors;
(++data)("{");
do
......@@ -70,17 +72,7 @@ CMAcablingdata::confirm_data(ViewType side)
unsigned int div = 247;
std::string view = (side == Phi)? "phi" : "eta";
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream disp;
#else
// put your gcc 2.95 specific code here
char buffer[5000];
for (int i=0;i<5000;++i) buffer[i] = '\0';
__osstream disp(buffer,5000);
#endif
bool have_low_Pt_input = (m_lowPt_number_co != -1)? true : false;
bool have_high_Pt_input = (m_highPt_number_co != -1)? true : false;
......
......@@ -94,15 +94,7 @@ CMApivotdata::confirm_data(ViewType side)
int stop = m_stop_ch*100 + m_stop_st;
std::string view = (side == Phi)? "phi" : "eta";
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream disp;
#else
// put your gcc 2.95 specific code here
char buffer[5000];
for (int i=0;i<5000;++i) buffer[i] = '\0';
__osstream disp(buffer,5000);
#endif
if(!CMAidentity::coverage(m_covtag,m_coverage))
{
......
......@@ -1731,6 +1731,7 @@ RPCofflineId CablingRPC::strip_id_fromCode(unsigned long int strip_code)
{
RPCdecoder decode(strip_code);
RPCofflineId rpcId;
rpcId.init();
if (!decode) {
// DISP << "strip_id_fromCode error: cannot decode the following LVL1 Id"
// << " " << decode.code();
......
......@@ -19,7 +19,7 @@ using namespace MuonRPC_Cabling;
EvenPhiCMA::EvenPhiCMA(int num,int stat,int type,CMAcoverage coverage,
int eta,int phi,int PAD,int Ixx,
int pivot_station,int lowPt_station,int highPt_station,
int pivot_station,int lowPt_station,int highPt_station,
int start_ch,int start_st,int stop_ch,int stop_st) :
CMAparameters(num,stat,type,coverage,eta,phi,PAD,Ixx,
pivot_station,lowPt_station,highPt_station,
......@@ -108,17 +108,21 @@ EvenPhiCMA::cable_CMA_channels(void)
int chs = (this->id().Ixx_index() == 0) ?
pivot_channels - abs(stop - start) -1 : 0;
chs += (local_strip >=0 )? 0 : abs(local_strip) + 1;
if(chs >= pivot_channels)
{
noMoreChannels("Pivot");
return false;
}
if (chs <= first_ch_cabled) first_ch_cabled = chs;
if (local_strip <= 0) local_strip = 1;
do
{
if(chs == pivot_channels)
if(chs == pivot_channels)
{
noMoreChannels("Pivot");
return false;
}
return false;
}
if(local_strip > 0 && local_strip <= rpc_st)
{
if(rpc->ijk_phiReadout() ==1)
......@@ -143,17 +147,22 @@ EvenPhiCMA::cable_CMA_channels(void)
// Set first and last connectors code
int code = m_pivot_station*100000 + 1*100000000;
int ch = 0;
// first_ch_cabled and last_ch_cabled are initialized with "out-of-bound" values
// of the m_pivot array; proper values should be assigned during the loop;
// the init values though are "misused" for certain conditions, too, therefore
// they cannot be changed; but the following if should NEVER fire.
if( first_ch_cabled >= pivot_channels || last_ch_cabled < 0 ) {
std::cout << "MuonRPC_Cabling: EvenPhiCMA::cable_CMA_channels - out of bound array indices (m_pivot)!" <<std::endl;
std::cout << "\t\tValues:" << first_ch_cabled << ", " << last_ch_cabled << " . Taking emergency exit!"<< std::endl;
throw;
}
for(ch=0;ch < m_pivot_rpc_read; ++ch)
if(m_pivot[ch][0][first_ch_cabled] >= 0) break;
if(ch == m_pivot_rpc_read) --ch;
m_first_pivot_code = code + m_pivot[ch][0][first_ch_cabled];
if(last_ch_cabled < 0) {
std::cout << "MuonRPC_Cabling: EvenPhiCMA - neg. array idx - taking emergency exit!." <<std::endl;
throw;
}
for(ch=0;ch < m_pivot_rpc_read; ++ch)
if(m_pivot[ch][0][last_ch_cabled] >= 0) break;
if(ch == m_pivot_rpc_read) --ch;
......@@ -209,6 +218,11 @@ EvenPhiCMA::cable_CMA_channels(void)
}
chs += (local_strip >=0 )? 0 : abs(local_strip) + 1;
if(chs >= confirm_channels)
{
noMoreChannels("Low Pt");
return false;
}
if (chs <= first_ch_cabled) first_ch_cabled = chs;
if (local_strip <= 0) local_strip = 1;
......@@ -252,17 +266,22 @@ EvenPhiCMA::cable_CMA_channels(void)
// Set first and last connectors code
int code = m_lowPt_station*100000 +1*100000000;
int ch = 0;
// first_ch_cabled and last_ch_cabled are initialized with "out-of-bound" values
// of the m_lowPt array; proper values should be assigned during the loop;
// the init values though are "misused" for certain conditions, too, therefore
// they cannot be changed; but the following if should NEVER fire.
if( first_ch_cabled >= confirm_channels || last_ch_cabled < 0 ) {
std::cout << "MuonRPC_Cabling: EvenPhiCMA::cable_CMA_channels - out of bound array indices (m_lowPt)!" <<std::endl;
std::cout << "\t\tValues:" << first_ch_cabled << ", " << last_ch_cabled << " . Taking emergency exit!"<< std::endl;
throw;
}
for(ch=0;ch < m_lowPt_rpc_read; ++ch)
if(m_lowPt[ch][0][first_ch_cabled] >= 0) break;
if(ch == m_lowPt_rpc_read) --ch;
m_first_lowPt_code = code + m_lowPt[ch][0][first_ch_cabled];
if(last_ch_cabled < 0) {
std::cout << "MuonRPC_Cabling: EvenPhiCMA - neg. array idx - taking emergency exit!." <<std::endl;
throw;
}
for(ch=0;ch < m_lowPt_rpc_read; ++ch)
if(m_lowPt[ch][0][last_ch_cabled] >= 0) break;
if(ch == m_lowPt_rpc_read) --ch;
......@@ -322,6 +341,11 @@ EvenPhiCMA::cable_CMA_channels(void)
}
chs += (local_strip >=0 )? 0 : abs(local_strip) + 1;
if(chs >= confirm_channels)
{
noMoreChannels("High Pt");
return false;
}
if (chs <= first_ch_cabled) first_ch_cabled = chs;
if (local_strip <= 0) local_strip = 1;
......@@ -364,17 +388,22 @@ EvenPhiCMA::cable_CMA_channels(void)
// Set first and last connectors code
int code = m_highPt_station*100000 + 1*100000000;
int ch = 0;
// first_ch_cabled and last_ch_cabled are initialized with "out-of-bound" values
// of the m_highPt array; proper values should be assigned during the loop;
// the init values though are "misused" for certain conditions, too, therefore
// they cannot be changed; but the following if should NEVER fire.
if( first_ch_cabled >= confirm_channels || last_ch_cabled < 0 ) {
std::cout << "MuonRPC_Cabling: EvenPhiCMA::cable_CMA_channels - out of bound array indices (m_highPt)!" <<std::endl;
std::cout << "\t\tValues:" << first_ch_cabled << ", " << last_ch_cabled << " . Taking emergency exit!"<< std::endl;
throw;
}
for(ch=0;ch < m_highPt_rpc_read; ++ch)
if(m_highPt[ch][0][first_ch_cabled] >= 0) break;
if(ch == m_highPt_rpc_read) --ch;
m_first_highPt_code = code + m_highPt[ch][0][first_ch_cabled];
if(last_ch_cabled < 0) {
std::cout << "MuonRPC_Cabling: EvenPhiCMA - neg. array idx - taking emergency exit!." <<std::endl;
throw;
}
for(ch=0;ch < m_highPt_rpc_read; ++ch)
if(m_highPt[ch][0][last_ch_cabled] >= 0) break;
if(ch == m_highPt_rpc_read) --ch;
......
......@@ -525,15 +525,7 @@ MuonRPC_CablingSvc::printType(int type,int station,std::string element,bool deta
MsgStream log(msgSvc(), name());
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream display;
#else
// put your gcc 2.95 specific code here
char buffer[500000];
for (int i=0;i<500000;++i) buffer[i] = '\0';
__osstream display(buffer,500000);
#endif
log << MSG::DEBUG << name() << " is demanding a cabling printout" <<endreq;
......@@ -548,15 +540,7 @@ MuonRPC_CablingSvc::printSector(int sector,int station,std::string element,bool
{
MsgStream log(msgSvc(), name());
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream display;
#else
// put your gcc 2.95 specific code here
char buffer[500000];
for (int i=0;i<500000;++i) buffer[i] = '\0';
__osstream display(buffer,500000);
#endif
log << MSG::DEBUG << name() << " is demanding a cabling printout" <<endreq;
......
......@@ -107,7 +107,11 @@ OddPhiCMA::cable_CMA_channels(void)
int chs = (this->id().Ixx_index() == 0) ?
pivot_channels - abs(stop - start) -1 : 0;
if(chs >= pivot_channels)
{
noMoreChannels("Pivot");
return false;
}
if (chs <= first_ch_cabled) first_ch_cabled = chs;
do
......@@ -141,7 +145,17 @@ OddPhiCMA::cable_CMA_channels(void)
// Set first and last connectors code
int code = m_pivot_station*100000 + 1*100000000;
int ch = 0;
// first_ch_cabled and last_ch_cabled are initialized with "out-of-bound" values
// of the m_pivot array; proper values should be assigned during the loop;
// the init values though are "misused" for certain conditions, too, therefore
// they cannot be changed; but the following if should NEVER fire.
if( first_ch_cabled >= pivot_channels || last_ch_cabled < 0 ) {
std::cout << "MuonRPC_Cabling: OddPhiCMA::cable_CMA_channels - out of bound array indices!" <<std::endl;
std::cout << "\t\tValues:" << first_ch_cabled << ", " << last_ch_cabled << " . Taking emergency exit!"<< std::endl;
throw;
}
// get LowPhi code
for (ch=0; ch < m_pivot_rpc_read;++ch)
if(m_pivot[ch][0][last_ch_cabled] >= 0) break;
......
......@@ -66,7 +66,7 @@ CablingObject(cham.number(),cham.station(),cham.sector_type(),cham.name())
m_readoutCMAs = cham.readoutCMAs();
}
RPCchamber RPCchamber::operator=(const RPCchamber& cham)
RPCchamber& RPCchamber::operator=(const RPCchamber& cham)
{
if(this!=&cham){
m_strips_in_Eta_Conn = cham.strips_in_Eta_Conn();
......@@ -501,15 +501,7 @@ RPCchamber::extendedName (int sector) const
default: return "";
}
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream out;
#else
// put your gcc 2.95 specific code here
char stringa[80];
for (int i=0;i<80;++i) stringa[i]='\0';
__osstream out = __osstream(stringa,80);
#endif
int physicsSector = (((sector+1)%32)/2 + 1)%16;
if (!physicsSector) physicsSector = 16;
......@@ -530,13 +522,7 @@ RPCchamber::extendedName (int sector) const
}
std::string outstr;
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
outstr = out.str();
#else
// put your gcc 2.95 specific code here
outstr += stringa;
#endif
return outstr;
}
......
......@@ -21,13 +21,17 @@ RPCchamberdata::RPCchamberdata(DBline& data, int type) :
{
int chams;
m_type = type;
m_fail = true;
m_station = -1;
m_strips_in_Eta_Conn = -1;
m_strips_in_Phi_Conn = -1;
reset_data();
m_fail = false;
if(!(data("station") >> m_station)) return;
if(!(data("made of") >> chams >> "chamber. Strips in connectors:")) return;
if(!(data("eta") >> m_strips_in_Eta_Conn)) return;
if(!(data("phi") >> m_strips_in_Phi_Conn)) return;
m_fail = false;
//--m_station;
(++data)("{");
......@@ -90,15 +94,7 @@ RPCchamberdata::confirm_connectors(ViewType side)
float str = (float)strips/(float)connectors;
std::string view = (side == Phi)? "phi" : "eta";
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream disp;
#else
// put your gcc 2.95 specific code here
char buffer[5000];
for (int i=0;i<5000;++i) buffer[i] = '\0';
__osstream disp(buffer,5000);
#endif
if(str > strips_in_conn)
{
......@@ -140,15 +136,7 @@ RPCchamberdata::confirm_ijk(ViewType side)
int ijk = (side == Phi)? m_ijk_phiReadout : m_ijk_etaReadout;
std::string view = (side == Phi)? "phi" : "eta";
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream disp;
#else
// put your gcc 2.95 specific code here
char buffer[5000];
for (int i=0;i<5000;++i) buffer[i] = '\0';
__osstream disp(buffer,5000);
#endif
if(ijk != 1 && ijk != 10)
{
......
......@@ -47,31 +47,33 @@ SectorLogicSetup::SectorLogicSetup(const SectorLogicSetup& sec) :
SectorLogicSetup&
SectorLogicSetup::operator=(const SectorLogicSetup& sec)
{
m_positive_sector = sec.positive_sector();
m_negative_sector = sec.negative_sector();
m_sector_type = sec.sector_type();
m_stations.clear();
m_stations = sec.giveStations();
m_sectors.clear();
m_sectors = sec.sectors();
RPCs.clear();
RPCs = sec.giveRPC();
WORs.clear();
WORs = sec.giveWOR();
etaCMAs.clear();
etaCMAs = sec.giveEtaCMA();
evenphiCMAs.clear();
evenphiCMAs = sec.giveEvenPhiCMA();
oddphiCMAs.clear();
oddphiCMAs = sec.giveOddPhiCMA();
if (this!=&sec) {
m_positive_sector = sec.positive_sector();
m_negative_sector = sec.negative_sector();
m_sector_type = sec.sector_type();
m_stations.clear();
m_stations = sec.giveStations();
m_sectors.clear();
m_sectors = sec.sectors();
RPCs.clear();
RPCs = sec.giveRPC();
WORs.clear();
WORs = sec.giveWOR();
etaCMAs.clear();
etaCMAs = sec.giveEtaCMA();
evenphiCMAs.clear();
evenphiCMAs = sec.giveEvenPhiCMA();
oddphiCMAs.clear();
oddphiCMAs = sec.giveOddPhiCMA();
m_online_database = sec.online_database();
m_layout = sec.layout();
m_cosmic = sec.cosmic();
m_online_database = sec.online_database();
m_layout = sec.layout();
m_cosmic = sec.cosmic();
}
return*this;
}
......@@ -90,15 +92,7 @@ SectorLogicSetup::~SectorLogicSetup()
void
SectorLogicSetup::no_elements(std::string tech,int stat)
{
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream disp;
#else
// put your gcc 2.95 specific code here
char buffer[5000];
for(int i=0;i<5000;++i) buffer[i] = '\0';
__osstream disp(buffer,5000);
#endif
disp << "No " << tech << " elements for Sector Type " << m_sector_type;
if (stat) disp << ", station " << stat << "!" << std::endl;
......@@ -868,7 +862,6 @@ SectorLogicSetup::operator<<(int sector)
{
m_sectors.push_back(sector);
#if (__GNUC__) && (__GNUC__ > 2)
__osstream str;
if (sector < 32 )
{
......@@ -880,20 +873,6 @@ SectorLogicSetup::operator<<(int sector)
str << std::setw(3) << sector - 32 << std::ends;
m_positive_sector += str.str();
}
#else
char buffer[4];
__osstream str(buffer,4);
if (sector < 32 )
{
str << std::setw(3) << sector << std::ends;
m_negative_sector += buffer;
}
else
{
str << std::setw(3) << sector - 32 << std::ends;
m_positive_sector += buffer;
}
#endif
return *this;
}
......
......@@ -18,7 +18,8 @@ WiredORdata::WiredORdata(DBline& data, int type) :
BaseObject(Logic,"Wired OR Data")
{
m_type = type;
m_fail = true;
m_station = -1;
reset_data();
if(!(data("station") >> m_station)) return;
//--m_station;
......@@ -57,15 +58,7 @@ WiredORdata::confirm_boundary() const
{
if(m_start > m_stop )
{
#if (__GNUC__) && (__GNUC__ > 2)
// put your gcc 3.2 specific code here
__osstream display;
#else
// put your gcc 2.95 specific code here
char buffer[5000];
for (int i=0;i<5000;++i) buffer[i] = '\0';
__osstream display(buffer,5000);
#endif
display << "WORdata error in configuration for Sector Type " << m_type
<< ", station " << m_station << ", WOR number "
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment