X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=CORRFW%2FAliCFManager.cxx;h=3e697868497c5d611155e78598532341ed37088a;hb=5a41314b24346379691be601056b9eff2257c71b;hp=069aa05099d85a3465f37a8ba8c40ee65d5e090b;hpb=563113d007806c95a507719858554afe77b20e8d;p=u%2Fmrichter%2FAliRoot.git diff --git a/CORRFW/AliCFManager.cxx b/CORRFW/AliCFManager.cxx index 069aa05099d..3e697868497 100644 --- a/CORRFW/AliCFManager.cxx +++ b/CORRFW/AliCFManager.cxx @@ -21,10 +21,6 @@ // efficiency calculation. // prototype version by S.Arcelli silvia.arcelli@cern.ch /////////////////////////////////////////////////////////////////////////// -#include "TBits.h" -#include "TList.h" -#include "TH1.h" -#include "AliLog.h" #include "AliCFCutBase.h" #include "AliCFManager.h" @@ -33,45 +29,45 @@ ClassImp(AliCFManager) //_____________________________________________________________________________ AliCFManager::AliCFManager() : TNamed(), + fNStepEvt(0), + fNStepPart(0), fEvtContainer(0x0), fPartContainer(0x0), - fhQABits(0x0) - + fEvtCutList(0x0), + fPartCutList(0x0) { // // ctor // - for(Int_t i=0;ifNStepEvt=c.fNStepEvt; + this->fNStepPart=c.fNStepPart; this->fEvtContainer=c.fEvtContainer; this->fPartContainer=c.fPartContainer; - this->fhQABits=c.fhQABits; - for(Int_t i=0;ifEvtCutList[i]=c.fEvtCutList[i]; - for(Int_t i=0;ifPartCutList[i]=c.fPartCutList[i]; + this->fEvtCutList=c.fEvtCutList; + this->fPartCutList=c.fPartCutList; return *this ; } @@ -95,7 +92,6 @@ AliCFManager::~AliCFManager() { // //dtor // - if(fhQABits) delete fhQABits; } //_____________________________________________________________________________ @@ -104,9 +100,9 @@ Bool_t AliCFManager::CheckParticleCuts(Int_t isel, TObject *obj, const TString // check whether object obj passes particle-level selection isel // - if(isel>=kNPartSel){ - AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,kNPartSel)); - return kTRUE; + if(isel>=fNStepPart){ + AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,fNStepPart)); + return kTRUE; } if(!fPartCutList[isel])return kTRUE; TObjArrayIter iter(fPartCutList[isel]); @@ -125,8 +121,8 @@ Bool_t AliCFManager::CheckEventCuts(Int_t isel, TObject *obj, const TString &se // check whether object obj passes event-level selection isel // - if(isel>=kNEvtSel){ - AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,kNEvtSel)); + if(isel>=fNStepEvt){ + AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,fNStepEvt)); return kTRUE; } if(!fEvtCutList[isel])return kTRUE; @@ -141,197 +137,134 @@ Bool_t AliCFManager::CheckEventCuts(Int_t isel, TObject *obj, const TString &se } //_____________________________________________________________________________ -void AliCFManager::FillQABeforeParticleCuts(Int_t isel, TObject *obj) const{ - // - // Fill QA histos before cuts at particle selection level isel are applied - // +void AliCFManager::SetMCEventInfo(const TObject *obj) const { - if(isel>=kNPartSel){ - AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,kNPartSel)); - return; - } - if(!fPartCutList[isel])return; + //Particle level cuts - TObjArrayIter iter(fPartCutList[isel]); - AliCFCutBase *cut = 0; - while ( (cut = (AliCFCutBase*)iter.Next()) ) { - if(cut->IsQAOn())cut->FillHistogramsBeforeCuts(obj); + if (!fPartCutList) { + AliWarning("No particle cut list found"); } -} -//_____________________________________________________________________________ -void AliCFManager::FillQAAfterParticleCuts(Int_t isel, TObject *obj) const{ - // - // Fill QA histos after cuts at particle selection level isel are applied - // - if(isel>=kNPartSel){ - AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,kNPartSel)); - return; + else { + for(Int_t isel=0;iselSetMCEventInfo(obj); + } + } } - if(!fPartCutList[isel])return; - - TObjArrayIter iter(fPartCutList[isel]); - AliCFCutBase *cut = 0; - while ( (cut = (AliCFCutBase*)iter.Next()) ) { - if(cut->IsQAOn())cut->FillHistogramsAfterCuts(obj); + + //Event level cuts + + if (!fEvtCutList) { + AliWarning("No event cut list found"); + } + else { + for(Int_t isel=0;iselSetMCEventInfo(obj); + } + } } } - //_____________________________________________________________________________ -void AliCFManager::FillQABeforeEventCuts(Int_t isel, TObject *obj) const{ - // - // Fill QA histos before cuts at event selection level isel are applied - // +void AliCFManager::SetRecEventInfo(const TObject *obj) const { - if(isel>=kNEvtSel){ - AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,kNEvtSel)); - return; - } - if(!fEvtCutList[isel])return; + //Particle level cuts - TObjArrayIter iter(fEvtCutList[isel]); - AliCFCutBase *cut = 0; - while ( (cut = (AliCFCutBase*)iter.Next()) ) { - if(cut->IsQAOn())cut->FillHistogramsBeforeCuts(obj); + if (!fPartCutList) { + AliWarning("No particle cut list found"); } -} - -//_____________________________________________________________________________ -void AliCFManager::FillQAAfterEventCuts(Int_t isel, TObject *obj) const{ - // - // Fill QA histos after cuts at event selection level isel are applied - // - - if(isel>=kNEvtSel){ - AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,kNEvtSel)); - return; + else { + for(Int_t isel=0;iselSetRecEventInfo(obj); + } + } } - if(!fEvtCutList[isel])return; - - TObjArrayIter iter(fEvtCutList[isel]); - AliCFCutBase *cut = 0; - while ( (cut = (AliCFCutBase*)iter.Next()) ) { - if(cut->IsQAOn())cut->FillHistogramsAfterCuts(obj); + + //Event level cuts + + if (!fEvtCutList) { + AliWarning("No event cut list found"); + } + else { + for(Int_t isel=0;iselSetRecEventInfo(obj); + } + } } } //_____________________________________________________________________________ -void AliCFManager::AddQAHistosToList(TList *list) const { +Bool_t AliCFManager::CompareStrings(const TString &cutname,const TString &selcuts) const{ // - // Add to list the full list of QA histograms to be written to the output + // compare two strings // - for(Int_t isel=0;iselIsQAOn())cut->AddQAHistograms(list); - } - } + if(selcuts.Contains("all"))return kTRUE; + if ( selcuts.CompareTo(cutname) == 0 || + selcuts.BeginsWith(cutname+" ") || + selcuts.EndsWith(" "+cutname) || + selcuts.Contains(" "+cutname+" ")) return kTRUE; + return kFALSE; +} - //Event-level cuts QA - for(Int_t isel=0;iselIsQAOn())cut->AddQAHistograms(list); - } - } -} //_____________________________________________________________________________ -TBits* AliCFManager::GetQAParticleSelBits(Int_t isel, TObject *obj) { +void AliCFManager::SetEventCutsList(Int_t isel, TObjArray* array) { // - // Get the full list of QA histograms to be written to the output + //Setter for event-level selection cut list at selection step isel // - fhQABits->Clear(); //reset the list - - //Particle-level cuts QA - - if(fPartCutList[isel]){ - TObjArrayIter iter(fPartCutList[isel]); - AliCFCutBase *cut = 0; - while ( (cut = (AliCFCutBase*)iter.Next()) ) { - if(cut->IsQAOn()){ - TBits *qalist=new TBits(0); - cut->GetBitMap(obj,qalist); - for(UInt_t icut=0;icutGetNbits();icut++){ - fhQABits->SetBitNumber(icut,qalist->TestBitNumber(icut)); - } - delete qalist; - } - } + if (!fEvtContainer) { + AliWarning("No event container defined, you may need to set it first!"); } - return fhQABits; + Int_t nstep = fNStepEvt; + if (!fEvtCutList) { + fEvtCutList = new TObjArray*[nstep] ; + for (Int_t i=0; i= nstep) { + AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,nstep)); + return; + } + fEvtCutList[isel] = array; } //_____________________________________________________________________________ -void AliCFManager::SetEventInfo(TObject *obj) const { - - //Particle level cuts +void AliCFManager::SetParticleCutsList(Int_t isel, TObjArray* array) { + // + //Setter for particle-level selection cut list at selection step isel + // - for(Int_t isel=0;iselSetEvtInfo(obj); - } + if (!fPartContainer) { + AliWarning("No particle container defined, you may need to set it first!"); } - //Event level cuts - - for(Int_t isel=0;iselSetEvtInfo(obj); - } - } -} -//_____________________________________________________________________________ -void AliCFManager::InitQAHistos() const { - - //Particle level cuts - - for(Int_t isel=0;iselIsQAOn())cut->Init(); - } + Int_t nstep = fNStepPart ; + + if (!fPartCutList) { + fPartCutList = new TObjArray*[nstep] ; + for (Int_t istep = 0; istep < nstep; istep++) fPartCutList[istep] = 0; } - //Event level cuts - - for(Int_t isel=0;iselIsQAOn())cut->Init(); - } + if (isel >= nstep) { + AliWarning(Form("Selection index out of Range! isel=%i, max. number of selections= %i", isel,nstep)); + return; } + fPartCutList[isel] = array; } - -//_____________________________________________________________________________ -Bool_t AliCFManager::CompareStrings(const TString &cutname,const TString &selcuts) const{ - // - // compare two strings - // - - if(selcuts.Contains("all"))return kTRUE; - if ( selcuts.CompareTo(cutname) == 0 || - selcuts.BeginsWith(cutname+" ") || - selcuts.EndsWith(" "+cutname) || - selcuts.Contains(" "+cutname+" ")) return kTRUE; - return kFALSE; -} - -