CMS 3D CMS Logo

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

#include <EcalTPGPhysicsConstfromFile.h>

Inheritance diagram for popcon::EcalTPGPhysicsConstfromFile:
popcon::PopConSourceHandler< EcalTPGPhysicsConst >

Public Member Functions

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

Detailed Description

Definition at line 46 of file EcalTPGPhysicsConstfromFile.h.

Constructor & Destructor Documentation

popcon::EcalTPGPhysicsConstfromFile::EcalTPGPhysicsConstfromFile ( edm::ParameterSet const &  )

Definition at line 11 of file EcalTPGPhysicsConstfromFile.cc.

References gather_cfg::cout.

12  : m_name(ps.getUntrackedParameter<std::string>("name","EcalTPGPhysicsConstfromFile")) {
13 
14  std::cout << "EcalTPGPhysicsConstfromFile constructor" << std::endl;
15 }
popcon::EcalTPGPhysicsConstfromFile::~EcalTPGPhysicsConstfromFile ( )

Definition at line 17 of file EcalTPGPhysicsConstfromFile.cc.

17  {
18  // do nothing
19 }

Member Function Documentation

void popcon::EcalTPGPhysicsConstfromFile::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< EcalTPGPhysicsConst >.

Definition at line 21 of file EcalTPGPhysicsConstfromFile.cc.

References gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, EcalTPGPhysicsConst::Item::EtSat, EcalTPGPhysicsConst::Item::FG_highRatio, EcalTPGPhysicsConst::Item::FG_highThreshold, EcalTPGPhysicsConst::Item::FG_lowRatio, EcalTPGPhysicsConst::Item::FG_lowThreshold, alignmentValidation::fname, mps_fire::i, popcon::PopConSourceHandler< EcalTPGPhysicsConst >::lastPayload(), geometryCSVtoXML::line, popcon::PopConSourceHandler< EcalTPGPhysicsConst >::m_to_transfer, jetCorrFactors_cfi::payload, DetId::rawId(), EcalTPGPhysicsConst::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, EcalTPGPhysicsConst::Item::ttf_threshold_High, and EcalTPGPhysicsConst::Item::ttf_threshold_Low.

21  {
22  std::cout << "------- EcalTPGPhysicsConstfromFile -> getNewObjects\n";
23  edm::LogInfo("EcalTPGPhysicsConstfromFile") << "Started GetNewObjects!!!";
24 
26  // here popcon tells us which is the last since of the last object in the offline DB
27 
29  int fileIOV;
30  std::cout << "LinPed which input IOV do you want " << std::endl;
31  std::cin >> fileIOV;
32  std::ifstream fLin;
33  std::ostringstream oss;
34  oss << fileIOV;
35  std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
36  fLin.open(fname.c_str());
37  if(!fLin.is_open()) {
38  std::cout << "ERROR : can't open file '" << fname << std::endl;
39  return;
40  }
41  std::cout << " file " << fname << " opened" << std::endl;
43  for(int i = 0; i < 76; i++) getline (fLin, line);
44 
46  // Ecal barrel detector
47  getline (fLin, line); // PHYSICS_EB 838860800
48  // std::cout << " EB DetId " << line << std::endl;
50  float ETSat, TTThreshlow, TTThreshhigh, FG_lowThreshold, FG_highThreshold, FG_lowRatio, FG_highRatio;
51  getline (fLin, line);
52  sscanf(line.c_str(), "%f %f %f", &ETSat, &TTThreshlow, &TTThreshhigh);
53  item.EtSat = ETSat;
54  item.ttf_threshold_Low = TTThreshlow;
55  item.ttf_threshold_High = TTThreshhigh;
56  getline (fLin, line);
57  sscanf(line.c_str(), "%f %f %f %f", &FG_lowThreshold, &FG_highThreshold, &FG_lowRatio, &FG_highRatio);
58  item.FG_lowThreshold = FG_lowThreshold;
59  item.FG_highThreshold = FG_highThreshold;
60  item.FG_lowRatio = FG_lowRatio;
61  item.FG_highRatio = FG_highRatio;
62  physC->setValue(eb.rawId(), item);
63 
64  // Ecal endcap detector
65  getline (fLin, line); // empty line
66  getline (fLin, line); // PHYSICS_EE 872415232
67  std::cout << " EE DetId " << line << std::endl;
69  getline (fLin, line);
70  // std::cout << " EE TTT " << line << std::endl;
71  sscanf(line.c_str(), "%f %f %f", &ETSat, &TTThreshlow, &TTThreshhigh);
72  item.EtSat = ETSat;
73  item.ttf_threshold_Low = TTThreshlow;
74  item.ttf_threshold_High = TTThreshhigh;
75  getline (fLin, line);
76  // std::cout << " EE FG " << line << std::endl;
77  sscanf(line.c_str(), "%f %f %f %f", &FG_lowThreshold, &FG_highThreshold, &FG_lowRatio, &FG_highRatio);
78  item.FG_lowThreshold = FG_lowThreshold;
79  item.FG_highThreshold = FG_highThreshold;
80  item.FG_lowRatio = FG_lowRatio;
81  item.FG_highRatio = FG_highRatio;
82  physC->setValue(ee.rawId(), item);
83 
84  m_to_transfer.push_back(std::make_pair((EcalTPGPhysicsConst*)physC, fileIOV));
85 
86  std::cout << "EcalTPGPhysicsConstfromFile - > end of getNewObjects -----------\n";
87 
88 }
void setValue(const uint32_t &id, const Item &value)
payload
payload postfix for testing
Definition: DetId.h:18
string fname
main script
std::string popcon::EcalTPGPhysicsConstfromFile::id ( ) const
inlinevirtual

Member Data Documentation

std::string popcon::EcalTPGPhysicsConstfromFile::m_name
private

Definition at line 56 of file EcalTPGPhysicsConstfromFile.h.