CMS 3D CMS Logo

Public Member Functions | Private Attributes

calibXMLwriter Class Reference

#include <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, lut2db_cfg::filename, and subdet_.

                                                     : subdet_(subdet)
{
    
    char filename[128];
    if (subdet_==EcalEndcap) {
      sprintf(filename,"endcap_iniCalib.xml");
    } else {
      sprintf(filename,"barrel_iniCalib.xml");
    }
    FILENAME = fopen(filename,"w");
    fprintf(FILENAME,"<?xml version=\"1.0\" ?>\n");
    fprintf(FILENAME,"<CalibrationConstants>\n");
    if (subdet==EcalEndcap) {
      fprintf(FILENAME,"<EcalEndcap>\n");
    } else {
      fprintf(FILENAME,"<EcalBarrel>\n");
    }

}
calibXMLwriter::~calibXMLwriter ( )

Definition at line 25 of file calibXMLwriter.cc.

References EcalEndcap, FILENAME, and subdet_.

{
    if (subdet_==EcalEndcap) {
      fprintf(FILENAME,"<EcalEndcap>\n");
    } else {
      fprintf(FILENAME,"<EcalBarrel>\n");
    }
    fprintf(FILENAME,"</CalibrationConstants>\n");
    fclose(FILENAME);
}

Member Function Documentation

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(), EcalEleCalibLooper::endOfJob(), ZeeCalibration::endOfJob(), and InvRingCalib::endOfJob().

{
int eta=det.ieta();
int phi=det.iphi();
fprintf(FILENAME,"<Cell eta_index=\"%d\" phi_index=\"%d\" scale_factor=\"%f\"/>\n",eta,phi,calib);
}
void calibXMLwriter::writeLine ( EEDetId const &  det,
float  calib 
)

Definition at line 44 of file calibXMLwriter.cc.

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

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

Member Data Documentation

FILE* calibXMLwriter::FILENAME [private]

Definition at line 29 of file calibXMLwriter.h.

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

Definition at line 28 of file calibXMLwriter.h.

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