diff --git a/StRoot/StFwdUtils/StFwdAnalysisMaker.h b/StRoot/StFwdUtils/StFwdAnalysisMaker.h index cf7cdfe9244..362a9564277 100644 --- a/StRoot/StFwdUtils/StFwdAnalysisMaker.h +++ b/StRoot/StFwdUtils/StFwdAnalysisMaker.h @@ -25,16 +25,41 @@ class StFwdAnalysisMaker : public StMaker protected: + /** + * @brief Map of + * + */ std::map mHists; + + /** + * @brief Add a histogram to the map + * + * Convenience method to avoid duplicate typing name / possible mismatch + * @param h1 TH1* histogram object + * @return TH1* return the same object for ease of use + */ TH1 * addHist( TH1 * h1){ mHists[h1->GetName()] = h1; + return h1; } + + /** + * @brief Get the Hist object from the map + * - Additional check and safety for missing histograms + * @param n Histogram name + * @return TH1* histogram if found, otherwise a 'nil' histogram with one bin + */ TH1* getHist( TString n ){ if (mHists.count(n)) return mHists[n]; LOG_ERROR << "Attempting to access non-existing histogram" << endm; return new TH1F( "NULL", "NULL", 1, 0, 1 ); // returning nullptr can lead to seg fault, this fails softly } + + /** + * @brief Control whether the analysis uses StEvent (default) or MuDst as input + * + */ bool mAnalyzeMuDst = false; ClassDef(StFwdAnalysisMaker, 0);