CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/CondTools/Ecal/bin/array2xmlEB.cc File Reference

#include <iostream>
#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
#include "CondTools/Ecal/interface/EcalIntercalibConstantsXMLTranslator.h"
#include "CondTools/Ecal/interface/EcalCondHeader.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include <string>
#include <sstream>
#include <fstream>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
void usage ()

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 23 of file array2xmlEB.cc.

References trackerHits::c, gather_cfg::cout, cmsRelvalreport::exit, h, UserOptions_cff::idx, recoMuon::in, EEDetId::kSizeForDenseIndexing, EBDetId::unhashIndex(), EEDetId::unhashIndex(), usage(), EEDetId::validHashIndex(), and EcalFloatCondObjectContainerXMLTranslator::writeXML().

                                {

 if (argc!=3) {
    usage();
    exit(0);
  }


 string arrayfilename(argv[1]);
 string xmlfilename(argv[2]);
 fstream arrayfile(arrayfilename.c_str(),ios::in);
 

 EcalIntercalibConstants rcd ;

 float c=0;
 int   idx=0;

 while (arrayfile>>c){
   uint32_t id=EBDetId::unhashIndex(idx);
   rcd[id]=c;
   ++idx;
 }
 cout << idx << endl;
 
 for (int cellid = 0; 
       cellid < EEDetId::kSizeForDenseIndexing; 
       ++cellid){// loop on EB cells
    
    

    if (EEDetId::validHashIndex(cellid)){  
      uint32_t rawid = EEDetId::unhashIndex(cellid);
     
      rcd[rawid]=0.0;
     
    } // if
  } 



 
   
 // write new format
 EcalCondHeader h; 
 EcalIntercalibConstantsXMLTranslator::writeXML(xmlfilename,h,rcd); 
   

}
void usage ( )

Definition at line 14 of file array2xmlEB.cc.

References gather_cfg::cout.

Referenced by main(), and stor::detail::memoryUsage().

            {
  cout << endl;
  cout << "array2xml [arrayfile] [xmlfile]" <<  endl;
  cout << "Read coefficients from straight array [denseindex]"<<endl;
  cout << "and write in xml format" << endl;

}