CMS 3D CMS Logo

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

#include <calibXMLwriter.h>

Public Member Functions

 calibXMLwriter (EcalSubdetector=EcalBarrel)
 
void writeLine (EBDetId const &, float)
 
void writeLine (EEDetId const &, float)
 
 ~calibXMLwriter ()
 

Private Attributes

FILE * FILENAME
 
EcalSubdetector subdet_
 

Detailed Description

Definition at line 15 of file calibXMLwriter.h.

Constructor & Destructor Documentation

◆ calibXMLwriter()

calibXMLwriter::calibXMLwriter ( EcalSubdetector  subdet = EcalBarrel)

Definition at line 5 of file calibXMLwriter.cc.

5  : subdet_(subdet) {
6  char filename[128];
7  if (subdet_ == EcalEndcap) {
8  sprintf(filename, "endcap_iniCalib.xml");
9  } else {
10  sprintf(filename, "barrel_iniCalib.xml");
11  }
12  FILENAME = fopen(filename, "w");
13  fprintf(FILENAME, "<?xml version=\"1.0\" ?>\n");
14  fprintf(FILENAME, "<CalibrationConstants>\n");
15  if (subdet == EcalEndcap) {
16  fprintf(FILENAME, "<EcalEndcap>\n");
17  } else {
18  fprintf(FILENAME, "<EcalBarrel>\n");
19  }
20 }

References EcalEndcap, FILENAME, corrVsCorr::filename, and subdet_.

◆ ~calibXMLwriter()

calibXMLwriter::~calibXMLwriter ( )

Definition at line 22 of file calibXMLwriter.cc.

22  {
23  if (subdet_ == EcalEndcap) {
24  fprintf(FILENAME, "<EcalEndcap>\n");
25  } else {
26  fprintf(FILENAME, "<EcalBarrel>\n");
27  }
28  fprintf(FILENAME, "</CalibrationConstants>\n");
29  fclose(FILENAME);
30 }

References EcalEndcap, FILENAME, and subdet_.

Member Function Documentation

◆ writeLine() [1/2]

void calibXMLwriter::writeLine ( EBDetId const &  det,
float  calib 
)

Definition at line 32 of file calibXMLwriter.cc.

32  {
33  int eta = det.ieta();
34  int phi = det.iphi();
35  fprintf(FILENAME, "<Cell eta_index=\"%d\" phi_index=\"%d\" scale_factor=\"%f\"/>\n", eta, phi, calib);
36 }

References PVValHelper::eta, FILENAME, EBDetId::ieta(), EBDetId::iphi(), and phi.

Referenced by ElectronCalibration::endJob(), ElectronCalibrationUniv::endJob(), InvRingCalib::endOfJob(), EcalEleCalibLooper::endOfJob(), and ZeeCalibration::endOfJob().

◆ writeLine() [2/2]

void calibXMLwriter::writeLine ( EEDetId const &  det,
float  calib 
)

Definition at line 38 of file calibXMLwriter.cc.

38  {
39  int x = det.ix();
40  int y = det.iy();
41  int z = det.zside();
42  fprintf(FILENAME, "<Cell x_index=\"%d\" y_index=\"%d\" z_index=\"%d\" scale_factor=\"%f\"/>\n", x, y, z, calib);
43 }

References FILENAME, EEDetId::ix(), EEDetId::iy(), x, y, z, and EEDetId::zside().

Member Data Documentation

◆ FILENAME

FILE* calibXMLwriter::FILENAME
private

Definition at line 25 of file calibXMLwriter.h.

Referenced by calibXMLwriter(), writeLine(), and ~calibXMLwriter().

◆ subdet_

EcalSubdetector calibXMLwriter::subdet_
private

Definition at line 24 of file calibXMLwriter.h.

Referenced by calibXMLwriter(), and ~calibXMLwriter().

DDAxes::y
calibXMLwriter::subdet_
EcalSubdetector subdet_
Definition: calibXMLwriter.h:24
calibXMLwriter::FILENAME
FILE * FILENAME
Definition: calibXMLwriter.h:25
DDAxes::x
PVValHelper::eta
Definition: PVValidationHelpers.h:70
DDAxes::z
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
calib
Definition: CalibElectron.h:12
EcalEndcap
Definition: EcalSubdetector.h:10
DDAxes::phi