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.

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

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 }
EcalSubdetector subdet_

◆ ~calibXMLwriter()

calibXMLwriter::~calibXMLwriter ( )

Definition at line 22 of file calibXMLwriter.cc.

References EcalEndcap, FILENAME, and subdet_.

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 }
EcalSubdetector subdet_

Member Function Documentation

◆ writeLine() [1/2]

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

Definition at line 32 of file calibXMLwriter.cc.

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

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

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 }

◆ writeLine() [2/2]

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

Definition at line 38 of file calibXMLwriter.cc.

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

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 }

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().