CMS 3D CMS Logo

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

#include <EcalTPGFineGrainStripfromFile.h>

Inheritance diagram for popcon::EcalTPGFineGrainStripfromFile:
popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >

Public Member Functions

 EcalTPGFineGrainStripfromFile (edm::ParameterSet const &)
 
void getNewObjects () override
 
std::string id () const override
 
 ~EcalTPGFineGrainStripfromFile () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >
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< EcalTPGFineGrainStripEE >
typedef std::map< Time_t, std::shared_ptr< EcalTPGFineGrainStripEE > > Container
 
typedef std::unique_ptr< EcalTPGFineGrainStripEERef
 
typedef PopConSourceHandler< EcalTPGFineGrainStripEEself
 
typedef cond::Time_t Time_t
 
typedef EcalTPGFineGrainStripEE value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >
Container m_iovs
 
std::vector< std::pair< EcalTPGFineGrainStripEE *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 20 of file EcalTPGFineGrainStripfromFile.h.

Constructor & Destructor Documentation

◆ ~EcalTPGFineGrainStripfromFile()

popcon::EcalTPGFineGrainStripfromFile::~EcalTPGFineGrainStripfromFile ( )
override

Definition at line 21 of file EcalTPGFineGrainStripfromFile.cc.

21  {
22  // do nothing
23 }

◆ EcalTPGFineGrainStripfromFile()

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

Definition at line 14 of file EcalTPGFineGrainStripfromFile.cc.

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

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 }

Member Function Documentation

◆ getNewObjects()

void popcon::EcalTPGFineGrainStripfromFile::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >.

Definition at line 25 of file EcalTPGFineGrainStripfromFile.cc.

References gather_cfg::cout, alignmentValidation::fname, mps_fire::i, B2GTnPMonitor_cfi::item, mps_splice::line, EcalTPGFineGrainStripEE::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, and HLT_2022v12_cff::Threshold.

25  {
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 }
void setValue(const uint32_t &id, const Item &value)
std::vector< std::pair< EcalTPGFineGrainStripEE *, Time_t > > m_to_transfer
Log< level::Info, false > LogInfo

◆ id()

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

Member Data Documentation

◆ fname

std::string popcon::EcalTPGFineGrainStripfromFile::fname
private

Definition at line 30 of file EcalTPGFineGrainStripfromFile.h.

Referenced by EcalTPGFineGrainStripfromFile().

◆ m_name

std::string popcon::EcalTPGFineGrainStripfromFile::m_name
private

Definition at line 29 of file EcalTPGFineGrainStripfromFile.h.

Referenced by id().