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 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 m_name
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalTPGSpike >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< EcalTPGSpike *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< EcalTPGSpikeself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalTPGSpike value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGSpike >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGSpike >
OldContainer 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.

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

References gather_cfg::cout.

Member Function Documentation

◆ getNewObjects()

void popcon::EcalTPGSpikeThresholdfromFile::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGSpike >.

Definition at line 23 of file EcalTPGSpikeThresholdfromFile.cc.

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 }

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

◆ id()

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

Implements popcon::PopConSourceHandler< EcalTPGSpike >.

Definition at line 50 of file EcalTPGSpikeThresholdfromFile.h.

50 { return m_name; }

References m_name.

Member Data Documentation

◆ m_name

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

Definition at line 53 of file EcalTPGSpikeThresholdfromFile.h.

Referenced by id().

HLT_FULL_cff.Threshold
Threshold
Definition: HLT_FULL_cff.py:11663
mps_fire.i
i
Definition: mps_fire.py:428
popcon::PopConSourceHandler< EcalTPGSpike >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
EcalTPGSpike
Definition: EcalTPGSpike.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EcalTPGSpike::setValue
void setValue(const uint32_t &id, const uint16_t &val)
Definition: EcalTPGSpike.cc:7
jets_cff.payload
payload
Definition: jets_cff.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition: JetExtendedAssociation.h:32
popcon::PopConSourceHandler< EcalTPGSpike >::lastPayload
Ref lastPayload() const
Definition: PopConSourceHandler.h:81
popcon::EcalTPGSpikeThresholdfromFile::m_name
std::string m_name
Definition: EcalTPGSpikeThresholdfromFile.h:53
mps_splice.line
line
Definition: mps_splice.py:76