CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 trackerHits::c, gather_cfg::cout, cmsRelvalreport::exit, h, customizeTrackingMonitorSeedNumber::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)
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
static bool validHashIndex(int i)
Definition: EEDetId.h:240
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
tuple argc
Definition: dir2webdir.py:41
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:115
void usage()
Definition: array2xmlEB.cc:14
tuple cout
Definition: gather_cfg.py:121
void usage ( )

Definition at line 14 of file array2xmlEB.cc.

References gather_cfg::cout.

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

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 }
tuple cout
Definition: gather_cfg.py:121