ODIN
splitter.h
1 /***************************************************************************
2  splitter.h - description
3  -------------------
4  begin : Fri Feb 2 2007
5  copyright : (C) 2000-2021 by Thies Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef RECOSPLITTER_H
19 #define RECOSPLITTER_H
20 
21 
22 #include "step.h"
23 
24 
25 /*
26  * Template class to split data in one or more dimensions and to feed it separately
27  * into the remaining part of the pipeline.
28  * The rank of the unmodified collected data dimensions is is given by 'Nunmod'.
29  * The particular unmodified dimension are given in 'Unmod' by a specialization of 'RecoDim'.
30  * The numer of dimensions to split is given in 'Nsplit' and specified in 'Split' by
31  * a specialization of 'RecoDim'.
32  * The dimensions to split are expected leftmost in the input data array.
33  */
34 template<unsigned int Nunmod, class Unmod, unsigned int Nsplit, class Split>
35 class RecoSplitter : public RecoStep, public Labeled {
36 
37  public:
38  RecoSplitter(const STD_string& split_label) : Labeled(split_label) {}
39 
40  private:
41 
42  // implementing virtual functions of RecoStep
43  STD_string label() const {return get_label();}
44  STD_string description() const {return "Split data in one or more dimensions";}
45  bool process(RecoData& rd, RecoController& controller);
46  RecoCoord input_coord() const {RecoCoord result=Unmod::preset_coord(RecoIndex::collected); Split::modify(RecoIndex::collected,result); return result;}
47  void modify_coord(RecoCoord& coord) const {Split::modify(RecoIndex::separate,coord);}
48  RecoStep* allocate() const {return new RecoSplitter(get_label());}
49  void init() {}
50 
51 };
52 
53 
54 
55 #endif
56 
Labeled(const STD_string &label="unnamed")
Definition: tjlabel.h:38
const STD_string & get_label() const
Definition: tjlabel.h:48
chansplit, repsplit: Split data in one or more dimensions
Definition: splitter.h:35