In file included from input_line_36:1: /home/scheirich/Documents/1.2_ANALYSIS/mwe.C:16:21: error: qualified reference to 'TH1D' is a constructor name rather than a type in this context std::vector histos; //pointer to histograms ^ /home/scheirich/Documents/1.2_ANALYSIS/mwe.C:16:28: error: no matching constructor for initialization of 'std::vector' std::vector histos; //pointer to histograms ^ /usr/include/c++/7/bits/stl_vector.h:411:2: note: candidate constructor template not viable: requires at least 2 arguments, but 0 were provided vector(_InputIterator __first, _InputIterator __last, ^ /usr/include/c++/7/bits/stl_vector.h:270:7: note: candidate constructor not viable: requires single argument '__a', but no arguments were provided vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT ^ /usr/include/c++/7/bits/stl_vector.h:326:7: note: candidate constructor not viable: requires single argument '__x', but no arguments were provided vector(const vector& __x) ^ /usr/include/c++/7/bits/stl_vector.h:344:7: note: candidate constructor not viable: requires single argument '__x', but no arguments were provided vector(vector&& __x) noexcept ^ /usr/include/c++/7/bits/stl_vector.h:283:7: note: candidate constructor not viable: requires at least argument '__n', but no arguments were provided vector(size_type __n, const allocator_type& __a = allocator_type()) ^ /usr/include/c++/7/bits/stl_vector.h:348:7: note: candidate constructor not viable: requires 2 arguments, but 0 were provided vector(const vector& __x, const allocator_type& __a) ^ /usr/include/c++/7/bits/stl_vector.h:358:7: note: candidate constructor not viable: requires 2 arguments, but 0 were provided vector(vector&& __rv, const allocator_type& __m) ^ /usr/include/c++/7/bits/stl_vector.h:383:7: note: candidate constructor not viable: requires at least argument '__l', but no arguments were provided vector(initializer_list __l, ^ /usr/include/c++/7/bits/stl_vector.h:295:7: note: candidate constructor not viable: requires at least 2 arguments, but 0 were provided vector(size_type __n, const value_type& __value, ^ In file included from input_line_36:1: /home/scheirich/Documents/1.2_ANALYSIS/mwe.C:19:5: error: use of undeclared identifier 'histo' histo.push_back(static_cast(name)) ^ /home/scheirich/Documents/1.2_ANALYSIS/mwe.C:19:21: error: cannot cast from type 'const std::__cxx11::basic_string' to pointer type 'TH1D *' histo.push_back(static_cast(name)) ^~~~~~~~~~~~~~~~~~~~~~~~