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

#include <DTTtrigHandler.h>

Inheritance diagram for DTTtrigHandler:
popcon::PopConSourceHandler< DTTtrig >

Public Member Functions

 DTTtrigHandler (const edm::ParameterSet &ps)
 
void getNewObjects ()
 
std::string id () const
 
virtual ~DTTtrigHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< DTTtrig >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry 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 dataTag
 
std::string fileName
 
unsigned int runNumber
 

Additional Inherited Members

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

Detailed Description

Description:

Date:
2007/12/07 15:12:32
Revision:
1.2
Author
Paolo Ronchese INFN Padova

Definition at line 35 of file DTTtrigHandler.h.

Constructor & Destructor Documentation

DTTtrigHandler::DTTtrigHandler ( const edm::ParameterSet ps)

Constructor

Definition at line 34 of file DTTtrigHandler.cc.

34  :
35  dataTag( ps.getParameter<std::string> ( "tag" ) ),
36  fileName( ps.getParameter<std::string> ( "file" ) ),
37  runNumber( ps.getParameter<unsigned int> ( "run" ) ) {
38 }
T getParameter(std::string const &) const
std::string dataTag
std::string fileName
unsigned int runNumber
DTTtrigHandler::~DTTtrigHandler ( )
virtual

Destructor

Definition at line 43 of file DTTtrigHandler.cc.

43  {
44 }

Member Function Documentation

void DTTtrigHandler::getNewObjects ( )
virtual

Operations

Implements popcon::PopConSourceHandler< DTTtrig >.

Definition at line 49 of file DTTtrigHandler.cc.

References DTTimeUnits::counts, gather_cfg::cout, dataTag, fileName, compare_using_db::ifile, prof2calltree::last, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< DTTtrig >::m_to_transfer, plotscripts::rms(), runNumber, DTTtrig::set(), ntuplemaker::status, and popcon::PopConSourceHandler< DTTtrig >::tagInfo().

49  {
50 
51  //to access the information on the tag inside the offline database:
52  cond::TagInfo const & ti = tagInfo();
53  unsigned int last = ti.lastInterval.first;
54 
55  //to access the information on last successful log entry for this tag:
56 // cond::LogDBEntry const & lde = logDBEntry();
57 
58  //to access the lastest payload (Ref is a smart pointer)
59 // Ref payload = lastPayload();
60 
61 /*
62  int irun = event.id().run();
63  int ievt = event.id().event();
64  std::cout << "================ "
65  << irun << " " << ievt << std::endl;
66 
67  std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
68  std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
69  std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
70  std::cout << "list of all tags: " << std::endl;
71  while ( iter != iend ) {
72  std::cout << "Tag: " << iter->first
73  << " , last object valid since " << iter->second.last_since
74  << " to " << iter->second.last_till
75  << std::endl;
76  iter++;
77  }
78 
79  std::cout << "look for tag " << dataTag << std::endl;
80  std::map<std::string, popcon::PayloadIOV>::iterator itag =
81  mp.find( dataTag );
82 */
83 
84  DTTtrig* tTrig = new DTTtrig( dataTag );
85 
86  int status = 0;
87  std::ifstream ifile( fileName.c_str() );
88  int whe;
89  int sta;
90  int sec;
91  int qua;
92  float tri;
93  float rms;
94  float fac;
95  while ( ifile >> whe
96  >> sta
97  >> sec
98  >> qua
99  >> tri
100  >> rms
101  >> fac ) {
102  status = tTrig->set( whe, sta, sec, qua, tri, rms, fac,
104  std::cout << whe << " "
105  << sta << " "
106  << sec << " "
107  << qua << " "
108  << tri << " "
109  << rms << " "
110  << fac << " -> ";
111  std::cout << "insert status: " << status << std::endl;
112  }
113 
114 /*
115  unsigned int runf = irun;
116  unsigned int runl = 0xffffffff;
117  popcon::IOVPair iop = { runf, runl };
118  std::cout << "APPEND NEW OBJECT: "
119  << runf << " " << runl << " " << tTrig << std::endl;
120  m_to_transfer->push_back( std::make_pair( tTrig, iop ) );
121 */
122 
123  //for each payload provide IOV information (say in this case we use since)
124  cond::Time_t snc = runNumber;
125  if ( runNumber > last )
126  m_to_transfer.push_back( std::make_pair( tTrig, snc ) );
127  else
128  std::cout << "More recent data already present - skipped" << std::endl;
129 
130  return;
131 
132 }
int set(int wheelId, int stationId, int sectorId, int slId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
Definition: DTTtrig.cc:248
std::string dataTag
cond::ValidityInterval lastInterval
Definition: Types.h:70
unsigned long long Time_t
Definition: Time.h:16
std::string fileName
tuple cout
Definition: gather_cfg.py:121
unsigned int runNumber
tuple status
Definition: ntuplemaker.py:245
cond::TagInfo_t const & tagInfo() const
std::string DTTtrigHandler::id ( void  ) const
virtual

Implements popcon::PopConSourceHandler< DTTtrig >.

Definition at line 135 of file DTTtrigHandler.cc.

References dataTag.

135  {
136  return dataTag;
137 }
std::string dataTag

Member Data Documentation

std::string DTTtrigHandler::dataTag
private

Definition at line 55 of file DTTtrigHandler.h.

Referenced by getNewObjects(), and id().

std::string DTTtrigHandler::fileName
private

Definition at line 56 of file DTTtrigHandler.h.

Referenced by getNewObjects().

unsigned int DTTtrigHandler::runNumber
private

Definition at line 57 of file DTTtrigHandler.h.

Referenced by getNewObjects().