#include <EcalSimRawData.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
EcalSimRawData (const edm::ParameterSet &pset) | |
virtual | ~EcalSimRawData () |
Public Member Functions inherited from edm::EDAnalyzer | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
EDAnalyzer () | |
ModuleDescription const & | moduleDescription () const |
std::string | workerType () const |
virtual | ~EDAnalyzer () |
Public Member Functions inherited from edm::EDConsumerBase | |
std::vector< ConsumesInfo > | consumesInfo () const |
EDConsumerBase () | |
ProductHolderIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
void | itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
void | itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
std::vector < ProductHolderIndexAndSkipBit > const & | itemsToGetFromEvent () const |
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
void | modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const |
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
bool | registeredToConsume (ProductHolderIndex, bool, BranchType) const |
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
void | updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &) |
virtual | ~EDConsumerBase () |
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::auto_ptr < EcalSelectiveReadout > | esr_ |
bool | fe2dcc_ |
bool | fe2tcc_ |
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::EDAnalyzer | |
typedef EDAnalyzer | ModuleType |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
Static Public Member Functions inherited from edm::EDAnalyzer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &) |
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 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 182 of file EcalSimRawData.h.
|
explicit |
Constructor
pset | CMSSW configuration |
Definition at line 47 of file EcalSimRawData.cc.
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.
|
inlinevirtual |
|
virtual |
Main method. Called back for each event. This method produced the raw data and write them to disk.
Implements edm::EDAnalyzer.
Definition at line 83 of file EcalSimRawData.cc.
References ecalMGPA::adc(), gather_cfg::cout, iEvent, and nEndcaps.
|
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 237 of file EcalSimRawData.h.
|
inlineprivate |
Converse of iTtPhi2cIndex
iTtPhi0 | phi index of TT |
Definition at line 245 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.
References assert().
|
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.
|
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, and alignCSCRings::s.
|
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, and alignCSCRings::s.
|
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.
|
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, and alignCSCRings::s.
|
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(), gather_cfg::cout, TauDecayModes::dec, Exception, EBDataFrame::id(), edm::HandleBase::isValid(), hgc_digi::nSamples, EcalMGPASample::raw(), compare_using_db::sample, EcalDataFrame::sample(), and EcalDataFrame::size().
|
private |
Help function to get the file extension which depends on the output formats.
Definition at line 171 of file EcalSimRawData.cc.
|
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 assert(), i, EBSrFlag::id(), EESrFlag::id(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), edm::HandleBase::isValid(), EcalScDetId::ix(), EcalScDetId::iy(), nEndcaps, EcalSrFlag::value(), and EcalScDetId::zside().
|
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 >::end(), EcalTriggerPrimitiveDigi::id(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), edm::HandleBase::isValid(), edm::Handle< T >::product(), and EcalTriggerPrimitiveDigi::sampleOfInterest().
|
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 208 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 217 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 229 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 254 of file EcalSimRawData.h.
|
private |
|
private |
basename for output files
Definition at line 466 of file EcalSimRawData.h.
|
private |
Index of the DCC, FE data must be produced for. -1 for all TTCs
Definition at line 458 of file EcalSimRawData.h.
|
private |
Name of module/plugin/producer making digis
Definition at line 369 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel crystals along phi covered by a DCC
Definition at line 140 of file EcalSimRawData.h.
|
private |
EB digi product instance name
Definition at line 373 of file EcalSimRawData.h.
|
private |
EB SRP flag digi product instance name
Definition at line 386 of file EcalSimRawData.h.
|
staticprivate |
number of TTs along phi of a TCC sector
Definition at line 128 of file EcalSimRawData.h.
|
private |
EE digi product instance name
Definition at line 377 of file EcalSimRawData.h.
|
private |
EE SRP flag digi product instancename
Definition at line 390 of file EcalSimRawData.h.
|
private |
Selective readout simulator
Definition at line 442 of file EcalSimRawData.h.
|
private |
Switch for data of FE->DCC link
Definition at line 430 of file EcalSimRawData.h.
|
private |
Switch for data of FE->TCC link
Definition at line 434 of file EcalSimRawData.h.
|
staticprivate |
Number of DCCs for a single endcap
Definition at line 124 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel DCCs along Phi
Definition at line 120 of file EcalSimRawData.h.
|
staticprivate |
Number of crystals in ECAL barrel along eta
Definition at line 60 of file EcalSimRawData.h.
|
staticprivate |
Number of crystals in ECAL barrel along phi
Definition at line 64 of file EcalSimRawData.h.
Referenced by iPhi2cIndex().
Number of TTs along Ecal barrel eta
Definition at line 108 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along eta for one endcap.
Definition at line 112 of file EcalSimRawData.h.
|
staticprivate |
X-edge of endcap (x,y)- crystal grid
Definition at line 68 of file EcalSimRawData.h.
|
staticprivate |
Y-edge of endcap (x,y)- crystal grid
Definition at line 72 of file EcalSimRawData.h.
|
staticprivate |
Number of endcaps
Definition at line 76 of file EcalSimRawData.h.
|
staticprivate |
Maximum number of supercrystal along x axis
Definition at line 84 of file EcalSimRawData.h.
|
staticprivate |
Maximum number of supercrystal along y axis
Definition at line 88 of file EcalSimRawData.h.
|
staticprivate |
Number of TCCs for a single endcap
Definition at line 136 of file EcalSimRawData.h.
|
staticprivate |
Number of Barrel TTCs along phi
Definition at line 132 of file EcalSimRawData.h.
Number of TTs along ECAL eta
Definition at line 116 of file EcalSimRawData.h.
Number of TTs along Ecal Phi
Definition at line 104 of file EcalSimRawData.h.
|
staticprivate |
Number of trigger towers alng phi covered by a DCC
Definition at line 144 of file EcalSimRawData.h.
|
staticprivate |
Number of trigger towers alng phi covered by a TCC
Definition at line 148 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along SM eta
Definition at line 100 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along SM phi
Definition at line 96 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel trigger tower types (in term of VFE card orientation)
Definition at line 152 of file EcalSimRawData.h.
|
staticprivate |
Supercrystal edge in number of crystals
Definition at line 80 of file EcalSimRawData.h.
|
private |
Label of SR flags and suppressed digis
Definition at line 382 of file EcalSimRawData.h.
|
private |
Output file for selective readout flags
Definition at line 450 of file EcalSimRawData.h.
|
private |
Switch for data of SRP->DCC link
Definition at line 422 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 173 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 166 of file EcalSimRawData.h.
|
private |
Switch for data of TCC->DCC link
Definition at line 426 of file EcalSimRawData.h.
|
private |
default TriggerPrimitive values if the trigger tower is abscent
Definition at line 462 of file EcalSimRawData.h.
|
private |
Index of the TCC, FE data must be produced for. -1 for all TTCs
Definition at line 454 of file EcalSimRawData.h.
|
private |
TCP Fenix output digi product instance name
Definition at line 398 of file EcalSimRawData.h.
|
private |
Calorimeter geometry
Definition at line 402 of file EcalSimRawData.h.
|
private |
ECAL endcap trigger tower map
Definition at line 438 of file EcalSimRawData.h.
|
private |
Trigger primitive digi product instance name
Definition at line 394 of file EcalSimRawData.h.
|
private |
Name of the trigger primitive label
Definition at line 406 of file EcalSimRawData.h.
|
private |
Verbosity switch for crystal data
Definition at line 418 of file EcalSimRawData.h.
|
staticprivate |
Definition at line 92 of file EcalSimRawData.h.
|
private |
Output file for trigger tower flags
Definition at line 446 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 158 of file EcalSimRawData.h.
|
private |
output format
Definition at line 410 of file EcalSimRawData.h.
|
private |
Verbosity switch for crystal data
Definition at line 414 of file EcalSimRawData.h.