Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Wrapping processors inside Gaudi #36

Merged
merged 3 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 47 additions & 48 deletions source/include/marlin/EventSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,54 @@ using namespace marlin ;
* @author F. Gaede, DESY
* @version $Id:$
*/
namespace marlin {

class EventSelector : public Processor, public marlin::EventModifier {

typedef std::set< std::pair< int, int > > SET ;

public:

virtual Processor* newProcessor() { return new EventSelector ; }


EventSelector() ;

/** Called at the begin of the job before anything is read.
* Use to initialize the processor, e.g. book histograms.
*/
virtual void init() ;

/** Called for every run.
*/
virtual void processRunHeader( LCRunHeader* run ) ;

/** Called for every event - the working horse.
*/
virtual void processEvent( LCEvent * evt ) ;


virtual void check( LCEvent * evt ) ;


virtual void modifyEvent( LCEvent *evt ) ;


/** Called after data processing for clean up.
*/
virtual void end() ;

virtual const std::string & name() const { return Processor::name() ; }


protected:

/** Input collection name.
*/
IntVec _evtList{};
SET _evtSet{};

int _nRun=-1;
int _nEvt=-1;
} ;
class EventSelector : public Processor, public marlin::EventModifier {

typedef std::set< std::pair< int, int > > SET ;

public:

virtual Processor* newProcessor() { return new EventSelector ; }

EventSelector() ;

/** Called at the begin of the job before anything is read.
* Use to initialize the processor, e.g. book histograms.
*/
virtual void init() ;

/** Called for every run.
*/
virtual void processRunHeader( LCRunHeader* run ) ;

/** Called for every event - the working horse.
*/
virtual void processEvent( LCEvent * evt ) ;

virtual void check( LCEvent * evt ) ;

virtual void modifyEvent( LCEvent *evt ) ;

/** Called after data processing for clean up.
*/
virtual void end() ;

virtual const std::string & name() const { return Processor::name() ; }


protected:

/** Input collection name.
*/
IntVec _evtList{};
SET _evtSet{};

int _nRun=-1;
int _nEvt=-1;
} ;

} // namespace marlin

#endif

Expand Down
12 changes: 6 additions & 6 deletions source/include/marlin/Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ namespace marlin{
// */
// ProcessorParameter* getProcessorParameter( const std::string name) ;

/** Initialize the parameters */
virtual void setParameters( std::shared_ptr<StringParameters> parameters) ;

/** Set processor name */
virtual void setName( const std::string & processorName) { _processorName = processorName ; }

protected:

/** Set the return value for this processor - typically at end of processEvent().
Expand Down Expand Up @@ -409,12 +415,6 @@ namespace marlin{

/** Allow friend class CCProcessor to update processor parameters */
virtual void updateParameters();

/** Set processor name */
virtual void setName( const std::string & processorName) { _processorName = processorName ; }

/** Initialize the parameters */
virtual void setParameters( std::shared_ptr<StringParameters> parameters) ;

/** Sets the registered steering parameters before calling init()
*/
Expand Down