/* * PndEventCombinerTask.h * * Created on: May 3, 2017 * Author: Steinschaden * */ //* Class to combine a defined number of entries ("events") of a branch and buffer this "eventbunches" (or store them) for further use. #ifndef PndEventCombinerTask_H_ #define PndEventCombinerTask_H_ #include "TClonesArray.h" #include "FairTask.h" #include class PndEventCombinerTask : public FairTask { public: /** Default constructor **/ PndEventCombinerTask(); /** Destructor **/ virtual ~PndEventCombinerTask(); /** Virtual method Init **/ virtual InitStatus Init(); //virtual void SetParContainers(); // virtual InitStatus ReInit(); /** Virtual method Exec **/ virtual void Exec(Option_t* opt); // virtual void FinishEvent(); // virtual void FinishTask(); // Set and add the branches for which you want to combine events void AddInputBranch(TString branchName){ fInBranches.push_back(branchName);}; // Set Persistance to kTRUE if you want to store the combined Events. otherwise they are just buffered for the direct use of other tasks in the same run void SetPersistence(Bool_t val){ fPersistence = val;}; // set the number of events you want to combine to one data sample. This also sets the default output name if the combined data are stored ("comb_NEvents_InputBranchName") void SetNEvents(Int_t nEvents) {fNEvents = nEvents;}; private: std::vector fInBranches; std::vector fInArrays; std::vector fTmpArrays; std::vector fOutArrays; Bool_t fPersistence; Int_t fNEvents; ClassDef(PndEventCombinerTask,0); }; #endif /*PndEventCombinerTask_H_*/