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

◆ main()

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

Definition at line 21 of file array2xmlEB.cc.

21  {
22  if (argc != 3) {
23  usage();
24  exit(0);
25  }
26 
27  string arrayfilename(argv[1]);
28  string xmlfilename(argv[2]);
29  fstream arrayfile(arrayfilename.c_str(), ios::in);
30 
32 
33  float c = 0;
34  int idx = 0;
35 
36  while (arrayfile >> c) {
37  uint32_t id = EBDetId::unhashIndex(idx);
38  rcd[id] = c;
39  ++idx;
40  }
41  cout << idx << endl;
42 
43  for (int cellid = 0; cellid < EEDetId::kSizeForDenseIndexing; ++cellid) { // loop on EB cells
44 
45  if (EEDetId::validHashIndex(cellid)) {
46  uint32_t rawid = EEDetId::unhashIndex(cellid);
47 
48  rcd[rawid] = 0.0;
49 
50  } // if
51  }
52 
53  // write new format
56 }

References dir2webdir::argc, cmsBatch::argv, c, gather_cfg::cout, beamvalidation::exit(), h, triggerObjects_cff::id, heavyIonCSV_trainingSettings::idx, recoMuon::in, EEDetId::kSizeForDenseIndexing, EBDetId::unhashIndex(), EEDetId::unhashIndex(), usage(), EEDetId::validHashIndex(), and EcalFloatCondObjectContainerXMLTranslator::writeXML().

◆ usage()

void usage ( )

Definition at line 14 of file array2xmlEB.cc.

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 }

References gather_cfg::cout.

Referenced by edm::service::getCPU(), and main().

cmsBatch.argv
argv
Definition: cmsBatch.py:279
dir2webdir.argc
argc
Definition: dir2webdir.py:39
EEDetId::unhashIndex
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EBDetId::unhashIndex
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
h
EEDetId::kSizeForDenseIndexing
Definition: EEDetId.h:329
EcalCondHeader
Definition: EcalCondHeader.h:16
recoMuon::in
Definition: RecoMuonEnumerators.h:6
EEDetId::validHashIndex
static bool validHashIndex(int i)
Definition: EEDetId.h:239
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
usage
void usage()
Definition: array2xmlEB.cc:14
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:52
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
EcalFloatCondObjectContainerXMLTranslator::writeXML
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalFloatCondObjectContainer &record)
Definition: EcalFloatCondObjectContainerXMLTranslator.cc:246