More information on this package is here.
#include "TFilter.h"

TFilter


class description - header file - source file

class TFilter: public TClasTool

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TFilter()
~TFilter()
voidTObject::AbstractMethod(const char* method) const
Int_tTClasTool::Add(const Char_t* filename)
Int_tTClasTool::AddEPICFile(const char* filename, Int_t nentries)
Int_tTClasTool::AddFile(const Char_t* filename)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
Int_tTClasTool::Check_Reader_Defined()
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
voidClearHistos()
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
Int_tTClasTool::Correct_ECPB_bank(TEVNTClass* e)
Int_tTClasTool::Correct_ECPB_bank(TECPBClass* eco)
TTree*Create_Out_Tree(TDSTReader* dstread)
virtual voidTObject::Delete(Option_t* option = "")
voidDeleteHistos()
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
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 TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TObject*TClasTool::GetBankRow(const Char_t* bankname, Int_t nrow)
Float_tTClasTool::GetBeamEnergy()
TCCPBClass*TClasTool::GetCCPB(Int_t nrow)
Int_tTClasTool::GetCurrentEvent()
TDCPBClass*TClasTool::GetDCPB(Int_t nrow)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
TECPBClass*TClasTool::GetECPB(Int_t nrow)
Double_tTClasTool::GetEntries()
Double_tTClasTool::GetEntriesFast()
Int_tTClasTool::GetEntry(Int_t entry = -1, Int_t getall = 0)
TEPICClass*TClasTool::GetEPICClass()
Float_tTClasTool::GetEPICValue(const char* fName)
Int_tTClasTool::GetEventNumber()
TEVNTClass*TClasTool::GetEVNT(Int_t nrow)
Int_tGetFixEC()
THEADERClass*TClasTool::GetHEADER()
Int_tTClasTool::GetHelicity()
virtual const char*TObject::GetIconName() const
voidTClasTool::GetInvariants(Float_t* Q2, Float_t* W2)
TLCPBClass*TClasTool::GetLCPB(Int_t nrow)
virtual const char*TObject::GetName() const
Int_tTClasTool::GetNFiles()
TObject*TClasTool::GetNotify()
Int_tTClasTool::GetNPart()
Int_tTClasTool::GetNRows(const Char_t* bankname = "EVNT")
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TVector3TClasTool::GetPart3Vector(Int_t indx)
TLorentzVectorTClasTool::GetPart4Vector(Int_t indx)
Int_tTClasTool::GetPartCharge(Int_t indx)
Int_tTClasTool::GetPartID(Int_t indx)
TVector3TClasTool::GetPartVertex(Int_t indx)
TVirtualReader*TClasTool::GetReader()
TSCPBClass*TClasTool::GetSCPB(Int_t nrow)
TSTPBClass*TClasTool::GetSTPB(Int_t nrow)
virtual const char*TObject::GetTitle() const
TChain*TClasTool::GetTree(Char_t* treename = "EVNT")
virtual UInt_tTObject::GetUniqueID() const
TVERTClass*TClasTool::GetVert(Int_t part1, Int_t part2)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::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
Int_tTClasTool::InitDSTReader(const Char_t* readertype = "ROOTDSTR")
Int_tTClasTool::InitDSTReader(TVirtualReader* reader)
virtual voidInitHistos()
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
Int_tTClasTool::Next()
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static 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)
TClasTool&TClasTool::operator=(const TClasTool&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
voidTClasTool::Print(Int_t full = 0)
voidTClasTool::PrintEPICPosition()
voidTClasTool::PrintEventStatus()
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual Int_tRun(Int_t Nevt = 2147483647)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual Int_tSelectEvent()
voidTClasTool::SetBeamEnergy(Float_t fbm)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
voidSetFixEC(Int_t s = 1)
voidTClasTool::SetNoScalers()
voidTClasTool::SetNotify(TObject* Notify)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& 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
voidWrite()
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
TVERTClass*TClasTool::Vert_Error_Handler(Int_t NRows, Int_t track1, Int_t track2)

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
public:
Int_tgFix_EC_Bank
TCounterColCutsCollections of counters for all your cuts.
TObjArray*HArray that stores your histograms.
TInterrupt*Interrupt
TStopwatch*Time
TChain*chainPointer to input tree.
TTree*treePointer to the output tree.
TH1F*H_PIDPointer to the one histogram defined here.
Int_tiEventEvent being processed
Int_tC_Good_Event_OutExample for a counter index.
TVirtualReader*TClasTool::fReaderThis is a pointer to the actual reader used.
Int_tTClasTool::fDebug_ModeSets the verbosity of the code.
protected:
Float_tTClasTool::fEBeamBeam energy. Set with SetBeamEnergy().
Int_tTClasTool::isReaderDefinedTrue is reader is initialized.

Class Description

____________________ 

TFilter

This Class is the base class for writing data filters. I highly recommend that you use it by deriving your own class from this one. All you then need to do is override the default SelectEvent() fuction, which decides whether to keep the event or not. (The default version keeps all events.)

Another good practice that I strongly encourage is that you keep a list of counters (TCounterCol) and a list of histograms that show all your cuts and percentage passed and stick these results right in the output file. This can save you a headache later trying to figure out what was in the files.

Notice: This class only works with data read by the TDSTReader (i.e. written by Write_Root_DST).

 
TFilter()
 Initialize code.

void InitHistos(void)
 This functions needs an override where you define your own histograms and counters.
 You want to have the overridden InitHistos() routine called from the deriving class initializer.
 NOTE: Your InitHistos method must at least define the C_Good_Event_Out counter.
Int_t SelectEvent()
 This function must be overridden to provide your own cut.
 This function returns 0 when you want to skip the event
 and 1 when you want to keep it.
void DeleteHistos(void)
 Delete all histograms by calling H->Delete()

void ClearHistos(void)
 Clear all histograms.

void Write(void)
 Write all histograms in H and
 all counters in Cuts to the currently
 open file.

TTree * Create_Out_Tree(TDSTReader *dstread)
 In a more simple world we would just be able to clone the input tree to the
 output tree, using TTree *tree=chain->CloneTree().
 This broke when there was a data change (from UChar_t to Char_t) in the 
 TVirtualData class. 
 Instead of cloning the input tree, we build a new tree, similar to the 
 one in TDSTReader

Int_t Run(Int_t Max_evt)
~TFilter()
void SetFixEC(Int_t s=1)
{gFix_EC_Bank=s;}
Int_t GetFixEC()
{return gFix_EC_Bank;}


Author: Maurik Holtrop
Last update: ClasTool/TFilter.cc:$Name: $:$Id: TFilter.cc,v 1.3 2007/04/05 20:36:43 holtrop Exp $
CopyLeft - This code is freely available.

ROOT Home page - ClasTool Class index - Class Hierarchy - Top of the page