Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllBase.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllBase.cc
1 #include "Fun4AllBase.h"
2 
3 #include <phool/phool.h>
4 
5 #include <cstdlib>
6 #include <iostream>
7 #include <string>
8 
10  : m_ThisName(name)
11 {
12  if (name.empty())
13  {
14  std::cout << "Fun4AllBase::Fun4AllBase: No empty strings as Object Name" << std::endl;
15  std::cout << "You likely create a module with an empty name in your macro" << std::endl;
16  std::cout << "Since it does not have a name I cannot tell you what it is, but this message is from its ctor, so it happens when you do a new XXX() in your macro" << std::endl;
17  exit(1);
18  }
19  std::string validChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";
20  std::string badChars;
21  for (char ch : name)
22  {
23  // Check if the character is not in the validChars string
24  if (validChars.find(ch) == std::string::npos)
25  {
26  // Character is invalid, print it
27  badChars += std::string("\"") + ch + std::string("\" ");
28  }
29  }
30  if (!badChars.empty())
31  {
32  std::cout << PHWHERE << " Bad characters in modulename: " << badChars << std::endl;
33  std::cout << "Change them to valid characters from this list: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-" << std::endl;
34  exit(1);
35  }
36  return;
37 }
38 
40 {
42  {
43  std::cout << "Deleting " << m_ThisName << std::endl;
44  }
45  return;
46 }
47 
48 void Fun4AllBase::Print(const std::string& /*what*/) const
49 {
50  std::cout << Name() << " did not implement Print method" << std::endl;
51  return;
52 }