CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
popcon::EcalTPGFineGrainTowerfromFile Class Reference

#include <EcalTPGFineGrainTowerfromFile.h>

Inheritance diagram for popcon::EcalTPGFineGrainTowerfromFile:
popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >

Public Member Functions

 EcalTPGFineGrainTowerfromFile (edm::ParameterSet const &)
 
void getNewObjects () override
 
std::string id () const override
 
 ~EcalTPGFineGrainTowerfromFile () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

std::string fname
 
std::string m_name
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< EcalTPGFineGrainTowerEE *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< EcalTPGFineGrainTowerEEself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalTPGFineGrainTowerEE value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 20 of file EcalTPGFineGrainTowerfromFile.h.

Constructor & Destructor Documentation

◆ ~EcalTPGFineGrainTowerfromFile()

popcon::EcalTPGFineGrainTowerfromFile::~EcalTPGFineGrainTowerfromFile ( )
override

Definition at line 21 of file EcalTPGFineGrainTowerfromFile.cc.

21 {}

◆ EcalTPGFineGrainTowerfromFile()

popcon::EcalTPGFineGrainTowerfromFile::EcalTPGFineGrainTowerfromFile ( edm::ParameterSet const &  ps)

Definition at line 14 of file EcalTPGFineGrainTowerfromFile.cc.

15  : m_name(ps.getUntrackedParameter<std::string>("name", "EcalTPGFineGrainTowerfromFile")) {
16  fname = ps.getParameter<std::string>("FileName");
17 
18  std::cout << "EcalTPGFineGrainTowerfromFile constructor\n" << std::endl;
19 }

References gather_cfg::cout, fname, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

Member Function Documentation

◆ getNewObjects()

void popcon::EcalTPGFineGrainTowerfromFile::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >.

Definition at line 23 of file EcalTPGFineGrainTowerfromFile.cc.

23  {
24  std::cout << "------- Ecal -> getNewObjects\n";
25  edm::LogInfo("EcalTPGFineGrainTowerfromFile") << "Started GetNewObjects!!!";
26 
27  int fileIOV;
28  std::cout << "LinPed which input IOV do you want " << std::endl;
29  std::cin >> fileIOV;
30  std::ifstream fLin;
31  std::ostringstream oss;
32  oss << fileIOV;
33  // std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
34  fLin.open(fname.c_str());
35  if (!fLin.is_open()) {
36  std::cout << "ERROR : can't open file '" << fname << std::endl;
37  return;
38  }
39  std::cout << " file " << fname << " opened" << std::endl;
40  /* structure of the file:
41 TOWER_EB 365224/375015 : 9792 lines 2448 towers 3 lines : 0, 0, 96 (LUTGroupId, FgGroupId, spike_killing_threshold)
42 empty line 375016
43 TOWER_EE 375017/379768 : 4752 lines 1584 towers 2 lines : 0, 0x0 (LUTGroupId, tower_lut_fg)
44  */
46  for (int i = 0; i < 375016; i++)
47  getline(fLin, line);
48  char tower[8];
49  unsigned int towerId, LUTFg;
51  for (int itower = 0; itower < 1584; itower++) {
52  getline(fLin, line);
53  sscanf(line.c_str(), "%s %u", tower, &towerId);
54  if (itower < 10 || (itower > 1574 && itower < 1584))
55  std::cout << " string " << tower << " Id " << towerId;
56  getline(fLin, line); // LUTGroupId
57  getline(fLin, line); // tower_lut_fg
58  if (itower < 10 || (itower > 1574 && itower < 1584))
59  std::cout << " line " << line << std::endl;
60  sscanf(line.c_str(), "%x", &LUTFg);
61  // EcalTPGFineGrainTowerEE::Item item;
62  // item.lut = LUTFg;
63  // fgrMap->setValue(towerId, item);
64 
65  fgrMap->setValue(towerId, LUTFg);
66  } // end loop over EE towers
67  fLin.close();
68 
69  m_to_transfer.push_back(std::make_pair(fgrMap, fileIOV));
70 
71  std::cout << "Ecal -> end of getNewObjects -----------\n";
72 }

References gather_cfg::cout, alignmentValidation::fname, mps_fire::i, mps_splice::line, EcalTPGFineGrainTowerEE::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, hgcalTowerProducer_cfi::tower, and ecaldqm::towerId().

◆ id()

std::string popcon::EcalTPGFineGrainTowerfromFile::id ( ) const
inlineoverridevirtual

Implements popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >.

Definition at line 26 of file EcalTPGFineGrainTowerfromFile.h.

26 { return m_name; }

References m_name.

Member Data Documentation

◆ fname

std::string popcon::EcalTPGFineGrainTowerfromFile::fname
private

Definition at line 30 of file EcalTPGFineGrainTowerfromFile.h.

Referenced by EcalTPGFineGrainTowerfromFile().

◆ m_name

std::string popcon::EcalTPGFineGrainTowerfromFile::m_name
private

Definition at line 29 of file EcalTPGFineGrainTowerfromFile.h.

Referenced by id().

popcon::EcalTPGFineGrainTowerfromFile::fname
std::string fname
Definition: EcalTPGFineGrainTowerfromFile.h:30
mps_fire.i
i
Definition: mps_fire.py:428
popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
popcon::EcalTPGFineGrainTowerfromFile::m_name
std::string m_name
Definition: EcalTPGFineGrainTowerfromFile.h:29
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
ecaldqm::towerId
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:77
EcalTPGFineGrainTowerEE
Definition: EcalTPGFineGrainTowerEE.h:9
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTPGFineGrainTowerEE::setValue
void setValue(const uint32_t &id, const uint32_t &lut)
Definition: EcalTPGFineGrainTowerEE.cc:7
mps_splice.line
line
Definition: mps_splice.py:76