CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTT0Handler Class Reference

#include <DTT0Handler.h>

Inheritance diagram for DTT0Handler:
popcon::PopConSourceHandler< DTT0 >

Public Member Functions

 DTT0Handler (const edm::ParameterSet &ps)
 
void getNewObjects ()
 
std::string id () const
 
virtual ~DTT0Handler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< DTT0 >
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 dataTag
 
std::string fileName
 
unsigned int runNumber
 

Additional Inherited Members

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

Detailed Description

Description:

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

Definition at line 35 of file DTT0Handler.h.

Constructor & Destructor Documentation

DTT0Handler::DTT0Handler ( const edm::ParameterSet ps)

Constructor

Definition at line 34 of file DTT0Handler.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
unsigned int runNumber
Definition: DTT0Handler.h:57
std::string dataTag
Definition: DTT0Handler.h:55
std::string fileName
Definition: DTT0Handler.h:56
DTT0Handler::~DTT0Handler ( )
virtual

Destructor

Definition at line 43 of file DTT0Handler.cc.

43  {
44 }

Member Function Documentation

void DTT0Handler::getNewObjects ( )
virtual

Operations

Implements popcon::PopConSourceHandler< DTT0 >.

Definition at line 49 of file DTT0Handler.cc.

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

Implements popcon::PopConSourceHandler< DTT0 >.

Definition at line 139 of file DTT0Handler.cc.

References dataTag.

139  {
140  return dataTag;
141 }
std::string dataTag
Definition: DTT0Handler.h:55

Member Data Documentation

std::string DTT0Handler::dataTag
private

Definition at line 55 of file DTT0Handler.h.

Referenced by getNewObjects(), and id().

std::string DTT0Handler::fileName
private

Definition at line 56 of file DTT0Handler.h.

Referenced by getNewObjects(), and readConfig.fileINI::read().

unsigned int DTT0Handler::runNumber
private

Definition at line 57 of file DTT0Handler.h.

Referenced by getNewObjects().