#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 | |
EDAnalyzer () | |
std::string | workerType () const |
virtual | ~EDAnalyzer () |
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 |
typedef WorkerT< EDAnalyzer > | WorkerType |
Static Public Member Functions inherited from edm::EDAnalyzer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
Protected Member Functions inherited from edm::EDAnalyzer | |
CurrentProcessingContext const * | currentContext () const |
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.
|
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 183 of file EcalSimRawData.h.
|
explicit |
Constructor
pset | CMSSW configuration |
Definition at line 47 of file EcalSimRawData.cc.
References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
|
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 238 of file EcalSimRawData.h.
|
inlineprivate |
Converse of iTtPhi2cIndex
iTtPhi0 | phi index of TT |
Definition at line 246 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.
|
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 trackerHits::c.
|
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, runTheMatrix::data, f, and asciidump::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 runTheMatrix::data, edm::hlt::Exception, f, and asciidump::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, edm::hlt::Exception, and asciidump::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, runTheMatrix::data, and asciidump::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, edm::hlt::Exception, EBDataFrame::id(), edm::HandleBase::isValid(), EcalMGPASample::raw(), 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 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 209 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 218 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 230 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 255 of file EcalSimRawData.h.
|
private |
|
private |
basename for output files
Definition at line 467 of file EcalSimRawData.h.
|
private |
Index of the DCC, FE data must be produced for. -1 for all TTCs
Definition at line 459 of file EcalSimRawData.h.
|
private |
Name of module/plugin/producer making digis
Definition at line 370 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel crystals along phi covered by a DCC
Definition at line 141 of file EcalSimRawData.h.
|
private |
EB digi product instance name
Definition at line 374 of file EcalSimRawData.h.
|
private |
EB SRP flag digi product instance name
Definition at line 387 of file EcalSimRawData.h.
|
staticprivate |
number of TTs along phi of a TCC sector
Definition at line 129 of file EcalSimRawData.h.
|
private |
EE digi product instance name
Definition at line 378 of file EcalSimRawData.h.
|
private |
EE SRP flag digi product instancename
Definition at line 391 of file EcalSimRawData.h.
|
private |
Selective readout simulator
Definition at line 443 of file EcalSimRawData.h.
|
private |
Switch for data of FE->DCC link
Definition at line 431 of file EcalSimRawData.h.
|
private |
Switch for data of FE->TCC link
Definition at line 435 of file EcalSimRawData.h.
|
staticprivate |
Number of DCCs for a single endcap
Definition at line 125 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel DCCs along Phi
Definition at line 121 of file EcalSimRawData.h.
|
staticprivate |
Number of crystals in ECAL barrel along eta
Definition at line 61 of file EcalSimRawData.h.
|
staticprivate |
Number of crystals in ECAL barrel along phi
Definition at line 65 of file EcalSimRawData.h.
Referenced by iPhi2cIndex().
Number of TTs along Ecal barrel eta
Definition at line 109 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along eta for one endcap.
Definition at line 113 of file EcalSimRawData.h.
|
staticprivate |
X-edge of endcap (x,y)- crystal grid
Definition at line 69 of file EcalSimRawData.h.
|
staticprivate |
Y-edge of endcap (x,y)- crystal grid
Definition at line 73 of file EcalSimRawData.h.
|
staticprivate |
Number of endcaps
Definition at line 77 of file EcalSimRawData.h.
|
staticprivate |
Maximum number of supercrystal along x axis
Definition at line 85 of file EcalSimRawData.h.
|
staticprivate |
Maximum number of supercrystal along y axis
Definition at line 89 of file EcalSimRawData.h.
|
staticprivate |
Number of TCCs for a single endcap
Definition at line 137 of file EcalSimRawData.h.
|
staticprivate |
Number of Barrel TTCs along phi
Definition at line 133 of file EcalSimRawData.h.
Number of TTs along ECAL eta
Definition at line 117 of file EcalSimRawData.h.
Number of TTs along Ecal Phi
Definition at line 105 of file EcalSimRawData.h.
|
staticprivate |
Number of trigger towers alng phi covered by a DCC
Definition at line 145 of file EcalSimRawData.h.
|
staticprivate |
Number of trigger towers alng phi covered by a TCC
Definition at line 149 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along SM eta
Definition at line 101 of file EcalSimRawData.h.
|
staticprivate |
Number of TTs along SM phi
Definition at line 97 of file EcalSimRawData.h.
|
staticprivate |
Number of barrel trigger tower types (in term of VFE card orientation)
Definition at line 153 of file EcalSimRawData.h.
|
staticprivate |
Supercrystal edge in number of crystals
Definition at line 81 of file EcalSimRawData.h.
|
private |
Label of SR flags and suppressed digis
Definition at line 383 of file EcalSimRawData.h.
|
private |
Output file for selective readout flags
Definition at line 451 of file EcalSimRawData.h.
|
private |
Switch for data of SRP->DCC link
Definition at line 423 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 174 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 167 of file EcalSimRawData.h.
|
private |
Switch for data of TCC->DCC link
Definition at line 427 of file EcalSimRawData.h.
|
private |
default TriggerPrimitive values if the trigger tower is abscent
Definition at line 463 of file EcalSimRawData.h.
|
private |
Index of the TCC, FE data must be produced for. -1 for all TTCs
Definition at line 455 of file EcalSimRawData.h.
|
private |
TCP Fenix output digi product instance name
Definition at line 399 of file EcalSimRawData.h.
|
private |
Calorimeter geometry
Definition at line 403 of file EcalSimRawData.h.
|
private |
ECAL endcap trigger tower map
Definition at line 439 of file EcalSimRawData.h.
|
private |
Trigger primitive digi product instance name
Definition at line 395 of file EcalSimRawData.h.
|
private |
Name of the trigger primitive label
Definition at line 407 of file EcalSimRawData.h.
|
private |
Verbosity switch for crystal data
Definition at line 419 of file EcalSimRawData.h.
|
staticprivate |
Definition at line 93 of file EcalSimRawData.h.
|
private |
Output file for trigger tower flags
Definition at line 447 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 159 of file EcalSimRawData.h.
|
private |
output format
Definition at line 411 of file EcalSimRawData.h.
|
private |
Verbosity switch for crystal data
Definition at line 415 of file EcalSimRawData.h.