CMS 3D CMS Logo

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

#include <DTReadOutMappingHandler.h>

Inheritance diagram for DTReadOutMappingHandler:
popcon::PopConSourceHandler< DTReadOutMapping >

Public Member Functions

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

Detailed Description

Description:

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

Definition at line 35 of file DTReadOutMappingHandler.h.

Constructor & Destructor Documentation

DTReadOutMappingHandler::DTReadOutMappingHandler ( const edm::ParameterSet ps)

Constructor

Definition at line 34 of file DTReadOutMappingHandler.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
DTReadOutMappingHandler::~DTReadOutMappingHandler ( )
override

Destructor

Definition at line 43 of file DTReadOutMappingHandler.cc.

43  {
44 }

Member Function Documentation

void DTReadOutMappingHandler::getNewObjects ( )
overridevirtual

Operations

Implements popcon::PopConSourceHandler< DTReadOutMapping >.

Definition at line 49 of file DTReadOutMappingHandler.cc.

References gather_cfg::cout, dataTag, fileName, compare_using_db::ifile, DTReadOutMapping::insertReadOutGeometryLink(), plotBeamSpotDB::last, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< DTReadOutMapping >::m_to_transfer, runNumber, mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, and popcon::PopConSourceHandler< DTReadOutMapping >::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  std::string robMap( dataTag );
85  std::string rosMap( dataTag );
86  robMap += "_ROB";
87  rosMap += "_ROS";
88  DTReadOutMapping* ro_map = new DTReadOutMapping( robMap, rosMap );
89 
90  int status = 0;
91  std::ifstream ifile( fileName.c_str() );
92  int ddu;
93  int ros;
94  int rob;
95  int tdc;
96  int cha;
97  int whe;
98  int sta;
99  int sec;
100  int qua;
101  int lay;
102  int cel;
103  while ( ifile >> ddu
104  >> ros
105  >> rob
106  >> tdc
107  >> cha
108  >> whe
109  >> sta
110  >> sec
111  >> qua
112  >> lay
113  >> cel ) {
114  status = ro_map->insertReadOutGeometryLink( ddu, ros, rob, tdc, cha,
115  whe, sta, sec,
116  qua, lay, cel );
117  std::cout << ddu << " "
118  << ros << " "
119  << rob << " "
120  << tdc << " "
121  << cha << " "
122  << whe << " "
123  << sta << " "
124  << sec << " "
125  << qua << " "
126  << lay << " "
127  << cel << " -> ";
128  std::cout << "insert status: " << status << std::endl;
129  }
130 
131 /*
132  unsigned int runf = irun;
133  unsigned int runl = 0xffffffff;
134  popcon::IOVPair iop = { runf, runl };
135  std::cout << "APPEND NEW OBJECT: "
136  << runf << " " << runl << " " << ro_map << std::endl;
137  m_to_transfer->push_back( std::make_pair( ro_map, iop ) );
138 */
139 
140  //for each payload provide IOV information (say in this case we use since)
141  cond::Time_t snc = runNumber;
142  if ( runNumber > last )
143  m_to_transfer.push_back( std::make_pair( ro_map, snc ) );
144  else {
145  std::cout << "More recent data already present - skipped" << std::endl;
146  delete ro_map;
147  }
148 
149  return;
150 
151 }
cond::ValidityInterval lastInterval
Definition: Types.h:75
unsigned long long Time_t
Definition: Time.h:16
int insertReadOutGeometryLink(int dduId, int rosId, int robId, int tdcId, int channelId, int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId)
insert connection
std::string DTReadOutMappingHandler::id ( ) const
overridevirtual

Implements popcon::PopConSourceHandler< DTReadOutMapping >.

Definition at line 154 of file DTReadOutMappingHandler.cc.

References dataTag.

154  {
155  return dataTag;
156 }

Member Data Documentation

std::string DTReadOutMappingHandler::dataTag
private

Definition at line 55 of file DTReadOutMappingHandler.h.

Referenced by getNewObjects(), and id().

std::string DTReadOutMappingHandler::fileName
private

Definition at line 56 of file DTReadOutMappingHandler.h.

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

unsigned int DTReadOutMappingHandler::runNumber
private