Skip to content

Commit d0db5ab

Browse files
committed
get rid of cerr,cout
1 parent fb9ffe2 commit d0db5ab

File tree

9 files changed

+99
-150
lines changed

9 files changed

+99
-150
lines changed

DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processEvent.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ void EventProcessor::processEvent(const char* data, const int32_t dataSize, cons
8888

8989
if (config->getBINCHECKER_OUTPUT())
9090
{
91-
binChecker.output1().show();
92-
binChecker.output2().show();
91+
// binChecker.output1().show();
92+
/ binChecker.output2().show();
9393
}
9494
else
9595
{
96-
binChecker.output1().hide();
97-
binChecker.output2().hide();
96+
// binChecker.output1().hide();
97+
// binChecker.output2().hide();
9898
}
9999

100100
binChecker.setMask(config->getBINCHECK_MASK());
@@ -220,13 +220,13 @@ void EventProcessor::processEvent(const char* data, const int32_t dataSize, cons
220220

221221
if (config->getBINCHECKER_OUTPUT())
222222
{
223-
binChecker.output1().show();
224-
binChecker.output2().show();
223+
// binChecker.output1().show();
224+
// binChecker.output2().show();
225225
}
226226
else
227227
{
228-
binChecker.output1().hide();
229-
binChecker.output2().hide();
228+
// binChecker.output1().hide();
229+
// binChecker.output2().hide();
230230
}
231231

232232
binChecker.setMask(config->getBINCHECK_MASK());

DQMOffline/Muon/src/CSCOfflineMonitor.cc

-4
Original file line numberDiff line numberDiff line change
@@ -1613,13 +1613,9 @@ void CSCOfflineMonitor::doBXMonitor(edm::Handle<CSCALCTDigiCollection> alcts, ed
16131613
std::stringstream examiner_out, examiner_err;
16141614
goodEvent = true;
16151615
examiner = new CSCDCCExaminer();
1616-
examiner->output1().redirect(examiner_out);
1617-
examiner->output2().redirect(examiner_err);
16181616
if( examinerMask&0x40000 ) examiner->crcCFEB(1);
16191617
if( examinerMask&0x8000 ) examiner->crcTMB (1);
16201618
if( examinerMask&0x0400 ) examiner->crcALCT(1);
1621-
examiner->output1().show();
1622-
examiner->output2().show();
16231619
examiner->setMask(examinerMask);
16241620
const short unsigned int *data = (short unsigned int *)fedData.data();
16251621

DataFormats/CSCDigi/interface/CSCStripDigi.h

+21-7
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,31 @@ class CSCStripDigi{
1818

1919
public:
2020

21-
// Construct from the strip number and all the other data members.
22-
CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts, const std::vector<uint16_t> & ADCOverflow,
23-
const std::vector<uint16_t> & Overlap,
24-
const std::vector<uint16_t> & Errorstat);
21+
// Construct from the strip number and all the other data members.
22+
CSCStripDigi (const int & istrip, const std::vector<int> & vADCCounts, const std::vector<uint16_t> & vADCOverflow, const std::vector<uint16_t> & vOverlap,
23+
const std::vector<uint16_t> & vErrorstat ) :
24+
strip(istrip),
25+
ADCCounts(vADCCounts),
26+
ADCOverflow(vADCOverflow),
27+
OverlappedSample(vOverlap),
28+
Errorstat(vErrorstat) {}
2529

2630
// Construct from the strip number and the ADC readings.
27-
CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts);
31+
CSCStripDigi (const int & istrip, const std::vector<int> & vADCCounts):
32+
strip(istrip),
33+
ADCCounts(vADCCounts),
34+
ADCOverflow(8,0),
35+
OverlappedSample(8,0),
36+
Errorstat(8,0){}
2837

2938

30-
// Default construction.
31-
CSCStripDigi ();
39+
CSCStripDigi ():
40+
strip(0),
41+
ADCCounts(8,0),
42+
ADCOverflow(8,0),
43+
OverlappedSample(8,0),
44+
Errorstat(8,0){}
45+
3246

3347
// Digis are equal if they are on the same strip and have same ADC readings
3448
bool operator==(const CSCStripDigi& digi) const;

DataFormats/CSCDigi/src/CSCStripDigi.cc

+1-29
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,8 @@
55
*/
66
#include "DataFormats/CSCDigi/interface/CSCStripDigi.h"
77
#include <iostream>
8-
#include <stdint.h>
8+
#include <cstdint>
99

10-
// Constructors
11-
CSCStripDigi::CSCStripDigi (const int & istrip, const std::vector<int> & vADCCounts, const std::vector<uint16_t> & vADCOverflow, const std::vector<uint16_t> & vOverlap, const std::vector<uint16_t> & vErrorstat ):
12-
strip(istrip),
13-
ADCCounts(vADCCounts),
14-
ADCOverflow(vADCOverflow),
15-
OverlappedSample(vOverlap),
16-
Errorstat(vErrorstat)
17-
{
18-
}
19-
20-
CSCStripDigi::CSCStripDigi (const int & istrip, const std::vector<int> & vADCCounts):
21-
strip(istrip),
22-
ADCCounts(vADCCounts),
23-
ADCOverflow(8,0),
24-
OverlappedSample(8,0),
25-
Errorstat(8,0)
26-
{
27-
}
28-
29-
30-
CSCStripDigi::CSCStripDigi ():
31-
strip(0),
32-
ADCCounts(8,0),
33-
ADCOverflow(8,0),
34-
OverlappedSample(8,0),
35-
Errorstat(8,0)
36-
{
37-
}
3810

3911
// Comparison
4012
bool

EventFilter/CSCRawToDigi/interface/CSCDCCExaminer.h

+1-31
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <map>
55
#include <vector>
66
#include <string>
7-
#include <iostream>
7+
#include <ostream>
88

99
#include "DataFormats/CSCDigi/interface/CSCDCCFormatStatusDigi.h"
1010

@@ -30,34 +30,6 @@ class CSCDCCExaminer {
3030
std::map<DDUIdType,ExaminerStatusType> bDDU_ERR; // ddu <-> errors in bits
3131
std::map<DDUIdType,ExaminerStatusType> bDDU_WRN; // ddu <-> errors in bits
3232

33-
class OStream : public std::ostream {
34-
private:
35-
class buffer : public std::streambuf{};
36-
buffer buff;
37-
std::streambuf *stream;
38-
std::streambuf *null;
39-
std::string name;
40-
41-
public:
42-
void show(void){ rdbuf(stream); }
43-
void hide(void){ rdbuf(null); }
44-
void sign(std::string nm) { name=nm; }
45-
void sign(const char *nm){ name=nm; }
46-
47-
void redirect(std::ostream &str){
48-
stream = str.rdbuf(); tie(&str);
49-
if( rdbuf() != null ) rdbuf(stream);
50-
}
51-
52-
template<class T> std::ostream& operator<<(const T& val){
53-
return (*(std::ostream*)this)<<name<<val;
54-
}
55-
56-
OStream(void):std::ostream(std::cout.rdbuf()),buff(),stream(std::cout.rdbuf()),null(&buff),name(""){}
57-
OStream(std::ostream &str):std::ostream(str.rdbuf()),buff(),stream(str.rdbuf()),null(&buff),name(""){}
58-
};
59-
60-
OStream cout, cerr;
6133

6234
CSCIdType currentChamber; // ( (CrateNumber<<4) + DMBslot ) specifies chamber
6335

@@ -145,8 +117,6 @@ class CSCDCCExaminer {
145117
const uint16_t *buffer_start;
146118

147119
public:
148-
OStream& output1(void){ return cout; }
149-
OStream& output2(void){ return cerr; }
150120

151121
int32_t check(const uint16_t* &buffer, int32_t length);
152122

EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc

-4
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,9 @@ void CSCDCCUnpacker::produce(edm::Event & e, const edm::EventSetup& c){
198198
if (useExaminer) {///examine event for integrity
199199
// CSCDCCExaminer examiner;
200200
examiner = new CSCDCCExaminer();
201-
examiner->output1().redirect(examiner_out);
202-
examiner->output2().redirect(examiner_err);
203201
if( examinerMask&0x40000 ) examiner->crcCFEB(1);
204202
if( examinerMask&0x8000 ) examiner->crcTMB (1);
205203
if( examinerMask&0x0400 ) examiner->crcALCT(1);
206-
examiner->output1().show();
207-
examiner->output2().show();
208204
examiner->setMask(examinerMask);
209205
const short unsigned int *data = (short unsigned int *)fedData.data();
210206

EventFilter/CSCRawToDigi/src/CSCCFEBData.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void CSCCFEBData::digis(uint32_t idlayer, std::vector<CSCStripDigi> & result )
270270
if ( me1a ) strip = strip%64; // reset 65-80 to 1-16 digi
271271
if ( me1a && zplus ) { strip = 17-strip; } // 1-16 -> 16-1
272272
if ( me1b && !zplus) { strip = 65 - strip;} // 1-64 -> 64-1 ...
273-
result.push_back(CSCStripDigi(strip, sca, overflow, overlap, errorfl));
273+
result.emplace_back(strip, sca, overflow, overlap, errorfl);
274274
}
275275
}
276276

0 commit comments

Comments
 (0)