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 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 ()
 
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::map< Time_t, std::shared_ptr< EcalTPGFineGrainTowerEE > > Container
 
typedef std::unique_ptr< EcalTPGFineGrainTowerEERef
 
typedef PopConSourceHandler< EcalTPGFineGrainTowerEEself
 
typedef cond::Time_t Time_t
 
typedef EcalTPGFineGrainTowerEE value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
Container m_iovs
 
std::vector< std::pair< EcalTPGFineGrainTowerEE *, Time_t > > 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.

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

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 }

Member Function Documentation

◆ getNewObjects()

void popcon::EcalTPGFineGrainTowerfromFile::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >.

Definition at line 23 of file EcalTPGFineGrainTowerfromFile.cc.

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

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 }
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
std::vector< std::pair< EcalTPGFineGrainTowerEE *, Time_t > > m_to_transfer
void setValue(const uint32_t &id, const uint32_t &lut)
Log< level::Info, false > LogInfo

◆ id()

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

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().