CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CalibCalorimetry/CaloMiscalibTools/src/MiscalibReaderXMLEcalEndcap.cc

Go to the documentation of this file.
00001 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00002 #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLEcalEndcap.h"
00003 
00004 
00005 DetId MiscalibReaderFromXMLEcalEndcap::parseCellEntry(XERCES_CPP_NAMESPACE::DOMNamedNodeMap *attribute)
00006 {
00007 
00008 EEDetId cell= MiscalibReaderFromXMLEcalEndcap::getCellFromAttributes(
00009                                             getIntAttribute(attribute,"x_index"),
00010                                             getIntAttribute(attribute,"y_index"),
00011                                             getIntAttribute(attribute,"z_index")
00012                                             );
00013 return cell;
00014 }
00015 
00016 EEDetId MiscalibReaderFromXMLEcalEndcap::getCellFromAttributes(int ix, int iy, int iz)
00017 {
00018 
00019        try 
00020          {
00021            if (EEDetId::validDetId(ix, iy, iz)) {
00022              EEDetId cell(ix,iy,iz);
00023              return cell;
00024            } else {
00025              return EEDetId(0);
00026            }
00027          }
00028     
00029            catch (...)
00030           
00031         {
00032           std::cout << "Null coordinates = "<< ix << "," << iy << "," << iz << std::endl;
00033           return EEDetId(0);
00034         }
00035             
00036             
00037 }
00038