File indexing completed on 2024-04-06 12:10:38
0001 #ifndef EcalTB07DaqFormatter_H
0002 #define EcalTB07DaqFormatter_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 #include "FWCore/ParameterSet/interface/FileInPath.h"
0024
0025 class FEDRawData;
0026 class DCCDataParser;
0027 class EcalTB07DaqFormatter {
0028 public:
0029 EcalTB07DaqFormatter(std::string tbName, int a[68][5][5], int b[71], int c[201]);
0030 virtual ~EcalTB07DaqFormatter() {
0031 LogDebug("EcalTB07RawToDigi") << "@SUB=EcalTB07DaqFormatter"
0032 << "\n";
0033 };
0034
0035 void interpretRawData(const FEDRawData& data,
0036 EBDigiCollection& digicollection,
0037 EEDigiCollection& eeDigiCollection,
0038 EcalPnDiodeDigiCollection& pndigicollection,
0039 EcalRawDataCollection& DCCheaderCollection,
0040 EBDetIdCollection& dccsizecollection,
0041 EcalElectronicsIdCollection& ttidcollection,
0042 EcalElectronicsIdCollection& blocksizecollection,
0043 EBDetIdCollection& chidcollection,
0044 EBDetIdCollection& gaincollection,
0045 EBDetIdCollection& gainswitchcollection,
0046 EcalElectronicsIdCollection& memttidcollection,
0047 EcalElectronicsIdCollection& memblocksizecollection,
0048 EcalElectronicsIdCollection& memgaincollection,
0049 EcalElectronicsIdCollection& memchidcollection,
0050 EcalTrigPrimDigiCollection& tpcollection);
0051
0052 private:
0053 void DecodeMEM(DCCTBTowerBlock* towerblock,
0054 EcalPnDiodeDigiCollection& pndigicollection,
0055 EcalElectronicsIdCollection& memttidcollection,
0056 EcalElectronicsIdCollection& memblocksizecollection,
0057 EcalElectronicsIdCollection& memgaincollection,
0058 EcalElectronicsIdCollection& memchidcollection);
0059
0060 std::pair<int, int> cellIndex(int tower_id, int strip, int xtal);
0061 int cryIc(int tower_id, int strip, int xtal);
0062 bool leftTower(int tower) const;
0063 bool rightTower(int tower) const;
0064
0065 private:
0066 DCCTBDataParser* theParser_;
0067 int cryIcMap_[68][5][5];
0068 int tbStatusToLocation_[71];
0069 int tbTowerIDToLocation_[201];
0070 std::string tbName_;
0071
0072 int getEE_ix(int tower, int strip, int ch);
0073 int getEE_iy(int tower, int strip, int ch);
0074
0075 enum SMGeom_t {
0076 kModules = 4,
0077 kTriggerTowers = 68,
0078 kTowersInPhi = 4,
0079 kTowersInEta = 17,
0080 kCrystals = 1700,
0081 kPns = 10,
0082 kCrystalsInPhi = 20,
0083 kCrystalsInEta = 85,
0084 kCrystalsPerTower = 25,
0085 kCardsPerTower = 5,
0086 kChannelsPerCard = 5
0087 };
0088
0089 enum SMElectronics_t {
0090 kSamplesPerChannel = 10,
0091 kSamplesPerPn = 50,
0092 kChannelsPerTower = 25,
0093 kStripsPerTower = 5,
0094 kChannelsPerStrip = 5,
0095 kPnPerTowerBlock = 5,
0096 kTriggerTowersAndMem = 70
0097 };
0098
0099
0100 unsigned _numExpectedTowers;
0101 unsigned _ExpectedTowers[71];
0102 unsigned _expTowersIndex;
0103
0104
0105 int memRawSample_[kStripsPerTower][kChannelsPerStrip][kSamplesPerChannel + 1];
0106 int data_MEM[500];
0107 bool pnAllocated;
0108 bool pnIsOkInBlock[kPnPerTowerBlock];
0109 };
0110 #endif