CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalLuttoDB Class Reference

#include <CalibCalorimetry/HcalLuttoDB/src/HcalLuttoDB.cc>

Inheritance diagram for HcalLuttoDB:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 HcalLuttoDB (const edm::ParameterSet &)
 
 ~HcalLuttoDB () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

std::vector< unsigned char > extractOutputLut (const CaloTPGTranscoder &coder, HcalTrigTowerDetId chan)
 
std::ostream * openChecksums ()
 
std::ostream * openPerCrate (int crate)
 
std::ostream * openPerLut1 (HcalElectronicsId eid)
 
std::ostream * openPerLut2 (HcalElectronicsId eid)
 
void writeoutlut1 (HcalDetId id, HcalElectronicsId eid, const std::vector< unsigned short > &lut, std::ostream &os)
 
void writeoutlut2 (HcalTrigTowerDetId id, HcalElectronicsId eid, const std::vector< unsigned char > &lut, std::ostream &os)
 

Private Attributes

std::string creationstamp_
 
std::string fileformat_
 
bool filePerCrate_
 
std::ostream * oc_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>=""> R Implementation: <Notes on="" implementation>="">

Definition at line 56 of file HcalLuttoDB.cc.

Constructor & Destructor Documentation

HcalLuttoDB::HcalLuttoDB ( const edm::ParameterSet iConfig)
explicit

Definition at line 86 of file HcalLuttoDB.cc.

References creationtag_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and targetfirmware_.

87 {
88 
89  creationtag_ = iConfig.getParameter<std::string>("creationtag");
90  targetfirmware_ = iConfig.getParameter<std::string>("targetfirmware");
91  filePerCrate_ = iConfig.getUntrackedParameter<bool>("filePerCrate",true);
92  fileformat_=iConfig.getParameter<std::string>("filePrefix");
93 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool filePerCrate_
Definition: HcalLuttoDB.cc:69
std::string targetfirmware_
Definition: HcalLuttoDB.cc:81
std::string fileformat_
Definition: HcalLuttoDB.cc:71
std::string creationtag_
Definition: HcalLuttoDB.cc:80
HcalLuttoDB::~HcalLuttoDB ( )
override

Definition at line 95 of file HcalLuttoDB.cc.

96 {
97 }

Member Function Documentation

void HcalLuttoDB::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 261 of file HcalLuttoDB.cc.

References HcalElectronicsMap::allElectronicsId(), HcalGenericDetId::genericSubdet(), edm::EventSetup::get(), HcalDbService::getHcalMapping(), HcalTPGCoder::getLinearizationLUT(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalElectronicsMap::lookup(), HcalElectronicsMap::lookupTrigger(), lumiPlot::lut, and DetId::null().

262 {
263  //using namespace edm;
264  //using namespace std;
265 
266  edm::LogInfo("Hcal") << "Beginning dump of Hcal TPG LUTS (this may take a minute or two)";
267 
268  const HcalElectronicsMap* Map_;
270  iSetup.get<HcalDbRecord>().get( pSetup );
271  Map_=pSetup->getHcalMapping();
272  // get the conditions, for the decoding
273  edm::ESHandle<HcalTPGCoder> inputCoder;
274  iSetup.get<HcalTPGRecord>().get(inputCoder);
275  edm::ESHandle<CaloTPGTranscoder> outTranscoder;
276  iSetup.get<CaloTPGRecord>().get(outTranscoder);
277 
278  std::vector<HcalElectronicsId> allEID = Map_->allElectronicsId();
279  std::vector<HcalElectronicsId>::iterator itreid;
280 
281  std::ostream* pfile=nullptr;
282  oc_=openChecksums();
283 
284  for (int crate=0; crate<20; crate++) {
285  edm::LogInfo("Hcal") << "Beginning crate " << crate;
286  for(itreid = allEID.begin(); itreid != allEID.end(); ++itreid)
287  {
288  if (itreid->readoutVMECrateId()!=crate) continue;
289  if (itreid->isTriggerChainId()) { // lut2
290  HcalTrigTowerDetId tid=Map_->lookupTrigger(*itreid);
291  if (tid.null()) continue;
292 
293  if (filePerCrate_ && pfile==nullptr) pfile=openPerCrate(crate);
294  else if (pfile==nullptr) pfile=openPerLut2(*itreid);
295 
296  std::vector<unsigned char> lut=extractOutputLut(*outTranscoder,tid);
297  writeoutlut2(tid,*itreid,lut,*pfile);
298  if (!filePerCrate_) { delete pfile; pfile=nullptr; }
299  } else { // lut1
300  HcalGenericDetId gid=Map_->lookup(*itreid);
302 
303  if (filePerCrate_ && pfile==nullptr) pfile=openPerCrate(crate);
304  else if (pfile==nullptr) pfile=openPerLut1(*itreid);
305 
306  std::vector<unsigned short> lut=inputCoder->getLinearizationLUT(HcalDetId(gid));
307  writeoutlut1(HcalDetId(gid),*itreid,lut,*pfile);
308  if (!filePerCrate_) { delete pfile; pfile=nullptr; }
309  }
310  }
311  if (pfile!=nullptr) {
312  if (filePerCrate_) *pfile << "</CFGBrickSet>\n";
313  delete pfile;
314  pfile=nullptr;
315  }
316  }
317  *oc_ << "</CFGBrick>\n";
318  delete oc_;
319 
320 }
constexpr bool null() const
is this a null id ?
Definition: DetId.h:49
std::ostream * openPerLut2(HcalElectronicsId eid)
Definition: HcalLuttoDB.cc:129
bool filePerCrate_
Definition: HcalLuttoDB.cc:69
std::ostream * openChecksums()
Definition: HcalLuttoDB.cc:104
void writeoutlut2(HcalTrigTowerDetId id, HcalElectronicsId eid, const std::vector< unsigned char > &lut, std::ostream &os)
Definition: HcalLuttoDB.cc:197
std::ostream * oc_
Definition: HcalLuttoDB.cc:76
virtual std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
Definition: HcalTPGCoder.cc:3
std::ostream * openPerCrate(int crate)
Definition: HcalLuttoDB.cc:112
std::vector< HcalElectronicsId > allElectronicsId() const
std::ostream * openPerLut1(HcalElectronicsId eid)
Definition: HcalLuttoDB.cc:120
T get() const
Definition: EventSetup.h:62
const HcalElectronicsMap * getHcalMapping() const
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
void writeoutlut1(HcalDetId id, HcalElectronicsId eid, const std::vector< unsigned short > &lut, std::ostream &os)
Definition: HcalLuttoDB.cc:140
HcalGenericSubdetector genericSubdet() const
std::vector< unsigned char > extractOutputLut(const CaloTPGTranscoder &coder, HcalTrigTowerDetId chan)
Definition: HcalLuttoDB.cc:250
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void HcalLuttoDB::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 326 of file HcalLuttoDB.cc.

References edmScanValgrind::buffer, cmsPerfSuiteHarvest::now, and ntuplemaker::time.

327 {
328  char buffer[120];
329  time_t now=time(nullptr);
330  struct tm* tm=localtime(&now);
331  strftime(buffer,120,"%F %T",tm);
333 }
std::string creationstamp_
Definition: HcalLuttoDB.cc:70
void HcalLuttoDB::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 337 of file HcalLuttoDB.cc.

References DEFINE_FWK_MODULE.

Referenced by o2olib.O2ORunMgr::executeJob().

337  {
338 }
std::vector< unsigned char > HcalLuttoDB::extractOutputLut ( const CaloTPGTranscoder coder,
HcalTrigTowerDetId  chan 
)
private

Definition at line 250 of file HcalLuttoDB.cc.

References HcalTriggerPrimitiveSample::compressedEt(), CaloTPGTranscoder::hcalCompress(), mps_fire::i, lumiPlot::lut, and alignCSCRings::s.

250  {
251  std::vector<unsigned char> lut;
252  for (int i=0; i<1024; i++) {
253  HcalTriggerPrimitiveSample s=coder.hcalCompress(chan,i,false);
254  lut.push_back(s.compressedEt());
255  }
256  return lut;
257 }
int compressedEt() const
get the encoded/compressed Et
virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId &id, unsigned int sample, int fineGrain) const =0
Compression from linear samples+fine grain in the HTR.
std::ostream * HcalLuttoDB::openChecksums ( )
private

Definition at line 104 of file HcalLuttoDB.cc.

References alignmentValidation::fname.

104  {
105  char fname[1024];
106  snprintf(fname,1024,"%s_checksums.xml",fileformat_.c_str());
107  std::ostream* os=new std::ofstream(fname);
108  (*os) << "<?xml version=\"1.0\"?>\n<CFGBrick>\n";
109  return os;
110 }
std::string fileformat_
Definition: HcalLuttoDB.cc:71
string fname
main script
std::ostream * HcalLuttoDB::openPerCrate ( int  crate)
private

Definition at line 112 of file HcalLuttoDB.cc.

References alignmentValidation::fname.

112  {
113  char fname[1024];
114  snprintf(fname,1024,"%s_%d.xml",fileformat_.c_str(),crate);
115  std::ostream* os=new std::ofstream(fname);
116  (*os) << "<?xml version=\"1.0\"?>\n<CFGBrickSet>\n";
117  return os;
118 }
std::string fileformat_
Definition: HcalLuttoDB.cc:71
string fname
main script
std::ostream * HcalLuttoDB::openPerLut1 ( HcalElectronicsId  eid)
private

Definition at line 120 of file HcalLuttoDB.cc.

References HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), alignmentValidation::fname, HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), and HcalElectronicsId::readoutVMECrateId().

120  {
121  char fname[1024];
122  snprintf(fname,1024,"%s_%d_%d%c_%d_%d_1.xml",fileformat_.c_str(),eid.readoutVMECrateId(),
123  eid.htrSlot(),((eid.htrTopBottom())?('t'):('b')),eid.fiberIndex(),eid.fiberChanId());
124  std::ostream* os=new std::ofstream(fname);
125  (*os) << "<?xml version=\"1.0\"?>\n";
126  return os;
127 }
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
constexpr int htrSlot() const
get the htr slot
constexpr int readoutVMECrateId() const
get the readout VME crate number
std::string fileformat_
Definition: HcalLuttoDB.cc:71
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
string fname
main script
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
std::ostream * HcalLuttoDB::openPerLut2 ( HcalElectronicsId  eid)
private

Definition at line 129 of file HcalLuttoDB.cc.

References alignmentValidation::fname, HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), HcalElectronicsId::readoutVMECrateId(), HcalElectronicsId::slbChannelIndex(), and HcalElectronicsId::slbSiteNumber().

129  {
130  char fname[1024];
131  snprintf(fname,1024,"%s_%d_%d%c_%d_%d_2.xml",fileformat_.c_str(),eid.readoutVMECrateId(),
132  eid.htrSlot(),((eid.htrTopBottom())?('t'):('b')),eid.slbSiteNumber(),eid.slbChannelIndex());
133  std::ostream* os=new std::ofstream(fname);
134  (*os) << "<?xml version=\"1.0\"?>\n";
135  return os;
136 }
constexpr int slbChannelIndex() const
get the SLB channel index (valid only for VME trigger-chain ids)
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
constexpr int htrSlot() const
get the htr slot
constexpr int readoutVMECrateId() const
get the readout VME crate number
std::string fileformat_
Definition: HcalLuttoDB.cc:71
string fname
main script
constexpr int slbSiteNumber() const
get the SLB site number (valid only for VME trigger-chain ids)
void HcalLuttoDB::writeoutlut1 ( HcalDetId  id,
HcalElectronicsId  eid,
const std::vector< unsigned short > &  lut,
std::ostream &  os 
)
private

Definition at line 140 of file HcalLuttoDB.cc.

References creationtag_, TauDecayModes::dec, HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), formatRevision_, HcalForward, HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), mps_fire::i, HcalElectronicsId::readoutVMECrateId(), and targetfirmware_.

140  {
141 
142  os <<"<CFGBrick> "<<std::endl;
143  os <<" <Parameter name='IETA' type='int'>"<<id.ieta()<<"</Parameter>"<<std::endl;
144  os <<" <Parameter name='IPHI' type='int'>"<<id.iphi()<<"</Parameter>"<<std::endl;
145  os <<" <Parameter name='DEPTH' type='int'>"<<id.depth()<<"</Parameter>"<<std::endl;
146  os <<" <Parameter name='CRATE' type='int'>"<<eid.readoutVMECrateId()<<"</Parameter>"<<std::endl;
147  os <<" <Parameter name='SLOT' type='int'>"<<eid.htrSlot()<<"</Parameter>"<<std::endl;
148  os <<" <Parameter name='TOPBOTTOM' type='int'>"<<eid.htrTopBottom()<<"</Parameter>"<<std::endl;
149  os <<" <Parameter name='FIBER' type='int'>"<<eid.fiberIndex()<<"</Parameter>"<<std::endl;
150  os <<" <Parameter name='FIBERCHAN' type='int'>"<<eid.fiberChanId()<<"</Parameter>"<<std::endl;
151  os <<" <Parameter name='LUT_TYPE' type='int'>1</Parameter>"<<std::endl;
152  os <<" <Parameter name='CREATIONTAG' type='string'>"<<creationtag_<<"</Parameter>"<<std::endl;
153  os <<" <Parameter name='CREATIONSTAMP' type='string'>"<<creationstamp_<<"</Parameter>"<<std::endl;
154  os <<" <Parameter name='FORMATREVISION' type='string'>"<<formatRevision_<<"</Parameter>"<<std::endl;
155  os <<" <Parameter name='TARGETFIRMWARE' type='string'>"<<targetfirmware_<<"</Parameter>"<<std::endl;
156  int generalizedIndex=id.ietaAbs()+1000*id.depth()+10000*id.iphi()+
157  ((id.ieta()<0)?(0):(100))+((id.subdet()==HcalForward && id.ietaAbs()==29)?(4*10000):(0));
158 
159  os <<" <Parameter name='GENERALIZEDINDEX' type='int'>"<<generalizedIndex<<"</Parameter>"<<std::endl;
160  // do checksum
161  md5_state_t md5er;
162  md5_byte_t digest[16];
163  unsigned char tool[2];
164  md5_init(&md5er);
165  for (int i=0; i<128; i++) {
166  tool[0]=lut[i]&0xFF;
167  tool[1]=(lut[i]>>8)&0xFF;
168  md5_append(&md5er,tool,2);
169  }
170  md5_finish(&md5er,digest);
171  os <<" <Parameter name='CHECKSUM' type='string'>";
172  for (int i=0; i<16; i++) os << std::hex << (((int)(digest[i]))&0xFF);
173  os << "</Parameter>\n";
174 
175  *oc_ << " <Data crate='" << eid.readoutVMECrateId()
176  << "' slot='" << eid.htrSlot()
177  << "' fpga='" << eid.htrTopBottom()
178  << "' fiber='" << eid.fiberIndex()
179  << "' fiberchan='" << eid.fiberChanId()
180  << "' luttype='1' elements='1' encoding='hex'>";
181  for (int i=0; i<16; i++) *oc_ << std::hex << (((int)(digest[i]))&0xFF);
182  *oc_ << "</Data>\n";
183 
184  os <<" <Data elements='128' encoding='hex'> "<<std::endl;
185  os << std::hex;
186  for(int initr2 = 0; initr2 < 128; initr2++){
187  os<<lut[initr2]<<" ";
188  }
189  os << std::dec;
190  os<<std::endl;
191  os <<" </Data> "<<std::endl;
192  os <<"</CFGBrick> "<<std::endl;
193 
194 }
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
std::string targetfirmware_
Definition: HcalLuttoDB.cc:81
constexpr int htrSlot() const
get the htr slot
constexpr int readoutVMECrateId() const
get the readout VME crate number
std::ostream * oc_
Definition: HcalLuttoDB.cc:76
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
std::string creationstamp_
Definition: HcalLuttoDB.cc:70
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
std::string creationtag_
Definition: HcalLuttoDB.cc:80
static const int formatRevision_
Definition: HcalLuttoDB.cc:82
void HcalLuttoDB::writeoutlut2 ( HcalTrigTowerDetId  id,
HcalElectronicsId  eid,
const std::vector< unsigned char > &  lut,
std::ostream &  os 
)
private

Definition at line 197 of file HcalLuttoDB.cc.

References creationtag_, TauDecayModes::dec, formatRevision_, HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), mps_fire::i, createfilelist::int, HcalElectronicsId::readoutVMECrateId(), HcalElectronicsId::slbChannelIndex(), HcalElectronicsId::slbSiteNumber(), and targetfirmware_.

197  {
198 
199  os <<"<CFGBrick> "<<std::endl;
200  os <<" <Parameter name='IETA' type='int'>"<<id.ieta()<<"</Parameter>"<<std::endl;
201  os <<" <Parameter name='IPHI' type='int'>"<<id.iphi()<<"</Parameter>"<<std::endl;
202  os <<" <Parameter name='CRATE' type='int'>"<<eid.readoutVMECrateId()<<"</Parameter>"<<std::endl;
203  os <<" <Parameter name='SLOT' type='int'>"<<eid.htrSlot()<<"</Parameter>"<<std::endl;
204  os <<" <Parameter name='TOPBOTTOM' type='int'>"<<eid.htrTopBottom()<<"</Parameter>"<<std::endl;
205  os <<" <Parameter name='SLB' type='int'>"<<eid.slbSiteNumber()<<"</Parameter>"<<std::endl;
206  os <<" <Parameter name='SLBCHAN' type='int'>"<<eid.slbChannelIndex()<<"</Parameter>"<<std::endl;
207  os <<" <Parameter name='LUT_TYPE' type='int'>2</Parameter>"<<std::endl;
208  os <<" <Parameter name='CREATIONTAG' type='string'>"<<creationtag_<<"</Parameter>"<<std::endl;
209  os <<" <Parameter name='CREATIONSTAMP' type='string'>"<<creationstamp_<<"</Parameter>"<<std::endl;
210  os <<" <Parameter name='FORMATREVISION' type='string'>"<<formatRevision_<<"</Parameter>"<<std::endl;
211  os <<" <Parameter name='TARGETFIRMWARE' type='string'>"<<targetfirmware_<<"</Parameter>"<<std::endl;
212  int generalizedIndex=id.ietaAbs()+10000*id.iphi()+
213  ((id.ieta()<0)?(0):(100));
214 
215 
216  os <<" <Parameter name='GENERALIZEDINDEX' type='int'>"<<generalizedIndex<<"</Parameter>"<<std::endl;
217 
218 
219 // do checksum
220  md5_state_t md5er;
221  md5_byte_t digest[16];
222  md5_init(&md5er);
223  md5_append(&md5er,&(lut[0]),1024);
224  md5_finish(&md5er,digest);
225  os <<" <Parameter name='CHECKSUM' type='string'>";
226  for (int i=0; i<16; i++) os << std::hex << (((int)(digest[i]))&0xFF);
227  os << "</Parameter>\n";
228 
229  *oc_ << " <Data crate='" << eid.readoutVMECrateId()
230  << "' slot='" << eid.htrSlot()
231  << "' fpga='" << eid.htrTopBottom()
232  << "' slb='" << eid.slbSiteNumber()
233  << "' slbchan='" << eid.slbChannelIndex()
234  << "' luttype='2' elements='1' encoding='hex'>";
235  for (int i=0; i<16; i++) *oc_ << std::hex << (((int)(digest[i]))&0xFF);
236  *oc_ << "</Data>\n";
237 
238  os <<" <Data elements='1024' encoding='hex'> "<<std::endl;
239  os << std::hex;
240  for(int initr2 = 0; initr2 < 1024; initr2++){
241  os<< (int(lut[initr2])&0xFF)<<" ";
242  }
243  os << std::dec;
244  os<<std::endl;
245  os <<" </Data> "<<std::endl;
246  os <<"</CFGBrick> "<<std::endl;
247 
248 }
constexpr int slbChannelIndex() const
get the SLB channel index (valid only for VME trigger-chain ids)
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
std::string targetfirmware_
Definition: HcalLuttoDB.cc:81
constexpr int htrSlot() const
get the htr slot
constexpr int readoutVMECrateId() const
get the readout VME crate number
std::ostream * oc_
Definition: HcalLuttoDB.cc:76
std::string creationstamp_
Definition: HcalLuttoDB.cc:70
constexpr int slbSiteNumber() const
get the SLB site number (valid only for VME trigger-chain ids)
std::string creationtag_
Definition: HcalLuttoDB.cc:80
static const int formatRevision_
Definition: HcalLuttoDB.cc:82

Member Data Documentation

std::string HcalLuttoDB::creationstamp_
private

Definition at line 70 of file HcalLuttoDB.cc.

std::string HcalLuttoDB::fileformat_
private

Definition at line 71 of file HcalLuttoDB.cc.

bool HcalLuttoDB::filePerCrate_
private

Definition at line 69 of file HcalLuttoDB.cc.

std::ostream* HcalLuttoDB::oc_
private

Definition at line 76 of file HcalLuttoDB.cc.