CMS 3D CMS Logo

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

#include <DTStatusFlagHandler.h>

Inheritance diagram for DTStatusFlagHandler:
popcon::PopConSourceHandler< DTStatusFlag >

Public Member Functions

 DTStatusFlagHandler (const edm::ParameterSet &ps)
 
void getNewObjects () override
 
std::string id () const override
 
 ~DTStatusFlagHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< DTStatusFlag >
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 ()
 
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< DTStatusFlag >
typedef std::map< Time_t, std::shared_ptr< DTStatusFlag > > Container
 
typedef std::unique_ptr< DTStatusFlagRef
 
typedef PopConSourceHandler< DTStatusFlagself
 
typedef cond::Time_t Time_t
 
typedef DTStatusFlag value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< DTStatusFlag >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< DTStatusFlag >
Container m_iovs
 
std::vector< std::pair< DTStatusFlag *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Description:

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

Definition at line 34 of file DTStatusFlagHandler.h.

Constructor & Destructor Documentation

◆ DTStatusFlagHandler()

DTStatusFlagHandler::DTStatusFlagHandler ( const edm::ParameterSet ps)

Constructor

Definition at line 33 of file DTStatusFlagHandler.cc.

34  : dataTag(ps.getParameter<std::string>("tag")),
35  fileName(ps.getParameter<std::string>("file")),
36  runNumber(ps.getParameter<unsigned int>("run")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~DTStatusFlagHandler()

DTStatusFlagHandler::~DTStatusFlagHandler ( )
override

Destructor

Definition at line 41 of file DTStatusFlagHandler.cc.

41 {}

Member Function Documentation

◆ getNewObjects()

void DTStatusFlagHandler::getNewObjects ( )
overridevirtual

Operations

Implements popcon::PopConSourceHandler< DTStatusFlag >.

Definition at line 46 of file DTStatusFlagHandler.cc.

References gather_cfg::cout, dataTag, fileName, compare_using_db::ifile, dqmdumpme::last, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< DTStatusFlag >::m_to_transfer, runNumber, fileinputsource_cfi::sec, DTStatusFlag::set(), cond::Iov_t::since, mps_update::status, and popcon::PopConSourceHandler< DTStatusFlag >::tagInfo().

46  {
47  //to access the information on the tag inside the offline database:
48  cond::TagInfo_t const& ti = tagInfo();
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  if (runNumber <= last) {
80  std::cout << "More recent data already present - skipped" << std::endl;
81  return;
82  }
83 
84  DTStatusFlag* stFlag = new DTStatusFlag(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  int lay;
93  int cel;
94  int noiseFlag;
95  int feMask;
96  int tdcMask;
97  int trigMask;
98  int deadFlag;
99  int nohvFlag;
100  while (ifile >> whe >> sta >> sec >> qua >> lay >> cel >> noiseFlag >> feMask >> tdcMask >> trigMask >> deadFlag >>
101  nohvFlag) {
102  status = stFlag->set(whe,
103  sta,
104  sec,
105  qua,
106  lay,
107  cel,
108  noiseFlag != 0,
109  feMask != 0,
110  tdcMask != 0,
111  trigMask != 0,
112  deadFlag != 0,
113  nohvFlag != 0);
114  std::cout << whe << " " << sta << " " << sec << " " << qua << " " << lay << " " << cel << " " << noiseFlag << " "
115  << feMask << " " << tdcMask << " " << trigMask << " " << deadFlag << " " << nohvFlag << " -> ";
116  std::cout << "insert status: " << status << std::endl;
117  }
118 
119  /*
120  unsigned int runf = irun;
121  unsigned int runl = 0xffffffff;
122  popcon::IOVPair iop = { runf, runl };
123  std::cout << "APPEND NEW OBJECT: "
124  << runf << " " << runl << " " << stFlag << std::endl;
125  m_to_transfer->push_back( std::make_pair( stFlag, iop ) );
126 */
127 
128  //for each payload provide IOV information (say in this case we use since)
129  m_to_transfer.emplace_back(stFlag, runNumber);
130 }
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool noiseFlag, bool feMask, bool tdcMask, bool trigMask, bool deadFlag, bool nohvFlag)
Iov_t lastInterval
Definition: Types.h:73
Time_t since
Definition: Types.h:53
cond::TagInfo_t const & tagInfo() const
unsigned long long Time_t
Definition: Time.h:14
std::vector< std::pair< DTStatusFlag *, Time_t > > m_to_transfer

◆ id()

std::string DTStatusFlagHandler::id ( ) const
overridevirtual

Implements popcon::PopConSourceHandler< DTStatusFlag >.

Definition at line 132 of file DTStatusFlagHandler.cc.

References dataTag.

132 { return dataTag; }

Member Data Documentation

◆ dataTag

std::string DTStatusFlagHandler::dataTag
private

Definition at line 51 of file DTStatusFlagHandler.h.

Referenced by getNewObjects(), and id().

◆ fileName

std::string DTStatusFlagHandler::fileName
private

Definition at line 52 of file DTStatusFlagHandler.h.

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

◆ runNumber

unsigned int DTStatusFlagHandler::runNumber
private