CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
Pi0CalibXMLwriter Class Reference

#include <Pi0CalibXMLwriter.h>

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

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

Definition at line 25 of file Pi0CalibXMLwriter.cc.

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

25  : subdet_(subdet), loop_(loop)
26 {
27 
28  char filename[128];
29  if (subdet_==EcalEndcap) {
30  sprintf(filename,"endcap_calib_loop_%d.xml",loop);
31  } else {
32  sprintf(filename,"barrel_calib_loop_%d.xml",loop);
33  }
34  FILENAME = fopen(filename,"w");
35  fprintf(FILENAME,"<?xml version=\"1.0\" ?>\n");
36  fprintf(FILENAME,"<CalibrationConstants>\n");
37  if (subdet==EcalEndcap) {
38  fprintf(FILENAME,"<EcalEndcap>\n");
39  } else {
40  fprintf(FILENAME,"<EcalBarrel>\n");
41  }
42 
43 }
EcalSubdetector subdet_
int loop
CMSSW
tuple filename
Definition: lut2db_cfg.py:20
Pi0CalibXMLwriter::~Pi0CalibXMLwriter ( )

Definition at line 45 of file Pi0CalibXMLwriter.cc.

References EcalEndcap, FILENAME, and subdet_.

46 {
47  if (subdet_==EcalEndcap) {
48  fprintf(FILENAME,"<EcalEndcap>\n");
49  } else {
50  fprintf(FILENAME,"<EcalBarrel>\n");
51  }
52  fprintf(FILENAME,"</CalibrationConstants>\n");
53  fclose(FILENAME);
54 }
EcalSubdetector subdet_

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

57 {
58 int eta=det.ieta();
59 int phi=det.iphi();
60 fprintf(FILENAME,"<Cell eta_index=\"%d\" phi_index=\"%d\" scale_factor=\"%f\"/>\n",eta,phi,calib);
61 }
T eta() const
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
Definition: DDAxes.h:10
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, detailsBasic3DVector::z, and EEDetId::zside().

65 {
66 int x=det.ix();
67 int y=det.iy();
68 int z=det.zside()>0 ? 1 : 0;
69 fprintf(FILENAME,"<Cell x_index=\"%d\" y_index=\"%d\" z_index=\"%d\" scale_factor=\"%f\"/>\n",x,y,z,calib);
70 }
float float float z
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
Definition: DDAxes.h:10

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.

EcalSubdetector Pi0CalibXMLwriter::subdet_
private

Definition at line 24 of file Pi0CalibXMLwriter.h.

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