CMS 3D CMS Logo

Functions | Variables
recycleTccEmu.cc File Reference
#include <iostream>
#include <fstream>
#include <sstream>
#include <cinttypes>
#include <iomanip>
#include <cstdlib>
#include <cstdio>
#include <cstring>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Variables

uint16_t mem [nChs][nEvts]
 
const int nChs = 68
 
const int nEvts = 2048
 

Detailed Description

The TCC memory for FE data emulation takes a fixed number, 2048, of events. This standalone application completes a FE emulation data file with an arbitrary number of events (<=2048) in order to have the required 2048 events. The N initial events are repeated till having 2048 events. In general the number of initial events is choosen as a divider of 2048.

Definition in file recycleTccEmu.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

===============================================================================================================================================================================================


variant2: for each run define phi-averaged A for normalization channel (Dref,16) and then, divide Rijk on it, i.e. get RRijk




















































































eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=29 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=28

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:







Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Sticking ADC counts in neughbouring TS for HB:

Sticking ADC counts in neughbouring TS for HE:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:





Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:





Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:


CALO JETS


PF JETS

Definition at line 23 of file recycleTccEmu.cc.

References dir2webdir::argc, GCPpyPlots::argv, gather_cfg::cout, TauDecayModes::dec, beamvalidation::exit(), recoMuon::in, mem, nChs, nEvts, MillePedeFileConverter_cfg::out, alignCSCRings::s, and heppy_batch::val.

23  {
24  if ((argc >= 2 && ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0))) || argc != 3) {
25  cout << "Usage: recycleTccEmu infile outfile\n";
26  return 1;
27  }
28 
29  string ifilename = argv[1];
30  string ofilename = argv[2];
31 
32  for (int iCh = 0; iCh < nChs; ++iCh) {
33  for (int iEvts = 0; iEvts < nEvts; ++iEvts) {
34  mem[iCh][iEvts] = 0xFFFF;
35  }
36  }
37 
38  ifstream in(ifilename.c_str());
39  int chnb;
40  int bcnb;
41  int val;
42  int dummy;
43  int oldLineCnt = 0;
44 
45  //reads input file:
46  if (in) {
47  while (!in.eof()) {
48  in >> dec >> chnb >> bcnb >> hex >> val >> dummy;
49  mem[chnb - 1][bcnb] = val & 0x7FF;
50  if (mem[chnb - 1][bcnb] != val) {
51  cout << "Invalid Et value at line " << oldLineCnt + 1 << ".\n";
52  exit(1);
53  }
54  // cout<<"Channel: "<< dec <<chnb <<", BX: "
55  // << dec << bcnb << " filled with val:"<< hex<< mem[chnb-1][bcnb]
56  // << dec << endl;
57  ++oldLineCnt;
58  }
59  } else {
60  cout << "Failed to open file " << ifilename << "\n";
61  }
62 
63  in.close();
64  ofstream out(ofilename.c_str());
65 
66  if (!out) {
67  cout << "Failed to open file '" << ofilename << "' in write mode.\n";
68  return 1;
69  }
70 
71  bool singleOldEventCnt = true;
72  int oldEventCnt[nChs];
73  //fills output file:
74  for (int iCh = 0; iCh < nChs; ++iCh) {
75  int evtcnt = 0;
76  //find first not initialized events:
77  while (evtcnt < nEvts && mem[iCh][evtcnt] != 0xFFFF) {
78  ++evtcnt;
79  }
80  //cout << "ch " << iCh << " event count: " << evtcnt << "\n";
81  oldEventCnt[iCh] = evtcnt;
82  if (oldEventCnt[0] != oldEventCnt[iCh])
83  singleOldEventCnt = false;
84  if (evtcnt == 0) {
85  cout << "Error: no data found for channel " << iCh << "\n";
86  }
87  //clones data of channel iCh
88  for (int ievt = evtcnt; ievt < nEvts; ++ievt) {
89  if (mem[iCh][ievt] != 0xFFFF) {
90  cout << "Error: memory offset of channel " << iCh << " events are not contiguous.\n";
91  exit(1);
92  }
93  mem[iCh][ievt] = mem[iCh][ievt % evtcnt];
94  }
95 
96  for (int ievt = 0; ievt < nEvts; ++ievt) {
97  out << iCh + 1 << "\t" << ievt << "\t" << hex << "0x" << setfill('0') << setw(4) << mem[iCh][ievt] << setfill(' ')
98  << dec << "\t0"
99  << "\n";
100  }
101  }
102 
103  //warning for aperiodic case:
104  if (singleOldEventCnt && (nEvts % oldEventCnt[0] != 0)) {
105  cout << "Warning: ouput event count (2048) is not a mulitple of input "
106  "event counts\n";
107  }
108  if (!singleOldEventCnt) {
109  stringstream s;
110  for (int iCh = 0; iCh < nChs; ++iCh) {
111  if (nEvts % oldEventCnt[iCh]) {
112  s << (s.str().empty() ? "" : ", ") << iCh;
113  }
114  }
115  if (!s.str().empty())
116  cout << "Warning: ouput event count (2048) for channel" << (s.str().size() > 1 ? "s" : "") << " " << s.str()
117  << " is not a mulitple of input event counts\n";
118  }
119 
120  if (!singleOldEventCnt) {
121  cout << "Info: in the input file the event count depends on the channel";
122  }
123 }
const int nChs
uint16_t mem[nChs][nEvts]
const int nEvts
def exit(msg="")

Variable Documentation

◆ mem

uint16_t mem[nChs][nEvts]

◆ nChs

const int nChs = 68

Definition at line 11 of file recycleTccEmu.cc.

Referenced by ecalsrcondtools::importSrpConfigFile(), and main().

◆ nEvts

const int nEvts = 2048