CMS 3D CMS Logo

EcalTPGFineGrainStripfromFile.cc
Go to the documentation of this file.
2 
4 
6 
9 
10 #include <iostream>
11 #include <fstream>
12 #include <sstream>
13 
15  : m_name(ps.getUntrackedParameter<std::string>("name", "EcalTPGFineGrainStripfromFile")) {
16  fname = ps.getParameter<std::string>("FileName");
17 
18  std::cout << "EcalTPGFineGrainStripfromFile constructor\n" << std::endl;
19 }
20 
22  // do nothing
23 }
24 
26  std::cout << "------- Ecal -> getNewObjects\n";
27  edm::LogInfo("EcalTPGFineGrainStripfromFile") << "Started GetNewObjects!!!";
28 
29  int fileIOV;
30  std::cout << "LinPed which input IOV do you want " << std::endl;
31  std::cin >> fileIOV;
32  std::ifstream fLin;
33  std::ostringstream oss;
34  oss << fileIOV;
35  // std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
36  fLin.open(fname.c_str());
37  if (!fLin.is_open()) {
38  std::cout << "ERROR : can't open file '" << fname << std::endl;
39  return;
40  }
41  std::cout << " file " << fname << " opened" << std::endl;
43  for (int i = 0; i < 304517; i++)
44  getline(fLin, line);
45  char strip[8];
46  unsigned int stripId, Threshold, LUTFgr;
47 
49 
50  for (int istrip = 0; istrip < 15176; istrip++) {
51  getline(fLin, line);
52  sscanf(line.c_str(), "%s %u", strip, &stripId);
53  if (istrip < 10 || (istrip > 12239 && istrip < 12250))
54  std::cout << " string " << strip << " Id " << stripId;
55  getline(fLin, line); // sliding_window
56  getline(fLin, line); // weightGroupId
57  getline(fLin, line); // threshold_sfg lut_sfg
58  if (istrip < 10 || (istrip > 12239 && istrip < 12250))
59  std::cout << " line " << line;
60  sscanf(line.c_str(), "%x %x", &Threshold, &LUTFgr);
61  if (istrip < 10 || (istrip > 12239 && istrip < 12250))
62  std::cout << " Threshold " << Threshold << std::endl;
64  item.threshold = Threshold;
65  item.lut = LUTFgr;
66 
67  fgrStripEE->setValue(stripId, item);
68  if (istrip == 12239)
69  getline(fLin, line); // 1 empty line between EB and EE
70  } // end loop over EB + EE strips
71  fLin.close();
72 
73  m_to_transfer.push_back(std::make_pair(fgrStripEE, fileIOV));
74 
75  std::cout << "Ecal -> end of getNewObjects -----------\n";
76 }
HLT_FULL_cff.Threshold
Threshold
Definition: HLT_FULL_cff.py:11663
mps_fire.i
i
Definition: mps_fire.py:428
ESHandle.h
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
EcalTPGFineGrainStripEE
Definition: EcalTPGFineGrainStripEE.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalTPGFineGrainStripEE::Item
Definition: EcalTPGFineGrainStripEE.h:14
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
popcon::EcalTPGFineGrainStripfromFile::fname
std::string fname
Definition: EcalTPGFineGrainStripfromFile.h:30
popcon::EcalTPGFineGrainStripfromFile::EcalTPGFineGrainStripfromFile
EcalTPGFineGrainStripfromFile(edm::ParameterSet const &)
Definition: EcalTPGFineGrainStripfromFile.cc:14
EcalTPGFineGrainStripEE::setValue
void setValue(const uint32_t &id, const Item &value)
Definition: EcalTPGFineGrainStripEE.cc:7
EcalMappingRcd.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
EcalElectronicsMapping.h
popcon::EcalTPGFineGrainStripfromFile::getNewObjects
void getNewObjects() override
Definition: EcalTPGFineGrainStripfromFile.cc:25
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
std
Definition: JetResolutionObject.h:76
ParameterSetfwd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
popcon::EcalTPGFineGrainStripfromFile::~EcalTPGFineGrainStripfromFile
~EcalTPGFineGrainStripfromFile() override
Definition: EcalTPGFineGrainStripfromFile.cc:21
mps_splice.line
line
Definition: mps_splice.py:76
EcalTPGFineGrainStripfromFile.h