CMS 3D CMS Logo

Classes | Functions
SiPixel2DTemplateDBObjectReader.cc File Reference
#include <iomanip>
#include <fstream>
#include <iostream>
#include <cmath>
#include <memory>
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#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 "MagneticField/Engine/interface/MagneticField.h"
#include "CondFormats/SiPixelObjects/interface/SiPixel2DTemplateDBObject.h"
#include "CondFormats/DataRecord/interface/SiPixel2DTemplateDBObjectRcd.h"
#include "CalibTracker/Records/interface/SiPixel2DTemplateDBObjectESProducerRcd.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"

Go to the source code of this file.

Classes

class  SiPixel2DTemplateDBObjectReader
 

Functions

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

Function Documentation

◆ operator<<()

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

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

-these are modifiable parameters for the extended 2DTemplates

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

-local indicies for loops

-changes the size of the 2DTemplates based on the version

Definition at line 199 of file SiPixel2DTemplateDBObjectReader.cc.

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

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

◆ s_filler_0__LINE__()

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

◆ s_maker__LINE__()

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