A++ » INC » AtlHistFactorySystematic

class AtlHistFactorySystematic: public TNamed


 Class with information on systematics

 This class holds all information for a systematic, i.e. the
 pointer to the nominal and the systematic histograms. In order to
 keep the class structure simple and efficient, the
 class only stores information for _one_ process at a time.

 Please use the ChangeProcess("processname") function to change processes.

 There are two operation modes:
 - This class can be used with a MCPlotter file to extract the histograms
 and save them in a template file.
 - The template file should then be used to perform shape tests, extract
 rate uncertainties, etc.

 The derived class need to implement the functions:
 - Initialize:
   Function for reading MCPlotter files and extracting a list of
   histograms that are needed for ComputeUpDownVariation().
   (The histograms can then be accessed for each process by calling
    ChangeProcess() )

 - GetHistsFromFile:
   Read systematic templates from template file for a given process.

 - ComputeUpDownVariation:
   Function for computing the up and down variation for this systematic
   given the histograms from any MCPlotter file.


 If this class is used with MCPlotter files:

 To prevent open and closing of files, the user should get all infos
 for all processes, before going to the next systematic.
 - see AtlHistFactoryTask as example



 Author: Soeren Stamm <mailto: stamm@physik.hu-berlin.de>
 Update: $Id: AtlHistFactorySystematic.cxx,v 1.9 2016/04/19 07:46:17 stamm Exp $
 Copyright: 2015 (C) Soeren Stamm

Function Members (Methods)

 
    This is an abstract class, constructors will not be documented.
    Look at the header to check for available constructors.

public:
virtual~AtlHistFactorySystematic()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
AtlHistFactorySystematic()
AtlHistFactorySystematic(const AtlHistFactorySystematic&)
AtlHistFactorySystematic(const char* systname, const char* systtitle, Bool_t useShape)
virtual voidTObject::Browse(TBrowser* b)
voidChangeProcess(const char* process)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidExportShapePlots(const char* process, const char* dir)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TH1F*GetChi2Distribution()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
TH1*GetHistDown() const
TH1*GetHistNominal() const
TH1*GetHistUp() const
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
voidGetRateUnc(Double_t& rate_up, Double_t& rate_down)
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Bool_tGetUseFullStats() const
Bool_tGetUseShape() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidInitialize(const char* BaseDir, const char* scheme)
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tIsNominal() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
AtlHistFactorySystematic&operator=(const AtlHistFactorySystematic&)
virtual voidTObject::Paint(Option_t* option = "")
voidPerformShapeTest(Double_t& pval_up, Double_t& kstest_min)
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual voidSaveShapeCtrlPlots(TFile* fout, const char* process)
virtual voidSaveTemplates(TFile* fout)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetChi2Distribution(TH1F* h_chi2)
voidSetDiscriminant(const char* discriminant)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetHistDown(TH1* h)
voidSetHistNominal(TH1* h)
voidSetHistUp(TH1* h)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetTemplateFile(TFile* f)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetUseFullStats(Bool_t flag = kTRUE)
voidSetUsePseudoExp(Bool_t flag = kTRUE)
voidSetUseShape(Bool_t useShape = kTRUE)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidComputeChi2Distribution()
virtual voidComputeUpDownVariation(const char* process)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual voidGetHistsFromFile(const char* process)
voidTObject::MakeZombie()

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
TString*fDiscriminantFull path to the discriminant histogram
TGraph*fGraphShapeQQPlotQ-Q plots of normalized residuals
TH1F*fHistChi2Chi2 Distribution for shape tests
TH1*fHistDownHistogram for down-variation (1-sigma)
TH1*fHistNomNominal histogram
TH1*fHistShapeResidualChi2 normalized residuals
TH1*fHistUpHistogram for up-variation (1-sigma)
Bool_tfIsNominalIs this nominal?
Int_tfNPseudoExpNumber of pseudo exp. for shape tests
TStringTNamed::fNameobject identifier
Double_tfPValue_downp-value from Chi2 test (down-syst.)
Double_tfPValue_upp-value from Chi2 test (up-syst.)
TFile*fTemplateFileFile holding all templates
TStringTNamed::fTitleobject title
Bool_tfUseFullStatsUse full staistics for shape comparison?
Bool_tfUsePseudoExpUse pseudo exp. for shape tests?
Bool_tfUseShapeUse shape information?

Class Charts

Inheritance Chart:
TObject
TNamed
AtlHistFactorySystematic
AtlHistFactorySystEnvelope
AtlHistFactorySystNominal
AtlHistFactorySystOneSided
AtlHistFactorySystPair
AtlHistFactorySystModelPair
AtlHistFactorySystPdf

Function documentation

AtlHistFactorySystematic()
 Default constructor

AtlHistFactorySystematic(const char* systname, const char* systtitle, Bool_t useShape)
 Default constructor

~AtlHistFactorySystematic()
 Default destructor

void PerformShapeTest(Double_t& pval_up, Double_t& kstest_min)
 Perform shape test, returns p-value for up and down variations.

 If a systematic does not have a up/down histogram for shape
 comparisons this function can be overloaded for this particular
 systematic.

 Method only works with a shape template file
void SetDiscriminant(const char* discriminant)
 Setter function for the histogram name and it's directory
 within the MCPlotter file.

void GetRateUnc(Double_t& rate_up, Double_t& rate_down)
 Return the relative rate uncertainties

   rate_up   = (up - nom)/nom;
   rate_down = (nom - down)/nom;

   up/down/nom = Number of Events (up/down/nom)

void ChangeProcess(const char* process)
 Change the process and load the corresponding informations
 into the class data members.

void SaveTemplates(TFile* fout)
 Save the templates of the up/down variations in the
 output file.

 Systematics that do not produce a up and down varied histogram
 can overwrite this function, e.g. for the nominal case.

void SaveShapeCtrlPlots(TFile* fout, const char* process)
 Save the residual and Q-Q ctrl plots for this systematic
 in given output file

 Systematics that do not produce a up and down varied histogram
 can overwrite this function

 Write() will save it to the current directory
 therefore change the current directory
void ComputeChi2Distribution()
 Compute the chi square distribution for the reference
 histogram using pseudo experiments and assuming gaussian
 errors in each bin.

 The resulting chi2 distribution can be used to compute p-values
 without assuming a chi square distribution.

TH1F* GetChi2Distribution()
 Return the chi2 distribution (compute dist. if necessary)

void ExportShapePlots(const char* process, const char* dir)
 Export shape plots to pdf for given process in directory 'dir'

 set batch mode to suppress canvas
AtlHistFactorySystematic()
void Initialize(const char* BaseDir, const char* scheme)
TH1* GetHistUp() const
{ return fHistUp; }
TH1* GetHistDown() const
{ return fHistDown; }
TH1* GetHistNominal() const
{ return fHistNom; }
Bool_t GetUseShape() const
{ return fUseShape; }
Bool_t GetUseFullStats() const
{ return fUseFullStats; }
Bool_t IsNominal() const
{ return fIsNominal; }
void SetChi2Distribution(TH1F* h_chi2)
{ fHistChi2 = h_chi2; }
void SetHistNominal(TH1* h)
{ fHistNom = h; }
void SetHistUp(TH1* h)
{ fHistUp = h; }
void SetHistDown(TH1* h)
{ fHistDown = h; }
void SetTemplateFile(TFile* f)
{ fTemplateFile = f; }
void SetUseFullStats(Bool_t flag = kTRUE)
{ fUseFullStats = flag; }
void SetUsePseudoExp(Bool_t flag = kTRUE)
{ fUsePseudoExp = flag; }
void SetUseShape(Bool_t useShape = kTRUE)
{ fUseShape = useShape; }
void GetHistsFromFile(const char* process)
void ComputeUpDownVariation(const char* process)