Belle II Software development
Filter.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <TTree.h>
12#include <string>
13#include <type_traits>
14
15#include <tracking/trackFindingVXD/filterMap/filterFramework/VoidObserver.h>
16
17namespace Belle2 {
33 template<typename ... typePack>
34 class Filter {
35 /* Empty: just specialized templates are interesting */
36 };
37
38
45 template<typename ... types>
46 struct all_same : std::false_type {};
47
53 template<typename T>
54 struct all_same<T> : std::true_type {};
55
61 template< >
62 struct all_same< > : std::true_type {};
63
70 template<typename T, typename ... types>
71 struct all_same<T, T, types ...> : all_same<T, types ...> {};
72
75 class BypassableFilter;
77 class ActivatableFilter;
78
79
81
108 template <
109 class Variable,
110 class RangeType,
111 class Observer
112 >
113 class Filter <Variable, RangeType, Observer> {
114 public:
116 typedef typename Variable::argumentType argumentType;
117
119 typedef typename Variable::functionType functionType;
120
128 explicit Filter(const RangeType& range):
129 m_range(range) { };
130
132 Filter() = default;
133
134
136 RangeType getRange(void) const { return m_range; }
137
138
145 template<typename ... argsType>
148 typename std::enable_if<all_same<argumentType, argsType ... >::value, bool>::type
149 accept(const argsType& ... args) const
150 {
151 typename Variable::variableType value = Variable::value(args ...);
152 Observer::notify(Variable(), value, m_range, args ...);
153 return m_range.contains(value);
154 }
155
156
161 void persist(TTree* t, const std::string& branchName)
162 {
163 m_range.persist(t, branchName, Variable().name());
164 }
165
166
171 void setBranchAddress(TTree* t, const std::string& branchName)
172 {
173 m_range.setBranchAddress(t, branchName, Variable().name());
174 }
175
176
208 bypass(const bool& bypassVariable = false)
209 {
210 return Filter<Variable, RangeType, BypassableFilter, Observer>(m_range, bypassVariable);
211 }
212
213
219 // __attribute__((deprecated("Please use the bypass( const bool &) method instead")))
220 enable(const bool& enableVariable = true)
221 {
222 return Filter<Variable, RangeType, ActivatableFilter, Observer>(m_range, enableVariable);
223 }
224
225
230 template< class otherObserver >
232 observeLeaf(const otherObserver&) const
233 {
235 }
236
237
242 template< class otherObserver >
244 m_range(filter.getRange()) {};
245
246
252 std::string getNameAndReference(std::vector<std::pair<char, void*> >* pointers = nullptr)
253 {
254 return m_range.getNameAndReference(pointers, Variable::name());
255 }
256
257 protected:
259 RangeType m_range;
260 };
261
262
263
265
300 template <
301 class Variable,
302 class RangeType,
303 class Observer
304 >
305 class Filter <Variable, RangeType, Belle2::BypassableFilter, Observer>:
306 public Filter<Variable, RangeType, Observer> {
307 public:
309 typedef typename Variable::argumentType argumentType;
311 typedef typename Variable::functionType functionType;
312
313
324 Filter(const RangeType& range, const bool& bypass):
325 Filter<Variable, RangeType, Observer>(range)
326 { m_bypass = &bypass; };
327
328
330 Filter() = default;
331
332
339 template<typename ... argsType>
342 typename std::enable_if<all_same<argumentType, argsType ...>::value, bool>::type
343 accept(const argsType& ... args) const
344 {
345 typename Variable::variableType value = Variable::value(args ...);
347 return (*m_bypass) || Filter<Variable, RangeType, Observer>::m_range.contains(value);
348 }
349
350
356 std::string getNameAndReference(std::vector<std::pair<char, void*>>* pointers = nullptr)
357 {
358 return "(" + std::to_string(*m_bypass) + " OR " +
359 Filter<Variable, RangeType, Observer>::m_range.getNameAndReference(pointers, Variable::name()) + ")";
360 }
361
362 private:
364 const bool* m_bypass;
365 };
366
367
368
371
407 template <
408 class Variable,
409 class RangeType,
410 class Observer
411 >
412 class Filter <Variable, RangeType, Belle2::ActivatableFilter, Observer>:
413 public Filter<Variable, RangeType, Observer> {
414 public:
416 typedef typename Variable::argumentType argumentType;
418 typedef typename Variable::functionType functionType;
419
420
431 Filter(const RangeType& range, const bool& enable):
432 Filter<Variable, RangeType, Observer>(range)
433 {
434 m_enable = & enable ;
435 };
436
437
439 Filter() = default;
440
447 template<typename ... argsType>
448 typename std::enable_if<all_same<argumentType, argsType ...>::value, bool>::type
449 accept(const argsType& ... args) const
450 {
451 typename Variable::variableType value = Variable::value(args ...);
453 args ...);
454 return (!(*m_enable)) || Filter<Variable, RangeType, Observer>::m_range.contains(value);
455 }
456
457
463 std::string getNameAndReference(std::vector< std::pair<char, void*>>* pointers = nullptr)
464 {
465 return "(!(" + std::to_string(*m_enable) + ") OR "
466 + Filter<Variable, RangeType, Observer>::m_range.getNameAndReference(pointers, Variable::name()) + ")";
467 }
468
469 private:
471 const bool* m_enable;
472 };
473
474
475
478 class OperatorNot;
479
484 template <
485 class someFilter,
486 class templateObserverType
487 >
488 class Filter <Belle2::OperatorNot, someFilter, templateObserverType> {
490 const char* c_notSuffix = "_not";
491 public:
493 typedef typename someFilter::argumentType argumentType;
495 typedef typename someFilter::functionType functionType;
496
497
501 explicit Filter(const someFilter& filter):
502 m_filter(filter) { };
503
504
506 Filter() { };
507
508
515 template<typename ... argsType>
516 typename std::enable_if<all_same<argumentType, argsType ...>::value, bool>::type
517 accept(const argsType& ... args) const
518 {
519 return ! m_filter.accept(args ...);
520 }
521
522
528 std::string getNameAndReference(std::vector< std::pair<char, void*>>* pointers = nullptr)
529 {
530 return "!" + m_filter.getNameAndReference(pointers);
531 }
532
533
538 template<class otherObserver>
539 Filter<Belle2::OperatorNot, decltype(someFilter().observeLeaf(otherObserver())), otherObserver>
540 observeLeaf(const otherObserver&) const
541 {
542 return Filter<Belle2::OperatorNot, decltype(someFilter().observeLeaf(otherObserver())),
543 otherObserver>(m_filter.observeLeaf(otherObserver()));
544 }
545
546
551 void persist(TTree* t, const std::string& branchName)
552 {
553 std::string nameOfFilter(branchName);
554 nameOfFilter += c_notSuffix;
555 m_filter.persist(t, nameOfFilter);
556 }
557
558
563 void setBranchAddress(TTree* t, const std::string& branchName)
564 {
565 std::string nameOfFilter(branchName);
566 nameOfFilter += c_notSuffix;
567 m_filter.setBranchAddress(t, nameOfFilter);
568 }
569
570 private:
572 someFilter m_filter;
573 };
574
575
581 template<typename ... types>
582 Filter<OperatorNot, Filter<types...>, VoidObserver>
584 {
585 return Filter<OperatorNot, Filter<types...>, VoidObserver>(filter);
586 }
587
588
589
592 class OperatorAnd;
593
599 template <
600 class FilterA,
601 class FilterB,
602 class templateObserverType
603 >
604 class Filter <Belle2::OperatorAnd, FilterA, FilterB, templateObserverType> {
606 const char* c_andSuffixA = "_and_A";
608 const char* c_andSuffixB = "_and_B";
609 public:
611 typedef typename FilterA::argumentType argumentType;
613 typedef typename FilterB::argumentType argumentTypeB;
615 typedef typename FilterA::functionType functionTypeA;
617 typedef typename FilterB::functionType functionTypeB;
619 typedef typename std::enable_if<all_same<functionTypeA, functionTypeB>::value, functionTypeA>::type functionType;
620
621
626 Filter(const FilterA& filterA, const FilterB& filterB):
627 m_filterA(filterA), m_filterB(filterB) { };
628
629
631 Filter() { };
632
633
641 template<typename ... argsType>
642 typename std::enable_if<all_same<argumentType, argumentTypeB, argsType ...>::value, bool>::type
643 accept(const argsType& ... args) const
644 {
645 templateObserverType::prepare(args ...);
646 bool returnValue = m_filterA.accept(args ...) && m_filterB.accept(args ...);
647 templateObserverType::collect(args ...);
648 return returnValue;
649 }
650
651
658 template<class otherObserver>
659 Filter<Belle2::OperatorAnd, decltype(FilterA().observeLeaf(otherObserver())),
660 decltype(FilterB().observeLeaf(otherObserver())), otherObserver>
661 observe(const otherObserver&) const
662 {
663 // this will recursively loop over all AND Filters and set the SAME observer
664 return Filter<Belle2::OperatorAnd,
665 decltype(FilterA().observeLeaf(otherObserver())),
666 decltype(FilterB().observeLeaf(otherObserver())),
667 otherObserver>(m_filterA.observeLeaf(otherObserver()), m_filterB.observeLeaf(otherObserver()));
668 }
669
670
677 template<class otherObserver>
678 Filter<Belle2::OperatorAnd, decltype(FilterA().observeLeaf(otherObserver())),
679 decltype(FilterB().observeLeaf(otherObserver())), VoidObserver>
680 observeLeaf(const otherObserver&) const
681 {
682 // This will recursively loop over all lower level Filters of the AND combination and set the SAME observer.
683 // For the top level filter the void observer is used.
684 return Filter<Belle2::OperatorAnd,
685 decltype(FilterA().observeLeaf(otherObserver())),
686 decltype(FilterB().observeLeaf(otherObserver())),
687 VoidObserver>(m_filterA.observeLeaf(otherObserver()), m_filterB.observeLeaf(otherObserver()));
688 }
689
690
695 void persist(TTree* t, const std::string& branchName)
696 {
697 std::string nameOfFilterA(branchName);
698 nameOfFilterA += c_andSuffixA;
699 m_filterA.persist(t, nameOfFilterA);
700
701 std::string nameOfFilterB(branchName);
702 nameOfFilterB += c_andSuffixB;
703 m_filterB.persist(t, nameOfFilterB);
704 }
705
706
711 void setBranchAddress(TTree* t, const std::string& branchName)
712 {
713 std::string nameOfFilterA(branchName);
714 nameOfFilterA += c_andSuffixA;
715 m_filterA.setBranchAddress(t, nameOfFilterA);
716
717 std::string nameOfFilterB(branchName);
718 nameOfFilterB += c_andSuffixB;
719 m_filterB.setBranchAddress(t, nameOfFilterB);
720 }
721
722
728 std::string getNameAndReference(std::vector< std::pair<char, void*>>* pointers = nullptr)
729 {
730 return "(" + m_filterA.getNameAndReference(pointers) + " AND " + m_filterB.getNameAndReference(pointers) + ")";
731 }
732
733 private:
735 FilterA m_filterA;
737 FilterB m_filterB;
738 };
739
740
748 template <
749 typename ... types1,
750 typename ... types2
751 >
752 Filter<Belle2::OperatorAnd, Belle2::Filter<types1...>, Belle2::Filter<types2...>, Belle2::VoidObserver>
753 operator &&(const Filter<types1...>& filter1, const Filter<types2...>& filter2)
754 {
755 return Filter<OperatorAnd, Filter<types1...>, Filter<types2...>, VoidObserver> (filter1, filter2);
756 }
757
758
759
762 class OperatorOr;
763
769 template <
770 class FilterA,
771 class FilterB,
772 class templateObserverType
773 >
774 // cppcheck-suppress copyCtorAndEqOperator
775 class Filter <Belle2::OperatorOr, FilterA, FilterB, templateObserverType > {
777 const char* c_orSuffixA = "_or_A";
779 const char* c_orSuffixB = "_or_B";
780
781 public:
783 typedef typename FilterA::argumentType argumentType;
785 typedef typename FilterB::argumentType argumentTypeB;
787 typedef typename FilterA::functionType functionTypeA;
789 typedef typename FilterB::functionType functionTypeB;
791 typedef typename std::enable_if<all_same<functionTypeA, functionTypeB>::value, functionTypeA>::type functionType;
792
793
798 Filter(const FilterA& filterA, const FilterB& filterB):
799 m_filterA(filterA), m_filterB(filterB) { };
800
801
803 Filter() { };
804
805
813 template<typename ... argsType>
814 typename std::enable_if <all_same<argumentType, argumentTypeB, argsType ...>::value, bool>::type
815 accept(const argsType& ... args) const
816 {
817 templateObserverType::prepare(args ...);
818 bool returnValue = m_filterA.accept(args ...) || m_filterB.accept(args ...);
819 templateObserverType::collect(args ...);
820 return returnValue;
821 }
822
823
829 template<class otherObserver>
830 Filter<Belle2::OperatorOr, decltype(FilterA().observeLeaf(otherObserver())),
831 decltype(FilterB().observeLeaf(otherObserver())), otherObserver>
832 observe(const otherObserver&) const
833 {
834 // this will recursively loop over all "and" Filters and set the SAME observer
835 return Filter<Belle2::OperatorOr,
836 decltype(FilterA().observeLeaf(otherObserver())),
837 decltype(FilterB().observeLeaf(otherObserver())),
838 otherObserver>(m_filterA.observeLeaf(otherObserver()), m_filterB.observeLeaf(otherObserver()));
839 }
840
841
849 template<class otherObserver>
850 Filter<Belle2::OperatorOr, decltype(FilterA().observeLeaf(otherObserver())),
851 decltype(FilterB().observeLeaf(otherObserver())), VoidObserver>
852 observeLeaf(const otherObserver&) const
853 {
854 // This will recursively loop over all lower level Filters of the AND combination and set the SAME observer.
855 // For the top level filter the void observer is used.
856 return Filter<Belle2::OperatorOr,
857 decltype(FilterA().observeLeaf(otherObserver())),
858 decltype(FilterB().observeLeaf(otherObserver())),
859 VoidObserver>(m_filterA.observeLeaf(otherObserver()), m_filterB.observeLeaf(otherObserver()));
860 }
861
862
867 void persist(TTree* t, const std::string& branchName)
868 {
869 std::string nameOfFilterA(branchName);
870 nameOfFilterA += c_orSuffixA;
871 m_filterA.persist(t, nameOfFilterA);
872
873 std::string nameOfFilterB(branchName);
874 nameOfFilterB += c_orSuffixB;
875 m_filterB.persist(t, nameOfFilterB);
876 }
877
878
883 void setBranchAddress(TTree* t, const std::string& branchName)
884 {
885 std::string nameOfFilterA(branchName);
886 nameOfFilterA += c_orSuffixA;
887 m_filterA.setBranchAddress(t, nameOfFilterA);
888
889 std::string nameOfFilterB(branchName);
890 nameOfFilterB += c_orSuffixB;
891 m_filterB.setBranchAddress(t, nameOfFilterB);
892 }
893
894
900 std::string getNameAndReference(std::vector< std::pair<char, void*>>* pointers = nullptr)
901 {
902 return "(" + m_filterA.getNameAndReference(pointers) + " OR " + m_filterB.getNameAndReference(pointers) + ")";
903 }
904
905 private:
907 FilterA m_filterA;
909 FilterB m_filterB;
910 };
911
912
920 template <
921 typename ... types1,
922 typename ... types2
923 >
924 Filter<Belle2::OperatorOr, Belle2::Filter<types1...>, Belle2::Filter<types2...>, Belle2::VoidObserver>
925 operator ||(const Filter<types1...>& filter1, const Filter<types2...>& filter2)
926 {
927 return Filter<OperatorOr, Filter<types1...>, Filter<types2...>, VoidObserver> (filter1, filter2);
928 }
929
930
931
933
942 template<class booleanBinaryOperator,
943 typename ... types1,
944 typename ... types2,
945 class observer,
946 typename ... argsTypes>
947 bool initializeObservers(const Filter<booleanBinaryOperator, Belle2::Filter<types1...>,
948 Belle2::Filter<types2...>, observer>&,
949 argsTypes ... args)
950 {
951 return observer::initialize(args ...)
954 }
955
956
965 template<class booleanUnaryOperator,
966 typename ... types1,
967 class observer,
968 typename ... argsTypes>
969 bool initializeObservers(const Filter<booleanUnaryOperator, Belle2::Filter<types1...>, observer>&, argsTypes ... args)
970 {
971 return observer::initialize(args ...) && initializeObservers(Belle2::Filter<types1...>(), args...);
972 }
973
974
984 template<class Variable, class RangeType, class observer, typename ... argsTypes>
986 {
987 return observer::initialize(Variable(), filter.getRange(), args ...);
988 }
990}
void setBranchAddress(TTree *t, const std::string &branchName)
Set the Branches addresses to this filter.
Definition: Filter.h:711
FilterA::argumentType argumentType
Handy typedef for arguments type A.
Definition: Filter.h:611
FilterB::argumentType argumentTypeB
Handy typedef for arguments type B.
Definition: Filter.h:613
FilterB m_filterB
Member containing the filter B of the combination A AND B.
Definition: Filter.h:737
Filter< Belle2::OperatorAnd, decltype(FilterA().observeLeaf(otherObserver())), decltype(FilterB().observeLeaf(otherObserver())), VoidObserver > observeLeaf(const otherObserver &) const
will set the observer for the Leaves of this filter, this AND filter will not be observed.
Definition: Filter.h:680
std::enable_if< all_same< functionTypeA, functionTypeB >::value, functionTypeA >::type functionType
Handy typedef for combined function type.
Definition: Filter.h:619
void persist(TTree *t, const std::string &branchName)
Persist the filter on a TTree.
Definition: Filter.h:695
std::string getNameAndReference(std::vector< std::pair< char, void * > > *pointers=nullptr)
Getter for name of and reference to the range of the filters.
Definition: Filter.h:728
Filter< Belle2::OperatorAnd, decltype(FilterA().observeLeaf(otherObserver())), decltype(FilterB().observeLeaf(otherObserver())), otherObserver > observe(const otherObserver &) const
Will set the observer for this and both of the via the AND operation combined filters it contains.
Definition: Filter.h:661
Filter(const FilterA &filterA, const FilterB &filterB)
Constructor creating a filter representing the boolean AND combination of two filters.
Definition: Filter.h:626
FilterB::functionType functionTypeB
Handy typedef for function type B.
Definition: Filter.h:617
FilterA m_filterA
Member containing the filter A of the combination A AND B.
Definition: Filter.h:735
std::enable_if< all_same< argumentType, argumentTypeB, argsType... >::value, bool >::type accept(const argsType &... args) const
The accept method for the combination of two filters with the AND Operator: This will return the comb...
Definition: Filter.h:643
FilterA::functionType functionTypeA
Handy typedef for function type A.
Definition: Filter.h:615
void setBranchAddress(TTree *t, const std::string &branchName)
Set the Branches addresses to this filter.
Definition: Filter.h:563
someFilter m_filter
Member variable containing the filter.
Definition: Filter.h:572
void persist(TTree *t, const std::string &branchName)
Persist the filter on a TTree.
Definition: Filter.h:551
std::string getNameAndReference(std::vector< std::pair< char, void * > > *pointers=nullptr)
Getter for name of and reference to the range of the filters.
Definition: Filter.h:528
std::enable_if< all_same< argumentType, argsType... >::value, bool >::type accept(const argsType &... args) const
The accept method of the filter with NOT Operator: This will return the inverse of the result of the ...
Definition: Filter.h:517
Filter< Belle2::OperatorNot, decltype(someFilter().observeLeaf(otherObserver())), otherObserver > observeLeaf(const otherObserver &) const
Will set the observer for the combination of NOT operator + filter.
Definition: Filter.h:540
someFilter::argumentType argumentType
Handy typedef for arguments.
Definition: Filter.h:493
Filter(const someFilter &filter)
Constructor creating a NOT filter from a filter.
Definition: Filter.h:501
someFilter::functionType functionType
Handy typedef for function.
Definition: Filter.h:495
void setBranchAddress(TTree *t, const std::string &branchName)
Set the Branches addresses to this filter.
Definition: Filter.h:883
FilterA::argumentType argumentType
Handy typedef for arguments type A.
Definition: Filter.h:783
FilterB::argumentType argumentTypeB
Handy typedef for arguments type B.
Definition: Filter.h:785
FilterB m_filterB
Member containing the filter B of the combination A OR B.
Definition: Filter.h:909
std::enable_if< all_same< functionTypeA, functionTypeB >::value, functionTypeA >::type functionType
Handy typedef for the combined function type.
Definition: Filter.h:791
void persist(TTree *t, const std::string &branchName)
Persist the filter on a TTree.
Definition: Filter.h:867
Filter< Belle2::OperatorOr, decltype(FilterA().observeLeaf(otherObserver())), decltype(FilterB().observeLeaf(otherObserver())), otherObserver > observe(const otherObserver &) const
Will set the observer for this and both via the OR operator combined filters it contains,...
Definition: Filter.h:832
Filter< Belle2::OperatorOr, decltype(FilterA().observeLeaf(otherObserver())), decltype(FilterB().observeLeaf(otherObserver())), VoidObserver > observeLeaf(const otherObserver &) const
Will set the observer for both via the OR operation combined filters it contains, this filter itself ...
Definition: Filter.h:852
std::string getNameAndReference(std::vector< std::pair< char, void * > > *pointers=nullptr)
Getter for name of and reference to the range of the filters.
Definition: Filter.h:900
Filter(const FilterA &filterA, const FilterB &filterB)
Constructor creating a filter representing the boolean OR combination of two filters.
Definition: Filter.h:798
FilterB::functionType functionTypeB
Handy typedef for function type B.
Definition: Filter.h:789
FilterA m_filterA
Member containing the filter A of the combination A OR B.
Definition: Filter.h:907
std::enable_if< all_same< argumentType, argumentTypeB, argsType... >::value, bool >::type accept(const argsType &... args) const
The accept method for the combination of two filters with the OR Operator: This will return the combi...
Definition: Filter.h:815
FilterA::functionType functionTypeA
Handy typedef for function type A.
Definition: Filter.h:787
Variable::argumentType argumentType
Handy typedef for arguments.
Definition: Filter.h:416
Variable::functionType functionType
Handy typedef for function.
Definition: Filter.h:418
std::string getNameAndReference(std::vector< std::pair< char, void * > > *pointers=nullptr)
Getter for name of and reference to the range of the filters.
Definition: Filter.h:463
Filter(const RangeType &range, const bool &enable)
Constructor.
Definition: Filter.h:431
std::enable_if< all_same< argumentType, argsType... >::value, bool >::type accept(const argsType &... args) const
The accept method of the activatable filter: All the real computations are occuring in this method.
Definition: Filter.h:449
const bool * m_enable
Member pointer to boolean indicating if filters are active (true) or inactive (false).
Definition: Filter.h:471
Variable::argumentType argumentType
Handy typedef for arguments.
Definition: Filter.h:309
Variable::functionType functionType
Handy typedef for function.
Definition: Filter.h:311
std::string getNameAndReference(std::vector< std::pair< char, void * > > *pointers=nullptr)
Getter for name of and reference to the range of the filters.
Definition: Filter.h:356
const bool * m_bypass
Member pointer to boolean indicating if filters are bypassed (true) or thier actual result is returne...
Definition: Filter.h:364
std::enable_if< all_same< argumentType, argsType... >::value, bool >::type accept(const argsType &... args) const
The accept method of the bypassable filter: All the real computations are occuring in this method.
Definition: Filter.h:343
Filter(const RangeType &range, const bool &bypass)
Constructor.
Definition: Filter.h:324
void setBranchAddress(TTree *t, const std::string &branchName)
Set the Branches addresses to this filter.
Definition: Filter.h:171
Filter< Variable, RangeType, BypassableFilter, Observer > bypass(const bool &bypassVariable=false)
This method creates a new bypassable Filter with the same range of *this E.g.:
Definition: Filter.h:208
Variable::argumentType argumentType
Handy typedef for arguments.
Definition: Filter.h:116
void persist(TTree *t, const std::string &branchName)
Persist the range on a TTree.
Definition: Filter.h:161
Filter(const Filter< Variable, RangeType, otherObserver > &filter)
Copy constructor for filter.
Definition: Filter.h:243
Variable::functionType functionType
Handy typedef for function.
Definition: Filter.h:119
std::string getNameAndReference(std::vector< std::pair< char, void * > > *pointers=nullptr)
Getter for name of and reference to the range of the filters.
Definition: Filter.h:252
Filter< Variable, RangeType, otherObserver > observeLeaf(const otherObserver &) const
Function to observer of a filter.
Definition: Filter.h:232
std::enable_if< all_same< argumentType, argsType... >::value, bool >::type accept(const argsType &... args) const
The accept method of the filter: All the real computations are occuring in this method.
Definition: Filter.h:149
RangeType m_range
Member range of the filter.
Definition: Filter.h:259
RangeType getRange(void) const
Getter of the range.
Definition: Filter.h:136
Filter(const RangeType &range)
Constructor.
Definition: Filter.h:128
Filter< Variable, RangeType, ActivatableFilter, Observer > enable(const bool &enableVariable=true)
Create a new activatable filter.
Definition: Filter.h:220
This class is used to select pairs, triplets... of objects.
Definition: Filter.h:34
Observer base class which can be used to evaluate the VXDTF2's Filters.
Definition: Observer.h:19
static void notify(T, double, someRangeType, const someHitType &, const someHitType &)
exemplary draft for a notify-function of an observer
Definition: Observer.h:23
The most CPU efficient Observer for the VXDTF filter tools (even if useless).
Definition: VoidObserver.h:30
Filter< Belle2::OperatorOr, Belle2::Filter< types1... >, Belle2::Filter< types2... >, Belle2::VoidObserver > operator||(const Filter< types1... > &filter1, const Filter< types2... > &filter2)
Definition of the boolean OR operator || of the Filter class.
Definition: Filter.h:925
Filter< Belle2::OperatorAnd, Belle2::Filter< types1... >, Belle2::Filter< types2... >, Belle2::VoidObserver > operator&&(const Filter< types1... > &filter1, const Filter< types2... > &filter2)
Definition of the boolean AND operator && of the Filter class.
Definition: Filter.h:753
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double > > &runs, double cut, std::map< ExpRun, std::pair< double, double > > &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:38
Filter< OperatorNot, Filter< types... >, VoidObserver > operator!(const Filter< types... > &filter)
Definition of the NOT operator ! for the Filter class.
Definition: Filter.h:583
bool initializeObservers(const Filter< booleanBinaryOperator, Belle2::Filter< types1... >, Belle2::Filter< types2... >, observer > &, argsTypes ... args)
Observer Stuff ///.
Definition: Filter.h:947
Abstract base class for different kinds of events.
The all_same struct is meant to check that all the types in a template pack are of the same type.
Definition: Filter.h:46