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
EcalTBDaqFormatter::kPns
Definition: EcalTBDaqFormatter.h:72
EcalTBDaqFormatter::kChannelsPerTower
Definition: EcalTBDaqFormatter.h:83
MessageLogger.h
EcalTBDaqFormatter::leftTower
bool leftTower(int tower) const
Definition: EcalTBDaqFormatter.cc:767
EcalTBDaqFormatter::kModules
Definition: EcalTBDaqFormatter.h:67
EcalTBDaqFormatter::cryIc
int cryIc(int tower_id, int strip, int xtal)
Definition: EcalTBDaqFormatter.cc:747
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
EcalDetIdCollections.h
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
EcalTBDaqFormatter::_numExpectedTowers
unsigned _numExpectedTowers
Definition: EcalTBDaqFormatter.h:91
edm::SortedCollection
Definition: SortedCollection.h:49
EcalTBDaqFormatter
Definition: EcalTBDaqFormatter.h:26
EcalTBDaqFormatter::DecodeMEM
void DecodeMEM(DCCTBTowerBlock *towerblock, EcalPnDiodeDigiCollection &pndigicollection, EcalElectronicsIdCollection &memttidcollection, EcalElectronicsIdCollection &memblocksizecollection, EcalElectronicsIdCollection &memgaincollection, EcalElectronicsIdCollection &memchidcollection)
Definition: EcalTBDaqFormatter.cc:523
EcalTBDaqFormatter::cellIndex
std::pair< int, int > cellIndex(int tower_id, int strip, int xtal)
Definition: EcalTBDaqFormatter.cc:719
EcalTBDaqFormatter::kCrystals
Definition: EcalTBDaqFormatter.h:71
EcalTBDaqFormatter::kCrystalsInEta
Definition: EcalTBDaqFormatter.h:74
FEDRawData
Definition: FEDRawData.h:19
EcalTBDaqFormatter::kTriggerTowers
Definition: EcalTBDaqFormatter.h:68
EcalRawDataCollections.h
Service.h
EcalTBDaqFormatter::EcalTBDaqFormatter
EcalTBDaqFormatter()
Definition: EcalTBDaqFormatter.cc:30
EcalDigiCollections.h
EcalTBDaqFormatter::kTowersInPhi
Definition: EcalTBDaqFormatter.h:69
EcalTBDaqFormatter::data_MEM
int data_MEM[500]
Definition: EcalTBDaqFormatter.h:97
DCCTBTowerBlock
Definition: DCCTowerBlock.h:19
EcalTBDaqFormatter::kCardsPerTower
Definition: EcalTBDaqFormatter.h:76
EcalTBDaqFormatter::kSamplesPerChannel
Definition: EcalTBDaqFormatter.h:81
DCCTowerBlock.h
EcalTBDaqFormatter::kStripsPerTower
Definition: EcalTBDaqFormatter.h:84
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
EcalTBDaqFormatter::SMGeom_t
SMGeom_t
Definition: EcalTBDaqFormatter.h:66
EBDigiCollection
Definition: EcalDigiCollections.h:32
EcalTBDaqFormatter::theParser_
DCCTBDataParser * theParser_
Definition: EcalTBDaqFormatter.h:64
EcalTBDaqFormatter::_expTowersIndex
unsigned _expTowersIndex
Definition: EcalTBDaqFormatter.h:93
EcalTBDaqFormatter::kCrystalsPerTower
Definition: EcalTBDaqFormatter.h:75
edm::EDCollection
Definition: EDCollection.h:16
EcalTBDaqFormatter::pnAllocated
bool pnAllocated
Definition: EcalTBDaqFormatter.h:98
EcalTBDaqFormatter::~EcalTBDaqFormatter
virtual ~EcalTBDaqFormatter()
Definition: EcalTBDaqFormatter.h:29
EcalTBDaqFormatter::memRawSample_
int memRawSample_[kStripsPerTower][kChannelsPerStrip][kSamplesPerChannel+1]
Definition: EcalTBDaqFormatter.h:96
EcalTBDaqFormatter::pnIsOkInBlock
bool pnIsOkInBlock[kPnPerTowerBlock]
Definition: EcalTBDaqFormatter.h:99
EcalTBDaqFormatter::SMElectronics_t
SMElectronics_t
Definition: EcalTBDaqFormatter.h:80
EcalTBDaqFormatter::interpretRawData
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)
Definition: EcalTBDaqFormatter.cc:47
DCCTBDataParser
Definition: DCCDataParser.h:25
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
EcalTBDaqFormatter::rightTower
bool rightTower(int tower) const
Definition: EcalTBDaqFormatter.cc:759
EcalTBDaqFormatter::_ExpectedTowers
unsigned _ExpectedTowers[71]
Definition: EcalTBDaqFormatter.h:92
EcalTBDaqFormatter::kCrystalsInPhi
Definition: EcalTBDaqFormatter.h:73
EcalTBDaqFormatter::kSamplesPerPn
Definition: EcalTBDaqFormatter.h:82
EcalTBDaqFormatter::kTriggerTowersAndMem
Definition: EcalTBDaqFormatter.h:87
EcalTBDaqFormatter::kTowersInEta
Definition: EcalTBDaqFormatter.h:70
EcalTBDaqFormatter::kPnPerTowerBlock
Definition: EcalTBDaqFormatter.h:86
EcalTBDaqFormatter::kChannelsPerCard
Definition: EcalTBDaqFormatter.h:77
EcalTBDaqFormatter::kChannelsPerStrip
Definition: EcalTBDaqFormatter.h:85