File indexing completed on 2024-04-06 12:10:38
0001 #ifndef EcalTBDaqFormatter_H
0002 #define EcalTBDaqFormatter_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
0012 #include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
0013 #include <DataFormats/EcalDetId/interface/EcalDetIdCollections.h>
0014 #include "DCCTowerBlock.h"
0015
0016 #include <vector>
0017 #include <map>
0018 #include <iostream>
0019
0020 #include "FWCore/ServiceRegistry/interface/Service.h"
0021
0022 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0023
0024 class FEDRawData;
0025 class DCCTBDataParser;
0026 class EcalTBDaqFormatter {
0027 public:
0028 EcalTBDaqFormatter();
0029 virtual ~EcalTBDaqFormatter() {
0030 LogDebug("EcalTBRawToDigi") << "@SUB=EcalTBDaqFormatter"
0031 << "\n";
0032 };
0033
0034 void interpretRawData(const FEDRawData& data,
0035 EBDigiCollection& digicollection,
0036 EcalPnDiodeDigiCollection& pndigicollection,
0037 EcalRawDataCollection& DCCheaderCollection,
0038 EBDetIdCollection& dccsizecollection,
0039 EcalElectronicsIdCollection& ttidcollection,
0040 EcalElectronicsIdCollection& blocksizecollection,
0041 EBDetIdCollection& chidcollection,
0042 EBDetIdCollection& gaincollection,
0043 EBDetIdCollection& gainswitchcollection,
0044 EcalElectronicsIdCollection& memttidcollection,
0045 EcalElectronicsIdCollection& memblocksizecollection,
0046 EcalElectronicsIdCollection& memgaincollection,
0047 EcalElectronicsIdCollection& memchidcollection,
0048 EcalTrigPrimDigiCollection& tpcollection);
0049
0050 private:
0051 void DecodeMEM(DCCTBTowerBlock* towerblock,
0052 EcalPnDiodeDigiCollection& pndigicollection,
0053 EcalElectronicsIdCollection& memttidcollection,
0054 EcalElectronicsIdCollection& memblocksizecollection,
0055 EcalElectronicsIdCollection& memgaincollection,
0056 EcalElectronicsIdCollection& memchidcollection);
0057
0058 std::pair<int, int> cellIndex(int tower_id, int strip, int xtal);
0059 int cryIc(int tower_id, int strip, int xtal);
0060 bool leftTower(int tower) const;
0061 bool rightTower(int tower) const;
0062
0063 private:
0064 DCCTBDataParser* theParser_;
0065
0066 enum SMGeom_t {
0067 kModules = 4,
0068 kTriggerTowers = 68,
0069 kTowersInPhi = 4,
0070 kTowersInEta = 17,
0071 kCrystals = 1700,
0072 kPns = 10,
0073 kCrystalsInPhi = 20,
0074 kCrystalsInEta = 85,
0075 kCrystalsPerTower = 25,
0076 kCardsPerTower = 5,
0077 kChannelsPerCard = 5
0078 };
0079
0080 enum SMElectronics_t {
0081 kSamplesPerChannel = 10,
0082 kSamplesPerPn = 50,
0083 kChannelsPerTower = 25,
0084 kStripsPerTower = 5,
0085 kChannelsPerStrip = 5,
0086 kPnPerTowerBlock = 5,
0087 kTriggerTowersAndMem = 70
0088 };
0089
0090
0091 unsigned _numExpectedTowers;
0092 unsigned _ExpectedTowers[71];
0093 unsigned _expTowersIndex;
0094
0095
0096 int memRawSample_[kStripsPerTower][kChannelsPerStrip][kSamplesPerChannel + 1];
0097 int data_MEM[500];
0098 bool pnAllocated;
0099 bool pnIsOkInBlock[kPnPerTowerBlock];
0100 };
0101 #endif