CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
std::string id () const
 
 ~EcalTPGSpikeThresholdfromFile ()
 
- 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< TripletContainer
 
typedef std::vector< std::pair
< EcalTPGSpike *, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< EcalTPGSpike
self
 
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)
 
- 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

popcon::EcalTPGSpikeThresholdfromFile::~EcalTPGSpikeThresholdfromFile ( )

Definition at line 20 of file EcalTPGSpikeThresholdfromFile.cc.

20  {
21  // do nothing
22 }
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 
17  std::cout << "EcalTPGSpikeThresholdfromFile constructor\n" << std::endl;
18 }
tuple cout
Definition: gather_cfg.py:145

Member Function Documentation

void popcon::EcalTPGSpikeThresholdfromFile::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< EcalTPGSpike >.

Definition at line 24 of file EcalTPGSpikeThresholdfromFile.cc.

References gather_cfg::cout, alignmentValidation::fname, i, geometryCSVtoXML::line, lumiPlot::lut, EcalTPGSpike::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::towerId().

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

Member Data Documentation

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

Definition at line 54 of file EcalTPGSpikeThresholdfromFile.h.

Referenced by id().