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 Member Functions | Private Attributes
stor::EventConsumerRegistrationInfo Class Reference

#include <EventConsumerRegistrationInfo.h>

Inheritance diagram for stor::EventConsumerRegistrationInfo:
stor::RegistrationInfoBase

Public Member Functions

virtual void do_appendToPSet (edm::ParameterSet &) const
 
virtual void do_eventType (std::ostream &) const
 
virtual void do_registerMe (EventDistributor *)
 
uint32 eventCode () const
 
 EventConsumerRegistrationInfo (const edm::ParameterSet &pset, const EventServingParams &eventServingParams, const std::string &remoteHost=toolbox::net::getHostName())
 
 EventConsumerRegistrationInfo (const edm::ParameterSet &pset, const std::string &remoteHost=toolbox::net::getHostName())
 
uint32 eventRequestCode () const
 
const StringseventSelection () const
 
std::string eventURL () const
 
const int & headerRetryInterval () const
 
bool operator!= (const EventConsumerRegistrationInfo &) const
 
bool operator< (const EventConsumerRegistrationInfo &) const
 
bool operator== (const EventConsumerRegistrationInfo &) const
 
const std::string & outputModuleLabel () const
 
const int & prescale () const
 
std::string registerURL () const
 
const std::string & triggerSelection () const
 
const bool & uniqueEvents () const
 
std::ostream & write (std::ostream &os) const
 
 ~EventConsumerRegistrationInfo ()
 
- Public Member Functions inherited from stor::RegistrationInfoBase
const int & connectTrySleepTime () const
 
void consumerContact ()
 
const ConsumerIDconsumerId () const
 
const std::string & consumerName () const
 
void eventType (std::ostream &) const
 
edm::ParameterSet getPSet () const
 
bool isStale (const utils::TimePoint_t &) const
 
bool isValid () const
 
double lastContactSecondsAgo (const utils::TimePoint_t &) const
 
const int & maxConnectTries () const
 
const utils::Duration_tminEventRequestInterval () const
 
virtual bool operator!= (const RegistrationInfoBase &) const
 
virtual bool operator< (const RegistrationInfoBase &) const
 
virtual bool operator== (const RegistrationInfoBase &) const
 
const QueueIDqueueId () const
 
void queueInfo (std::ostream &) const
 
const enquing_policy::PolicyTagqueuePolicy () const
 
const int & queueSize () const
 
void registerMe (EventDistributor *dist)
 
 RegistrationInfoBase (const std::string &consumerName, const std::string &remoteHost, const int &queueSize, const enquing_policy::PolicyTag &queuePolicy, const utils::Duration_t &secondsToStale)
 
 RegistrationInfoBase (const edm::ParameterSet &pset, const std::string &remoteHost, const EventServingParams &eventServingParams, const bool useEventServingParams)
 
const std::string & remoteHost () const
 
const int & retryInterval () const
 
const utils::Duration_tsecondsToStale () const
 
void setConsumerId (const ConsumerID &id)
 
void setMinEventRequestInterval (const utils::Duration_t &interval)
 
void setQueueId (const QueueID &id)
 
void setSourceURL (const std::string &url)
 
const std::string & sourceURL () const
 
virtual ~RegistrationInfoBase ()
 

Private Member Functions

void parsePSet (const edm::ParameterSet &)
 

Private Attributes

Strings eventSelection_
 
int headerRetryInterval_
 
std::string outputModuleLabel_
 
int prescale_
 
std::string triggerSelection_
 
bool uniqueEvents_
 

Additional Inherited Members

Detailed Description

Holds the registration information from a event consumer.

Author:
wmtan
Revision:
1.15
Date:
2011/08/31 20:11:59

Definition at line 34 of file EventConsumerRegistrationInfo.h.

Constructor & Destructor Documentation

stor::EventConsumerRegistrationInfo::EventConsumerRegistrationInfo ( const edm::ParameterSet pset,
const EventServingParams eventServingParams,
const std::string &  remoteHost = toolbox::net::getHostName() 
)

Definition at line 17 of file EventConsumerRegistrationInfo.cc.

21  :
22  RegistrationInfoBase(pset, remoteHost, eventServingParams, true)
23  {
24  parsePSet(pset);
25  }
RegistrationInfoBase(const std::string &consumerName, const std::string &remoteHost, const int &queueSize, const enquing_policy::PolicyTag &queuePolicy, const utils::Duration_t &secondsToStale)
const std::string & remoteHost() const
stor::EventConsumerRegistrationInfo::EventConsumerRegistrationInfo ( const edm::ParameterSet pset,
const std::string &  remoteHost = toolbox::net::getHostName() 
)

Definition at line 28 of file EventConsumerRegistrationInfo.cc.

31  :
32  RegistrationInfoBase(pset, remoteHost, EventServingParams(), false)
33  {
34  parsePSet(pset);
35  }
RegistrationInfoBase(const std::string &consumerName, const std::string &remoteHost, const int &queueSize, const enquing_policy::PolicyTag &queuePolicy, const utils::Duration_t &secondsToStale)
const std::string & remoteHost() const
stor::EventConsumerRegistrationInfo::~EventConsumerRegistrationInfo ( )
inline

Definition at line 54 of file EventConsumerRegistrationInfo.h.

54 {};

Member Function Documentation

void stor::EventConsumerRegistrationInfo::do_appendToPSet ( edm::ParameterSet pset) const
virtual

Implements stor::RegistrationInfoBase.

Definition at line 73 of file EventConsumerRegistrationInfo.cc.

References edm::ParameterSet::addParameter(), edm::ParameterSet::addUntrackedParameter(), eventSelection_, headerRetryInterval_, outputModuleLabel_, prescale_, AlCaHLTBitMon_QueryRunRegistry::string, triggerSelection_, and uniqueEvents_.

74  {
75  pset.addUntrackedParameter<std::string>("SelectHLTOutput", outputModuleLabel_);
76  pset.addUntrackedParameter<std::string>("TriggerSelector", triggerSelection_);
77  pset.addParameter<Strings>("TrackedEventSelection", eventSelection_);
78  pset.addUntrackedParameter<bool>("uniqueEvents", uniqueEvents_);
79  pset.addUntrackedParameter<int>("prescale", prescale_);
80 
81  if ( headerRetryInterval_ != 5 )
82  pset.addUntrackedParameter<int>("headerRetryInterval", headerRetryInterval_);
83  }
std::vector< std::string > Strings
Definition: MsgTools.h:18
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:209
void stor::EventConsumerRegistrationInfo::do_eventType ( std::ostream &  os) const
virtual

Implements stor::RegistrationInfoBase.

Definition at line 92 of file EventConsumerRegistrationInfo.cc.

References filterCSVwithJSON::copy, eventSelection_, outputModuleLabel_, prescale_, stor::RegistrationInfoBase::queueInfo(), triggerSelection_, and uniqueEvents_.

93  {
94  os << "Output module: " << outputModuleLabel_ << "\n";
95 
96  if ( triggerSelection_.empty() )
97  {
98  if ( ! eventSelection_.empty() )
99  {
100  os << "Event Selection: ";
101  std::copy(eventSelection_.begin(), eventSelection_.end()-1,
102  std::ostream_iterator<Strings::value_type>(os, ","));
103  os << *(eventSelection_.end()-1);
104  }
105  }
106  else
107  os << "Trigger Selection: " << triggerSelection_;
108 
109  if ( prescale_ != 1 )
110  os << "; prescale: " << prescale_;
111 
112  if ( uniqueEvents_ != false )
113  os << "; uniqueEvents";
114 
115  os << "\n";
116  queueInfo(os);
117  }
void queueInfo(std::ostream &) const
void stor::EventConsumerRegistrationInfo::do_registerMe ( EventDistributor evtDist)
virtual

Implements stor::RegistrationInfoBase.

Definition at line 86 of file EventConsumerRegistrationInfo.cc.

References stor::EventDistributor::registerEventConsumer().

87  {
88  evtDist->registerEventConsumer(shared_from_this());
89  }
uint32 stor::EventConsumerRegistrationInfo::eventCode ( ) const
inline

Definition at line 64 of file EventConsumerRegistrationInfo.h.

References Header::EVENT.

64 { return Header::EVENT; }
uint32 stor::EventConsumerRegistrationInfo::eventRequestCode ( ) const
inline

Definition at line 63 of file EventConsumerRegistrationInfo.h.

References Header::EVENT_REQUEST.

const Strings& stor::EventConsumerRegistrationInfo::eventSelection ( ) const
inline

Definition at line 58 of file EventConsumerRegistrationInfo.h.

References eventSelection_.

Referenced by operator<(), and operator==().

std::string stor::EventConsumerRegistrationInfo::eventURL ( ) const
inline

Definition at line 65 of file EventConsumerRegistrationInfo.h.

References stor::RegistrationInfoBase::sourceURL().

65 { return sourceURL() + "/geteventdata"; }
const std::string & sourceURL() const
const int& stor::EventConsumerRegistrationInfo::headerRetryInterval ( ) const
inline
bool stor::EventConsumerRegistrationInfo::operator!= ( const EventConsumerRegistrationInfo other) const

Definition at line 149 of file EventConsumerRegistrationInfo.cc.

150  {
151  return ! ( *this == other );
152  }
bool stor::EventConsumerRegistrationInfo::operator< ( const EventConsumerRegistrationInfo other) const

Definition at line 120 of file EventConsumerRegistrationInfo.cc.

References eventSelection(), stor::RegistrationInfoBase::operator<(), outputModuleLabel(), prescale(), triggerSelection(), and uniqueEvents().

121  {
122  if ( outputModuleLabel() != other.outputModuleLabel() )
123  return ( outputModuleLabel() < other.outputModuleLabel() );
124  if ( triggerSelection() != other.triggerSelection() )
125  return ( triggerSelection() < other.triggerSelection() );
126  if ( eventSelection() != other.eventSelection() )
127  return ( eventSelection() < other.eventSelection() );
128  if ( prescale() != other.prescale() )
129  return ( prescale() < other.prescale() );
130  if ( uniqueEvents() != other.uniqueEvents() )
131  return ( uniqueEvents() < other.uniqueEvents() );
132  return RegistrationInfoBase::operator<(other);
133  }
virtual bool operator<(const RegistrationInfoBase &) const
bool stor::EventConsumerRegistrationInfo::operator== ( const EventConsumerRegistrationInfo other) const

Definition at line 136 of file EventConsumerRegistrationInfo.cc.

References eventSelection(), stor::RegistrationInfoBase::operator==(), outputModuleLabel(), prescale(), triggerSelection(), and uniqueEvents().

137  {
138  return (
139  outputModuleLabel() == other.outputModuleLabel() &&
140  triggerSelection() == other.triggerSelection() &&
141  eventSelection() == other.eventSelection() &&
142  prescale() == other.prescale() &&
143  uniqueEvents() == other.uniqueEvents() &&
145  );
146  }
virtual bool operator==(const RegistrationInfoBase &) const
const std::string& stor::EventConsumerRegistrationInfo::outputModuleLabel ( ) const
inline

Definition at line 59 of file EventConsumerRegistrationInfo.h.

References outputModuleLabel_.

Referenced by operator<(), and operator==().

void stor::EventConsumerRegistrationInfo::parsePSet ( const edm::ParameterSet pset)
private

Definition at line 38 of file EventConsumerRegistrationInfo.cc.

References alignCSCRings::e, edm::ParameterSet::empty(), eventSelection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), headerRetryInterval_, outputModuleLabel_, prescale_, AlCaHLTBitMon_QueryRunRegistry::string, triggerSelection_, and uniqueEvents_.

39  {
40  try
41  {
42  outputModuleLabel_ = pset.getUntrackedParameter<std::string>("SelectHLTOutput");
43  }
44  catch( edm::Exception& e )
45  {
46  XCEPT_RAISE( stor::exception::ConsumerRegistration,
47  "No HLT output module specified" );
48  }
49 
50  triggerSelection_ = pset.getUntrackedParameter<std::string>("TriggerSelector", "");
51 
52  try
53  {
54  eventSelection_ = pset.getParameter<Strings>("TrackedEventSelection");
55  }
56  catch( edm::Exception& e )
57  {
58  edm::ParameterSet tmpPSet1 =
60  if ( ! tmpPSet1.empty() )
61  {
62  eventSelection_ = tmpPSet1.getParameter<Strings>("SelectEvents");
63  }
64  }
65 
66  prescale_ = pset.getUntrackedParameter<int>("prescale", 1);
67  uniqueEvents_ = pset.getUntrackedParameter<bool>("uniqueEvents", false);
68  headerRetryInterval_ = pset.getUntrackedParameter<int>("headerRetryInterval", 5);
69  }
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:219
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > Strings
Definition: MsgTools.h:18
const int& stor::EventConsumerRegistrationInfo::prescale ( ) const
inline

Definition at line 60 of file EventConsumerRegistrationInfo.h.

References prescale_.

Referenced by operator<(), and operator==().

std::string stor::EventConsumerRegistrationInfo::registerURL ( ) const
inline

Definition at line 66 of file EventConsumerRegistrationInfo.h.

References stor::RegistrationInfoBase::sourceURL().

66 { return sourceURL() + "/registerConsumer"; }
const std::string & sourceURL() const
const std::string& stor::EventConsumerRegistrationInfo::triggerSelection ( ) const
inline

Definition at line 57 of file EventConsumerRegistrationInfo.h.

References triggerSelection_.

Referenced by operator<(), and operator==().

const bool& stor::EventConsumerRegistrationInfo::uniqueEvents ( ) const
inline

Definition at line 61 of file EventConsumerRegistrationInfo.h.

References uniqueEvents_.

Referenced by operator<(), and operator==().

std::ostream& stor::EventConsumerRegistrationInfo::write ( std::ostream &  os) const

Member Data Documentation

Strings stor::EventConsumerRegistrationInfo::eventSelection_
private
int stor::EventConsumerRegistrationInfo::headerRetryInterval_
private

Definition at line 90 of file EventConsumerRegistrationInfo.h.

Referenced by do_appendToPSet(), headerRetryInterval(), and parsePSet().

std::string stor::EventConsumerRegistrationInfo::outputModuleLabel_
private
int stor::EventConsumerRegistrationInfo::prescale_
private

Definition at line 88 of file EventConsumerRegistrationInfo.h.

Referenced by do_appendToPSet(), do_eventType(), parsePSet(), and prescale().

std::string stor::EventConsumerRegistrationInfo::triggerSelection_
private
bool stor::EventConsumerRegistrationInfo::uniqueEvents_
private