ROOT logo
AliRoot » ANALYSIS » AliPhysicsSelection

class AliPhysicsSelection: public AliAnalysisCuts

                      Implementation of   Class AliPhysicsSelection
 This class selects collision candidates from data runs, applying selection cuts on triggers
 and background rejection based on the content of the ESD

 Usage:

 Create the object:
   fPhysicsSelection = new AliPhysicsSelection;

 For MC data, call
   fPhysicsSelection->SetAnalyzeMC()

 To check if an event is a collision candidate, use:
   fPhysicsSelection->IsCollisionCandidate(fESD)

 After processing save the resulting histograms to a file with (a folder physics_selection
   will be created that contains the histograms):
   fPhysicsSelection->SaveHistograms("physics_selection")

 To print statistics after processing use:
   fPhysicsSelection->Print();

 The BX ids corresponding to real bunches crossings p2 are
 automatically selected. You cannot process runs with different
 filling schemes if this option is set. If you want to disable this,
 use:
   fPhysicsSelection->SetUseBXNumbers(0);


 If you are analizing muons and you want to keep the muon triggers
 besides the CINT1B you can set:
   fPhysicsSelection->SetUseMuonTriggers();


 To compute the Background automatically using the control triggers
 use:
   fPhysicsSelection->SetComputeBG();
 this will show the value of the Beam Gas, accidentals and good
 events as additional rows in the statistic tables, but it will NOT
 subtract the background automatically.
 This option will only work for runs taken with the CINT1
 suite. This options enables automatically also the usage of BX
 numbers. You can only process one run at a time if you require this
 options, because it uses the bunch intensity estimated run by run.

 The BG will usually be more important in the so-called "bin 0": the
 class can also compute the statistics table for events in this
 bin. Since the definition of bin 0 may in general change from
 analysis to analysis, the user needs to provide a callback
 implementing the definition of bin zero. The callback should be
 implemented as a method in the analysis task and should override
 the IsEventInBinZero method of AliAnalysisTaskSE, and should thus
 have the the following prototype:
   Bool_t IsEventInBinZero();
 It should return true if the event is in the bin 0 and it is set by
 passing to the physics selection the NAME of the task where the
 callback is implemented:
   fPhysicsSelection->SetBin0Callback("MyTask").


 Usually the class selects the trigger scheme by itself depending on the run number.
 Nevertheless, you can do that manually by calling AddCollisionTriggerClass() and AddBGTriggerClass()
 Example:
 To define the class CINT1B-ABCE-NOPF-ALL as collision trigger (those will be accepted as
 collision candidates when they pass the selection):
   AddCollisionTriggerClass("+CINT1B-ABCE-NOPF-ALL #769 #3119");
 To select on bunch crossing IDs in addition, use:
   AddCollisionTriggerClass("+CINT1B-ABCE-NOPF-ALL #769 #3119");
 To define the class CINT1A-ABCE-NOPF-ALL as a background trigger (those will only be counted
 for the control histograms):
   AddBGTriggerClass("+CINT1A-ABCE-NOPF-ALL");
 You can also specify more than one trigger class in a string or you can require that some are *not*
 present. The following line would require CSMBA-ABCE-NOPF-ALL, but CSMBB-ABCE-NOPF-ALL is not allowed
 to be present:
   AddBGTriggerClass("+CSMBA-ABCE-NOPF-ALL -CSMBB-ABCE-NOPF-ALL");

 The class also supports the triggers used in heavy ion runs

   Origin: Jan Fiete Grosse-Oetringhaus, CERN
           Michele Floris, CERN

Function Members (Methods)

public:
AliPhysicsSelection()
virtual~AliPhysicsSelection()
voidTObject::AbstractMethod(const char* method) const
voidAddBackgroundIdentification(AliAnalysisCuts*)
voidAddBGTriggerClass(const char* className)
voidAddCollisionTriggerClass(const char* className)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(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
voidDetectPassName()
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 TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tGetBGStatOffset() const
const TList*GetBGTriggerClasses() const
const TH2F*GetBunchCrossingHistogram() const
const TList*GetCollisionTriggerClasses() const
Int_tGetCurrentRun() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual UInt_tAliAnalysisCuts::GetFilterMask() const
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
static const char*GetOADBFileName()
const AliOADBFillingScheme*GetOADBFillingScheme() const
const AliOADBPhysicsSelection*GetOADBPhysicsSelection() const
const AliOADBTriggerAnalysis*GetOADBTriggerAnalysis() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual TList*AliAnalysisCuts::GetOutput()
virtual UInt_tGetSelectionMask(const TObject* obj)
virtual TObject*GetStatistics(Option_t* option) const
const TH2F*GetStatisticsHistogram(Int_t idx = kStatIdxAll) const
virtual const char*TNamed::GetTitle() const
AliTriggerAnalysis*GetTriggerAnalysis(Int_t i = 0)
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 voidAliAnalysisCuts::Init()
Bool_tInitialize(const AliESDEvent* aEsd)
Bool_tInitialize(Int_t runNumber)
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
UInt_tIsCollisionCandidate(const AliESDEvent* aEsd)
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tIsMC() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tIsSelected(TList*)
virtual Bool_tIsSelected(TObject*)
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Long64_tMerge(TCollection* list)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(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
voidSaveHistograms(const char* folder = 0)
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
virtual UInt_tAliAnalysisCuts::Selected() const
voidSetAnalyzeMC(Bool_t flag = kTRUE)
voidSetBIFactors(const AliESDEvent* aESD)
voidSetBin0Callback(const char* cb)
voidSetBin0CallbackViaPointer(AliPhysicsSelection::Bin0Callback_t cb)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetComputeBG(UInt_t flag = AliVEvent::kMB)
voidSetCustomOADBObjects(AliOADBPhysicsSelection* oadbPS, AliOADBFillingScheme* oadbFS, AliOADBTriggerAnalysis* oadbTA = 0)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidAliAnalysisCuts::SetFilterMask(UInt_t mask)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPassName(const TString passName)
virtual voidAliAnalysisCuts::SetSelected(Bool_t dec)
voidSetSkipTriggerClassSelection(Bool_t flag = kTRUE)
voidSetSkipV0(Bool_t flag = kTRUE)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetUseBXNumbers(Bool_t flag = kTRUE)
voidSetUseMuonTriggers(Bool_t)
virtual voidShowMembers(TMemberInspector&)
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:
TH2F*BookHistStatistics(const char* tag)
UInt_tCheckTriggerClass(const AliESDEvent* aEsd, const char* trigger, Int_t& triggerLogic) const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
Bool_tEvaluateTriggerLogic(const AliESDEvent* aEsd, AliTriggerAnalysis* triggerAnalysis, const char* triggerLogic, Bool_t offline)
Int_tGetStatRow(const char* triggerBXClass, UInt_t offlineTriggerType, UInt_t** rowIDs) const
const char*GetTriggerString(TObjString* obj)
voidTObject::MakeZombie()

Data Members

public:
enum { kStatTriggerClass
kStatHWTrig
kStatV0ABG
kStatV0CBG
kStatMB1
kStatMB1Prime
kStatLaserCut
kHVdipCut
kStatFO1
kStatFO2
kStatFO2L1
kStatV0A
kStatV0C
kStatT0BB
kStatT0BG
kStatT0PileUp
kStatZDCA
kStatZDCC
kStatZDCAC
kStatZDCTime
kStatZNABG
kStatZNCBG
kStatV0
kStatV0ZN
kStatOffline
kStatBG
kStatAcceptedPileUp
kStatAccepted
kStatRowAllB
kStatRowAllAC
kStatRowAllE
kStatRowBG
kStatRowAcc
kStatRowGood
kStatIdxAll
kStatIdxBin0
};
enum ETriggerLogic { kCINT1
kCMBS2A
kCMBS2C
kCMBAC
kCMBACS2
kHighMultL1
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Int_tfBGStatOffsetOffset of the BG statistics computed at the end of the processing. It depends on how many trigger classes you have selected
TListfBGTrigClassestrigger classes identifying background events
Float_tfBIFactorAratio of interacting over non interacting bunch intensities for beam 1
Float_tfBIFactorACratio of interacting over non interacting bunch intensities for beam 1&2:
Float_tfBIFactorCratio of interacting over non interacting bunch intensities for beam 2
TStringfBin0CallBackcallback used to determine if an event is in the bin0 (name of the task where the callback is implemented);
void*fBin0CallBackPointer! don't stream this. TO BE REMOVED SOON
TList*fCashedTokens! trigger token lookup list
TListfCollTrigClassestrigger class identifying collision candidates
UInt_tfComputeBGSwitch on computation of background and filling of relevant stat table entries. If you enable this you can only process one run at a time (the relative bunch intensity used to compute this chages from run to run); This is a mask of the trigger types to be used in the selection, as defined in AliVEvent
Int_tfCurrentRunrun number for which the object is initialized
AliOADBFillingScheme*fFillOADBFilling scheme OADB object
TStringfFillingSchemestores the filling scheme of the current run.
TH2F*fHistBunchCrossinghistograms of accepted bunch crossing numbers
TH2F*fHistStatistics[2]how many events are cut away why {all,bin 0}
TH1F*fHistTriggerPatternPattern of the individual detectors in the MB1 trigger. Can reveal inconsistencies/inefficiencies in the trigger
Bool_tfIsPPTrue if processing pp run, false if heavy ion
Bool_tfMCflag if MC is analyzed
TStringTNamed::fNameobject identifier
AliOADBPhysicsSelection*fPSOADBPhysics selection OADB object
TStringfPassNamepass name for current run
TPRegexp*fRegexp! regular expression for trigger tokens
Bool_tfSkipTriggerClassSelectionflag that determines if the trigger class selection is skipped
Bool_tfSkipV0ignore information from v0
TStringTNamed::fTitleobject title
TListfTriggerAnalysislist of offline trigger objects (several are needed to keep the control histograms separate per trigger class)
AliOADBTriggerAnalysis*fTriggerOADBTrigger analysis OADB object
Bool_tfUseBXNumbersExplicitely select "good" bunch crossing numbers (exclude pilot, afterpulses and fakes). If you anable this you can only process runs within the same filling scheme.
Bool_tfUseMuonTriggersif true, also use the muon triggers
Bool_tfUsingCustomClassesflag that is set if costum trigger classes are defined

Class Charts

Inheritance Chart:
TNamed
AliVCuts
AliAnalysisCuts
AliPhysicsSelection
AliEmcalPhysicsSelection

Function documentation

AliPhysicsSelection()
  fHistStatisticsTokens(0),
 constructor
~AliPhysicsSelection()
 destructor
UInt_t CheckTriggerClass(const AliESDEvent* aEsd, const char* trigger, Int_t& triggerLogic) const
 checks if the given trigger class(es) are found for the current event
 format of trigger: +TRIGGER1,TRIGGER1b,TRIGGER1c -TRIGGER2 [#XXX] [&YY] [*ZZ]
   requires one out of TRIGGER1,TRIGGER1b,TRIGGER1c and rejects TRIGGER2
   in bunch crossing XXX
   if successful, YY is returned (for association between entry in fCollTrigClasses and AliVEvent::EOfflineTriggerTypes)
   triggerLogic is filled with ZZ, defaults to kCINT1
TObject * GetStatistics(Option_t* option) const
 Get the statistics histograms ("ALL" and "BIN0" and "TOK")
Bool_t EvaluateTriggerLogic(const AliESDEvent* aEsd, AliTriggerAnalysis* triggerAnalysis, const char* triggerLogic, Bool_t offline)
 evaluates trigger logic. If called with no ESD pointer/triggerAnalysis pointer, it just caches the tokens
 Fills the statistics histogram, if booked at row i
UInt_t IsCollisionCandidate(const AliESDEvent* aEsd)
 checks if the given event is a collision candidate

 returns a bit word describing the fired offline triggers (see AliVEvent::EOfflineTriggerTypes)
Bool_t Initialize(const AliESDEvent* aEsd)
Bool_t Initialize(Int_t runNumber)
 initializes the object for the given run
TH2F * BookHistStatistics(const char* tag)
 add 6 rows to count for the estimate of good, accidentals and
 BG and the ratio of BG and accidentals to total +ratio goot to
 first col + 2 for error on good.
 TODO: Remember the the indexes of rows for the BG selection. Add new member fBGRows[] and use kStat as indexes
void Print(Option_t* option = "") const
 print the configuration
Long64_t Merge(TCollection* list)
 Merge a list of AliMultiplicityCorrection objects with this (needed for
 PROOF).
 Returns the number of merged objects (including this).
void SaveHistograms(const char* folder = 0)
 write histograms to current directory
Int_t GetStatRow(const char* triggerBXClass, UInt_t offlineTriggerType, UInt_t** rowIDs) const
 Puts inside the array rowIDs the row number for a given offline
 trigger in a given bx class. Returns the total number of lines
 matching the selection
 triggerBXClass can be either "A", "AC", "B" or "E"
 offlineTriggerType is one of the types defined in AliVEvent
 User should delete rowIDs if no longer needed
void SetBIFactors(const AliESDEvent* aESD)
 Set factors for realtive bunch intesities
const char * GetTriggerString(TObjString* obj)
 Returns a formed objstring
void AddCollisionTriggerClass(const char* className)
void AddBGTriggerClass(const char* className)
 Add custom BG trigger class
void DetectPassName()
AliPhysicsSelection()
UInt_t GetSelectionMask(const TObject* obj)
 AliAnalysisCuts interface
{ return IsCollisionCandidate((const AliESDEvent*) obj); }
Bool_t IsSelected(TList* )
{ return kFALSE; }
Bool_t IsSelected(TObject* )
{return kFALSE;}
Int_t GetCurrentRun() const
{return fCurrentRun;}
void SetAnalyzeMC(Bool_t flag = kTRUE)
{ fMC = flag; }
void SetSkipTriggerClassSelection(Bool_t flag = kTRUE)
void SetSkipV0(Bool_t flag = kTRUE)
{ AliError ("This method is deprecated! Please change the OADB configuration instead") ; fSkipV0 = flag;}
void AddBackgroundIdentification(AliAnalysisCuts* )
{ AliFatal ("This method is deprecated. Please use the kSPDClsVsTrkBG tag in the OADB configuration instead"); }
const TList* GetCollisionTriggerClasses() const
{ return &fCollTrigClasses; }
const TList* GetBGTriggerClasses() const
{ return &fBGTrigClasses; }
void SetCustomOADBObjects(AliOADBPhysicsSelection* oadbPS, AliOADBFillingScheme* oadbFS, AliOADBTriggerAnalysis* oadbTA = 0)
{ fPSOADB = oadbPS; fFillOADB = oadbFS; fTriggerOADB = oadbTA; fUsingCustomClasses = kTRUE;}
const AliOADBPhysicsSelection * GetOADBPhysicsSelection() const
{return fPSOADB; }
const AliOADBFillingScheme * GetOADBFillingScheme() const
{return fFillOADB;}
const AliOADBTriggerAnalysis * GetOADBTriggerAnalysis() const
{return fTriggerOADB;}
Int_t GetBGStatOffset() const
{ return fBGStatOffset; }
AliTriggerAnalysis* GetTriggerAnalysis(Int_t i = 0)
{ return (fTriggerAnalysis.GetEntries() > 0) ? (AliTriggerAnalysis*) fTriggerAnalysis.At(i) : 0; }
const TH2F* GetStatisticsHistogram(Int_t idx = kStatIdxAll) const
{ return fHistStatistics[idx]; }
const TH2F* GetBunchCrossingHistogram() const
{ return fHistBunchCrossing; }
void SetUseBXNumbers(Bool_t flag = kTRUE)
{fUseBXNumbers = flag;}
void SetComputeBG(UInt_t flag = AliVEvent::kMB)
{fComputeBG = flag; if(flag) fUseBXNumbers = flag;}
void SetUseMuonTriggers(Bool_t )
{ Printf("ERROR: Use of AliPhysicsSelection::SetUseMuonTriggers is deprecated. Use AliVEvent::kMUON selection instead."); }
void SetBin0Callback(const char* cb)
void SetBin0CallbackViaPointer(AliPhysicsSelection::Bin0Callback_t cb)
const char * GetOADBFileName()
{ static TString filename; filename.Form("%s/COMMON/PHYSICSSELECTION/data/physicsSelection.root", AliAnalysisManager::GetOADBPath()); return filename.Data();}
void SetPassName(const TString passName)
{ fPassName = passName; }
Bool_t IsMC() const
{ return fMC; }
AliPhysicsSelection& operator=(const AliPhysicsSelection& )