CMS 3D CMS Logo

array2xmlEB.cc
Go to the documentation of this file.
1 #include <iostream>
7 
8 #include <string>
9 #include <sstream>
10 #include <fstream>
11 
12 using namespace std;
13 
14 void usage(){
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 }
21 
22 
23 int main(int argc, char* argv[]){
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:99
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:114
int main(int argc, char *argv[])
Definition: array2xmlEB.cc:23
void usage()
Definition: array2xmlEB.cc:14