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