CMS 3D CMS Logo

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