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 34 of file DTReadOutMappingHandler.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 33 of file DTReadOutMappingHandler.cc.

DTReadOutMappingHandler::~DTReadOutMappingHandler ( )
override

Destructor

Definition at line 41 of file DTReadOutMappingHandler.cc.

41 {}

Member Function Documentation

void DTReadOutMappingHandler::getNewObjects ( )
overridevirtual

Operations

Implements popcon::PopConSourceHandler< DTReadOutMapping >.

Definition at line 46 of file DTReadOutMappingHandler.cc.

References gather_cfg::cout, dataTag, fileName, compare_using_db::ifile, DTReadOutMapping::insertReadOutGeometryLink(), dqmdumpme::last, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< DTReadOutMapping >::m_to_transfer, runNumber, fileinputsource_cfi::sec, mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, and popcon::PopConSourceHandler< DTReadOutMapping >::tagInfo().

46  {
47  //to access the information on the tag inside the offline database:
48  cond::TagInfo const& ti = tagInfo();
49  unsigned int last = ti.lastInterval.first;
50 
51  //to access the information on last successful log entry for this tag:
52  // cond::LogDBEntry const & lde = logDBEntry();
53 
54  //to access the lastest payload (Ref is a smart pointer)
55  // Ref payload = lastPayload();
56 
57  /*
58  int irun = event.id().run();
59  int ievt = event.id().event();
60  std::cout << "================ "
61  << irun << " " << ievt << std::endl;
62 
63  std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
64  std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
65  std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
66  std::cout << "list of all tags: " << std::endl;
67  while ( iter != iend ) {
68  std::cout << "Tag: " << iter->first
69  << " , last object valid since " << iter->second.last_since
70  << " to " << iter->second.last_till
71  << std::endl;
72  iter++;
73  }
74 
75  std::cout << "look for tag " << dataTag << std::endl;
76  std::map<std::string, popcon::PayloadIOV>::iterator itag =
77  mp.find( dataTag );
78 */
79 
80  std::string robMap(dataTag);
81  std::string rosMap(dataTag);
82  robMap += "_ROB";
83  rosMap += "_ROS";
84  DTReadOutMapping* ro_map = new DTReadOutMapping(robMap, rosMap);
85 
86  int status = 0;
87  std::ifstream ifile(fileName.c_str());
88  int ddu;
89  int ros;
90  int rob;
91  int tdc;
92  int cha;
93  int whe;
94  int sta;
95  int sec;
96  int qua;
97  int lay;
98  int cel;
99  while (ifile >> ddu >> ros >> rob >> tdc >> cha >> whe >> sta >> sec >> qua >> lay >> cel) {
100  status = ro_map->insertReadOutGeometryLink(ddu, ros, rob, tdc, cha, whe, sta, sec, qua, lay, cel);
101  std::cout << ddu << " " << ros << " " << rob << " " << tdc << " " << cha << " " << whe << " " << sta << " " << sec
102  << " " << qua << " " << lay << " " << cel << " -> ";
103  std::cout << "insert status: " << status << std::endl;
104  }
105 
106  /*
107  unsigned int runf = irun;
108  unsigned int runl = 0xffffffff;
109  popcon::IOVPair iop = { runf, runl };
110  std::cout << "APPEND NEW OBJECT: "
111  << runf << " " << runl << " " << ro_map << std::endl;
112  m_to_transfer->push_back( std::make_pair( ro_map, iop ) );
113 */
114 
115  //for each payload provide IOV information (say in this case we use since)
116  cond::Time_t snc = runNumber;
117  if (runNumber > last)
118  m_to_transfer.push_back(std::make_pair(ro_map, snc));
119  else {
120  std::cout << "More recent data already present - skipped" << std::endl;
121  delete ro_map;
122  }
123 
124  return;
125 }
cond::ValidityInterval lastInterval
Definition: Types.h:74
unsigned long long Time_t
Definition: Time.h:14
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 127 of file DTReadOutMappingHandler.cc.

References dataTag.

127 { return dataTag; }

Member Data Documentation

std::string DTReadOutMappingHandler::dataTag
private

Definition at line 51 of file DTReadOutMappingHandler.h.

Referenced by getNewObjects(), and id().

std::string DTReadOutMappingHandler::fileName
private

Definition at line 52 of file DTReadOutMappingHandler.h.

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

unsigned int DTReadOutMappingHandler::runNumber
private