#include <EcalSimRawData.h>
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< EcalSelectiveReadout > | esr_ |
bool | fe2dcc_ |
bool | fe2tcc_ |
int | iEvent |
std::string | srDigiProducer_ |
std::ofstream | srfFile |
bool | srp2dcc_ |
bool | tcc2dcc_ |
int | tccInDefaultVal_ |
int | tccNum_ |
std::string | tcpDigiCollection_ |
const CaloGeometry * | theGeometry |
const EcalTrigTowerConstituentsMap * | theTriggerTowerMap |
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 | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
EDGetToken | consumes (const TypeToGet &id, 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) |
template<typename ESProduct , Transition Tr = Transition::Event> | |
auto | esConsumes (eventsetup::EventSetupRecordKey const &, ESInputTag const &tag) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
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 41 of file EcalSimRawData.h.
|
private |
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.
|
explicit |
Constructor
pset | CMSSW configuration |
Definition at line 47 of file EcalSimRawData.cc.
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), iEvent, AlCaHLTBitMon_QueryRunRegistry::string, and EcalSimRawData_cfi::writeMode.
|
inlineoverride |
|
override |
Main method. Called back for each event. This method produced the raw data and write them to disk.
Definition at line 84 of file EcalSimRawData.cc.
References ecalMGPA::adc(), gather_cfg::cout, iEvent, and nEndcaps.
Referenced by ~EcalSimRawData().
|
private |
call these once an event, to make sure everything is up-to-date
|
private |
|
inlineprivate |
Converse of iTtEta2cIndex
iTtEta0 | c eta index of TT |
std | CMSSW TT eta index |
Definition at line 240 of file EcalSimRawData.h.
|
inlineprivate |
Converse of iTtPhi2cIndex
iTtPhi0 | phi index of TT |
Definition at line 248 of file EcalSimRawData.h.
|
private |
Converts electronic number of an ECAL barrel channel to geometrical indices
ittEta0 | trigger tower c index | |
ittPhi0 | trigger tower c index | |
strip1 | strip index within the TT. Runs from 1 to 5. | |
ch1 | channel electronics number within the VFE. Runs from 1 to 5. | |
[out] | iEta0 | eta c index of the channel |
[out] | iPhi0 | eta c index of the channel |
Definition at line 124 of file EcalSimRawData.cc.
Referenced by iTtPhi2cIndex().
|
private |
Write a data 16-bit word into file according to selected format.
f | the file stream to write to | |
data | the peace of data to write | |
[in,out] | iword | pass 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. |
hpar | if true the horizontal odd word parity is set before writing the word into the file. |
Definition at line 137 of file EcalSimRawData.cc.
References EnergyCorrector::c, and TauDecayModes::dec.
Referenced by iTtPhi2cIndex().
|
private |
Generates FE crystal data
basename | base for the output file name. DCC number is appended to the name |
iEvent | event index |
adcCount | the payload, the ADC count of the channels. |
stripHeader |= parity(stripHeader) << 15;
Definition at line 184 of file EcalSimRawData.cc.
References ecalMGPA::adc(), gather_cfg::cout, data, TauDecayModes::dec, f, alignCSCRings::s, and globals_cff::x1.
Referenced by iTtPhi2cIndex().
|
private |
Generates SR flags
basename | base for the output file name. DCC number is appended to the name |
iEvent | event index |
the | trigger tower flags |
Definition at line 274 of file EcalSimRawData.cc.
References data, f, alignCSCRings::s, and globals_cff::x1.
Referenced by iTtPhi2cIndex().
|
private |
Generates FE trigger primitives data
basename | base for the output file name. DCC number is appended to the name |
iEvent | event index |
tps | the payload, the trigger primitives |
Definition at line 340 of file EcalSimRawData.cc.
References gather_cfg::cout, TauDecayModes::dec, and alignCSCRings::s.
Referenced by iTtPhi2cIndex().
|
private |
Generates TCC->DCC data
basename | base for the output file name. DCC number is appended to the name |
iEvent | event index |
tps | the payload, the trigger primitives |
Definition at line 398 of file EcalSimRawData.cc.
References gather_cfg::cout, data, TauDecayModes::dec, hgc_digi::nSamples, alignCSCRings::s, and globals_cff::x1.
Referenced by iTtPhi2cIndex().
|
private |
Retrieves barrel digis (APD ADC count).
event | CMS event |
adc | [out] the adc counts: adc[iEta0][iPhi0][iTimeSample0] |
Definition at line 531 of file EcalSimRawData.cc.
References ecalMGPA::adc(), edm::DataFrameContainer::begin(), gather_cfg::cout, TauDecayModes::dec, edm::DataFrameContainer::empty(), edm::DataFrameContainer::end(), Exception, EBDataFrame::id(), edm::HandleBase::isValid(), hgc_digi::nSamples, EcalMGPASample::raw(), simplePhotonAnalyzer_cfi::sample, EcalDataFrame::sample(), and EcalDataFrame::size().
Referenced by iTtPhi2cIndex().
|
private |
Help function to get the file extension which depends on the output formats.
Definition at line 171 of file EcalSimRawData.cc.
Referenced by iTtPhi2cIndex().
|
private |
Computes the selective readout flags.
[in] | event | CMS event |
[out] | ebSrf | the computed SR flags for barrel |
[out] | eeSrf | the computed SR flags for endcaps |
Definition at line 477 of file EcalSimRawData.cc.
References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), RemoveAddSevLevel::flag, mps_fire::i, EBSrFlag::id(), EESrFlag::id(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), edm::HandleBase::isValid(), EcalScDetId::ix(), EcalScDetId::iy(), nEndcaps, EcalSrFlag::value(), and EcalScDetId::zside().
Referenced by iTtPhi2cIndex().
|
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.
event | CMS event |
collName | label of the EDM collection containing the TP. |
tp | [out] the trigger primitives |
Definition at line 599 of file EcalSimRawData.cc.
References edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), EcalTriggerPrimitiveDigi::id(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), edm::HandleBase::isValid(), edm::Handle< T >::product(), and EcalTriggerPrimitiveDigi::sampleOfInterest().
Referenced by iTtPhi2cIndex().
|
inlineprivate |
Converts std CMSSW crystal eta index into a c-index (contiguous integer starting from 0 and increasing with pseudo-rapidity).
iEta | std CMSSW crystal eta index |
Definition at line 211 of file EcalSimRawData.h.
|
inlineprivate |
Converts std CMSSW crystal phi index into a c-index (contiguous integer starting from 0 at phi=0deg and increasing with phi).
iPhi | std CMSSW crystal phi index |
Definition at line 220 of file EcalSimRawData.h.
References nEbPhi.
|
inlineprivate |
Converts std CMSSW ECAL trigger tower eta index into a c-index (contiguous integer starting from 0 and increasing with pseudo-rapidity).
iEta | std CMSSW trigger tower eta index |
Definition at line 232 of file EcalSimRawData.h.
|
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).
iPhi | std CMSSW ECAL trigger tower phi index |
Definition at line 257 of file EcalSimRawData.h.
References a, ecalMGPA::adc(), estimatePileup::basename, data, elec2GeomNum(), f, fwrite(), genFeData(), genSrData(), genTccIn(), genTccOut(), getEbDigi(), getExt(), getSrfs(), getTp(), setHParity(), and AlCaHLTBitMon_QueryRunRegistry::string.
|
private |
Definition at line 467 of file EcalSimRawData.cc.
References AlCaHLTBitMon_ParallelJobs::p.
Referenced by iTtPhi2cIndex().
|
private |
basename for output files
Definition at line 469 of file EcalSimRawData.h.
|
private |
Index of the DCC, FE data must be produced for. -1 for all TTCs
Definition at line 461 of file EcalSimRawData.h.
|
private |
Name of module/plugin/producer making digis
Definition at line 372 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel crystals along phi covered by a DCC
Definition at line 143 of file EcalSimRawData.h.
|
private |
EB digi product instance name
Definition at line 376 of file EcalSimRawData.h.
|
private |
EB SRP flag digi product instance name
Definition at line 389 of file EcalSimRawData.h.
|
staticprivate |
number of TTs along phi of a TCC sector
Definition at line 131 of file EcalSimRawData.h.
|
private |
EE digi product instance name
Definition at line 380 of file EcalSimRawData.h.
|
private |
EE SRP flag digi product instancename
Definition at line 393 of file EcalSimRawData.h.
|
private |
Selective readout simulator
Definition at line 445 of file EcalSimRawData.h.
|
private |
Switch for data of FE->DCC link
Definition at line 433 of file EcalSimRawData.h.
|
private |
Switch for data of FE->TCC link
Definition at line 437 of file EcalSimRawData.h.
|
private |
Definition at line 59 of file EcalSimRawData.h.
|
staticprivate |
Number of DCCs for a single endcap
Definition at line 127 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel DCCs along Phi
Definition at line 123 of file EcalSimRawData.h.
|
staticprivate |
Number of crystals in ECAL barrel along eta
Definition at line 63 of file EcalSimRawData.h.
|
staticprivate |
Number of crystals in ECAL barrel along phi
Definition at line 67 of file EcalSimRawData.h.
Referenced by iPhi2cIndex().
Number of TTs along Ecal barrel eta
Definition at line 111 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along eta for one endcap.
Definition at line 115 of file EcalSimRawData.h.
|
staticprivate |
X-edge of endcap (x,y)- crystal grid
Definition at line 71 of file EcalSimRawData.h.
|
staticprivate |
Y-edge of endcap (x,y)- crystal grid
Definition at line 75 of file EcalSimRawData.h.
|
staticprivate |
Number of endcaps
Definition at line 79 of file EcalSimRawData.h.
|
staticprivate |
Maximum number of supercrystal along x axis
Definition at line 87 of file EcalSimRawData.h.
|
staticprivate |
Maximum number of supercrystal along y axis
Definition at line 91 of file EcalSimRawData.h.
|
staticprivate |
Number of TCCs for a single endcap
Definition at line 139 of file EcalSimRawData.h.
|
staticprivate |
Number of Barrel TTCs along phi
Definition at line 135 of file EcalSimRawData.h.
Number of TTs along ECAL eta
Definition at line 119 of file EcalSimRawData.h.
Number of TTs along Ecal Phi
Definition at line 107 of file EcalSimRawData.h.
|
staticprivate |
Number of trigger towers alng phi covered by a DCC
Definition at line 147 of file EcalSimRawData.h.
|
staticprivate |
Number of trigger towers alng phi covered by a TCC
Definition at line 151 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along SM eta
Definition at line 103 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along SM phi
Definition at line 99 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel trigger tower types (in term of VFE card orientation)
Definition at line 155 of file EcalSimRawData.h.
|
staticprivate |
Supercrystal edge in number of crystals
Definition at line 83 of file EcalSimRawData.h.
|
private |
Label of SR flags and suppressed digis
Definition at line 385 of file EcalSimRawData.h.
|
private |
Output file for selective readout flags
Definition at line 453 of file EcalSimRawData.h.
|
private |
Switch for data of SRP->DCC link
Definition at line 425 of file EcalSimRawData.h.
|
staticprivate |
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.
|
staticprivate |
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.
|
private |
Switch for data of TCC->DCC link
Definition at line 429 of file EcalSimRawData.h.
|
private |
default TriggerPrimitive values if the trigger tower is abscent
Definition at line 465 of file EcalSimRawData.h.
|
private |
Index of the TCC, FE data must be produced for. -1 for all TTCs
Definition at line 457 of file EcalSimRawData.h.
|
private |
TCP Fenix output digi product instance name
Definition at line 401 of file EcalSimRawData.h.
|
private |
Calorimeter geometry
Definition at line 405 of file EcalSimRawData.h.
|
private |
ECAL endcap trigger tower map
Definition at line 441 of file EcalSimRawData.h.
|
private |
Trigger primitive digi product instance name
Definition at line 397 of file EcalSimRawData.h.
|
private |
Name of the trigger primitive label
Definition at line 409 of file EcalSimRawData.h.
|
private |
Verbosity switch for crystal data
Definition at line 421 of file EcalSimRawData.h.
|
staticprivate |
Definition at line 95 of file EcalSimRawData.h.
|
private |
Output file for trigger tower flags
Definition at line 449 of file EcalSimRawData.h.
|
staticprivate |
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.
|
private |
output format
Definition at line 413 of file EcalSimRawData.h.
|
private |
Verbosity switch for crystal data
Definition at line 417 of file EcalSimRawData.h.