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 () override
 
std::string id () const override
 
 ~EcalTPGPhysicsConstfromFile () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGPhysicsConst >
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 ()
 
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::map< Time_t, std::shared_ptr< EcalTPGPhysicsConst > > Container
 
typedef std::unique_ptr< EcalTPGPhysicsConstRef
 
typedef PopConSourceHandler< EcalTPGPhysicsConstself
 
typedef cond::Time_t Time_t
 
typedef EcalTPGPhysicsConst value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGPhysicsConst >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGPhysicsConst >
Container m_iovs
 
std::vector< std::pair< EcalTPGPhysicsConst *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 43 of file EcalTPGPhysicsConstfromFile.h.

Constructor & Destructor Documentation

◆ EcalTPGPhysicsConstfromFile()

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

Definition at line 11 of file EcalTPGPhysicsConstfromFile.cc.

References gather_cfg::cout.

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

◆ ~EcalTPGPhysicsConstfromFile()

popcon::EcalTPGPhysicsConstfromFile::~EcalTPGPhysicsConstfromFile ( )
override

Definition at line 16 of file EcalTPGPhysicsConstfromFile.cc.

16  {
17  // do nothing
18 }

Member Function Documentation

◆ getNewObjects()

void popcon::EcalTPGPhysicsConstfromFile::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGPhysicsConst >.

Definition at line 20 of file EcalTPGPhysicsConstfromFile.cc.

References gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, alignmentValidation::fname, mps_fire::i, B2GTnPMonitor_cfi::item, mps_splice::line, jetsAK4_Puppi_cff::payload, DetId::rawId(), EcalTPGPhysicsConst::setValue(), and AlCaHLTBitMon_QueryRunRegistry::string.

20  {
21  std::cout << "------- EcalTPGPhysicsConstfromFile -> getNewObjects\n";
22  edm::LogInfo("EcalTPGPhysicsConstfromFile") << "Started GetNewObjects!!!";
23 
25  // here popcon tells us which is the last since of the last object in the offline DB
26 
27  int fileIOV;
28  std::cout << "LinPed which input IOV do you want " << std::endl;
29  std::cin >> fileIOV;
30  std::ifstream fLin;
31  std::ostringstream oss;
32  oss << fileIOV;
33  std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
34  fLin.open(fname.c_str());
35  if (!fLin.is_open()) {
36  std::cout << "ERROR : can't open file '" << fname << std::endl;
37  return;
38  }
39  std::cout << " file " << fname << " opened" << std::endl;
41  for (int i = 0; i < 76; i++)
42  getline(fLin, line);
43 
45  // Ecal barrel detector
46  getline(fLin, line); // PHYSICS_EB 838860800
47  // std::cout << " EB DetId " << line << std::endl;
49  float ETSat, TTThreshlow, TTThreshhigh, FG_lowThreshold, FG_highThreshold, FG_lowRatio, FG_highRatio;
50  getline(fLin, line);
51  sscanf(line.c_str(), "%f %f %f", &ETSat, &TTThreshlow, &TTThreshhigh);
52  item.EtSat = ETSat;
53  item.ttf_threshold_Low = TTThreshlow;
54  item.ttf_threshold_High = TTThreshhigh;
55  getline(fLin, line);
56  sscanf(line.c_str(), "%f %f %f %f", &FG_lowThreshold, &FG_highThreshold, &FG_lowRatio, &FG_highRatio);
57  item.FG_lowThreshold = FG_lowThreshold;
58  item.FG_highThreshold = FG_highThreshold;
59  item.FG_lowRatio = FG_lowRatio;
60  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(physC, fileIOV));
85 
86  std::cout << "EcalTPGPhysicsConstfromFile - > end of getNewObjects -----------\n";
87 }
void setValue(const uint32_t &id, const Item &value)
std::vector< std::pair< EcalTPGPhysicsConst *, Time_t > > m_to_transfer
Log< level::Info, false > LogInfo
Definition: DetId.h:17
string fname
main script
std::unique_ptr< EcalTPGPhysicsConst > Ref

◆ id()

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

Member Data Documentation

◆ m_name

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

Definition at line 52 of file EcalTPGPhysicsConstfromFile.h.

Referenced by id().