CMS 3D CMS Logo

calibXMLwriter Class Reference

#include <Calibration/Tools/interface/calibXMLwriter.h>

List of all members.

Public Member Functions

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

Private Attributes

FILE * FILENAME
EcalSubdetector subdet_


Detailed Description

Definition at line 15 of file calibXMLwriter.h.


Constructor & Destructor Documentation

calibXMLwriter::calibXMLwriter ( EcalSubdetector  subdet = EcalBarrel  ) 

Definition at line 5 of file calibXMLwriter.cc.

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

00005                                                      : subdet_(subdet)
00006 {
00007     
00008     char filename[128];
00009     if (subdet_==EcalEndcap) {
00010       sprintf(filename,"endcap_iniCalib.xml");
00011     } else {
00012       sprintf(filename,"barrel_iniCalib.xml");
00013     }
00014     FILENAME = fopen(filename,"w");
00015     fprintf(FILENAME,"<?xml version=\"1.0\" ?>\n");
00016     fprintf(FILENAME,"<CalibrationConstants>\n");
00017     if (subdet==EcalEndcap) {
00018       fprintf(FILENAME,"<EcalEndcap>\n");
00019     } else {
00020       fprintf(FILENAME,"<EcalBarrel>\n");
00021     }
00022 
00023 }

calibXMLwriter::~calibXMLwriter (  ) 

Definition at line 25 of file calibXMLwriter.cc.

References EcalEndcap, FILENAME, and subdet_.

00026 {
00027     if (subdet_==EcalEndcap) {
00028       fprintf(FILENAME,"<EcalEndcap>\n");
00029     } else {
00030       fprintf(FILENAME,"<EcalBarrel>\n");
00031     }
00032     fprintf(FILENAME,"</CalibrationConstants>\n");
00033     fclose(FILENAME);
00034 }


Member Function Documentation

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

Definition at line 44 of file calibXMLwriter.cc.

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

00045 {
00046 int x=det.ix();
00047 int y=det.iy();
00048 int z=det.zside();
00049 fprintf(FILENAME,"<Cell x_index=\"%d\" y_index=\"%d\" z_index=\"%d\" scale_factor=\"%f\"/>\n",x,y,z,calib);
00050 }

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

Definition at line 36 of file calibXMLwriter.cc.

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

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

00037 {
00038 int eta=det.ieta();
00039 int phi=det.iphi();
00040 fprintf(FILENAME,"<Cell eta_index=\"%d\" phi_index=\"%d\" scale_factor=\"%f\"/>\n",eta,phi,calib);
00041 }


Member Data Documentation

FILE* calibXMLwriter::FILENAME [private]

Definition at line 29 of file calibXMLwriter.h.

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

EcalSubdetector calibXMLwriter::subdet_ [private]

Definition at line 28 of file calibXMLwriter.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:15:38 2009 for CMSSW by  doxygen 1.5.4