Basic selector for analysis of ATLAS data Inherit from this class in order to write your own specific analysis selector. See the description of the AtlExampleAnalysis class for an example Main schema: The idea is to have different user analyses by means of inheritance: AtlSelector | | +-------------------+--------------------+--------------+ | | | | V V V V UserAnalaysis_1 UserAnalysis_2 UserAnalysis_3 ... The selector is mainly used for filling histograms during event processing. In addition, it is possible to create and fill an output A++ tree (see SetOutputTree()). This option is being used for the conversion of D3PDs into A++ files, for instance. The output tree as well as the histograms are filled only in case the ProcessCut() member function returns kTRUE for the event in question. This function can be optionally given by the user (see the example above how to do this). The default is to accept every event. The general picture of the data-flow looks like the following: +-------------+ | | +-----------------+ | A++ +----+ +---->| User Histograms | | .root files | | | +-----------------+ +-------------+ | +-------------+ | +----->| | | +-----------------+ OR | AtlSelector +----+---->| Ctrl Histograms | +----->| | | +-----------------+ +-------------+ | +-------------+ | | | | | +-----------------+ | DPD Ntuples +----+ +---->| A++ Tree | | | +-----------------+ +-------------+ Information about the processing status (no. of precessed events etc) is continuously printed to std output for non-batch jobs testet by gROOT->IsBatch() Processing and event selection: Flow-chart of user-defined functions +-------------------+ | SetBranchStatus() | +--------+----------+ | V +-------------------+ | BookHistograms() | +--------+----------+ | +------------------------------+ V | | +-------------------+ V +------------------+ false | | Event Loop +--------+ ObjSelectionTool +------>| +--------+----------+ +---+--------------+ | | V | | +------------------+ false | | | ProcessPreCut() +------>| | +---+--------------+ | | | | | +-----------------+ false | | | ProcessCut() +------->| | +---+-------------+ | | | | | true? | +-----------------++ | +----+ FillHistograms() | | +------------------+ V +-------------------+ | Terminate() | +-------------------+ Analysis tools: There exist a couple of tools (decay finders, ctrl plots, b-tagging, trigger etc.) which can be plugged into the analysis at different positions. See the class AtlAnalysisTool for details. ObjSelection Tool: The AtlObjSelectionTool selects the analysis objects (leptons, jets, b-jets) and performs cuts. The cuts have to be set with the use of public datamembers. Lepton cuts available: Pt-cut: fElectron_Pt_min, fMuon_Pt_min Jet-Cut: Pt-cut: fJetPt_min Eta-Range: fJetEta_min < |eta_jet| < fJetEta_max The number of jets in this list defines the Jet Multiplicity and the selector will remove any event that does not match the jet multiplicity provided via fJetMults. Selection cuts: Selection cuts are supposed to be stored in public data members of the derived classes (eg see Atl_tChannelAnalysis). The default values of these cuts are to be given in the virtual member function SetCutDefaults(). It is common to enclose an analysis selector inside an analysis task. The base class for this is the class AtlAppAnalysisTask which in turn is inherited to the various analyses. The actual cut values for an analysis should be given there via AtlAppAnalysis::SetCut(). Entry lists: Events that passed the ProcessCut() can be stored in a TEntryList. Later on, this list can be used to select only these events in a tree or chain. The chain has to be the same as when creating the list. To enable writing the entry list, use sel->SetWriteEntryList(kTRUE) or set it in the task class. This list will be created in the output root file with the tree name "app_entrylist". To apply the list on a chain, you first have to load the list from the root file. TFile *f = new TFile("outputfile.root","read"); TEntryList *elist = new TEntryList; elist = (TEntryList*)f->Get("app_entrylist"); Then you can apply it on your chain: ch->SetEntryList(elist); Running your analysis now will only include the events stored in the list. Author: Oliver Maria Kind <mailto:kind@mail.desy.de> Update: $Id: AtlSelector.cxx,v 1.156 2017/07/13 14:22:05 kind Exp $ Copyright: 2008 (C) Oliver Maria Kind
virtual | ~AtlSelector() |
virtual void | TSelector::Abort(const char* why, TSelector::EAbort what = kAbortProcess) |
void | TObject::AbstractMethod(const char* method) const |
void | AddTool(AtlAnalysisTool* tool) |
virtual void | TObject::AppendPad(Option_t* option = "") |
AtlSelector(const char* OutputFilename) | |
AtlSelector(const AtlSelector&) | |
virtual void | Begin(TTree* tree) |
virtual void | BookHistograms() |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | Clear(Option_t* otpion = "") |
virtual TObject* | TObject::Clone(const char* newname = "") const |
virtual Int_t | TObject::Compare(const TObject* obj) const |
virtual void | TObject::Copy(TObject& object) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual void | FillHistograms() |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
virtual TSelector::EAbort | TSelector::GetAbort() const |
TTree* | GetCurrentTree() const |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual Int_t | GetEntry(Long64_t entry = 0) |
AtlEvent* | GetEvent() const |
virtual const char* | TObject::GetIconName() const |
virtual TList* | TSelector::GetInputList() const |
static const char* | GetJetMultEnum(UInt_t jetmult) |
static const char* | GetJetMultLabel(AtlSelector::EJetMult jetmult) |
static const char* | GetJetMultLabel(Int_t i) |
static const char* | GetLeptonEnum(UInt_t lep) |
static const char* | GetLeptonLabel(AtlSelector::ELepChannel lep) |
static const char* | GetLeptonLabel(Int_t i) |
TList* | GetListOfTools() const |
virtual const char* | TObject::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual const char* | TSelector::GetOption() const |
TFile* | GetOutputFile() |
virtual TList* | GetOutputList() const |
Float_t | GetPreTagEvtWeight() const |
Int_t | GetProcessedEvents() const |
static TSelector* | TSelector::GetSelector(const char* filename) |
virtual Long64_t | TSelector::GetStatus() const |
Float_t | GetTagEvtWeight() const |
virtual const char* | TObject::GetTitle() const |
AtlAnalysisTool* | GetTool(const char* ClassName, const char* ToolName = "", Bool_t force = kFALSE) |
TTree* | GetTree() |
virtual UInt_t | TObject::GetUniqueID() const |
Bool_t | GetWriteEntryList() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TObject::Hash() const |
Bool_t | HasOutputTree() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | Init(TTree* tree = 0) |
virtual void | InitEvent() |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
Bool_t | IsFirstEvent() const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TObject::IsSortable() const |
static Bool_t | TSelector::IsStandardDraw(const char* selec) |
Bool_t | TObject::IsZombie() const |
AtlTriggerConf* | LoadTriggerConfig() |
virtual void | TObject::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
void | TObject::operator delete(void* ptr) |
void | TObject::operator delete(void* ptr, void* vp) |
void | TObject::operator delete[](void* ptr) |
void | TObject::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) |
AtlSelector& | operator=(const AtlSelector&) |
virtual void | TObject::Paint(Option_t* option = "") |
Bool_t | PassedSelection() const |
virtual void | TObject::Pop() |
virtual void | Print(Option_t* option = "") const |
void | PrintSummary() |
virtual Bool_t | Process(Long64_t entry) |
virtual Bool_t | ProcessCut() |
virtual void | ProcessFill() |
void | ProcessInfo() |
virtual Bool_t | ProcessPreCut() |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
virtual void | TSelector::ResetAbort() |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual void | SetBranches() |
virtual void | SetBranchStatus() |
virtual void | SetCutDefaults() |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
void | SetEvtReader(AtlEvtReaderBase* reader) |
virtual void | SetInputList(TList* input) |
void | SetInputMode(AtlSelector::EIOMode inputMode) |
virtual void | SetObject(TObject* obj) |
static void | TObject::SetObjectStat(Bool_t stat) |
virtual void | SetOption(const char* option) |
void | SetOutputTree(const char* name, const char* title) |
void | SetPassedSelection(Bool_t result) |
void | SetPrintEvent(Bool_t PrintEvent) |
void | SetPrintObjectTable(Bool_t PrintObjectTable) |
virtual void | TSelector::SetStatus(Long64_t status) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
void | SetWriteEntryList(Bool_t WriteEntryList) |
virtual void | ShowMembers(TMemberInspector& insp) const |
virtual void | SlaveBegin(TTree* tree) |
virtual void | SlaveTerminate() |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
virtual void | Terminate() |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | TObject::UseCurrentStyle() |
virtual Int_t | Version() const |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
void | BookJobInfoHistograms() |
void | ChangeOutputFile() |
void | DoBookkeeping(TFile* InputFile) |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
void | SetSumw2(TDirectory* dir) |
Bool_t | fDoTruthTree | Read and process TruthTree information. Caution: this is a very time-consuming operation (Run2 SgTop-D3PDs only; default=false) |
static const Int_t | fgNumJetMults | |
static const Int_t | fgNumLepChannels | |
static AtlSelector::EJetMult | k4To6Jets | |
static TSelector::EAbort | TSelector::kAbortFile | |
static TSelector::EAbort | TSelector::kAbortProcess | |
static AtlSelector::EJetMult | kAllJets | |
static AtlSelector::EIOMode | kApp | |
static TObject::(anonymous) | TObject::kBitMask | |
static TObject::EStatusBits | TObject::kCanDelete | |
static TObject::EStatusBits | TObject::kCannotPick | |
static TSelector::EAbort | TSelector::kContinue | |
static AtlSelector::EIOMode | kCustom | |
static AtlSelector::EIOMode | kD3PDCKM | |
static AtlSelector::EIOMode | kD3PDSgTop | |
static AtlSelector::EIOMode | kD3PDSgTop_v2 | |
static AtlSelector::ELepChannel | kElectron | |
static AtlSelector::EJetMult | kFiveJet | |
static AtlSelector::EJetMult | kFourJet | |
static TObject::EStatusBits | TObject::kHasUUID | |
static TObject::EStatusBits | TObject::kInvalidObject | |
static TObject::(anonymous) | TObject::kIsOnHeap | |
static TObject::EStatusBits | TObject::kIsReferenced | |
static AtlSelector::ELepChannel | kLepton | |
static AtlSelector::EIOMode | kMemNtuple | |
static AtlSelector::ELepChannel | kMuon | |
static TObject::EStatusBits | TObject::kMustCleanup | |
static TObject::EStatusBits | TObject::kNoContextMenu | |
static TObject::(anonymous) | TObject::kNotDeleted | |
static TObject::EStatusBits | TObject::kObjInCanvas | |
static AtlSelector::EJetMult | kOneJet | |
static AtlSelector::EJetMult | kOneOrMoreJets | |
static TObject::(anonymous) | TObject::kOverwrite | |
static TObject::(anonymous) | TObject::kSingleKey | |
static AtlSelector::EJetMult | kSixJet | |
static AtlSelector::EJetMult | kThreeJet | |
static AtlSelector::EJetMult | kThreeOrMoreJets | |
static AtlSelector::EJetMult | kTwoJet | |
static AtlSelector::EJetMult | kTwoOrMoreJets | |
static TObject::(anonymous) | TObject::kWriteDelete | |
static TObject::(anonymous) | TObject::kZombie |
TSelector::EAbort | TSelector::fAbort | Abort status |
Int_t | fAcceptedEvents | No. of accepted events (w/o weights) selected by ProcessCut() |
Float_t | fAcceptedEventsB | No. of accepted events (weighted) selected by ProcessCut() |
Float_t | fAcceptedEventsW | No. of accepted events (weighted) selected by ProcessCut() |
TObjArray* | fBookkeepingList | List of chain elements needed for bookkeeping |
Bool_t | fCountUnfilteredEvents | Count the no. of all unfiltered events (in case the input A++ file does not contain a JobInfo histogram) |
TTree* | fCurrentTree | Currently analysed tree |
Long64_t | fEntry | Global entry number of the current event in input chain |
TEntryList* | fEntryList | Global entry list for all files in a chain |
AtlEvent* | fEvent | Point to event object in memory |
AtlEvtReaderBase* | fEvtReader | Reader for input events |
AtlEvtReaderBase* | fEvtReaderUser | User-provided reader for input events (owned!) |
AtlEvtWriterBase* | fEvtWriter | Writer for output event |
TH1D* | fHistCutflow_NoWeights | SgTopD3PD CutFlow Histogram |
TH1D* | fHistCutflow_allEventsHFOR_NoWeights | SgTopD3PD CutFlow Histogram |
TH1D* | fHistCutflow_allEventsHFOR_genWeights | SgTopD3PD CutFlow Histogram |
TH1D* | fHistCutflow_genWeights | SgTopD3PD CutFlow Histogram |
TH1D* | fHistCutflow_genXpileupWeights | SgTopD3PD CutFlow Histogram |
TH1D* | fHistCutflow_genXpileupXzvertexWeights | SgTopD3PD CutFlow Histogram |
TH1F* | fHistEvents | Histogram for no. of processed and accepted events etc. |
TH1F* | fHistEvtWeights | Histogram of event weights |
TList* | TSelector::fInput | List of objects available during processing |
AtlSelector::EIOMode | fInputMode | Defines input file mode |
Bool_t | fIsChain | Input is chain or tree ? |
Int_t | fJetBinEvents | No. of events in jet bin (w/o weights) |
Float_t | fJetBinEventsW | No. of events in jet bin (weighted) |
TList* | fListOfTools | List of analysis tools |
MemInfo_t* | fMemInfo | Current memory usage information |
Int_t | fNBookkeeping | No. of bookkeeping files |
TObject* | TSelector::fObject | ! Current object if processing object (vs. TTree) |
TString | TSelector::fOption | Option given to TTree::Process |
TSelectorList* | TSelector::fOutput | ! List of objects created during processing |
TFile* | fOutputFile | Output file |
TString* | fOutputFilename | Name of the output file |
AtlSelector::EIOMode | fOutputMode | Defines mode for the output tree (if any) |
TTree* | fOutputTree | A++ output tree (if any) |
TString* | fOutputTreeName | Name of the A++ output tree (if any) |
TString* | fOutputTreeTitle | Title of the A++ output tree (if any) |
TTree* | fOutputTriggerConfTree | Needed for copying the trigger config dbases into the output file in case of written out A++ events |
Bool_t | fPassedSelection | variable for storing the selection decisions for the event |
Int_t | fPreAcceptedEvents | No. of pre-accepted events (w/o weights) selected by ProcessPreCut() |
Float_t | fPreAcceptedEventsW | No. of pre-accepted events (weighted) selected by ProcessPreCut() |
Float_t | fPreTaggedEvents | No. of events before b-tagging |
Float_t | fPreTaggedEventsW | No. of events before b-tagging (weighted) |
Bool_t | fPrintEvent | Print the content of every event (useful for testing/debugging) |
Bool_t | fPrintObjectTable | Print Root's object table for every event (useful for tracking memory leaks) |
ProcInfo_t* | fProcInfo | Current process information |
Int_t | fProcessedEvents | No. of processed events (w/o weights) |
Float_t | fProcessedEventsW | No. of processed events (weighted) |
Long64_t | TSelector::fStatus | Selector status |
TStopwatch | fStopwatch | Stopwatch used for process monitoring |
TTree* | fTree | Pointer to the currently analysed tree or chain |
Bool_t | fWriteEntryList | Switch for writing an entry list |
Set output tree/ntuple If the name of the output tree is set it is automatically being filled with all events passing the ProcessCut() method. The trigger configuration dbase of the used runs is also copied from the input files. If the size of the output tree exceeds the maximum tree size (see TTree::SetMaxTreeSize()) of (currently) 2Gb, Root splits the output file automatically. Iin contrast to Root's internal mechanism, which writes all histograms to the last of the splitted files only, the AtlSelector class splits also the histograms and writes them to their corresponding output files (see ChangeOutputFile()). The same holds for the trigger configuration dbase.
Set branch assignments of the input tree. Here an A++ input tree is assumed. For other trees this (virtual) method has to be overloaded. See also the GetEntry() method
Get entry from current input tree. This (virtual) method can be overloaded if needed (different type of input tree)
The Init() function is called when the selector needs to initialize a new tree or chain. Typically here the branch addresses and branch pointers of the tree will be set. It is normally not necessary to make changes to the generated code, but the routine can be extended by the user if needed. Init() will be called many times when running on PROOF (once per file to be processed).
The Notify() function is called when a new file is opened. This can be either for a new TTree in a TChain or when a new TTree is started when using PROOF. Load the configurations (trigger etc.) from the newly opened file. In case of writing an event list make sure a new one is appended for the current tree. At the end of this function, the Notify() functions of the current event reader and all active tools are called.
Perform bookkeeping of the cut-flow and job info histograms. This is done for every input file.
The SlaveBegin() function is called after the Begin() function. When running with PROOF SlaveBegin() is called on each slave server. The tree argument is deprecated (on PROOF 0 is passed). Function called before starting the event loop -it performs some cleanup -it creates histograms -it sets some initialisation for the event list
The Process() function is called for each entry in the tree (or possibly keyed object in the case of PROOF) to be processed. The entry argument specifies which entry in the currently loaded tree is to be processed. It can be passed to either AtlSelector::GetEntry() or TBranch::GetEntry() to read either all or the required parts of the data. When processing keyed objects with PROOF, the object is already loaded and is available via the fObject pointer. This function should contain the "body" of the analysis. It can contain simple or elaborate selection criteria, run algorithms on the data of the event and typically fill histograms. The processing can be stopped by calling Abort(). Use fStatus to set the return value of TTree::Process(). The return value is currently not used.
The SlaveTerminate() function is called after all entries or objects have been processed. When running with PROOF SlaveTerminate() is called on each slave server.
The Terminate() function is the last function to be called during a query. It always runs on the client, it can be used to present the results graphically or save the results to file.
Set Default Values for public member variables. When implementing this virtual method in a derived Selector class, make sure to call this base method as well. SetCutDefaults should be called in the ctor of the derived class. void DerivedSelector::SetCutDefaults(){ AtlSelector::SetCutDefaults(); // calls base portion fFoo = bar; // set default value of fFoo to bar }
Print information about the current process. For interactive (ie non-batch) jobs continuous output is given while for batch jobs only a few out is given to avoid too much junk in the log file
Retrieves Tool from fListOfTools If parameter force is true, the method will abort if no tool with the description is found otherwise it won't bother and simply return 0
Book histograms containing information about the analysis job like the no. of processed events, the event weights etc. The binning for the nevt histogram is as follows: Bin 1 : All unfiltered events (unweighted) Bin 2 : All unfiltered events (MC weight only) Bin 3 : All unfiltered events (all weights) Bin 4 : Processed events (unweighted) Bin 5 : Processed events (MC weight only) Bin 6 : Processed events (all weights) Bin 7 : Pre-accepted events by ProcessPreCut() (unweighted) Bin 8 : Pre-accepted events by ProcessPreCut() (MC weights only) Bin 9 : Pre-accepted events by ProcessPreCut() (all weights) Bin 10 : Accepted events by ProcessCut() (unweighted) Bin 11 : Accepted events by ProcessCut() (MC weight only) Bin 12 : Accepted events by ProcessCut() (all weights)
This method is used to prevent Root from wrinting all histograms only to the last file in case of splited output files (see TTree::ChangeFile()). Instead the histograms are splitted as well and written to their corresponding output file.
Clear AtlSelector User has to call this function in derived selector
Explcitly sets the event reader. Ownership of the reader is transferred to AtlSelector!
Sets the input mode. Deprecated, please use SetEvtReader() if possible.
Switch for printing every event (useful for testing/debugging)
Switch for printing the Root's object table (useful for tracking memory leaks)