9 : m_gctInputLabel(iConfig.getParameter<
edm::InputTag>(
"GctInputLabel")),
10 m_textFileName(iConfig.getParameter<
std::
string>(
"TextFileName")),
12 iConfig.getUntrackedParameter<
bool>(
"HexUpperCase",
false)) {
14 for (
unsigned i = 0;
i < 4;
i++) {
15 std::stringstream fileStream;
16 int ii = (
i < 2) ?
i :
i + 4;
22 <<
"GctDigiToPsbText::GctDigiToPsbText : " 23 <<
" couldn't create the file " <<
fileName << std::endl;
30 for (
unsigned i = 0;
i < 4;
i++)
46 uint16_t
data[4][2] = {{0}};
47 for (
int i = 0;
i < 4;
i++)
48 for (
int j = 0; j < 2; j++)
51 std::stringstream sstrm;
53 sstrm << std::uppercase;
55 sstrm.unsetf(std::ios::uppercase);
58 unsigned short cbs[2] = {1, 0};
62 unsigned iIsola, iNoIso;
64 for (
int i = 0;
i < 4;
i++) {
71 data[iIsola][cycle] = gctIsolaEm->at(
i).raw();
72 data[iNoIso][cycle] = gctNoIsoEm->at(
i).raw();
76 sstrm << setw(4) << setfill(
'0') << std::hex
77 << (data[iIsola][cycle] & 0x7fff) + ((cbs[cycle] & 0
x1) << 15);
78 m_file[iIsola] << sstrm.str() << std::endl;
80 sstrm << setw(4) << setfill(
'0') << std::hex
81 << (data[iNoIso][cycle] & 0x7fff) + ((cbs[cycle] & 0x1) << 15);
82 m_file[iNoIso] << sstrm.str() << std::endl;
86 for (
unsigned i = 0;
i < 4;
i++)
std::ofstream m_file[4]
handles for output files
std::string m_textFileName
basename for output files
edm::InputTag m_gctInputLabel
label for input digis
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool m_hexUpperCase
write upper case hex words
~GctDigiToPsbText() override
char data[epos_bytes_allocation]
void analyze(const edm::Event &, const edm::EventSetup &) override
GctDigiToPsbText(const edm::ParameterSet &)