Skip to content

Draft: ZDCPulseAnalyzer can pass the checker

ZDCPulseAnalyzer can pass the checker, this is basically item 3 on @wlampl list in [ATLASRECTS-7759]

The "annotations" are just for the compiler. They do not affect run-time

  1. ZdcAnalysis/ZDCFitWrapper.h This was actually perfectly MT safe. I think marking as not is prb over-reaction. These are simple/nice "functors"

  2. Most of the rest follow from 1

  3. The one that is tricky is the static , this I tried thread_local

@ssnyder

Does this look fine to you

namespace {

//  per thread cache
struct Cache {
  std::string fitOptions{};
  bool quietFits = true;
  bool saveFitFunc = false;
  TH1* undelayedFitHist = nullptr;
  TH1* delayedFitHist = nullptr;
  TF1* combinedFitFunc = nullptr;
  float combinedFitTMax = 1000;
  float combinedFitTMin = -0.5;
  std::vector<float> pullValues{};
};

Cache& getTLSCache() {
  thread_local Cache cache = Cache();
  return cache;
}

}  // namespace

The issue is that these are to be used by Minuit aka are used by a function internally that is passed to setFCN .... Options etc are set and then Minuit is called.

Prb would not hurt having code that pass the compile time checks long term. Run-time is another story and not affected by these annotations.

ping @steinber

Edited by Christos Anastopoulos

Merge request reports