Writing a Thread-Friendly EDAnalyzer for Analysis

Complete: 3

Contacts

Thread Safety Requirements

Modules which are thread-friendly can only call code which either

  • never reads or writes to memory data that can be written to by another module on another thread or
  • reads or writes to memory which was properly protected from multi-threads.

This primarily reduces to not calling code which uses non-const globals or statics. The biggest worry is using classes from ROOT since behind the scene ROOT often uses globals. The following items are safe to call from an EDAnalyzer.

  • Using a TFile, TTree and TBranch
  • Using a histogram
    • except calling Fit(const char*, ...) is not safe. Instead pass a TF1 as the first argument.
  • Using TMVA reader (writing is not guaranteed to be safe)
The following items are known to be unsafe
  • TFormula::SetName
  • TH1::Fit(const char*, ...)

Legacy EDAnalyzer

Thread-friendly EDAnalyzer

Using TFileService

Review status

Reviewer/Editor and Date Comments
Last reviewed by: ChrisDJones - 13-Nov-2012 Created the page

Responsible: ChrisDJones
Last reviewed by:

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2015-05-27 - ChrisDJones
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback