CMS 3D CMS Logo

EcalTBDaqFormatter.h
Go to the documentation of this file.
1 #ifndef EcalTBDaqFormatter_H
2 #define EcalTBDaqFormatter_H
3 
14 #include "DCCTowerBlock.h"
15 
16 #include <vector>
17 #include <map>
18 #include <iostream>
19 
21 
23 
24 class FEDRawData;
25 class DCCTBDataParser;
27 public:
29  virtual ~EcalTBDaqFormatter() {
30  LogDebug("EcalTBRawToDigi") << "@SUB=EcalTBDaqFormatter"
31  << "\n";
32  };
33 
34  void interpretRawData(const FEDRawData& data,
35  EBDigiCollection& digicollection,
36  EcalPnDiodeDigiCollection& pndigicollection,
37  EcalRawDataCollection& DCCheaderCollection,
38  EBDetIdCollection& dccsizecollection,
39  EcalElectronicsIdCollection& ttidcollection,
40  EcalElectronicsIdCollection& blocksizecollection,
41  EBDetIdCollection& chidcollection,
42  EBDetIdCollection& gaincollection,
43  EBDetIdCollection& gainswitchcollection,
44  EcalElectronicsIdCollection& memttidcollection,
45  EcalElectronicsIdCollection& memblocksizecollection,
46  EcalElectronicsIdCollection& memgaincollection,
47  EcalElectronicsIdCollection& memchidcollection,
48  EcalTrigPrimDigiCollection& tpcollection);
49 
50 private:
51  void DecodeMEM(DCCTBTowerBlock* towerblock,
52  EcalPnDiodeDigiCollection& pndigicollection,
53  EcalElectronicsIdCollection& memttidcollection,
54  EcalElectronicsIdCollection& memblocksizecollection,
55  EcalElectronicsIdCollection& memgaincollection,
56  EcalElectronicsIdCollection& memchidcollection);
57 
58  std::pair<int, int> cellIndex(int tower_id, int strip, int xtal);
59  int cryIc(int tower_id, int strip, int xtal);
60  bool leftTower(int tower) const;
61  bool rightTower(int tower) const;
62 
63 private:
65 
66  enum SMGeom_t {
67  kModules = 4, // Number of modules per supermodule
68  kTriggerTowers = 68, // Number of trigger towers per supermodule
69  kTowersInPhi = 4, // Number of trigger towers in phi
70  kTowersInEta = 17, // Number of trigger towers in eta
71  kCrystals = 1700, // Number of crystals per supermodule
72  kPns = 10, // Number of PN laser monitoring diodes per supermodule
73  kCrystalsInPhi = 20, // Number of crystals in phi
74  kCrystalsInEta = 85, // Number of crystals in eta
75  kCrystalsPerTower = 25, // Number of crystals per trigger tower
76  kCardsPerTower = 5, // Number of VFE cards per trigger tower
77  kChannelsPerCard = 5 // Number of channels per VFE card
78  };
79 
81  kSamplesPerChannel = 10, // Number of sample per channel, per event
82  kSamplesPerPn = 50, // Number of sample per PN, per event
83  kChannelsPerTower = 25, // Number of channels per trigger tower
84  kStripsPerTower = 5, // Number of VFE cards per trigger tower
85  kChannelsPerStrip = 5, // Number channels per VFE card
86  kPnPerTowerBlock = 5, // Number Pn diodes pertaining to 1 tower block = 1/2 mem box
87  kTriggerTowersAndMem = 70 // Number of trigger towers block including mems
88  };
89 
90  // index and container for expected towers (according to DCC status)
92  unsigned _ExpectedTowers[71];
93  unsigned _expTowersIndex;
94 
95  // used for mem boxes unpacking
96  int memRawSample_[kStripsPerTower][kChannelsPerStrip][kSamplesPerChannel + 1]; // store raw data for one mem
97  int data_MEM[500]; // collects unpacked data for both mems
100 };
101 #endif
bool rightTower(int tower) const
DCCTBDataParser * theParser_
int cryIc(int tower_id, int strip, int xtal)
void interpretRawData(const FEDRawData &data, EBDigiCollection &digicollection, EcalPnDiodeDigiCollection &pndigicollection, EcalRawDataCollection &DCCheaderCollection, EBDetIdCollection &dccsizecollection, EcalElectronicsIdCollection &ttidcollection, EcalElectronicsIdCollection &blocksizecollection, EBDetIdCollection &chidcollection, EBDetIdCollection &gaincollection, EBDetIdCollection &gainswitchcollection, EcalElectronicsIdCollection &memttidcollection, EcalElectronicsIdCollection &memblocksizecollection, EcalElectronicsIdCollection &memgaincollection, EcalElectronicsIdCollection &memchidcollection, EcalTrigPrimDigiCollection &tpcollection)
void DecodeMEM(DCCTBTowerBlock *towerblock, EcalPnDiodeDigiCollection &pndigicollection, EcalElectronicsIdCollection &memttidcollection, EcalElectronicsIdCollection &memblocksizecollection, EcalElectronicsIdCollection &memgaincollection, EcalElectronicsIdCollection &memchidcollection)
std::pair< int, int > cellIndex(int tower_id, int strip, int xtal)
bool pnIsOkInBlock[kPnPerTowerBlock]
bool leftTower(int tower) const
unsigned _ExpectedTowers[71]
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int memRawSample_[kStripsPerTower][kChannelsPerStrip][kSamplesPerChannel+1]
#define LogDebug(id)