CMS 3D CMS Logo

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

#include <EcalTPGFineGrainTowerfromFile.h>

Inheritance diagram for popcon::EcalTPGFineGrainTowerfromFile:
popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< EcalTPGFineGrainTowerEE *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< EcalTPGFineGrainTowerEEself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalTPGFineGrainTowerEE value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 20 of file EcalTPGFineGrainTowerfromFile.h.

Constructor & Destructor Documentation

popcon::EcalTPGFineGrainTowerfromFile::~EcalTPGFineGrainTowerfromFile ( )

Definition at line 21 of file EcalTPGFineGrainTowerfromFile.cc.

21 {}
popcon::EcalTPGFineGrainTowerfromFile::EcalTPGFineGrainTowerfromFile ( edm::ParameterSet const &  )

Definition at line 14 of file EcalTPGFineGrainTowerfromFile.cc.

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

15  : m_name(ps.getUntrackedParameter<std::string>("name","EcalTPGFineGrainTowerfromFile")) {
16  fname = ps.getParameter<std::string>("FileName");
17 
18  std::cout << "EcalTPGFineGrainTowerfromFile constructor\n" << std::endl;
19 }

Member Function Documentation

void popcon::EcalTPGFineGrainTowerfromFile::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >.

Definition at line 23 of file EcalTPGFineGrainTowerfromFile.cc.

References gather_cfg::cout, fname, mps_fire::i, geometryCSVtoXML::line, popcon::PopConSourceHandler< EcalTPGFineGrainTowerEE >::m_to_transfer, EcalTPGFineGrainTowerEE::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::towerId().

23  {
24  std::cout << "------- Ecal -> getNewObjects\n";
25  edm::LogInfo("EcalTPGFineGrainTowerfromFile") << "Started GetNewObjects!!!";
26 
28  int fileIOV;
29  std::cout << "LinPed which input IOV do you want " << std::endl;
30  std::cin >> fileIOV;
31  std::ifstream fLin;
32  std::ostringstream oss;
33  oss << fileIOV;
34  // std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
35  fLin.open(fname.c_str());
36  if(!fLin.is_open()) {
37  std::cout << "ERROR : can't open file '" << fname << std::endl;
38  return;
39  }
40  std::cout << " file " << fname << " opened" << std::endl;
41  /* structure of the file:
42 TOWER_EB 365224/375015 : 9792 lines 2448 towers 3 lines : 0, 0, 96 (LUTGroupId, FgGroupId, spike_killing_threshold)
43 empty line 375016
44 TOWER_EE 375017/379768 : 4752 lines 1584 towers 2 lines : 0, 0x0 (LUTGroupId, tower_lut_fg)
45  */
47  for(int i = 0; i < 375016; i++) getline (fLin, line);
48  char tower[8];
49  unsigned int towerId, LUTFg;
50  for (int itower = 0; itower < 1584; itower++) {
51  getline (fLin, line);
52  sscanf(line.c_str(), "%s %u", tower, &towerId);
53  if(itower < 10 || (itower > 1574 && itower < 1584)) std::cout << " string " << tower << " Id " << towerId;
54  getline (fLin, line); // LUTGroupId
55  getline (fLin, line); // tower_lut_fg
56  if(itower < 10 || (itower > 1574 && itower < 1584)) std::cout << " line " << line << std::endl;
57  sscanf(line.c_str(), "%x", &LUTFg);
58  // EcalTPGFineGrainTowerEE::Item item;
59  // item.lut = LUTFg;
60  // fgrMap->setValue(towerId, item);
61 
62  fgrMap->setValue(towerId, LUTFg);
63  } // end loop over EE towers
64  fLin.close();
65 
66  m_to_transfer.push_back(std::make_pair((EcalTPGFineGrainTowerEE*)fgrMap, fileIOV));
67 
68  std::cout << "Ecal -> end of getNewObjects -----------\n";
69 }
void setValue(const uint32_t &id, const uint32_t &lut)
unsigned towerId(DetId const &)
std::string popcon::EcalTPGFineGrainTowerfromFile::id ( ) const
inlinevirtual

Member Data Documentation

std::string popcon::EcalTPGFineGrainTowerfromFile::fname
private

Definition at line 31 of file EcalTPGFineGrainTowerfromFile.h.

Referenced by EcalTPGFineGrainTowerfromFile(), and getNewObjects().

std::string popcon::EcalTPGFineGrainTowerfromFile::m_name
private

Definition at line 30 of file EcalTPGFineGrainTowerfromFile.h.