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::EcalTPGFineGrainStripfromFile Class Reference

#include <EcalTPGFineGrainStripfromFile.h>

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

Public Member Functions

 EcalTPGFineGrainStripfromFile (edm::ParameterSet const &)
 
void getNewObjects ()
 
std::string id () const
 
 ~EcalTPGFineGrainStripfromFile ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >
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< EcalTPGFineGrainStripEE >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< EcalTPGFineGrainStripEE
*, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< EcalTPGFineGrainStripEE
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalTPGFineGrainStripEE value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 44 of file EcalTPGFineGrainStripfromFile.h.

Constructor & Destructor Documentation

popcon::EcalTPGFineGrainStripfromFile::~EcalTPGFineGrainStripfromFile ( )

Definition at line 20 of file EcalTPGFineGrainStripfromFile.cc.

20  {
21  // do nothing
22 }
popcon::EcalTPGFineGrainStripfromFile::EcalTPGFineGrainStripfromFile ( edm::ParameterSet const &  ps)

Definition at line 14 of file EcalTPGFineGrainStripfromFile.cc.

References gather_cfg::cout.

15  : m_name(ps.getUntrackedParameter<std::string>("name","EcalTPGFineGrainStripfromFile")) {
16 
17  std::cout << "EcalTPGFineGrainStripfromFile constructor\n" << std::endl;
18 }
tuple cout
Definition: gather_cfg.py:145

Member Function Documentation

void popcon::EcalTPGFineGrainStripfromFile::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< EcalTPGFineGrainStripEE >.

Definition at line 24 of file EcalTPGFineGrainStripfromFile.cc.

References gather_cfg::cout, alignmentValidation::fname, i, geometryCSVtoXML::line, EcalTPGFineGrainStripEE::Item::lut, EcalTPGFineGrainStripEE::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, and EcalTPGFineGrainStripEE::Item::threshold.

24  {
25  std::cout << "------- Ecal -> getNewObjects\n";
26  edm::LogInfo("EcalTPGFineGrainStripfromFile") << "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 < 304517; i++) getline (fLin, line);
48  char strip[8];
49  unsigned int stripId, Threshold, LUTFgr;
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)) std::cout << " string " << strip << " Id " << stripId;
54  getline (fLin, line); // sliding_window
55  getline (fLin, line); // weightGroupId
56  getline (fLin, line); // threshold_sfg lut_sfg
57  if(istrip < 10 || (istrip > 12239 && istrip < 12250)) std::cout << " line " << line;
58  sscanf(line.c_str(), "%x %x", &Threshold, &LUTFgr);
59  if(istrip < 10 || (istrip > 12239 && istrip < 12250)) std::cout << " Threshold " << Threshold << std::endl;
61  item.threshold = Threshold;
62  item.lut = LUTFgr;
63 
64  fgrStripEE->setValue(stripId, item);
65  if(istrip == 12239) getline (fLin, line); // 1 empty line between EB and EE
66  } // end loop over EB + EE strips
67  fLin.close();
68 
69  m_to_transfer.push_back(std::make_pair((EcalTPGFineGrainStripEE*)fgrStripEE, fileIOV));
70 
71  std::cout << "Ecal -> end of getNewObjects -----------\n";
72 }
int i
Definition: DBlmapReader.cc:9
void setValue(const uint32_t &id, const Item &value)
string fname
main script
tuple cout
Definition: gather_cfg.py:145
std::string popcon::EcalTPGFineGrainStripfromFile::id ( ) const
inlinevirtual

Member Data Documentation

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

Definition at line 54 of file EcalTPGFineGrainStripfromFile.h.

Referenced by id().