CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

stor::EventConsumerRegistrationInfo Class Reference

#include <EventConsumerRegistrationInfo.h>

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

List of all members.

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 ()

Private Member Functions

void parsePSet (const edm::ParameterSet &)

Private Attributes

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

Detailed Description

Holds the registration information from a event consumer.

Author:
mommsen
Revision:
1.14
Date:
2011/03/07 15:31:31

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.

    :
  RegistrationInfoBase(pset, remoteHost, eventServingParams, true)
  {
    parsePSet(pset);
  }
stor::EventConsumerRegistrationInfo::EventConsumerRegistrationInfo ( const edm::ParameterSet pset,
const std::string &  remoteHost = toolbox::net::getHostName() 
)

Definition at line 28 of file EventConsumerRegistrationInfo.cc.

    :
  RegistrationInfoBase(pset, remoteHost, EventServingParams(), false)
  {
    parsePSet(pset);
  }
stor::EventConsumerRegistrationInfo::~EventConsumerRegistrationInfo ( ) [inline]

Definition at line 54 of file EventConsumerRegistrationInfo.h.

{};

Member Function Documentation

void stor::EventConsumerRegistrationInfo::do_appendToPSet ( edm::ParameterSet pset) const [virtual]
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_.

  {
    os << "Output module: " << outputModuleLabel_ << "\n";

    if ( triggerSelection_.empty() )
    {
      if ( ! eventSelection_.empty() )
      {
        os  << "Event Selection: ";
        std::copy(eventSelection_.begin(), eventSelection_.end()-1,
          std::ostream_iterator<Strings::value_type>(os, ","));
        os << *(eventSelection_.end()-1);
      }
    }
    else
      os << "Trigger Selection: " << triggerSelection_;

    if ( prescale_ != 1 )
      os << "; prescale: " << prescale_;

    if ( uniqueEvents_ != false )
      os << "; uniqueEvents";

    os << "\n";
    queueInfo(os);
  }
void stor::EventConsumerRegistrationInfo::do_registerMe ( EventDistributor evtDist) [virtual]

Implements stor::RegistrationInfoBase.

Definition at line 86 of file EventConsumerRegistrationInfo.cc.

References stor::EventDistributor::registerEventConsumer().

  {
    evtDist->registerEventConsumer(shared_from_this());
  }
uint32 stor::EventConsumerRegistrationInfo::eventCode ( ) const [inline]

Definition at line 64 of file EventConsumerRegistrationInfo.h.

References Header::EVENT.

{ 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==().

{ return eventSelection_; }
std::string stor::EventConsumerRegistrationInfo::eventURL ( ) const [inline]

Definition at line 65 of file EventConsumerRegistrationInfo.h.

References stor::RegistrationInfoBase::sourceURL().

{ return sourceURL() + "/geteventdata"; }
const int& stor::EventConsumerRegistrationInfo::headerRetryInterval ( ) const [inline]

Definition at line 62 of file EventConsumerRegistrationInfo.h.

References headerRetryInterval_.

bool stor::EventConsumerRegistrationInfo::operator!= ( const EventConsumerRegistrationInfo other) const

Definition at line 149 of file EventConsumerRegistrationInfo.cc.

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

Definition at line 120 of file EventConsumerRegistrationInfo.cc.

References eventSelection(), outputModuleLabel(), prescale(), triggerSelection(), and uniqueEvents().

  {
    if ( outputModuleLabel() != other.outputModuleLabel() )
      return ( outputModuleLabel() < other.outputModuleLabel() );
    if ( triggerSelection() != other.triggerSelection() )
      return ( triggerSelection() < other.triggerSelection() );
    if ( eventSelection() != other.eventSelection() )
      return ( eventSelection() < other.eventSelection() );
    if ( prescale() != other.prescale() )
      return ( prescale() < other.prescale() );
    if ( uniqueEvents() != other.uniqueEvents() )
      return ( uniqueEvents() < other.uniqueEvents() );
    return RegistrationInfoBase::operator<(other);
  }
bool stor::EventConsumerRegistrationInfo::operator== ( const EventConsumerRegistrationInfo other) const

Definition at line 136 of file EventConsumerRegistrationInfo.cc.

References eventSelection(), outputModuleLabel(), prescale(), triggerSelection(), and uniqueEvents().

  {
    return (
      outputModuleLabel() == other.outputModuleLabel() &&
      triggerSelection() == other.triggerSelection() &&
      eventSelection() == other.eventSelection() &&
      prescale() == other.prescale() &&
      uniqueEvents() == other.uniqueEvents() &&
      RegistrationInfoBase::operator==(other)
    );
  }
const std::string& stor::EventConsumerRegistrationInfo::outputModuleLabel ( ) const [inline]

Definition at line 59 of file EventConsumerRegistrationInfo.h.

References outputModuleLabel_.

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

{ return outputModuleLabel_; }
void stor::EventConsumerRegistrationInfo::parsePSet ( const edm::ParameterSet pset) [private]

Definition at line 38 of file EventConsumerRegistrationInfo.cc.

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

  {
    try
    {
      outputModuleLabel_ = pset.getUntrackedParameter<std::string>("SelectHLTOutput");
    }
    catch( edm::Exception& e )
    {
      XCEPT_RAISE( stor::exception::ConsumerRegistration,
        "No HLT output module specified" );
    }

    triggerSelection_ = pset.getUntrackedParameter<std::string>("TriggerSelector", "");

    try
    {
      eventSelection_ = pset.getParameter<Strings>("TrackedEventSelection");
    }
    catch( edm::Exception& e )
    {
      edm::ParameterSet tmpPSet1 =
        pset.getUntrackedParameter<edm::ParameterSet>("SelectEvents", edm::ParameterSet());
      if ( ! tmpPSet1.empty() )
      {
        eventSelection_ = tmpPSet1.getParameter<Strings>("SelectEvents");
      }
    }

    prescale_ = pset.getUntrackedParameter<int>("prescale", 1);
    uniqueEvents_ = pset.getUntrackedParameter<bool>("uniqueEvents", false);
    headerRetryInterval_ = pset.getUntrackedParameter<int>("headerRetryInterval", 5);
  }
const int& stor::EventConsumerRegistrationInfo::prescale ( ) const [inline]

Definition at line 60 of file EventConsumerRegistrationInfo.h.

References prescale_.

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

{ return prescale_; }
std::string stor::EventConsumerRegistrationInfo::registerURL ( ) const [inline]

Definition at line 66 of file EventConsumerRegistrationInfo.h.

References stor::RegistrationInfoBase::sourceURL().

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

Definition at line 57 of file EventConsumerRegistrationInfo.h.

References triggerSelection_.

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

{ return triggerSelection_; }
const bool& stor::EventConsumerRegistrationInfo::uniqueEvents ( ) const [inline]

Definition at line 61 of file EventConsumerRegistrationInfo.h.

References uniqueEvents_.

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

{ return uniqueEvents_; }
std::ostream& stor::EventConsumerRegistrationInfo::write ( std::ostream &  os) const

Member Data Documentation

Definition at line 90 of file EventConsumerRegistrationInfo.h.

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

Definition at line 88 of file EventConsumerRegistrationInfo.h.

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