CMS 3D CMS Logo

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

#include <EcalTPGSpikeThresholdfromFile.h>

Inheritance diagram for popcon::EcalTPGSpikeThresholdfromFile:
popcon::PopConSourceHandler< EcalTPGSpike >

Public Member Functions

 EcalTPGSpikeThresholdfromFile (edm::ParameterSet const &)
 
void getNewObjects () override
 
std::string id () const override
 
 ~EcalTPGSpikeThresholdfromFile () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGSpike >
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 m_name
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalTPGSpike >
typedef std::map< Time_t, std::shared_ptr< EcalTPGSpike > > Container
 
typedef std::unique_ptr< EcalTPGSpikeRef
 
typedef PopConSourceHandler< EcalTPGSpikeself
 
typedef cond::Time_t Time_t
 
typedef EcalTPGSpike value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGSpike >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGSpike >
Container m_iovs
 
std::vector< std::pair< EcalTPGSpike *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 44 of file EcalTPGSpikeThresholdfromFile.h.

Constructor & Destructor Documentation

◆ ~EcalTPGSpikeThresholdfromFile()

popcon::EcalTPGSpikeThresholdfromFile::~EcalTPGSpikeThresholdfromFile ( )
override

Definition at line 19 of file EcalTPGSpikeThresholdfromFile.cc.

19  {
20  // do nothing
21 }

◆ EcalTPGSpikeThresholdfromFile()

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

Definition at line 14 of file EcalTPGSpikeThresholdfromFile.cc.

References gather_cfg::cout.

15  : m_name(ps.getUntrackedParameter<std::string>("name", "EcalTPGSpikeThresholdfromFile")) {
16  std::cout << "EcalTPGSpikeThresholdfromFile constructor\n" << std::endl;
17 }

Member Function Documentation

◆ getNewObjects()

void popcon::EcalTPGSpikeThresholdfromFile::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGSpike >.

Definition at line 23 of file EcalTPGSpikeThresholdfromFile.cc.

References gather_cfg::cout, alignmentValidation::fname, mps_fire::i, mps_splice::line, jetsAK4_Puppi_cff::payload, EcalTPGSpike::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, HLT_2023v12_cff::Threshold, and ecaldqm::towerId().

23  {
24  std::cout << "------- Ecal -> getNewObjects\n";
25  edm::LogInfo("EcalTPGSpikeThresholdfromFile") << "Started GetNewObjects!!!";
26 
28 
29  // here popcon tells us which is the last since of the last object in the offline DB
30 
31  int fileIOV;
32  std::cout << "LinPed which input IOV do you want " << std::endl;
33  std::cin >> fileIOV;
34  std::ifstream fLin;
35  std::ostringstream oss;
36  oss << fileIOV;
37  std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
38  fLin.open(fname.c_str());
39  if (!fLin.is_open()) {
40  std::cout << "ERROR : can't open file '" << fname << std::endl;
41  return;
42  }
43  std::cout << " file " << fname << " opened" << std::endl;
45  for (int i = 0; i < 365223; i++)
46  getline(fLin, line);
47  char tow[8];
48  unsigned int towerId, Threshold;
49  EcalTPGSpike *lut = new EcalTPGSpike();
50  for (int istrip = 0; istrip < 2448; istrip++) {
51  getline(fLin, line);
52  sscanf(line.c_str(), "%s %u", tow, &towerId);
53  if (istrip < 10)
54  std::cout << " string " << tow << " Id " << towerId;
55  getline(fLin, line); // LUTGroupId
56  getline(fLin, line); // FgGroupId
57  getline(fLin, line); // spike_killing_threshold
58  if (istrip < 10)
59  std::cout << " line " << line;
60  sscanf(line.c_str(), "%u", &Threshold);
61  if (istrip < 10)
62  std::cout << " Threshold " << Threshold << std::endl;
63 
64  lut->setValue(towerId, Threshold);
65  } // end loop over EB towers
66  fLin.close();
67 
68  m_to_transfer.push_back(std::make_pair(lut, fileIOV));
69 
70  std::cout << "Ecal -> end of getNewObjects -----------\n";
71 }
void setValue(const uint32_t &id, const uint16_t &val)
Definition: EcalTPGSpike.cc:7
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
std::vector< std::pair< EcalTPGSpike *, Time_t > > m_to_transfer
Log< level::Info, false > LogInfo
string fname
main script

◆ id()

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

Member Data Documentation

◆ m_name

std::string popcon::EcalTPGSpikeThresholdfromFile::m_name
private

Definition at line 53 of file EcalTPGSpikeThresholdfromFile.h.

Referenced by id().