CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
EcalSimRawData Class Reference

#include <EcalSimRawData.h>

Inheritance diagram for EcalSimRawData:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 EcalSimRawData (const edm::ParameterSet &pset)
 
 ~EcalSimRawData () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

enum  writeMode_t { littleEndian, bigEndian, ascii }
 

Private Member Functions

void checkGeometry (const edm::EventSetup &eventSetup)
 
void checkTriggerMap (const edm::EventSetup &eventSetup)
 
int cIndex2iTtEta (int iTtEta0) const
 
int cIndex2TtPhi (int iTtPhi0) const
 
void elec2GeomNum (int ittEta0, int ittPhi0, int strip1, int ch1, int &iEta0, int &iPhi0) const
 
void fwrite (std::ofstream &f, uint16_t data, int &iword, bool hpar=true) const
 
void genFeData (std::string basename, int iEvent, const std::vector< uint16_t > adcCount[nEbEta][nEbPhi]) const
 
void genSrData (std::string basename, int iEvent, int ttf[nEbTtEta][nTtPhi]) const
 
void genTccIn (std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
 
void genTccOut (std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
 
void getEbDigi (const edm::Event &event, std::vector< uint16_t > adc[nEbEta][nEbPhi]) const
 
std::string getExt () const
 
void getSrfs (const edm::Event &event, int ebSrf[nTtEta][nTtPhi], int eeSrf[nEndcaps][nScX][nScY]) const
 
void getTp (const edm::Event &event, const std::string &collName, int tp[nTtEta][nTtPhi]) const
 
int iEta2cIndex (int iEta) const
 
int iPhi2cIndex (int iPhi) const
 
int iTtEta2cIndex (int iTtEta) const
 
int iTtPhi2cIndex (int iTtPhi) const
 
void setHParity (uint16_t &a) const
 

Private Attributes

std::string basename_
 
int dccNum_
 
std::string digiProducer_
 
std::string ebDigiCollection_
 
std::string ebSrFlagCollection_
 
std::string eeDigiCollection_
 
std::string eeSrFlagCollection_
 
std::unique_ptr< EcalSelectiveReadoutesr_
 
bool fe2dcc_
 
bool fe2tcc_
 
int iEvent
 
std::string srDigiProducer_
 
std::ofstream srfFile
 
bool srp2dcc_
 
bool tcc2dcc_
 
int tccInDefaultVal_
 
int tccNum_
 
std::string tcpDigiCollection_
 
const CaloGeometrytheGeometry
 
const EcalTrigTowerConstituentsMaptheTriggerTowerMap
 
std::string tpDigiCollection_
 
std::string tpProducer_
 
bool tpVerbose_
 
std::ofstream ttfFile
 
writeMode_t writeMode_
 
bool xtalVerbose_
 

Static Private Attributes

static const int ebDccPhiEdge = 20
 
static const int ebTccPhiEdge = 20
 
static const int nDccEndcap = 9
 
static const int nDccInPhi = 18
 
static const int nEbEta = 170
 
static const int nEbPhi = 360
 
static const int nEbTtEta = nEbEta / ttEdge
 
static const int nEeTtEta = 11
 
static const int nEeX = 100
 
static const int nEeY = 100
 
static const int nEndcaps = 2
 
static const int nScX = 20
 
static const int nScY = 20
 
static const int nTccEndcap = 36
 
static const int nTccInPhi = 18
 
static const int nTtEta = nEbTtEta + 2 * nEeTtEta
 
static const int nTtPhi = nEbPhi / ttEdge
 
static const int nTtPhisPerEbDcc = 4
 
static const int nTtPhisPerEbTcc = 4
 
static const int nTtSmEta = 17
 
static const int nTtSmPhi = 4
 
static const int nTtTypes = 2
 
static const int scEdge = 5
 
static const int strip2Eta [nTtTypes][ttEdge]
 
static const int stripCh2Phi [nTtTypes][ttEdge][ttEdge]
 
static const int ttEdge = 5
 
static const int ttType [nEbTtEta]
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

The EcalSimRawData CMSSW module produces raw data from digis. The raw data are written into files which can be loaded into the TCC DCC and SRP boards in order to emulate the front-end. Only barrel is fully supported. The produced files for TCC assumes a special LUT in the TCC forged for FE emulation mode.

Module Parameters:

Definition at line 42 of file EcalSimRawData.h.

Member Enumeration Documentation

◆ writeMode_t

Output format mode

littleEndian: little endian binary bigEndian: big endian binary ascii: ascii mode. The one accepted by the TCC, DCC and SRP board control software.

Enumerator
littleEndian 
bigEndian 
ascii 

Definition at line 185 of file EcalSimRawData.h.

Constructor & Destructor Documentation

◆ EcalSimRawData()

EcalSimRawData::EcalSimRawData ( const edm::ParameterSet pset)
explicit

Constructor

Parameters
psetCMSSW configuration

Definition at line 42 of file EcalSimRawData.cc.

42  {
43  // sets up parameters:
44  digiProducer_ = params.getParameter<string>("unsuppressedDigiProducer");
45  ebDigiCollection_ = params.getParameter<std::string>("EBdigiCollection");
46  eeDigiCollection_ = params.getParameter<std::string>("EEdigiCollection");
47  srDigiProducer_ = params.getParameter<string>("srProducer");
48  ebSrFlagCollection_ = params.getParameter<std::string>("EBSrFlagCollection");
49  eeSrFlagCollection_ = params.getParameter<std::string>("EESrFlagCollection");
50  tpDigiCollection_ = params.getParameter<std::string>("trigPrimDigiCollection");
51  tcpDigiCollection_ = params.getParameter<std::string>("tcpDigiCollection");
52  tpProducer_ = params.getParameter<string>("trigPrimProducer");
53  xtalVerbose_ = params.getUntrackedParameter<bool>("xtalVerbose", false);
54  tpVerbose_ = params.getUntrackedParameter<bool>("tpVerbose", false);
55  tcc2dcc_ = params.getUntrackedParameter<bool>("tcc2dccData", true);
56  srp2dcc_ = params.getUntrackedParameter<bool>("srp2dccData", true);
57  fe2dcc_ = params.getUntrackedParameter<bool>("fe2dccData", true);
58  fe2tcc_ = params.getUntrackedParameter<bool>("fe2tccData", true);
59  dccNum_ = params.getUntrackedParameter<int>("dccNum", -1);
60  tccNum_ = params.getUntrackedParameter<int>("tccNum", -1);
61  tccInDefaultVal_ = params.getUntrackedParameter<int>("tccInDefaultVal", 0xffff);
62  basename_ = params.getUntrackedParameter<std::string>("outputBaseName");
63 
64  iEvent = 0;
65 
66  string writeMode = params.getParameter<string>("writeMode");
67 
68  if (writeMode == string("littleEndian")) {
70  } else if (writeMode == string("bigEndian")) {
72  } else {
73  writeMode_ = ascii;
74  }
75 }

References iEvent, CalibrationSummaryClient_cfi::params, AlCaHLTBitMon_QueryRunRegistry::string, and EcalSimRawData_cfi::writeMode.

◆ ~EcalSimRawData()

EcalSimRawData::~EcalSimRawData ( )
inlineoverride

Destructor

Definition at line 51 of file EcalSimRawData.h.

51 {};

Member Function Documentation

◆ analyze()

void EcalSimRawData::analyze ( const edm::Event event,
const edm::EventSetup es 
)
overridevirtual

Main method. Called back for each event. This method produced the raw data and write them to disk.

Implements edm::one::EDAnalyzerBase.

Definition at line 77 of file EcalSimRawData.cc.

77  {
78  // Event counter:
79  ++iEvent;
80 
81  if (xtalVerbose_ | tpVerbose_) {
82  cout << "=================================================================="
83  "====\n"
84  << " Event " << iEvent << "\n"
85  << "------------------------------------------------------------------"
86  "----\n";
87  }
88 
89  if (fe2dcc_) {
90  vector<uint16_t> adc[nEbEta][nEbPhi];
93  }
94 
95  if (fe2tcc_) {
96  int tcp[nTtEta][nTtPhi] = {{0}};
98  genTccIn(basename_, iEvent, tcp);
99  }
100 
101  if (tcc2dcc_) {
102  int tp[nTtEta][nTtPhi] = {{0}};
105  }
106 
107  // SR flags:
108  int ebSrf[nTtEta][nTtPhi];
109  int eeSrf[nEndcaps][nScX][nScY];
110 
111  if (srp2dcc_) {
112  getSrfs(event, ebSrf, eeSrf);
113  genSrData(basename_, iEvent, ebSrf);
114  }
115 }

References ecalMGPA::adc(), gather_cfg::cout, iEvent, nEndcaps, and cmsswSequenceInfo::tp.

◆ checkGeometry()

void EcalSimRawData::checkGeometry ( const edm::EventSetup eventSetup)
private

call these once an event, to make sure everything is up-to-date

◆ checkTriggerMap()

void EcalSimRawData::checkTriggerMap ( const edm::EventSetup eventSetup)
private

◆ cIndex2iTtEta()

int EcalSimRawData::cIndex2iTtEta ( int  iTtEta0) const
inlineprivate

Converse of iTtEta2cIndex

Parameters
iTtEta0c eta index of TT
stdCMSSW TT eta index

Definition at line 235 of file EcalSimRawData.h.

235 { return (iTtEta0 < 28) ? (iTtEta0 - 28) : (iTtEta0 - 27); }

◆ cIndex2TtPhi()

int EcalSimRawData::cIndex2TtPhi ( int  iTtPhi0) const
inlineprivate

Converse of iTtPhi2cIndex

Parameters
iTtPhi0phi index of TT
Returns
std CMSS TT index

Definition at line 241 of file EcalSimRawData.h.

241 { return iTtPhi0 + 1; }

◆ elec2GeomNum()

void EcalSimRawData::elec2GeomNum ( int  ittEta0,
int  ittPhi0,
int  strip1,
int  ch1,
int &  iEta0,
int &  iPhi0 
) const
private

Converts electronic number of an ECAL barrel channel to geometrical indices

Parameters
ittEta0trigger tower c index
ittPhi0trigger tower c index
strip1strip index within the TT. Runs from 1 to 5.
ch1channel electronics number within the VFE. Runs from 1 to 5.
[out]iEta0eta c index of the channel
[out]iPhi0eta c index of the channel

Definition at line 117 of file EcalSimRawData.cc.

117  {
118  assert(0 <= ittEta0 && ittEta0 < nEbTtEta);
119  assert(0 <= ittPhi0 && ittPhi0 < nTtPhi);
120  assert(1 <= strip1 && strip1 <= ttEdge);
121  assert(1 <= ch1 && ch1 <= ttEdge);
122  const int type = ttType[ittEta0];
123  iEta0 = ittEta0 * ttEdge + strip2Eta[type][strip1 - 1];
124  iPhi0 = ittPhi0 * ttEdge + stripCh2Phi[type][strip1 - 1][ch1 - 1];
125  assert(0 <= iEta0 && iEta0 < nEbEta);
126  assert(0 <= iPhi0 && iPhi0 < nEbPhi);
127 }

References cms::cuda::assert().

◆ fwrite()

void EcalSimRawData::fwrite ( std::ofstream &  f,
uint16_t  data,
int &  iword,
bool  hpar = true 
) const
private

Write a data 16-bit word into file according to selected format.

Parameters
fthe file stream to write to
datathe peace of data to write
[in,out]iwordpass zero when writing for the first time in a file, then the value returned by the previous call. Counts the number of words written into the file.
hparif true the horizontal odd word parity is set before writing the word into the file.

Definition at line 129 of file EcalSimRawData.cc.

129  {
130  if (hpar) {
131  // set horizontal odd parity bit:
132  setHParity(data);
133  }
134 
135  switch (writeMode_) {
136  case littleEndian: {
137  char c = data & 0x00FF;
138  f.write(&c, sizeof(c));
139  c = (data >> 8) & 0x00FF;
140  f.write(&c, sizeof(c));
141  } break;
142  case bigEndian: {
143  char c = (data >> 8) & 0x00FF;
144  f.write(&c, sizeof(c));
145  c = data & 0x00FF;
146  f.write(&c, sizeof(c));
147  } break;
148  case ascii:
149  f << ((iWord % 8 == 0 && iWord != 0) ? "\n" : "") << "0x" << setfill('0') << setw(4) << hex << data << "\t" << dec
150  << setfill(' ');
151  break;
152  }
153  ++iWord;
154 }

References HltBtagPostValidation_cff::c, std::data(), TauDecayModes::dec, and f.

◆ genFeData()

void EcalSimRawData::genFeData ( std::string  basename,
int  iEvent,
const std::vector< uint16_t >  adcCount[nEbEta][nEbPhi] 
) const
private

Generates FE crystal data

Parameters
basenamebase for the output file name. DCC number is appended to the name
iEventevent index
adcCountthe payload, the ADC count of the channels.

stripHeader |= parity(stripHeader) << 15;

Definition at line 169 of file EcalSimRawData.cc.

169  {
170  int smf = 0;
171  int gmf = 0;
172  int nPendingEvt = 0;
173  int monitorFlag = 0;
174  int chFrameLen = adcCount[0][0].size() + 1;
175 
176  int iWord = 0;
177 
178  for (int iZ0 = 0; iZ0 < 2; ++iZ0) {
179  for (int iDccPhi0 = 0; iDccPhi0 < nDccInPhi; ++iDccPhi0) {
180  int iDcc1 = iDccPhi0 + iZ0 * nDccInPhi + nDccEndcap + 1;
181 
182  if (dccNum_ != -1 && dccNum_ != iDcc1)
183  continue;
184 
185  stringstream s;
186  s.str("");
187  const string &ext = getExt();
188  s << basename << "_fe2dcc" << setfill('0') << setw(2) << iDcc1 << setfill(' ') << ext;
189  ofstream f(s.str().c_str(), (iEvent == 1 ? ios::ate : ios::app));
190 
191  if (f.fail())
192  return;
193 
194  if (writeMode_ == ascii) {
195  f << (iEvent == 1 ? "" : "\n") << "[Event:" << iEvent << "]\n";
196  }
197 
198  for (int iTtEtaInSm0 = 0; iTtEtaInSm0 < nTtSmEta; ++iTtEtaInSm0) {
199  int iTtEta0 = iZ0 * nTtSmEta + iTtEtaInSm0;
200  for (int iTtPhiInSm0 = 0; iTtPhiInSm0 < nTtSmPhi; ++iTtPhiInSm0) {
201  // phi=0deg at middle of 1st barrel DCC:
202  int iTtPhi0 = -nTtPhisPerEbDcc / 2 + iDccPhi0 * nTtPhisPerEbDcc + iTtPhiInSm0;
203  if (iTtPhi0 < 0)
204  iTtPhi0 += nTtPhi;
205  for (int stripId1 = 1; stripId1 <= ttEdge; ++stripId1) {
206  uint16_t stripHeader =
207  0xF << 11 | (nPendingEvt & 0x3F) << 5 | (gmf & 0x1) << 4 | (smf & 0x1) << 3 | (stripId1 & 0x7);
209  fwrite(f, stripHeader, iWord);
210 
211  for (int xtalId1 = 1; xtalId1 <= ttEdge; ++xtalId1) {
212  uint16_t crystalHeader = 1 << 14 | (chFrameLen & 0xFF) << 4 | (monitorFlag & 0x1) << 3 | (xtalId1 & 0x7);
213  // crystalHeader |=parity(crystalHeader) << 15;
214  fwrite(f, crystalHeader, iWord);
215 
216  int iEta0;
217  int iPhi0;
218  elec2GeomNum(iTtEta0, iTtPhi0, stripId1, xtalId1, iEta0, iPhi0);
219  if (xtalVerbose_) {
220  cout << dec << "iDcc1 = " << iDcc1 << "\t"
221  << "iEbTtEta0 = " << iTtEta0 << "\t"
222  << "iEbTtPhi0 = " << iTtPhi0 << "\t"
223  << "stripId1 = " << stripId1 << "\t"
224  << "xtalId1 = " << xtalId1 << "\t"
225  << "iEta0 = " << iEta0 << "\t"
226  << "iPhi0 = " << iPhi0 << "\t"
227  << "adc[5] = 0x" << hex << adcCount[iEta0][iPhi0][5] << dec << "\n";
228  }
229 
230  const vector<uint16_t> &adc = adcCount[iEta0][iPhi0];
231  for (unsigned iSample = 0; iSample < adc.size(); ++iSample) {
232  uint16_t data = adc[iSample] & 0x3FFF;
233  // data |= parity(data);
234  fwrite(f, data, iWord);
235  } // next time sample
236  } // next crystal in strip
237  } // next strip in TT
238  } // next TT along phi
239  } // next TT along eta
240  } // next DCC
241  } // next half-barrel
242 }

References ecalMGPA::adc(), gather_cfg::cout, std::data(), TauDecayModes::dec, f, iEvent, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

◆ genSrData()

void EcalSimRawData::genSrData ( std::string  basename,
int  iEvent,
int  ttf[nEbTtEta][nTtPhi] 
) const
private

Generates SR flags

Parameters
basenamebase for the output file name. DCC number is appended to the name
iEventevent index
thetrigger tower flags

Definition at line 244 of file EcalSimRawData.cc.

244  {
245  for (int iZ0 = 0; iZ0 < 2; ++iZ0) {
246  for (int iDccPhi0 = 0; iDccPhi0 < nDccInPhi; ++iDccPhi0) {
247  int iDcc1 = iDccPhi0 + iZ0 * nDccInPhi + nDccEndcap + 1;
248  if (dccNum_ != -1 && dccNum_ != iDcc1)
249  continue;
250  stringstream s;
251  s.str("");
252  s << basename << "_ab2dcc" << setfill('0') << setw(2) << iDcc1 << setfill(' ') << getExt();
253  ofstream f(s.str().c_str(), (iEvent == 1 ? ios::ate : ios::app));
254 
255  if (f.fail())
256  throw cms::Exception(string("Cannot create/open file ") + s.str() + ".");
257 
258  int iWord = 0;
259 
260  if (writeMode_ == ascii) {
261  f << (iEvent == 1 ? "" : "\n") << "[Event:" << iEvent << "]\n";
262  }
263 
264  const uint16_t le1 = 0;
265  const uint16_t le0 = 0;
266  const uint16_t h1 = 1;
267  const uint16_t nFlags = 68;
268  uint16_t data = (h1 & 0x1) << 14 | (le1 & 0x1) << 12 | (le0 & 0x1) << 11 | (nFlags & 0x7F);
269 
270  fwrite(f, data, iWord, true);
271 
272  int iFlag = 0;
273  data = 0;
274 
275  for (int iTtEtaInSm0 = 0; iTtEtaInSm0 < nTtSmEta; ++iTtEtaInSm0) {
276  // int iTtEbEta0 = iZ0*nTtSmEta + iTtEtaInSm0;
277  int iTtEta0 = nEeTtEta + iZ0 * nTtSmEta + iTtEtaInSm0;
278  for (int iTtPhiInSm0 = 0; iTtPhiInSm0 < nTtSmPhi; ++iTtPhiInSm0) {
279  // phi=0deg at middle of 1st barrel DCC:
280  int iTtPhi0 = -nTtPhisPerEbDcc / 2 + iDccPhi0 * nTtPhisPerEbDcc + iTtPhiInSm0;
281  if (iTtPhi0 < 0)
282  iTtPhi0 += nTtPhi;
283  // flags are packed by four:
284  //|15 |14 |13-12 |11 9|8 6|5 3|2 0|
285  //| P | 0 | X X | srf i+3| srf i+2| srf i+1| srf i |
286  //| | | | field 3 |field 2 | field 1| field 0|
287  const int field = iFlag % 4;
288  // cout << "TtEta0: " << iTtEta0 << "\tTtPhi0: " << iTtPhi0 << "\n";
289  // cout << "#" << oct << (int)srf[iTtEta0][iTtPhi0] << "o ****> #" <<
290  // oct << (srf[iTtEta0][iTtPhi0] << (field*3)) << "o\n" << dec;
291 
292  data |= srf[iTtEta0][iTtPhi0] << (field * 3);
293 
294  if (field == 3) {
295  // cout << srf[iTtEta0][iTtPhi0] << "----> 0x" << hex << data <<
296  // "\n";
297  fwrite(f, data, iWord, true);
298  data = 0;
299  }
300  ++iFlag;
301  } // next TT along phi
302  } // next TT along eta
303  } // next DCC
304  } // next half-barrel
305 }

References std::data(), f, iEvent, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

◆ genTccIn()

void EcalSimRawData::genTccIn ( std::string  basename,
int  iEvent,
const int  tps[nTtEta][nTtPhi] 
) const
private

Generates FE trigger primitives data

Parameters
basenamebase for the output file name. DCC number is appended to the name
iEventevent index
tpsthe payload, the trigger primitives

Definition at line 307 of file EcalSimRawData.cc.

307  {
308  for (int iZ0 = 0; iZ0 < 2; ++iZ0) {
309  for (int iTccPhi0 = 0; iTccPhi0 < nTccInPhi; ++iTccPhi0) {
310  int iTcc1 = iTccPhi0 + iZ0 * nTccInPhi + nTccEndcap + 1;
311 
312  if (tccNum_ != -1 && tccNum_ != iTcc1)
313  continue;
314 
315  stringstream s;
316  s.str("");
317  const char *ext = ".txt"; // only ascii mode supported for TCP
318 
319  s << basename << "_tcc" << setfill('0') << setw(2) << iTcc1 << setfill(' ') << ext;
320  ofstream fe2tcc(s.str().c_str(), (iEvent == 1 ? ios::ate : ios::app));
321 
322  if (fe2tcc.fail())
323  throw cms::Exception(string("Failed to create file ") + s.str() + ".");
324 
325  int memPos = iEvent - 1;
326  int iCh1 = 1;
327  for (int iTtEtaInSm0 = 0; iTtEtaInSm0 < nTtSmEta; ++iTtEtaInSm0) {
328  int iTtEta0 = (iZ0 == 0) ? 27 - iTtEtaInSm0 : 28 + iTtEtaInSm0;
329  for (int iTtPhiInSm0 = 0; iTtPhiInSm0 < nTtSmPhi; ++iTtPhiInSm0) {
330  // phi=0deg at middle of 1st barrel DCC:
331  int iTtPhi0 = -nTtPhisPerEbTcc / 2 + iTccPhi0 * nTtPhisPerEbTcc + iTtPhiInSm0;
332  iTtPhi0 += nTtPhisPerEbTcc * iTccPhi0;
333  if (iTtPhi0 < 0)
334  iTtPhi0 += nTtPhi;
335  uint16_t tp_fe2tcc = (tcp[iTtEta0][iTtPhi0] & 0x7ff); // keep only Et (9:0) and FineGrain (10)
336 
337  if (tpVerbose_ && tp_fe2tcc != 0) {
338  cout << dec << "iTcc1 = " << iTcc1 << "\t"
339  << "iTtEta0 = " << iTtEta0 << "\t"
340  << "iTtPhi0 = " << iTtPhi0 << "\t"
341  << "iCh1 = " << iCh1 << "\t"
342  << "memPos = " << memPos << "\t"
343  << "tp = 0x" << setfill('0') << hex << setw(3) << tp_fe2tcc << dec << setfill(' ') << "\n";
344  }
345  fe2tcc << iCh1 << "\t" << memPos << "\t" << setfill('0') << hex << "0x" << setw(4) << tp_fe2tcc << "\t"
346  << "0" << dec << setfill(' ') << "\n";
347  ++iCh1;
348  } // next TT along phi
349  } // next TT along eta
350  fe2tcc << std::flush;
351  fe2tcc.close();
352  } // next TCC
353  } // next half-barrel
354 }

References gather_cfg::cout, TauDecayModes::dec, iEvent, and alignCSCRings::s.

◆ genTccOut()

void EcalSimRawData::genTccOut ( std::string  basename,
int  iEvent,
const int  tps[nTtEta][nTtPhi] 
) const
private

Generates TCC->DCC data

Parameters
basenamebase for the output file name. DCC number is appended to the name
iEventevent index
tpsthe payload, the trigger primitives

Definition at line 356 of file EcalSimRawData.cc.

356  {
357  int iDccWord = 0;
358 
359  for (int iZ0 = 0; iZ0 < 2; ++iZ0) {
360  for (int iTccPhi0 = 0; iTccPhi0 < nTccInPhi; ++iTccPhi0) {
361  int iTcc1 = iTccPhi0 + iZ0 * nTccInPhi + nTccEndcap + 1;
362 
363  if (tccNum_ != -1 && tccNum_ != iTcc1)
364  continue;
365 
366  stringstream s;
367  s.str("");
368  const char *ext = ".txt"; // only ascii mode supported for TCP
369 
370  s << basename << "_tcc" << setfill('0') << setw(2) << iTcc1 << setfill(' ') << ext;
371 
372  s.str("");
373  s << basename << "_tcc2dcc" << setfill('0') << setw(2) << iTcc1 << setfill(' ') << getExt();
374  ofstream dccF(s.str().c_str(), (iEvent == 1 ? ios::ate : ios::app));
375 
376  if (dccF.fail()) {
377  cout << "Warning: failed to create or open file " << s.str() << ".\n";
378  return;
379  }
380 
381  const uint16_t h1 = 1;
382  const uint16_t le1 = 0;
383  const uint16_t le0 = 0;
384  const uint16_t nSamples = 1;
385  const uint16_t nTts = 68;
386  const uint16_t data =
387  (h1 & 0x1) << 14 | (le1 & 0x1) << 12 | (le0 & 0x1) << 11 | (nSamples & 0xF) << 7 | (nTts & 0x7F);
388  dccF << (iEvent == 1 ? "" : "\n") << "[Event:" << iEvent << "]\n";
389  fwrite(dccF, data, iDccWord, false);
390 
391  int memPos = iEvent - 1;
392  int iCh1 = 1;
393  for (int iTtEtaInSm0 = 0; iTtEtaInSm0 < nTtSmEta; ++iTtEtaInSm0) {
394  int iTtEta0 = nEeTtEta + iZ0 * nTtSmEta + iTtEtaInSm0;
395  for (int iTtPhiInSm0 = 0; iTtPhiInSm0 < nTtSmPhi; ++iTtPhiInSm0) {
396  // phi=0deg at middle of 1st barrel DCC:
397  int iTtPhi0 = -nTtPhisPerEbTcc / 2 + iTccPhi0 * nTtPhisPerEbTcc + iTtPhiInSm0;
398  if (iTtPhi0 < 0)
399  iTtPhi0 += nTtPhi;
400 
401  if (tpVerbose_) {
402  cout << dec << "iTcc1 = " << iTcc1 << "\t"
403  << "iTtEta0 = " << iTtEta0 << "\t"
404  << "iTtPhi0 = " << iTtPhi0 << "\t"
405  << "iCh1 = " << iCh1 << "\t"
406  << "memPos = " << memPos << "\t"
407  << "tp = 0x" << hex << tps[iTtEta0][iTtPhi0] << dec << "\n";
408  }
409  fwrite(dccF, tps[iTtEta0][iTtPhi0], iDccWord, false);
410  ++iCh1;
411  } // next TT along phi
412  } // next TT along eta
413  } // next TCC
414  } // next half-barrel
415 }

References gather_cfg::cout, std::data(), TauDecayModes::dec, iEvent, PresampleTask_cfi::nSamples, alignCSCRings::s, and testProducerWithPsetDescEmpty_cfi::x1.

◆ getEbDigi()

void EcalSimRawData::getEbDigi ( const edm::Event event,
std::vector< uint16_t >  adc[nEbEta][nEbPhi] 
) const
private

Retrieves barrel digis (APD ADC count).

Parameters
eventCMS event
adc[out] the adc counts: adc[iEta0][iPhi0][iTimeSample0]

Definition at line 478 of file EcalSimRawData.cc.

478  {
480  event.getByLabel(digiProducer_, ebDigiCollection_, hEbDigis);
481 
482  int nSamples = 0;
483  if (hEbDigis.isValid() && !hEbDigis->empty()) { // there is at least one digi
484  nSamples = hEbDigis->begin()->size(); // gets the sample count from 1st digi
485  }
486 
487  const uint16_t suppressed = 0xFFFF;
488 
489  adc[0][0] = vector<uint16_t>(nSamples, suppressed);
490 
491  for (int iEbEta = 0; iEbEta < nEbEta; ++iEbEta) {
492  for (int iEbPhi = 0; iEbPhi < nEbPhi; ++iEbPhi) {
493  adc[iEbEta][iEbPhi] = adc[0][0];
494  }
495  }
496  if (hEbDigis.isValid()) {
497  if (xtalVerbose_)
498  cout << setfill('0');
499  for (EBDigiCollection::const_iterator it = hEbDigis->begin(); it != hEbDigis->end(); ++it) {
500  const EBDataFrame &frame = *it;
501 
502  int iEta0 = iEta2cIndex((frame.id()).ieta());
503  int iPhi0 = iPhi2cIndex((frame.id()).iphi());
504 
505  // cout << "xtl indices conv: (" << frame.id().ieta() << ","
506  // << frame.id().iphi() << ") -> ("
507  // << iEta0 << "," << iPhi0 << ")\n";
508 
509  if (iEta0 < 0 || iEta0 >= nEbEta) {
510  cout << "iEta0 (= " << iEta0 << ") is out of range ("
511  << "[0," << nEbEta - 1 << "])\n";
512  }
513  if (iPhi0 < 0 || iPhi0 >= nEbPhi) {
514  cout << "iPhi0 (= " << iPhi0 << ") is out of range ("
515  << "[0," << nEbPhi - 1 << "])\n";
516  }
517 
518  if (xtalVerbose_) {
519  cout << iEta0 << "\t" << iPhi0 << ":\t";
520  cout << hex;
521  }
522 
523  if (nSamples != frame.size()) {
524  throw cms::Exception("EcalSimRawData",
525  "Found EB digis with different sample count! This "
526  "is not supported by EcalSimRawData.");
527  }
528 
529  for (int iSample = 0; iSample < nSamples; ++iSample) {
530  const EcalMGPASample &sample = frame.sample(iSample);
531  uint16_t encodedAdc = sample.raw();
532  adc[iEta0][iPhi0][iSample] = encodedAdc;
533  if (xtalVerbose_) {
534  cout << (iSample > 0 ? " " : "") << "0x" << setw(4) << encodedAdc;
535  }
536  }
537  if (xtalVerbose_)
538  cout << "\n" << dec;
539  }
540  if (xtalVerbose_)
541  cout << setfill(' ');
542  }
543 }

References ecalMGPA::adc(), edm::DataFrameContainer::begin(), gather_cfg::cout, TauDecayModes::dec, edm::DataFrameContainer::empty(), edm::DataFrameContainer::end(), Exception, amptDefault_cfi::frame, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, edm::HandleBase::isValid(), PresampleTask_cfi::nSamples, and simplePhotonAnalyzer_cfi::sample.

◆ getExt()

string EcalSimRawData::getExt ( ) const
private

Help function to get the file extension which depends on the output formats.

Definition at line 156 of file EcalSimRawData.cc.

156  {
157  switch (writeMode_) {
158  case littleEndian:
159  return ".le";
160  case bigEndian:
161  return ".be";
162  case ascii:
163  return ".txt";
164  default:
165  return ".?";
166  }
167 }

◆ getSrfs()

void EcalSimRawData::getSrfs ( const edm::Event event,
int  ebSrf[nTtEta][nTtPhi],
int  eeSrf[nEndcaps][nScX][nScY] 
) const
private

Computes the selective readout flags.

Parameters
[in]eventCMS event
[out]ebSrfthe computed SR flags for barrel
[out]eeSrfthe computed SR flags for endcaps

Definition at line 428 of file EcalSimRawData.cc.

430  {
431  // EE
433  event.getByLabel(srDigiProducer_, eeSrFlagCollection_, hEeSrFlags);
434  for (size_t i = 0; i < (nEndcaps * nScX * nScY); ((int *)eeSrf)[i++] = -1) {
435  };
436  if (hEeSrFlags.isValid()) {
437  for (EESrFlagCollection::const_iterator it = hEeSrFlags->begin(); it != hEeSrFlags->end(); ++it) {
438  const EESrFlag &flag = *it;
439  int iZ0 = flag.id().zside() > 0 ? 1 : 0;
440  int iX0 = flag.id().ix() - 1;
441  int iY0 = flag.id().iy() - 1;
442  assert(iZ0 >= 0 && iZ0 < nEndcaps);
443  assert(iX0 >= 0 && iX0 < nScX);
444  assert(iY0 >= 0 && iY0 < nScY);
445  eeSrf[iZ0][iX0][iY0] = flag.value();
446  }
447  } else {
448  LogWarning("EcalSimRawData") << "EE SR flag not found ("
449  << "Product label: " << srDigiProducer_ << "Producet instance: " << eeSrFlagCollection_
450  << ")";
451  }
452 
453  // EB
455  event.getByLabel(srDigiProducer_, ebSrFlagCollection_, hEbSrFlags);
456  for (size_t i = 0; i < (nTtEta * nTtPhi); ((int *)ebSrf)[i++] = -1) {
457  };
458  if (hEbSrFlags.isValid()) {
459  for (EBSrFlagCollection::const_iterator it = hEbSrFlags->begin(); it != hEbSrFlags->end(); ++it) {
460  const EBSrFlag &flag = *it;
461  int iEta = flag.id().ieta();
462  int iEta0 = iEta + nTtEta / 2 - (iEta >= 0 ? 1 : 0); // 0->55 from eta=-3 to eta=3
463  int iEbEta0 = iEta0 - nEeTtEta; // 0->33 from eta=-1.48 to eta=1.48
464  int iPhi0 = flag.id().iphi() - 1;
465 
466  assert(iEbEta0 >= 0 && iEbEta0 < nEbTtEta);
467  assert(iPhi0 >= 0 && iPhi0 < nTtPhi);
468 
469  ebSrf[iEbEta0][iPhi0] = flag.value();
470  }
471  } else {
472  LogWarning("EcalSimRawData") << "EB SR flag not found ("
473  << "Product label: " << srDigiProducer_ << "Producet instance: " << ebSrFlagCollection_
474  << ")";
475  }
476 }

References cms::cuda::assert(), edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), RemoveAddSevLevel::flag, mps_fire::i, L1TowerCalibrationProducer_cfi::iEta, edm::HandleBase::isValid(), and nEndcaps.

◆ getTp()

void EcalSimRawData::getTp ( const edm::Event event,
const std::string &  collName,
int  tp[nTtEta][nTtPhi] 
) const
private

Extracts the trigger primitive (TP). The collection name parameter permits to select either the TCP Fenix output or the TCC output. Note: TCP output is only valid for the barrel.

Parameters
eventCMS event
collNamelabel of the EDM collection containing the TP.
tp[out] the trigger primitives

Definition at line 545 of file EcalSimRawData.cc.

545  {
547  event.getByLabel(tpProducer_, collName, hTpDigis);
548  if (hTpDigis.isValid() && !hTpDigis->empty()) {
549  const EcalTrigPrimDigiCollection &tpDigis = *hTpDigis.product();
550 
551  // EcalSelectiveReadout::ttFlag_t ttf[nTtEta][nTtPhi];
552  for (int iTtEta0 = 0; iTtEta0 < nTtEta; ++iTtEta0) {
553  for (int iTtPhi0 = 0; iTtPhi0 < nTtPhi; ++iTtPhi0) {
554  tcp[iTtEta0][iTtPhi0] = tccInDefaultVal_;
555  }
556  }
557  if (tpVerbose_) {
558  cout << setfill('0');
559  }
560  for (EcalTrigPrimDigiCollection::const_iterator it = tpDigis.begin(); it != tpDigis.end(); ++it) {
561  const EcalTriggerPrimitiveDigi &tp = *it;
562  int iTtEta0 = iTtEta2cIndex(tp.id().ieta());
563  int iTtPhi0 = iTtPhi2cIndex(tp.id().iphi());
564  if (iTtEta0 < 0 || iTtEta0 >= nTtEta) {
565  cout << "iTtEta0 (= " << iTtEta0 << ") is out of range ("
566  << "[0," << nEbTtEta - 1 << "])\n";
567  }
568  if (iTtPhi0 < 0 || iTtPhi0 >= nTtPhi) {
569  cout << "iTtPhi0 (= " << iTtPhi0 << ") is out of range ("
570  << "[0," << nTtPhi - 1 << "])\n";
571  }
572 
573  tcp[iTtEta0][iTtPhi0] = tp[tp.sampleOfInterest()].raw();
574 
575  if (tpVerbose_) {
576  if (tcp[iTtEta0][iTtPhi0] != 0) // print non-zero values only
577  cout << collName << (collName.empty() ? "" : " ") << "TP(" << setw(2) << iTtEta0 << "," << iTtPhi0 << ") = "
578  << "0x" << setw(4) << tcp[iTtEta0][iTtPhi0] << "\tcmssw indices: " << tp.id().ieta() << " "
579  << tp.id().iphi() << "\n";
580  }
581  } // next TP
582  if (tpVerbose_)
583  cout << setfill(' ');
584  }
585 }

References edm::SortedCollection< T, SORT >::begin(), trigObjTnPSource_cfi::collName, gather_cfg::cout, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::HandleBase::isValid(), edm::Handle< T >::product(), and cmsswSequenceInfo::tp.

◆ iEta2cIndex()

int EcalSimRawData::iEta2cIndex ( int  iEta) const
inlineprivate

Converts std CMSSW crystal eta index into a c-index (contiguous integer starting from 0 and increasing with pseudo-rapidity).

Parameters
iEtastd CMSSW crystal eta index
Returns
the c-array index

Definition at line 209 of file EcalSimRawData.h.

209 { return (iEta < 0) ? iEta + 85 : iEta + 84; }

References L1TowerCalibrationProducer_cfi::iEta.

◆ iPhi2cIndex()

int EcalSimRawData::iPhi2cIndex ( int  iPhi) const
inlineprivate

Converts std CMSSW crystal phi index into a c-index (contiguous integer starting from 0 at phi=0deg and increasing with phi).

Parameters
iPhistd CMSSW crystal phi index
Returns
the c-array index

Definition at line 216 of file EcalSimRawData.h.

216  {
217  int iPhi0 = iPhi - 11;
218  if (iPhi0 < 0)
219  iPhi0 += nEbPhi;
220  return iPhi0;
221  }

References nEbPhi.

◆ iTtEta2cIndex()

int EcalSimRawData::iTtEta2cIndex ( int  iTtEta) const
inlineprivate

Converts std CMSSW ECAL trigger tower eta index into a c-index (contiguous integer starting from 0 and increasing with pseudo-rapidity).

Parameters
iEtastd CMSSW trigger tower eta index
Returns
the c-array index

Definition at line 229 of file EcalSimRawData.h.

229 { return (iTtEta < 0) ? (iTtEta + 28) : (iTtEta + 27); }

◆ iTtPhi2cIndex()

int EcalSimRawData::iTtPhi2cIndex ( int  iTtPhi) const
inlineprivate

Converts std CMSSW ECAL trigger tower phi index into a c-index (contiguous integer starting from 0 at phi=0deg and increasing with phi).

Parameters
iPhistd CMSSW ECAL trigger tower phi index
Returns
the c-array index

Definition at line 248 of file EcalSimRawData.h.

248 { return iTtPhi - 1; }

◆ setHParity()

void EcalSimRawData::setHParity ( uint16_t &  a) const
private

Definition at line 417 of file EcalSimRawData.cc.

417  {
418  const int odd = 1 << 15;
419  const int even = 0;
420  // parity bit of numbers from 0x0 to 0xF:
421  // 0 1 2 3 4 5 6 7 8 9 A B C
422  // D E F
423  const int p[16] = {even, odd, odd, even, odd, even, even, odd, odd, even, even, odd, even, odd, odd, even};
424  // inverts parity bit (LSB) of 'a' in case of even parity:
425  a ^= p[a & 0xF] ^ p[(a >> 4) & 0xF] ^ p[(a >> 8) & 0xF] ^ p[a >> 12 & 0xF] ^ odd;
426 }

References a, and AlCaHLTBitMon_ParallelJobs::p.

Member Data Documentation

◆ basename_

std::string EcalSimRawData::basename_
private

basename for output files

Definition at line 442 of file EcalSimRawData.h.

◆ dccNum_

int EcalSimRawData::dccNum_
private

Index of the DCC, FE data must be produced for. -1 for all TTCs

Definition at line 434 of file EcalSimRawData.h.

◆ digiProducer_

std::string EcalSimRawData::digiProducer_
private

Name of module/plugin/producer making digis

Definition at line 346 of file EcalSimRawData.h.

◆ ebDccPhiEdge

const int EcalSimRawData::ebDccPhiEdge = 20
staticprivate

Number of barrel crystals along phi covered by a DCC

Definition at line 143 of file EcalSimRawData.h.

◆ ebDigiCollection_

std::string EcalSimRawData::ebDigiCollection_
private

EB digi product instance name

Definition at line 350 of file EcalSimRawData.h.

◆ ebSrFlagCollection_

std::string EcalSimRawData::ebSrFlagCollection_
private

EB SRP flag digi product instance name

Definition at line 362 of file EcalSimRawData.h.

◆ ebTccPhiEdge

const int EcalSimRawData::ebTccPhiEdge = 20
staticprivate

number of TTs along phi of a TCC sector

Definition at line 131 of file EcalSimRawData.h.

◆ eeDigiCollection_

std::string EcalSimRawData::eeDigiCollection_
private

EE digi product instance name

Definition at line 354 of file EcalSimRawData.h.

◆ eeSrFlagCollection_

std::string EcalSimRawData::eeSrFlagCollection_
private

EE SRP flag digi product instancename

Definition at line 366 of file EcalSimRawData.h.

◆ esr_

std::unique_ptr<EcalSelectiveReadout> EcalSimRawData::esr_
private

Selective readout simulator

Definition at line 418 of file EcalSimRawData.h.

◆ fe2dcc_

bool EcalSimRawData::fe2dcc_
private

Switch for data of FE->DCC link

Definition at line 406 of file EcalSimRawData.h.

◆ fe2tcc_

bool EcalSimRawData::fe2tcc_
private

Switch for data of FE->TCC link

Definition at line 410 of file EcalSimRawData.h.

◆ iEvent

int EcalSimRawData::iEvent
private

Definition at line 59 of file EcalSimRawData.h.

◆ nDccEndcap

const int EcalSimRawData::nDccEndcap = 9
staticprivate

Number of DCCs for a single endcap

Definition at line 127 of file EcalSimRawData.h.

◆ nDccInPhi

const int EcalSimRawData::nDccInPhi = 18
staticprivate

Number of barrel DCCs along Phi

Definition at line 123 of file EcalSimRawData.h.

◆ nEbEta

const int EcalSimRawData::nEbEta = 170
staticprivate

Number of crystals in ECAL barrel along eta

Definition at line 63 of file EcalSimRawData.h.

◆ nEbPhi

const int EcalSimRawData::nEbPhi = 360
staticprivate

Number of crystals in ECAL barrel along phi

Definition at line 67 of file EcalSimRawData.h.

Referenced by iPhi2cIndex().

◆ nEbTtEta

const int EcalSimRawData::nEbTtEta = nEbEta / ttEdge
staticprivate

Number of TTs along Ecal barrel eta

Definition at line 111 of file EcalSimRawData.h.

◆ nEeTtEta

const int EcalSimRawData::nEeTtEta = 11
staticprivate

Number of TTs along eta for one endcap.

Definition at line 115 of file EcalSimRawData.h.

◆ nEeX

const int EcalSimRawData::nEeX = 100
staticprivate

X-edge of endcap (x,y)- crystal grid

Definition at line 71 of file EcalSimRawData.h.

◆ nEeY

const int EcalSimRawData::nEeY = 100
staticprivate

Y-edge of endcap (x,y)- crystal grid

Definition at line 75 of file EcalSimRawData.h.

◆ nEndcaps

const int EcalSimRawData::nEndcaps = 2
staticprivate

Number of endcaps

Definition at line 79 of file EcalSimRawData.h.

◆ nScX

const int EcalSimRawData::nScX = 20
staticprivate

Maximum number of supercrystal along x axis

Definition at line 87 of file EcalSimRawData.h.

◆ nScY

const int EcalSimRawData::nScY = 20
staticprivate

Maximum number of supercrystal along y axis

Definition at line 91 of file EcalSimRawData.h.

◆ nTccEndcap

const int EcalSimRawData::nTccEndcap = 36
staticprivate

Number of TCCs for a single endcap

Definition at line 139 of file EcalSimRawData.h.

◆ nTccInPhi

const int EcalSimRawData::nTccInPhi = 18
staticprivate

Number of Barrel TTCs along phi

Definition at line 135 of file EcalSimRawData.h.

◆ nTtEta

const int EcalSimRawData::nTtEta = nEbTtEta + 2 * nEeTtEta
staticprivate

Number of TTs along ECAL eta

Definition at line 119 of file EcalSimRawData.h.

◆ nTtPhi

const int EcalSimRawData::nTtPhi = nEbPhi / ttEdge
staticprivate

Number of TTs along Ecal Phi

Definition at line 107 of file EcalSimRawData.h.

◆ nTtPhisPerEbDcc

const int EcalSimRawData::nTtPhisPerEbDcc = 4
staticprivate

Number of trigger towers alng phi covered by a DCC

Definition at line 147 of file EcalSimRawData.h.

◆ nTtPhisPerEbTcc

const int EcalSimRawData::nTtPhisPerEbTcc = 4
staticprivate

Number of trigger towers alng phi covered by a TCC

Definition at line 151 of file EcalSimRawData.h.

◆ nTtSmEta

const int EcalSimRawData::nTtSmEta = 17
staticprivate

Number of TTs along SM eta

Definition at line 103 of file EcalSimRawData.h.

◆ nTtSmPhi

const int EcalSimRawData::nTtSmPhi = 4
staticprivate

Number of TTs along SM phi

Definition at line 99 of file EcalSimRawData.h.

◆ nTtTypes

const int EcalSimRawData::nTtTypes = 2
staticprivate

Number of barrel trigger tower types (in term of VFE card orientation)

Definition at line 155 of file EcalSimRawData.h.

◆ scEdge

const int EcalSimRawData::scEdge = 5
staticprivate

Supercrystal edge in number of crystals

Definition at line 83 of file EcalSimRawData.h.

◆ srDigiProducer_

std::string EcalSimRawData::srDigiProducer_
private

Label of SR flags and suppressed digis

Definition at line 358 of file EcalSimRawData.h.

◆ srfFile

std::ofstream EcalSimRawData::srfFile
private

Output file for selective readout flags

Definition at line 426 of file EcalSimRawData.h.

◆ srp2dcc_

bool EcalSimRawData::srp2dcc_
private

Switch for data of SRP->DCC link

Definition at line 398 of file EcalSimRawData.h.

◆ strip2Eta

const int EcalSimRawData::strip2Eta
staticprivate
Initial value:
= {
{4, 3, 2, 1, 0},
{0, 1, 2, 3, 4}
}

Maps strip_id to eta index within a TT. strip2Eta[iTtType][strip_id-1] will be the eta index of channels with strip_id 'strip_id'. The eta index runs from 0 to 4 and increasing with the eta of the std CMS coordinates.

Definition at line 176 of file EcalSimRawData.h.

◆ stripCh2Phi

const int EcalSimRawData::stripCh2Phi
staticprivate
Initial value:
= {
{{4, 3, 2, 1, 0},
{0, 1, 2, 3, 4},
{4, 3, 2, 1, 0},
{0, 1, 2, 3, 4},
{4, 3, 2, 1, 0}},
{{0, 1, 2, 3, 4}, {4, 3, 2, 1, 0}, {0, 1, 2, 3, 4}, {4, 3, 2, 1, 0}, {0, 1, 2, 3, 4}}}

Maps (strip_id, channel_id) to phi index within a TT. stripCh2Phi[iTtType][strip_id-1][ch_id-1] will be the phi index of the TT of type iTtType with strip ID 'strip_id' and channel VFE id 'ch_id'. The phi runs from 0 to 4 and increases with the phi of std CMS coordinates.

Definition at line 169 of file EcalSimRawData.h.

◆ tcc2dcc_

bool EcalSimRawData::tcc2dcc_
private

Switch for data of TCC->DCC link

Definition at line 402 of file EcalSimRawData.h.

◆ tccInDefaultVal_

int EcalSimRawData::tccInDefaultVal_
private

default TriggerPrimitive values if the trigger tower is abscent

Definition at line 438 of file EcalSimRawData.h.

◆ tccNum_

int EcalSimRawData::tccNum_
private

Index of the TCC, FE data must be produced for. -1 for all TTCs

Definition at line 430 of file EcalSimRawData.h.

◆ tcpDigiCollection_

std::string EcalSimRawData::tcpDigiCollection_
private

TCP Fenix output digi product instance name

Definition at line 374 of file EcalSimRawData.h.

◆ theGeometry

const CaloGeometry* EcalSimRawData::theGeometry
private

Calorimeter geometry

Definition at line 378 of file EcalSimRawData.h.

◆ theTriggerTowerMap

const EcalTrigTowerConstituentsMap* EcalSimRawData::theTriggerTowerMap
private

ECAL endcap trigger tower map

Definition at line 414 of file EcalSimRawData.h.

◆ tpDigiCollection_

std::string EcalSimRawData::tpDigiCollection_
private

Trigger primitive digi product instance name

Definition at line 370 of file EcalSimRawData.h.

◆ tpProducer_

std::string EcalSimRawData::tpProducer_
private

Name of the trigger primitive label

Definition at line 382 of file EcalSimRawData.h.

◆ tpVerbose_

bool EcalSimRawData::tpVerbose_
private

Verbosity switch for crystal data

Definition at line 394 of file EcalSimRawData.h.

◆ ttEdge

const int EcalSimRawData::ttEdge = 5
staticprivate

Definition at line 95 of file EcalSimRawData.h.

◆ ttfFile

std::ofstream EcalSimRawData::ttfFile
private

Output file for trigger tower flags

Definition at line 422 of file EcalSimRawData.h.

◆ ttType

const int EcalSimRawData::ttType
staticprivate
Initial value:
= {
0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1,
0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1
}

Map of trigger tower types (in term of VFE card orientation). ttType[iTtEta0]: trigger tower type of TTs with eta 'c-arrary' index iTtEta0

Definition at line 161 of file EcalSimRawData.h.

◆ writeMode_

writeMode_t EcalSimRawData::writeMode_
private

output format

Definition at line 386 of file EcalSimRawData.h.

◆ xtalVerbose_

bool EcalSimRawData::xtalVerbose_
private

Verbosity switch for crystal data

Definition at line 390 of file EcalSimRawData.h.

EcalSimRawData::iPhi2cIndex
int iPhi2cIndex(int iPhi) const
Definition: EcalSimRawData.h:216
EcalSimRawData::bigEndian
Definition: EcalSimRawData.h:185
EcalSimRawData::fwrite
void fwrite(std::ofstream &f, uint16_t data, int &iword, bool hpar=true) const
Definition: EcalSimRawData.cc:129
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
ext
Definition: memstream.h:15
EESrFlag
Definition: EESrFlag.h:13
EcalSimRawData::ttEdge
static const int ttEdge
Definition: EcalSimRawData.h:95
EcalSimRawData::nTtSmEta
static const int nTtSmEta
Definition: EcalSimRawData.h:103
mps_fire.i
i
Definition: mps_fire.py:355
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
EcalSimRawData::nTtPhi
static const int nTtPhi
Definition: EcalSimRawData.h:107
EcalSimRawData::strip2Eta
static const int strip2Eta[nTtTypes][ttEdge]
Definition: EcalSimRawData.h:176
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EcalSimRawData::nDccInPhi
static const int nDccInPhi
Definition: EcalSimRawData.h:123
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
EcalSimRawData::nTccInPhi
static const int nTccInPhi
Definition: EcalSimRawData.h:135
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
EcalSimRawData::tpVerbose_
bool tpVerbose_
Definition: EcalSimRawData.h:394
EcalSimRawData::nTccEndcap
static const int nTccEndcap
Definition: EcalSimRawData.h:139
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
EcalSimRawData::littleEndian
Definition: EcalSimRawData.h:185
EBDataFrame
Definition: EBDataFrame.h:11
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalSimRawData::nTtSmPhi
static const int nTtSmPhi
Definition: EcalSimRawData.h:99
gather_cfg.cout
cout
Definition: gather_cfg.py:144
trigObjTnPSource_cfi.collName
collName
Definition: trigObjTnPSource_cfi.py:66
cms::cuda::assert
assert(be >=bs)
EcalSimRawData::elec2GeomNum
void elec2GeomNum(int ittEta0, int ittPhi0, int strip1, int ch1, int &iEta0, int &iPhi0) const
Definition: EcalSimRawData.cc:117
edm::SortedCollection
Definition: SortedCollection.h:49
EcalSimRawData::eeSrFlagCollection_
std::string eeSrFlagCollection_
Definition: EcalSimRawData.h:366
EcalSimRawData::nEbEta
static const int nEbEta
Definition: EcalSimRawData.h:63
EcalSimRawData::nScX
static const int nScX
Definition: EcalSimRawData.h:87
EcalSimRawData::nEndcaps
static const int nEndcaps
Definition: EcalSimRawData.h:79
EcalSimRawData::dccNum_
int dccNum_
Definition: EcalSimRawData.h:434
edm::Handle< EBDigiCollection >
PresampleTask_cfi.nSamples
nSamples
Definition: PresampleTask_cfi.py:7
EcalSimRawData::digiProducer_
std::string digiProducer_
Definition: EcalSimRawData.h:346
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
EcalSimRawData::getExt
std::string getExt() const
Definition: EcalSimRawData.cc:156
EcalSimRawData::genTccOut
void genTccOut(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:356
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
EBSrFlag
Definition: EBSrFlag.h:13
edm::DataFrameContainer::empty
bool empty() const
Definition: DataFrameContainer.h:160
EcalSimRawData::tcpDigiCollection_
std::string tcpDigiCollection_
Definition: EcalSimRawData.h:374
EcalSimRawData::ebSrFlagCollection_
std::string ebSrFlagCollection_
Definition: EcalSimRawData.h:362
EcalSimRawData::eeDigiCollection_
std::string eeDigiCollection_
Definition: EcalSimRawData.h:354
EcalSimRawData::genSrData
void genSrData(std::string basename, int iEvent, int ttf[nEbTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:244
EcalSimRawData::setHParity
void setHParity(uint16_t &a) const
Definition: EcalSimRawData.cc:417
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
EcalSimRawData::tcc2dcc_
bool tcc2dcc_
Definition: EcalSimRawData.h:402
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
EcalSimRawData::iTtEta2cIndex
int iTtEta2cIndex(int iTtEta) const
Definition: EcalSimRawData.h:229
EcalSimRawData::genTccIn
void genTccIn(std::string basename, int iEvent, const int tps[nTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:307
EcalSimRawData::getSrfs
void getSrfs(const edm::Event &event, int ebSrf[nTtEta][nTtPhi], int eeSrf[nEndcaps][nScX][nScY]) const
Definition: EcalSimRawData.cc:428
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
a
double a
Definition: hdecay.h:119
EcalSimRawData::xtalVerbose_
bool xtalVerbose_
Definition: EcalSimRawData.h:390
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
EcalSimRawData::nScY
static const int nScY
Definition: EcalSimRawData.h:91
EcalSimRawData::nTtPhisPerEbTcc
static const int nTtPhisPerEbTcc
Definition: EcalSimRawData.h:151
EcalSimRawData::fe2tcc_
bool fe2tcc_
Definition: EcalSimRawData.h:410
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
EcalSimRawData::srp2dcc_
bool srp2dcc_
Definition: EcalSimRawData.h:398
EcalSimRawData::tccNum_
int tccNum_
Definition: EcalSimRawData.h:430
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
EcalMGPASample
Definition: EcalMGPASample.h:22
EcalSimRawData::iTtPhi2cIndex
int iTtPhi2cIndex(int iTtPhi) const
Definition: EcalSimRawData.h:248
EcalSimRawData::getEbDigi
void getEbDigi(const edm::Event &event, std::vector< uint16_t > adc[nEbEta][nEbPhi]) const
Definition: EcalSimRawData.cc:478
EcalSimRawData::tpProducer_
std::string tpProducer_
Definition: EcalSimRawData.h:382
EcalSimRawData::srDigiProducer_
std::string srDigiProducer_
Definition: EcalSimRawData.h:358
type
type
Definition: HCALResponse.h:21
EcalSimRawData::iEvent
int iEvent
Definition: EcalSimRawData.h:59
EcalSimRawData_cfi.writeMode
writeMode
Definition: EcalSimRawData_cfi.py:7
EcalSimRawData::fe2dcc_
bool fe2dcc_
Definition: EcalSimRawData.h:406
EcalTriggerPrimitiveDigi
Definition: EcalTriggerPrimitiveDigi.h:16
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
EcalSimRawData::ebDigiCollection_
std::string ebDigiCollection_
Definition: EcalSimRawData.h:350
EcalSimRawData::genFeData
void genFeData(std::string basename, int iEvent, const std::vector< uint16_t > adcCount[nEbEta][nEbPhi]) const
Definition: EcalSimRawData.cc:169
Exception
Definition: hltDiff.cc:246
EcalSimRawData::nTtPhisPerEbDcc
static const int nTtPhisPerEbDcc
Definition: EcalSimRawData.h:147
EcalSimRawData::nTtEta
static const int nTtEta
Definition: EcalSimRawData.h:119
EcalSimRawData::nEbPhi
static const int nEbPhi
Definition: EcalSimRawData.h:67
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
EcalSimRawData::iEta2cIndex
int iEta2cIndex(int iEta) const
Definition: EcalSimRawData.h:209
EcalSimRawData::nEbTtEta
static const int nEbTtEta
Definition: EcalSimRawData.h:111
EcalSimRawData::nDccEndcap
static const int nDccEndcap
Definition: EcalSimRawData.h:127
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
cms::Exception
Definition: Exception.h:70
EcalSimRawData::stripCh2Phi
static const int stripCh2Phi[nTtTypes][ttEdge][ttEdge]
Definition: EcalSimRawData.h:169
EcalSimRawData::ttType
static const int ttType[nEbTtEta]
Definition: EcalSimRawData.h:161
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
EcalSimRawData::getTp
void getTp(const edm::Event &event, const std::string &collName, int tp[nTtEta][nTtPhi]) const
Definition: EcalSimRawData.cc:545
EcalSimRawData::nEeTtEta
static const int nEeTtEta
Definition: EcalSimRawData.h:115
EcalSimRawData::ascii
Definition: EcalSimRawData.h:185
EcalSimRawData::basename_
std::string basename_
Definition: EcalSimRawData.h:442
EcalSimRawData::tpDigiCollection_
std::string tpDigiCollection_
Definition: EcalSimRawData.h:370
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
edm::SortedCollection::empty
bool empty() const
Definition: SortedCollection.h:210
EcalSimRawData::tccInDefaultVal_
int tccInDefaultVal_
Definition: EcalSimRawData.h:438
EcalSimRawData::writeMode_
writeMode_t writeMode_
Definition: EcalSimRawData.h:386