A++ » INC » AtlObjRecoScaleFactorTool

class AtlObjRecoScaleFactorTool: public AtlAnalysisTool



Object Reconstruction Scale Factor Tool

used for electrons, muons and jets

This tool changes the current event weight in MC events to correct for differences in the reconstruction of leptons and jets betwen DATA and MC.

The scale factors are valid for ttbar and single-top analyses. An overview of all corrections can be found at the TopCommonScales. The different scale factors can be enabled/disabled by setting the public data member fOperationMode (default=kAllSF). All systematics are included (see below) and can simply be applied by setting fSystematicMode to the corresponding systematic. (default is nominal, see also AtlTopLevelAnalysis for available systematics).

Lepton Reconstruction:

The signal lepton (either electron or muon) of each event must be set via SetLepton(). Note that at present there is no thorough treatment of di-lepton events. If you use this tool for such kind of events, you should use the lepton with the highest transverse momentum.

Jet B-Tagging:

The list of all jets for each event after all acceptance cuts (tagged and un-tagged) must be set via SetJets().
Note that the B-tag calibration is valid only in certain eta and Pt ranges. For details see GetBtagSF().

Usage:

  1. Create the tool in the usual way, add it to your analysis selector and configure the tool.
     ...
     AtlObjRecScaleFactorTool *reco_tool = new AtlObjRecoScaleFactorTool("tool_recoscale", "Object Reconstruction Scale Factor Tool");
     my_apptask->AddTool(reco_tool);
     my_apptask->SetToolVariable("tool_recoscale", "fSystematicMode", "AtlTopLevelAnalysis::kNominal");
     ...
     
  2. Configure the rest of the tool settings inside your analysis. Eg.
    In MyAnalysis::BookHistograms():
     ...
     fRecoSFTool = (AtlObjRecoScaleFactorTool*)GetTool("AtlObjRecoScaleFactorTool", "tool_recoscale");
     ...
     
  3. The tool will change set the weights 'fPreTagEvtWeight' and 'fTagEvtWeight' in the current event. ... >

 Author: Oliver Maria Kind <mailto: kind@mail.desy.de>
 Update: $Id: AtlObjRecoScaleFactorTool.cxx,v 1.37 2017/10/26 08:43:05 mergelm Exp $
 Copyright: 2011 (C) Oliver Maria Kind

Function Members (Methods)

public:
virtual~AtlObjRecoScaleFactorTool()
voidTObject::AbstractMethod(const char* method) const
virtual Bool_tAnalyzeEvent()
virtual voidTObject::AppendPad(Option_t* option = "")
AtlObjRecoScaleFactorTool(const AtlObjRecoScaleFactorTool&)
AtlObjRecoScaleFactorTool(const char* name, const char* title)
virtual voidBookHistograms()
virtual voidTObject::Browse(TBrowser* b)
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 voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual voidFillHistograms()
virtual voidAtlAnalysisTool::FillHistogramsNoEvtSel()
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Double_tGetBtagSF()
static const char*GetBTagWPName(AtlObjRecoScaleFactorTool::EBTagWP wp)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Double_tGetElectronSF() const
virtual const char*TObject::GetIconName() const
Double_tGetJetVertexSF() const
Double_tGetLeptonSF() const
Double_tGetMuonSF() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
TString*GetOperationName() const
virtual Option_t*TObject::GetOption() const
const char*AtlAnalysisTool::GetOutputDir() const
Float_tAtlAnalysisTool::GetPreTagEvtWeight() const
static const char*AtlAnalysisTool::GetProcessModeName(AtlAnalysisTool::EProcessMode mode)
Float_tAtlAnalysisTool::GetTagEvtWeight() const
virtual const char*TNamed::GetTitle() const
AtlAnalysisTool*AtlAnalysisTool::GetTool(const char* ClassName, const char* ToolName = "", Bool_t force = kFALSE) const
virtual UInt_tTObject::GetUniqueID() 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 voidAtlAnalysisTool::Init()
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_tAtlAnalysisTool::IsIndividual() const
Bool_tAtlAnalysisTool::IsMainAnalysis() const
Bool_tAtlAnalysisTool::IsObjectsDefinition() const
Bool_tAtlAnalysisTool::IsOff() const
Bool_tTObject::IsOnHeap() const
Bool_tAtlAnalysisTool::IsPostAnalysis() const
Bool_tAtlAnalysisTool::IsPreAnalysis() const
Bool_tAtlAnalysisTool::IsScaleFactor() const
virtual Bool_tTNamed::IsSortable() const
Bool_tAtlAnalysisTool::IsSystematics() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tAtlAnalysisTool::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)
AtlObjRecoScaleFactorTool&operator=(const AtlObjRecoScaleFactorTool&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint() const
Bool_tAtlAnalysisTool::Process()
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 = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidSetBranchStatus()
virtual voidAtlAnalysisTool::SetCutDefaults()
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidAtlAnalysisTool::SetEvent(AtlEvent* evt)
voidSetJets(TList* jets)
voidSetLeptons(TList* leptons)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
voidSetObjDefinitionTool(AtlObjectsToolD3PDSgTop* tool)
static voidTObject::SetObjectStat(Bool_t stat)
voidAtlAnalysisTool::SetOutputDir(const char* dir)
voidAtlAnalysisTool::SetOutputFile(TFile* f)
voidAtlAnalysisTool::SetParent(AtlSelector* parent)
virtual voidTNamed::SetTitle(const char* title = "")MENU
voidAtlAnalysisTool::SetTree(TTree* t)
virtual voidTObject::SetUniqueID(UInt_t uid)
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
virtual voidTerminate()
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 voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
AtlObjRecoScaleFactorTool::EBTagWPfBTagWPBTagging WP
doublefNjetSystDeltaNjet systematic: variation per jet bin
intfNjetSystModewhether Njet systematic is applied (1) or not (-1)
longfNjetSystNumberNjet systematic: number of jets
boolfNjetSystRestTermNjet systematic: use as last term
UInt_tfOperationModeOperation mode (default = all SFs)
TStringAtlAnalysisTool::fOutputDirDirectory in root output file, where histogram dir is created
AtlAnalysisTool::EProcessModeAtlAnalysisTool::fProcessModeDefines when exactly the tool is run (see AtlAnalysisTool class description for details)
AtlTopLevelAnalysis::ESystematicfSystematicModeSystematic mode (default = nominal)
Bool_tfUseCDISwitch for using CDI
Int_tAtlAnalysisTool::fVerbosityLevelIndicates the degree of verbosity of tool (0 = no info/debug output, 1 = info, 2 = info+debug)
const char*fXsecFileXsection file: contains shower info for MC/MC SF
static AtlObjRecoScaleFactorTool::EOperationkAllSF
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kIndividual
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static AtlObjRecoScaleFactorTool::EOperationkJetBtagSF
static AtlObjRecoScaleFactorTool::EOperationkJetVertexSF
static AtlObjRecoScaleFactorTool::EOperationkLeptonSF
static AtlObjRecoScaleFactorTool::EBTagWPkMV1_60
static AtlObjRecoScaleFactorTool::EBTagWPkMV1_70
static AtlObjRecoScaleFactorTool::EBTagWPkMV1_80
static AtlObjRecoScaleFactorTool::EBTagWPkMV1_85
static AtlObjRecoScaleFactorTool::EBTagWPkMV1c_50
static AtlObjRecoScaleFactorTool::EBTagWPkMV1c_80
static AtlObjRecoScaleFactorTool::EBTagWPkMV2c10_70
static AtlObjRecoScaleFactorTool::EBTagWPkMV2c10_77
static AtlObjRecoScaleFactorTool::EBTagWPkMV2c10_85
static AtlObjRecoScaleFactorTool::EBTagWPkMV2c20_77
static AtlObjRecoScaleFactorTool::EBTagWPkMV2c20_85
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kMainAnalysis
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static AtlObjRecoScaleFactorTool::EOperationkNoSF
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kObjectsDefinition
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kOff
static TObject::(anonymous)TObject::kOverwrite
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kPostAnalysis
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kPreAnalysis
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kScaleFactor
static TObject::(anonymous)TObject::kSingleKey
static AtlAnalysisTool::EProcessModeAtlAnalysisTool::kSystematics
static AtlObjRecoScaleFactorTool::EBTagWPkUndefined
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
AtlEvent*AtlAnalysisTool::fEventPointer to current event
TStringTNamed::fNameobject identifier
TString*AtlAnalysisTool::fOptionOption string
TFile*AtlAnalysisTool::fOutputFileOutput file
AtlSelector*AtlAnalysisTool::fParentPointer to parent selector
TStringTNamed::fTitleobject title
TTree*AtlAnalysisTool::fTreeEvent tree
private:
Analysis::CalibrationDataInterfaceROOT*CDIToolInterface for B-tagging SF (CDI)
Analysis::UncertaintyCDIUncertaintyContainer for B-Tagging uncertainty result (CDI)
Analysis::CalibrationDataVariablesCDIVarsContainer for B-tagging variables (CDI)
unsigned intCDIindex_Eff[4]Array for eff scale factors (b-tagging, CDI)
unsigned intCDIindex_SF[4]Array for scale factors (b-tagging, CDI)
Float_tfBTagWeight_minmin B-tag weight cut
AtlBTag::ETaggerfBTaggerB-tagger used
Bool_tfInitCDIflag for initializing CDI
TList*fJetsList of jets (after acceptance cuts)
TList*fLeptonsSignal leptons
AtlObjectsToolD3PDSgTop*fObjDefinitionToolPointer to objects definition (b-tag info)
unsigned intmapIndexMap for MC/MC eff. scale factors
inttauExtrapFromCharmCDI parameter
stringworkingPointWorking point of b-tagger

Class Charts

Inheritance Chart:
TObject
TNamed
AtlAnalysisTool
AtlObjRecoScaleFactorTool

Function documentation

AtlObjRecoScaleFactorTool(const char* name, const char* title)
 Default constructor

~AtlObjRecoScaleFactorTool()
 Default destructor

void Clear(Option_t* option = "")
 Clear this tool at the beginning of each event

TString* GetOperationName() const
 Get human-readable name of operation modes

void SetBranchStatus()
 Turn on all needed branches

void BookHistograms()
 Book Histograms

 Get ObjectSelection Tool + pointers to analysis objects

void FillHistograms()
 Fill Histograms

void Print() const
 Print tool information

Bool_t AnalyzeEvent()
 Calculate the scale factor for an event

Double_t GetLeptonSF() const
 Get lepton scale factor (e or mu)

Double_t GetElectronSF() const
 Get electron scale factor

Double_t GetMuonSF() const
 Get muon scale factor

Double_t GetBtagSF()
 Get B-tagging scale factor

 The supported |eta| range is [0,2.5]. If a jet is outside those
 ranges its weight is set to 1 and does not contribute to the
 event-wide scale factor.

 The same holds for jets with "unknown" flavour (ie not b,c or
 light-flavour). Tau-jets are of this type. Their weight is set
 to 1 also and does not contribute.

 The event weight is computed as the product of all jet weights
 for the jets under consideration (after pT and acceptance cuts).

 When evaluating uncertainties, the uncertainties for all b- and
 c- jets is shifted together, but independently for all light
 jets. Further, the efficiency and the inefficiency scale factor
 uncertainties are anti-correlated: when one is shifted upwards,
 the other will be shifted downwards and vice-versa.


Double_t GetBtagSF_MV1_60(AtlJet* jet) const
 Get BTag MV1 @ 60%

Double_t GetBtagSF_MV1_70(AtlJet* jet) const
 Get BTag MV1 @ 70%

Double_t GetBtagSF_MV1_80(AtlJet* jet) const
 Get BTag MV1 @ 80%

Double_t GetBtagSF_MV1c_50(AtlJet* jet) const
 Get BTag MV1 @ 80%

void Terminate()
 Executed at the end of the tool

Double_t ComputeBtagSF(AtlJet* jet)
 Compute b-tagging scale factors using the
 evil CDI

const char* GetBTagWPName(AtlObjRecoScaleFactorTool::EBTagWP wp)
 Get human-readable name of the b-tag working point

Double_t GetJetVertexSF() const
 Get JVF scale factor

AtlObjRecoScaleFactorTool(const char* name, const char* title)
void SetLeptons(TList* leptons)
 Set signal leptons for which the scale factor is obtained
 (must be one lepton, either electron or muon)

void SetJets(TList* jets)
 Set list of all jets (after all acceptance cuts) for which
 scale factors are obtained.

void SetObjDefinitionTool(AtlObjectsToolD3PDSgTop* tool)
 Set object defintion tool for inter-tool communication