CMS 3D CMS Logo

Classes | Functions
SiPixelTemplateDBObjectReader.cc File Reference
#include <iomanip>
#include <fstream>
#include <iostream>
#include <cmath>
#include <memory>
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESWatcher.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "CondFormats/SiPixelObjects/interface/SiPixelTemplateDBObject.h"
#include "CondFormats/DataRecord/interface/SiPixelTemplateDBObjectRcd.h"
#include "CalibTracker/Records/interface/SiPixelTemplateDBObjectESProducerRcd.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include "MagneticField/Engine/interface/MagneticField.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"

Go to the source code of this file.

Classes

class  SiPixelTemplateDBObjectReader
 

Functions

std::ostream & operator<< (std::ostream &s, const SiPixelTemplateDBObject &dbobject)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< SiPixelTemplateDBObjectReader > > s_filler_0__LINE__ ("SiPixelTemplateDBObjectReader")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< SiPixelTemplateDBObjectReader > > s_maker__LINE__ ("SiPixelTemplateDBObjectReader")
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  s,
const SiPixelTemplateDBObject dbobject 
)

-index to keep track of where we are in the object

-these are modifiable parameters for the extended templates

-entries takes the number of entries in By,Bx,Fy,Fx from the object

-local indicies for loops

-changes the size of the templates based on the version

Definition at line 198 of file SiPixelTemplateDBObjectReader.cc.

References mps_fire::i, caHitNtupletGeneratorKernels::if(), createfilelist::int, dqmiolumiharvest::j, dqmdumpme::k, MainPageGenerator::l, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, SiPixelTemplateDBObject::numOfTempl(), SiPixelTemplateDBObject::numOfTempl_, alignCSCRings::s, SiPixelTemplateDBObject::sVector_, groupFilesInBlocks::temp, and SiPixelTemplateDBObject::version().

198  {
200  int index = 0;
202  int txsize[4] = {7, 13, 0, 0};
203  int tysize[4] = {21, 21, 0, 0};
205  int entries[4] = {0};
207  int i, j, k, l, m, n, entry_it;
209  int sizeSetter = 0, templateVersion = 0;
210 
211  edm::LogPrint("SiPixelTemplateDBObjectReader") << "\n\nDBobject version: " << dbobject.version() << std::endl;
212 
213  for (m = 0; m < dbobject.numOfTempl(); ++m) {
214  //To change the size of the output based on which template version we are using"
215  templateVersion = (int)dbobject.sVector_[index + 21];
216  if (templateVersion <= 10) {
217  edm::LogPrint("SiPixelTemplateDBObjectReader")
218  << "*****WARNING***** This code will not format this template version properly *****WARNING*****\n";
219  sizeSetter = 0;
220  } else if (templateVersion <= 16)
221  sizeSetter = 1;
222  else
223  edm::LogPrint("SiPixelTemplateDBObjectReader")
224  << "*****WARNING***** This code has not been tested at formatting this version *****WARNING*****\n";
225 
226  edm::LogPrint("SiPixelTemplateDBObjectReader")
227  << "\n\n*********************************************************************************************"
228  << std::endl;
229  edm::LogPrint("SiPixelTemplateDBObjectReader")
230  << "*************** Reading Template ID " << dbobject.sVector_[index + 20] << "\t(" << m + 1
231  << "/" << dbobject.numOfTempl_ << ") ***************" << std::endl;
232  edm::LogPrint("SiPixelTemplateDBObjectReader")
233  << "*********************************************************************************************\n\n"
234  << std::endl;
235 
236  //Header Title
238  for (n = 0; n < 20; ++n) {
239  temp.f = dbobject.sVector_[index];
240  s << temp.c[0] << temp.c[1] << temp.c[2] << temp.c[3];
241  ++index;
242  }
243 
244  entries[0] = (int)dbobject.sVector_[index + 3]; // Y
245  entries[1] = (int)(dbobject.sVector_[index + 4] * dbobject.sVector_[index + 5]); // X
246 
247  //Header
248  s << dbobject.sVector_[index] << "\t" << dbobject.sVector_[index + 1] << "\t" << dbobject.sVector_[index + 2]
249  << "\t" << dbobject.sVector_[index + 3] << "\t" << dbobject.sVector_[index + 4] << "\t"
250  << dbobject.sVector_[index + 5] << "\t" << dbobject.sVector_[index + 6] << "\t" << dbobject.sVector_[index + 7]
251  << "\t" << dbobject.sVector_[index + 8] << "\t" << dbobject.sVector_[index + 9] << "\t"
252  << dbobject.sVector_[index + 10] << "\t" << dbobject.sVector_[index + 11] << "\t" << dbobject.sVector_[index + 12]
253  << "\t" << dbobject.sVector_[index + 13] << "\t" << dbobject.sVector_[index + 14] << "\t"
254  << dbobject.sVector_[index + 15] << "\t" << dbobject.sVector_[index + 16] << std::endl;
255  index += 17;
256 
257  //Loop over By,Bx,Fy,Fx
258  for (entry_it = 0; entry_it < 4; ++entry_it) {
259  //Run,costrk,qavg,...,clslenx
260  for (i = 0; i < entries[entry_it]; ++i) {
261  s << dbobject.sVector_[index] << "\t" << dbobject.sVector_[index + 1] << "\t" << dbobject.sVector_[index + 2]
262  << "\t" << dbobject.sVector_[index + 3] << "\n"
263  << dbobject.sVector_[index + 4] << "\t" << dbobject.sVector_[index + 5] << "\t"
264  << dbobject.sVector_[index + 6] << "\t" << dbobject.sVector_[index + 7] << "\t"
265  << dbobject.sVector_[index + 8] << "\t" << dbobject.sVector_[index + 9] << "\t"
266  << dbobject.sVector_[index + 10] << "\t" << dbobject.sVector_[index + 11] << "\n"
267  << dbobject.sVector_[index + 12] << "\t" << dbobject.sVector_[index + 13] << "\t"
268  << dbobject.sVector_[index + 14] << "\t" << dbobject.sVector_[index + 15] << "\t"
269  << dbobject.sVector_[index + 16] << "\t" << dbobject.sVector_[index + 17] << "\t"
270  << dbobject.sVector_[index + 18] << std::endl;
271  index += 19;
272  //YPar
273  for (j = 0; j < 2; ++j) {
274  for (k = 0; k < 5; ++k) {
275  s << dbobject.sVector_[index] << "\t";
276  ++index;
277  }
278  s << std::endl;
279  }
280  //YTemp
281  for (j = 0; j < 9; ++j) {
282  for (k = 0; k < tysize[sizeSetter]; ++k) {
283  s << dbobject.sVector_[index] << "\t";
284  ++index;
285  }
286  s << std::endl;
287  }
288  //XPar
289  for (j = 0; j < 2; ++j) {
290  for (k = 0; k < 5; ++k) {
291  s << dbobject.sVector_[index] << "\t";
292  ++index;
293  }
294  s << std::endl;
295  }
296  //XTemp
297  for (j = 0; j < 9; ++j) {
298  for (k = 0; k < txsize[sizeSetter]; ++k) {
299  s << dbobject.sVector_[index] << "\t";
300  ++index;
301  }
302  s << std::endl;
303  }
304  //Y average reco params
305  for (j = 0; j < 4; ++j) {
306  for (k = 0; k < 4; ++k) {
307  s << dbobject.sVector_[index] << "\t";
308  ++index;
309  }
310  s << std::endl;
311  }
312  //Yflpar
313  for (j = 0; j < 4; ++j) {
314  for (k = 0; k < 6; ++k) {
315  s << dbobject.sVector_[index] << "\t";
316  ++index;
317  }
318  s << std::endl;
319  }
320  //X average reco params
321  for (j = 0; j < 4; ++j) {
322  for (k = 0; k < 4; ++k) {
323  s << dbobject.sVector_[index] << "\t";
324  ++index;
325  }
326  s << std::endl;
327  }
328  //Xflpar
329  for (j = 0; j < 4; ++j) {
330  for (k = 0; k < 6; ++k) {
331  s << dbobject.sVector_[index] << "\t";
332  ++index;
333  }
334  s << std::endl;
335  }
336  //Chi2X,Y
337  for (j = 0; j < 4; ++j) {
338  for (k = 0; k < 2; ++k) {
339  for (l = 0; l < 2; ++l) {
340  s << dbobject.sVector_[index] << "\t";
341  ++index;
342  }
343  }
344  s << std::endl;
345  }
346  //Y average Chi2 params
347  for (j = 0; j < 4; ++j) {
348  for (k = 0; k < 4; ++k) {
349  s << dbobject.sVector_[index] << "\t";
350  ++index;
351  }
352  s << std::endl;
353  }
354  //X average Chi2 params
355  for (j = 0; j < 4; ++j) {
356  for (k = 0; k < 4; ++k) {
357  s << dbobject.sVector_[index] << "\t";
358  ++index;
359  }
360  s << std::endl;
361  }
362  //Y average reco params for CPE Generic
363  for (j = 0; j < 4; ++j) {
364  for (k = 0; k < 4; ++k) {
365  s << dbobject.sVector_[index] << "\t";
366  ++index;
367  }
368  s << std::endl;
369  }
370  //X average reco params for CPE Generic
371  for (j = 0; j < 4; ++j) {
372  for (k = 0; k < 4; ++k) {
373  s << dbobject.sVector_[index] << "\t";
374  ++index;
375  }
376  s << std::endl;
377  }
378  //SpareX,Y
379  for (j = 0; j < 20; ++j) {
380  s << dbobject.sVector_[index] << "\t";
381  ++index;
382  if (j == 9 || j == 19)
383  s << std::endl;
384  }
385  }
386  }
387  }
388  return s;
389 }
Log< level::Warning, true > LogPrint

◆ s_filler_0__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< SiPixelTemplateDBObjectReader > > s_filler_0__LINE__ ( "SiPixelTemplateDBObjectReader"  )
static

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< SiPixelTemplateDBObjectReader > > s_maker__LINE__ ( "SiPixelTemplateDBObjectReader"  )
static