diff --git a/DataFormats/GeometryVector/src/print.cc b/DataFormats/GeometryVector/src/print.cc index 1803340739407..b28d19f714344 100644 --- a/DataFormats/GeometryVector/src/print.cc +++ b/DataFormats/GeometryVector/src/print.cc @@ -1,12 +1,9 @@ #include - namespace geometryDetails { - std::ostream & print3D(std::ostream& s, double x, double y, double z) { + std::ostream& print3D(std::ostream& s, double x, double y, double z) { return s << " (" << x << ',' << y << ',' << z << ") "; - } - std::ostream & print2D(std::ostream& s, double x, double y) { - return s << " (" << x << ',' << y << ") "; - } + } + std::ostream& print2D(std::ostream& s, double x, double y) { return s << " (" << x << ',' << y << ") "; } -} +} // namespace geometryDetails diff --git a/SimCalorimetry/EcalElectronicsEmulation/bin/recycleTccEmu.cc b/SimCalorimetry/EcalElectronicsEmulation/bin/recycleTccEmu.cc index 443da8b6a39fa..6aa44b33f24f6 100644 --- a/SimCalorimetry/EcalElectronicsEmulation/bin/recycleTccEmu.cc +++ b/SimCalorimetry/EcalElectronicsEmulation/bin/recycleTccEmu.cc @@ -20,110 +20,104 @@ uint16_t mem[nChs][nEvts]; * general the number of initial events is choosen as a divider of 2048. */ -int main(int argc, char* argv[]){ - if((argc>=2 && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"--help")==0) )) - || argc!=3){ +int main(int argc, char* argv[]) { + if ((argc >= 2 && ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0))) || argc != 3) { cout << "Usage: recycleTccEmu infile outfile\n"; return 1; } - + string ifilename = argv[1]; string ofilename = argv[2]; - - for(int iCh=0; iCh>dec>> chnb >> bcnb >>hex>> val >> dummy ; - mem[chnb-1][bcnb] = val&0x7FF; - if(mem[chnb-1][bcnb]!=val){ - cout << "Invalid Et value at line " << oldLineCnt+1 << ".\n"; - exit(1); + if (in) { + while (!in.eof()) { + in >> dec >> chnb >> bcnb >> hex >> val >> dummy; + mem[chnb - 1][bcnb] = val & 0x7FF; + if (mem[chnb - 1][bcnb] != val) { + cout << "Invalid Et value at line " << oldLineCnt + 1 << ".\n"; + exit(1); } // cout<<"Channel: "<< dec <1?"s":"") << " " - << s.str() - << " is not a mulitple of input event counts\n" ; + if (!s.str().empty()) + cout << "Warning: ouput event count (2048) for channel" << (s.str().size() > 1 ? "s" : "") << " " << s.str() + << " is not a mulitple of input event counts\n"; } - - if(!singleOldEventCnt){ + + if (!singleOldEventCnt) { cout << "Info: in the input file the event count depends on the channel"; } } -