hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
StdhepMCParticleProcessor.h
Go to the documentation of this file.
1
7#ifndef __STDHEP_ROOT_CONVERTER_H__
8#define __STDHEP_ROOT_CONVERTER_H__
9
10//-----------------//
11// C++ StdLib //
12//-----------------//
13#include <iostream>
14#include <string>
15#include <cstdlib>
16#include <iostream>
17#include <sstream>
18#include <memory>
19#include <vector>
20
21//----------//
22// LCIO //
23//----------//
24#include <EVENT/LCIO.h>
25#include <EVENT/LCCollection.h>
26#include <IMPL/LCEventImpl.h>
27#include <IMPL/MCParticleImpl.h>
28
29#include <UTIL/LCStdHepRdr.h>
30
31
32//----------//
33// ROOT //
34//----------//
35#include "TFile.h"
36#include "TTree.h"
37//-----------//
38// hpstr //
39//-----------//
40#include "Processor.h"
41#include "MCParticle.h"
42
48
49 public:
50
58 StdhepMCParticleProcessor(const std::string& name, Process& process);
59
62
68 virtual bool process();
69 virtual bool process(IEvent* event) {};
70
76 virtual void configure(const ParameterSet& parameters);
77
85 virtual void initialize(std::string inFilename, std::string outFilename);
86
93 virtual void initialize(TTree* tree) {};
94
99 virtual void finalize();
100
101
102 private:
103 std::string inFilename_;
104 std::string mcPartCollStdhep_{"MCParticle"};
105 int maxEvent_{-1};
107 TFile* outF_{nullptr};
108 std::string mcPartCollRoot_{"MCParticle"};
109 std::vector<MCParticle*> mc_particles_{};
110 TTree* tree_{nullptr};
111
112}; // Tracking Processor
113
114#endif // __STDHEP_ROOT_CONVERTER_H__
Class used to encapsulate information about a mc particle.
Base classes for all user event processing components to extend.
Definition IEvent.h:7
description
Base class for all event processing components.
Definition Processor.h:34
Processor used to translate StdHep MCParticles to ROOT MCParticle objects. more details.
std::string inFilename_
stdhep input file
TFile * outF_
root tuple outfile
std::string mcPartCollStdhep_
name temporary lcio collection
virtual void configure(const ParameterSet &parameters)
Configure the Processor.
virtual void initialize(TTree *tree)
Callback for the Processor to take any necessary action when the processing of events starts.
virtual void finalize()
Callback for the Processor to take any necessary action when the processing of events finishes.
int skipEvent_
skipped event numbers to convet
TTree * tree_
TTree holds converted MCParticles for each event.
int maxEvent_
max stdhep event number to convert
std::vector< MCParticle * > mc_particles_
list of converted MCParticles
virtual void initialize(std::string inFilename, std::string outFilename)
Callback for the Processor to take any necessary action when the processing of events starts.
std::string mcPartCollRoot_
name root collection
virtual bool process(IEvent *event)
Process the event and put new data products into it.
virtual bool process()
Process the event and put new data products into it.