CMS 3D CMS Logo

Public Member Functions | Private Attributes

Pi0CalibXMLwriter Class Reference

#include <Pi0CalibXMLwriter.h>

List of all members.

Public Member Functions

 Pi0CalibXMLwriter (EcalSubdetector=EcalBarrel)
 Pi0CalibXMLwriter (EcalSubdetector=EcalBarrel, int=0)
void writeLine (EBDetId const &, float)
void writeLine (EEDetId const &, float)
 ~Pi0CalibXMLwriter ()

Private Attributes

FILE * FILENAME
int loop_
EcalSubdetector subdet_

Detailed Description

Definition at line 10 of file Pi0CalibXMLwriter.h.


Constructor & Destructor Documentation

Pi0CalibXMLwriter::Pi0CalibXMLwriter ( EcalSubdetector  subdet = EcalBarrel)

Definition at line 5 of file Pi0CalibXMLwriter.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");
    }

}
Pi0CalibXMLwriter::Pi0CalibXMLwriter ( EcalSubdetector  subdet = EcalBarrel,
int  loop = 0 
)

Definition at line 25 of file Pi0CalibXMLwriter.cc.

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

                                                                     : subdet_(subdet), loop_(loop)
{
    
    char filename[128];
    if (subdet_==EcalEndcap) {
      sprintf(filename,"endcap_calib_loop_%d.xml",loop);
    } else {
      sprintf(filename,"barrel_calib_loop_%d.xml",loop);
    }
    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");
    }

}
Pi0CalibXMLwriter::~Pi0CalibXMLwriter ( )

Definition at line 45 of file Pi0CalibXMLwriter.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 Pi0CalibXMLwriter::writeLine ( EBDetId const &  det,
float  calib 
)

Definition at line 56 of file Pi0CalibXMLwriter.cc.

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

Referenced by Pi0FixedMassWindowCalibration::endOfJob(), and Pi0FixedMassWindowCalibration::endOfLoop().

{
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 Pi0CalibXMLwriter::writeLine ( EEDetId const &  det,
float  calib 
)

Definition at line 64 of file Pi0CalibXMLwriter.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()>0 ? 1 : 0;
fprintf(FILENAME,"<Cell x_index=\"%d\" y_index=\"%d\" z_index=\"%d\" scale_factor=\"%f\"/>\n",x,y,z,calib);
}

Member Data Documentation

FILE* Pi0CalibXMLwriter::FILENAME [private]

Definition at line 26 of file Pi0CalibXMLwriter.h.

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

int Pi0CalibXMLwriter::loop_ [private]

Definition at line 25 of file Pi0CalibXMLwriter.h.

Definition at line 24 of file Pi0CalibXMLwriter.h.

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