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
RunSummaryHandler Class Reference

#include <RunSummaryHandler.h>

Inheritance diagram for RunSummaryHandler:
popcon::PopConSourceHandler< RunSummary >

Public Member Functions

void getNewObjects ()
 
std::string id () const
 
 RunSummaryHandler (const edm::ParameterSet &pset)
 
 ~RunSummaryHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< RunSummary >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (cond::DbSession dbSession, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (cond::DbSession session, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

std::string m_authpath
 
std::string m_connectionString
 
std::string m_host
 
std::string m_name
 
std::string m_pass
 
int m_port
 
std::string m_sid
 
unsigned long long m_since
 
std::string m_user
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< RunSummary >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< RunSummary *, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< RunSummary
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef RunSummary value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< RunSummary >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< RunSummary >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 10 of file RunSummaryHandler.h.

Constructor & Destructor Documentation

RunSummaryHandler::~RunSummaryHandler ( )

Definition at line 21 of file RunSummaryHandler.cc.

22 {
23 
24 }
RunSummaryHandler::RunSummaryHandler ( const edm::ParameterSet pset)

Definition at line 9 of file RunSummaryHandler.cc.

References m_connectionString.

9  :
10  m_name(pset.getUntrackedParameter<std::string>("name","RunSummaryHandler")),
11  // m_connect(pset.getUntrackedParameter<std::string>("OnlineConn","")),
12 
13  m_user(pset.getUntrackedParameter<std::string>("OnlineDBUser","CMS_RUNINFO")),
14  m_pass(pset.getUntrackedParameter<std::string>("OnlineDBPass","********"))
15 
16 {
17  m_connectionString= "oracle://cms_omds_lb/CMS_RUNINFO";
18 
19 }
T getUntrackedParameter(std::string const &, T const &) const
std::string m_connectionString

Member Function Documentation

void RunSummaryHandler::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< RunSummary >.

Definition at line 26 of file RunSummaryHandler.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, RunSummary::Fake_RunSummary(), cond::TagInfo::lastInterval, cond::TagInfo::lastPayloadToken, m_connectionString, m_name, m_pass, popcon::PopConSourceHandler< RunSummary >::m_to_transfer, m_user, popcon::PopConSourceHandler< RunSummary >::m_userTextLog, cond::TagInfo::name, alignCSCRings::r, RunSummaryRead::readData(), cond::TagInfo::size, findQualityFiles::size, and popcon::PopConSourceHandler< RunSummary >::tagInfo().

26  {
27  edm::LogInfo ("RunSummaryHandler") << "------- " << m_name
28  << " - > getNewObjects\n" <<
29  //check whats already inside of database
30  "got offlineInfo"<<
31  tagInfo().name << ", size " << tagInfo().size
32  << ", last object valid since "
33  << tagInfo().lastInterval.first << " token "
34  << tagInfo().lastPayloadToken << std::endl;
35 
36  /*
37  if (tagInfo().size>0) {
38  Ref payload = lastPayload();
39  //edm::LogInfo ("RunSummaryHandler")<<"size of last payload "<<
40  // payload->..........size()<<std::endl;
41  }
42  */
43  unsigned int snc;
44 
45 
46  std::cerr << "Source implementation test ::getNewObjects : enter runnumber as a first since ! \n";
47  std::cin >> snc;
48 
49 
50  std::cout<<"runnumber/first since = "<< snc <<std::endl;
51 
52 
53 
54 
55  RunSummary * r = new RunSummary();
56 
57 
58  //fill with null runsummary if empty run are found beetween the two last validones
59 
60  size_t n_empty_run=0;
61  if (tagInfo().size>0 && (tagInfo().lastInterval.first+1) < snc){
62  n_empty_run = snc- tagInfo().lastInterval.first - 1;
63  edm::LogInfo ("RunSummaryHandler") << "------- " << "entering fake run from " << tagInfo().lastInterval.first + 1 << "to " << snc -1 << "- > getNewObjects" << std::endl;
64  n_empty_run = snc- tagInfo().lastInterval.first - 1;
65  // for (size_t i=1; i<= n_empty_run ; i++){
66 
67  // r->summary.push_back(empty->fake_Run());
68  // }
69  }
70 
71 
72 
73 
74  // transfer fake run for 1 to since for the first time
75  if (tagInfo().size==0){
76  m_to_transfer.push_back(std::make_pair((RunSummary*) (r->Fake_RunSummary()),1));
77  }
78 
79  // transfer also empty run if tag already existing
80  if (n_empty_run!=0) {
81  m_to_transfer.push_back(std::make_pair((RunSummary*) (r->Fake_RunSummary()),tagInfo().lastInterval.first + 1));
82  }
83 
84 
85  // reading from omds
87 
88 
89  *r = rn.readData("RUNSESSION_PARAMETER", "STRING_VALUE",(int)snc );
90  m_to_transfer.push_back(std::make_pair((RunSummary*)r,snc));
91  std::ostringstream ss;
92  ss << "since =" << snc;
93 
94 
95 
96  m_userTextLog = ss.str()+";";
97 
98 
99  edm::LogInfo ("RunSummaryHandler") << "------- " << m_name << " - > getNewObjects" << std::endl;
100 
101 
102 }
static RunSummary * Fake_RunSummary()
Definition: RunSummary.cc:4
std::string lastPayloadToken
Definition: TagInfo.h:12
std::string name
Definition: TagInfo.h:9
std::string m_connectionString
size_t size
Definition: TagInfo.h:13
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
tuple cout
Definition: gather_cfg.py:121
tuple size
Write out results.
std::string RunSummaryHandler::id ( void  ) const
inlinevirtual

Implements popcon::PopConSourceHandler< RunSummary >.

Definition at line 13 of file RunSummaryHandler.h.

References m_name.

13 { return m_name;}

Member Data Documentation

std::string RunSummaryHandler::m_authpath
private

Definition at line 24 of file RunSummaryHandler.h.

std::string RunSummaryHandler::m_connectionString
private

Definition at line 22 of file RunSummaryHandler.h.

Referenced by getNewObjects(), and RunSummaryHandler().

std::string RunSummaryHandler::m_host
private

Definition at line 25 of file RunSummaryHandler.h.

std::string RunSummaryHandler::m_name
private

Definition at line 17 of file RunSummaryHandler.h.

Referenced by getNewObjects(), and id().

std::string RunSummaryHandler::m_pass
private

Definition at line 28 of file RunSummaryHandler.h.

Referenced by getNewObjects().

int RunSummaryHandler::m_port
private

Definition at line 29 of file RunSummaryHandler.h.

std::string RunSummaryHandler::m_sid
private

Definition at line 26 of file RunSummaryHandler.h.

unsigned long long RunSummaryHandler::m_since
private

Definition at line 18 of file RunSummaryHandler.h.

std::string RunSummaryHandler::m_user
private

Definition at line 27 of file RunSummaryHandler.h.

Referenced by getNewObjects().