CMS 3D CMS Logo

Functions
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 EnergyCorrector::c, gather_cfg::cout, cmsRelvalreport::exit, h, triggerObjects_cff::id, training_settings::idx, recoMuon::in, EEDetId::kSizeForDenseIndexing, EBDetId::unhashIndex(), EEDetId::unhashIndex(), usage(), EEDetId::validHashIndex(), and EcalFloatCondObjectContainerXMLTranslator::writeXML().

23  {
24 
25  if (argc!=3) {
26  usage();
27  exit(0);
28  }
29 
30 
31  string arrayfilename(argv[1]);
32  string xmlfilename(argv[2]);
33  fstream arrayfile(arrayfilename.c_str(),ios::in);
34 
35 
37 
38  float c=0;
39  int idx=0;
40 
41  while (arrayfile>>c){
42  uint32_t id=EBDetId::unhashIndex(idx);
43  rcd[id]=c;
44  ++idx;
45  }
46  cout << idx << endl;
47 
48  for (int cellid = 0;
50  ++cellid){// loop on EB cells
51 
52 
53 
54  if (EEDetId::validHashIndex(cellid)){
55  uint32_t rawid = EEDetId::unhashIndex(cellid);
56 
57  rcd[rawid]=0.0;
58 
59  } // if
60  }
61 
62 
63 
64 
65 
66  // write new format
69 
70 
71 }
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalFloatCondObjectContainer &record)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
static bool validHashIndex(int i)
Definition: EEDetId.h:239
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
void usage()
Definition: array2xmlEB.cc:14
void usage ( )

Definition at line 14 of file array2xmlEB.cc.

References gather_cfg::cout.

Referenced by main().

14  {
15  cout << endl;
16  cout << "array2xml [arrayfile] [xmlfile]" << endl;
17  cout << "Read coefficients from straight array [denseindex]"<<endl;
18  cout << "and write in xml format" << endl;
19 
20 }