1515// / functions and methods defined in HistogramRegistry.h and HisgtogramRegistry.cxx
1616// / \author Rahul Verma (rahul.verma@cern.ch, rahul.verma@iitb.ac.in)
1717
18- #ifndef FRAMEWORK_TLISTHANDLER_H_
19- #define FRAMEWORK_TLISTHANDLER_H_
18+ #ifndef COMMON_TOOLS_TLISTHANDLER_H_
19+ #define COMMON_TOOLS_TLISTHANDLER_H_
2020
2121#include " Framework/AnalysisTask.h"
2222#include " Framework/HistogramSpec.h"
@@ -42,22 +42,22 @@ class TListHandler
4242 struct HistName {
4343 // ctor for histogram names that are already hashed at compile time via HIST("myHistName")
4444 template <char ... chars>
45- constexpr HistName (const ConstStr<chars...>& hashedHistName);
45+ explicit constexpr HistName (const ConstStr<chars...>& hashedHistName);
4646 char const * const str{};
4747 const uint32_t hash{};
4848 const uint32_t idx{};
4949
5050 protected:
5151 friend class TListHandler ;
5252 // ctor that does the hashing at runtime (for internal use only)
53- constexpr HistName (char const * const name);
53+ explicit constexpr HistName (char const * const name);
5454 };
5555
5656 public:
5757 TList* rootList;
5858 bool makeNestedList;
5959 TListHandler () : rootList(nullptr ) {} // Default constructor
60- TListHandler (TList* list) : rootList(list) {} // Constructor accepting a TList*
60+ explicit TListHandler (TList* list) : rootList(list) {} // Constructor accepting a TList*
6161
6262 // operator() overload to assign a new list
6363 void operator ()(TList* list, bool makeNestedListFlag)
@@ -378,10 +378,10 @@ void TListHandler::insertInNestedTList(const std::string& name, const HistPtr hi
378378 TString dirPathT (dirPath.c_str ());
379379 TObjArray* folders = dirPathT.Tokenize (' /' );
380380 for (int i = 0 ; i < folders->GetEntries (); ++i) {
381- TString subdir = (( TObjString*) folders->At (i))->GetString ();
381+ TString subdir = reinterpret_cast < TObjString*>( folders->At (i))->GetString ();
382382 TObject* existingObj = parentList->FindObject (subdir);
383383 if (existingObj && existingObj->InheritsFrom (TList::Class ())) {
384- subList = ( TList*) existingObj;
384+ subList = reinterpret_cast < TList*>( existingObj) ;
385385 } else {
386386 subList = new TList ();
387387 subList->SetName (subdir);
@@ -393,7 +393,7 @@ void TListHandler::insertInNestedTList(const std::string& name, const HistPtr hi
393393 }
394394
395395 TNamed* rawPtrToObj = nullptr ;
396- std::visit ([&](const auto & sharedPtr) { rawPtrToObj = ( TNamed*) sharedPtr.get (); }, tObj);
396+ std::visit ([&](const auto & sharedPtr) { rawPtrToObj = reinterpret_cast < TNamed*>( sharedPtr.get () ); }, tObj);
397397 rawPtrToObj->SetName (histName.c_str ());
398398 }
399399
@@ -520,7 +520,7 @@ const TList* getRootSubList(TList* rootList, std::string dirPath)
520520 TString dirPathT (dirPath.c_str ());
521521 TObjArray* folders = dirPathT.Tokenize (' /' );
522522 for (int i = 0 ; i < folders->GetEntries (); ++i) {
523- TString subdir = (( TObjString*) folders->At (i))->GetString ();
523+ TString subdir = reinterpret_cast < TObjString*>( folders->At (i))->GetString ();
524524 TObject* existingObj = parentList->FindObject (subdir);
525525 if (existingObj && existingObj->InheritsFrom (TList::Class ())) {
526526 parentList = static_cast <const TList*>(existingObj);
@@ -579,7 +579,7 @@ void TListHandler::addClone(const std::string& source, const std::string& target
579579 if (!sharedPtr.get ()) {
580580 return ;
581581 }
582- std::string sourceName{(( TNamed*) sharedPtr.get ())->GetName ()};
582+ std::string sourceName{reinterpret_cast < TNamed*>( sharedPtr.get ())->GetName ()};
583583 // search for histograms starting with source_ substring
584584 if (sourceName.rfind (source, 0 ) == 0 ) {
585585 // when cloning groups of histograms source_ and target_ must end with "/"
@@ -618,7 +618,7 @@ double TListHandler::getSize(double fillFraction)
618618{
619619 double size{};
620620 for (auto j = 0u ; j < kMaxTListSize ; ++j) {
621- std::visit ([&fillFraction, &size](auto && hist) { if (hist) { size += HistFiller::getSize (hist, fillFraction);} }, mTListValue [j]);
621+ std::visit ([&fillFraction, &size](auto && hist) { if (hist) { size += HistFiller::getSize (hist, fillFraction);} }, mTListValue [j]);
622622 }
623623 return size;
624624}
@@ -787,4 +787,4 @@ template std::shared_ptr<StepTHn> TListHandler::add<StepTHn>(char const* const n
787787// --------------------------------------------------------------------------------------------------
788788// --------------------------------------------------------------------------------------------------
789789
790- #endif // FRAMEWORK_TLISTHANDLER_H_
790+ #endif // COMMON_TOOLS_TLISTHANDLER_H_
0 commit comments