Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:00:29

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 //====================================================================
0012 //  EventSelectorDataStream.h
0013 //--------------------------------------------------------------------
0014 //
0015 //  Package    : EventSelectorDataStream  (LHCb Event Selector Package)
0016 //
0017 //  Author     : M.Frank
0018 //      Created    : 4/10/00
0019 //  Changes    : R. Lambert 2009-09-04
0020 //
0021 //====================================================================
0022 #ifndef GAUDIKERNEL_EVENTSELECTORDATASTREAM_H
0023 #define GAUDIKERNEL_EVENTSELECTORDATASTREAM_H 1
0024 
0025 // Include files
0026 #include "GaudiKernel/IEvtSelector.h"
0027 #include <Gaudi/Property.h>
0028 
0029 // STL include files
0030 #include <iostream>
0031 #include <vector>
0032 
0033 // Forward declarations
0034 class MsgStream;
0035 class ISvcLocator;
0036 class EventSelectorDataStream;
0037 
0038 /** Definition of class EventSelectorDataStream
0039 
0040     Small class which eases the management of multiple
0041     input streams for the event selector.
0042 
0043     History:
0044     +---------+----------------------------------------------+------------+
0045     |    Date |                 Comment                      |    Who     |
0046     +---------+----------------------------------------------+------------+
0047     | 3/10/00 | Initial version                              | M.Frank    |
0048     +---------+----------------------------------------------+------------+
0049     | 4/09/09 | Added m_dbName and dbName()                  | R. Lambert |
0050     +---------+----------------------------------------------+------------+
0051    @author Markus Frank
0052    @author R. Lambert
0053    @version 1.0
0054 */
0055 class GAUDI_API EventSelectorDataStream : public implements<IInterface> {
0056   /// Output friend for MsgStream
0057   friend MsgStream& operator<<( MsgStream& s, const EventSelectorDataStream& obj );
0058   /// Output friend for standard I/O
0059   friend std::ostream& operator<<( std::ostream& s, const EventSelectorDataStream& obj );
0060 
0061 public:
0062   typedef std::vector<Gaudi::Property<std::string>> Properties;
0063 
0064 protected:
0065   /// Name
0066   std::string m_name;
0067   /// Definition string
0068   std::string m_definition;
0069   /// Criteria
0070   std::string m_criteria;
0071   /// String with name of the db as parsed
0072   std::string m_dbName;
0073   /// Event selector type
0074   std::string m_selectorType;
0075   /// Pointer to valid selector
0076   SmartIF<IEvtSelector> m_pSelector;
0077   /// Reference to service locator
0078   ISvcLocator* m_pSvcLocator;
0079   /// Properties vector
0080   Properties m_properties;
0081   /// Initialization state
0082   bool m_initialized = false;
0083   /// Standard Destructor
0084   virtual ~EventSelectorDataStream() = default;
0085 
0086 public:
0087   /// Standard Constructor
0088   EventSelectorDataStream( std::string nam, std::string def, ISvcLocator* svcloc );
0089   /// Attach event selector object
0090   virtual void setSelector( IEvtSelector* pSelector );
0091   /// Parse input criteria
0092   virtual StatusCode initialize();
0093   /// Finalize stream and release resources
0094   virtual StatusCode finalize();
0095   /// Allow access to individual properties by name
0096   Gaudi::Property<std::string>* property( const std::string& nam );
0097   /// Allow access to individual properties by name (CONST)
0098   const Gaudi::Property<std::string>* property( const std::string& nam ) const;
0099   /// Access properties
0100   const Properties& properties() { return m_properties; }
0101   /// Retrieve stream name
0102   const std::string& name() const { return m_name; }
0103   /// Retrieve stream criteria
0104   const std::string& criteria() const { return m_criteria; }
0105   /// Retrieve stream dbName
0106   const std::string& dbName() const { return m_dbName; }
0107   /// Retrieve event selector type
0108   const std::string& selectorType() const { return m_selectorType; }
0109   /// Retrieve definition string
0110   const std::string& definition() const { return m_definition; }
0111   /// Retrieve event selector object
0112   IEvtSelector* selector() const { return m_pSelector.get(); }
0113   /// Check initialization status
0114   bool isInitialized() const { return m_initialized; }
0115 };
0116 
0117 /// Output friend for MsgStream
0118 GAUDI_API MsgStream& operator<<( MsgStream& s, const EventSelectorDataStream& obj );
0119 /// Output friend for standard I/O
0120 GAUDI_API std::ostream& operator<<( std::ostream& s, const EventSelectorDataStream& obj );
0121 
0122 #endif // GAUDIKERNEL_EVENTSELECTORDATASTREAM_H