From c97d2ae122c39b91ed05b5222c06f45f203866c2 Mon Sep 17 00:00:00 2001 From: gconesab Date: Wed, 20 Jan 2010 10:57:42 +0000 Subject: [PATCH] new module for hadron correlations --- PWG4/JetCorrel/AliAnalysisTaskJetCorrel.cxx | 154 +++++++++++ PWG4/JetCorrel/AliAnalysisTaskJetCorrel.h | 55 ++++ PWG4/JetCorrel/AliJetCorrelMaker.cxx | 194 +++++++++++++ PWG4/JetCorrel/AliJetCorrelMaker.h | 53 ++++ PWG4/JetCorrel/AliJetCorrelMixer.cxx | 156 +++++++++++ PWG4/JetCorrel/AliJetCorrelMixer.h | 55 ++++ PWG4/JetCorrel/AliJetCorrelReader.cxx | 290 ++++++++++++++++++++ PWG4/JetCorrel/AliJetCorrelReader.h | 52 ++++ PWG4/JetCorrel/AliJetCorrelSelector.cxx | 253 +++++++++++++++++ PWG4/JetCorrel/AliJetCorrelSelector.h | 90 ++++++ PWG4/JetCorrel/AliJetCorrelWriter.cxx | 283 +++++++++++++++++++ PWG4/JetCorrel/AliJetCorrelWriter.h | 64 +++++ PWG4/JetCorrel/CorrelDefs.h | 74 +++++ PWG4/JetCorrel/CorrelKFTrack.cxx | 69 +++++ PWG4/JetCorrel/CorrelKFTrack.h | 40 +++ PWG4/JetCorrel/CorrelList.cxx | 129 +++++++++ PWG4/JetCorrel/CorrelList.h | 85 ++++++ PWG4/JetCorrel/CorrelParticle.cxx | 52 ++++ PWG4/JetCorrel/CorrelParticle.h | 62 +++++ PWG4/JetCorrel/CorrelRecoParent.cxx | 152 ++++++++++ PWG4/JetCorrel/CorrelRecoParent.h | 45 +++ PWG4/JetCorrel/CorrelTrack.cxx | 64 +++++ PWG4/JetCorrel/CorrelTrack.h | 41 +++ PWG4/JetCorrel/README | 130 +++++++++ PWG4/Makefile | 4 + PWG4/PROOF-INF.PWG4JetCorrel/BUILD.sh | 3 + PWG4/PROOF-INF.PWG4JetCorrel/SETUP.C | 11 + PWG4/PWG4JetCorrelLinkDef.h | 14 + PWG4/libPWG4JetCorrel.pkg | 21 ++ PWG4/macros/AddTaskJetCorrel.C | 36 +++ PWG4/macros/ConfigJetCorrel.C | 43 +++ 31 files changed, 2774 insertions(+) create mode 100644 PWG4/JetCorrel/AliAnalysisTaskJetCorrel.cxx create mode 100644 PWG4/JetCorrel/AliAnalysisTaskJetCorrel.h create mode 100644 PWG4/JetCorrel/AliJetCorrelMaker.cxx create mode 100644 PWG4/JetCorrel/AliJetCorrelMaker.h create mode 100644 PWG4/JetCorrel/AliJetCorrelMixer.cxx create mode 100644 PWG4/JetCorrel/AliJetCorrelMixer.h create mode 100644 PWG4/JetCorrel/AliJetCorrelReader.cxx create mode 100644 PWG4/JetCorrel/AliJetCorrelReader.h create mode 100644 PWG4/JetCorrel/AliJetCorrelSelector.cxx create mode 100644 PWG4/JetCorrel/AliJetCorrelSelector.h create mode 100644 PWG4/JetCorrel/AliJetCorrelWriter.cxx create mode 100644 PWG4/JetCorrel/AliJetCorrelWriter.h create mode 100644 PWG4/JetCorrel/CorrelDefs.h create mode 100644 PWG4/JetCorrel/CorrelKFTrack.cxx create mode 100644 PWG4/JetCorrel/CorrelKFTrack.h create mode 100644 PWG4/JetCorrel/CorrelList.cxx create mode 100644 PWG4/JetCorrel/CorrelList.h create mode 100644 PWG4/JetCorrel/CorrelParticle.cxx create mode 100644 PWG4/JetCorrel/CorrelParticle.h create mode 100644 PWG4/JetCorrel/CorrelRecoParent.cxx create mode 100644 PWG4/JetCorrel/CorrelRecoParent.h create mode 100644 PWG4/JetCorrel/CorrelTrack.cxx create mode 100644 PWG4/JetCorrel/CorrelTrack.h create mode 100644 PWG4/JetCorrel/README create mode 100755 PWG4/PROOF-INF.PWG4JetCorrel/BUILD.sh create mode 100644 PWG4/PROOF-INF.PWG4JetCorrel/SETUP.C create mode 100644 PWG4/PWG4JetCorrelLinkDef.h create mode 100644 PWG4/libPWG4JetCorrel.pkg create mode 100644 PWG4/macros/AddTaskJetCorrel.C create mode 100644 PWG4/macros/ConfigJetCorrel.C diff --git a/PWG4/JetCorrel/AliAnalysisTaskJetCorrel.cxx b/PWG4/JetCorrel/AliAnalysisTaskJetCorrel.cxx new file mode 100644 index 00000000000..c2d4d38de26 --- /dev/null +++ b/PWG4/JetCorrel/AliAnalysisTaskJetCorrel.cxx @@ -0,0 +1,154 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: $ */ + +//__________________________________________ +// Main class for two-particle correlations. +// Calls AliJetCorrelSelector and AliJetCorrelMaker for setup, then +// AliJetCorrelReader for ESD/AOD input reading into CorrelList_t lists, then +// AliJetCorrelMixer for event mixing and AliJetCorrelWriter for output histos +//-- Author: Paul Constantin + +#include "AliAnalysisTaskJetCorrel.h" + +using namespace std; +using namespace JetCorrelHD; + +ClassImp(AliAnalysisTaskJetCorrel) + +AliAnalysisTaskJetCorrel::AliAnalysisTaskJetCorrel(AliJetCorrelSelector *s) : + AliAnalysisTaskSE("JetCorrelTask"), fOutputContainer(new TList), + fSelector(s), fNumCorrel(0), fNumTrigg(0), fNumAssoc(0), fNumEvts(0), + fMaker(new AliJetCorrelMaker), fWriter(new AliJetCorrelWriter), fReader(new AliJetCorrelReader), + fMixer(new AliJetCorrelMixer), fTriggList(NULL), fAssocList(NULL) { + // constructor + + fNumCorrel = fSelector->NoOfCorrel(); + if(!fMaker->Init(fNumCorrel,fSelector->CorrelTypes())) + {std::cerr<<"AliJetCorrelMaker initialization failed. Bye!"<NoOfTrigg(); + fNumAssoc = fMaker->NoOfAssoc(); +// fMaker->Show(); + + fWriter->Init(fSelector,fMaker); + fReader->Init(fSelector,fWriter); + fMixer->Init(fSelector,fMaker,fWriter); + + fTriggList = new CorrelList_t[fNumTrigg]; + fAssocList = new CorrelList_t[fNumAssoc]; + + DefineInput(0, TChain::Class()); + DefineOutput(1, TList::Class()); +} + +AliAnalysisTaskJetCorrel::~AliAnalysisTaskJetCorrel(){ + // destructor + if(fTriggList) {delete [] fTriggList;} + if(fAssocList) {delete [] fAssocList;} + if(fOutputContainer) {fOutputContainer->Clear(); delete fOutputContainer;} + if(fMaker) delete fMaker; + if(fReader) delete fReader; + if(fWriter) delete fWriter; + if(fMixer) delete fMixer; + fNumEvts=0; +} + +void AliAnalysisTaskJetCorrel::UserCreateOutputObjects(){ + // call writer object methods for histogram booking inside the output container list + // OpenFile(1); + fOutputContainer->SetName("JetCorrelHistos"); + fWriter->CreateGeneric(fOutputContainer); + if(fSelector->GenQA()) fWriter->CreateQA(fOutputContainer); + fWriter->CreateCorrelations(fOutputContainer); +} + +void AliAnalysisTaskJetCorrel::UserExec(Option_t */*option*/){ + // get the event and pass it to the data reader object + AliVEvent *fEVT = (AliVEvent*)InputEvent(); + if(!fEVT){ + std::cerr<<"AliAnalysisTaskJetCorrel::UserExec() - ERROR: Cannot get event #"<SetEvent(fEVT); + + // get global event pars and apply global cuts + Float_t cent = fReader->GetMultiplicity(); // use multiplicity in p-p + Float_t zvtx = fReader->GetVertex(); + Int_t cBin = fSelector->GetBin(centr,cent); + Int_t vBin = fSelector->GetBin(zvert,zvtx); + if(cBin<0 || vBin<0) return; // event fails centrality or vertex selection + fWriter->FillGlobal(cent,zvtx); + fNumEvts++; + // std::cout<<"Event:"<Descriptor(iCor)<<"("<FillSingleHistos(&fTriggList[idxTrigg], cBin, idxTrigg); + + CrossCorrelate(&fTriggList[idxTrigg], &fAssocList[idxAssoc], cBin, vBin, iCor); // same-event correlation + + if(!tFilled) fMixer->FillPool(&fTriggList[idxTrigg], idxTrigg, vBin, cBin); + if(!aFilled) fMixer->FillPool(&fAssocList[idxAssoc], idxAssoc, vBin, cBin); + if(nTriggs>0) fMixer->Mix(vBin, cBin, idxTrigg, idxAssoc, iCor); + + PostData(1, fOutputContainer); + } // loop over correlations + + // clear the lists + for(UInt_t it=0; itCleanPool(triggs); + fMixer->CleanPool(assocs); +// std::cout<<"CorrelParticle="<=kMAXNUMCORREL){ + std::cerr<<"AliJetCorrelMaker::Initialize - ERROR: increase kMAXNUMCORREL above " + <fNumCorrel || fNumAssoc>fNumCorrel) return kFALSE; + for(UInt_t k=0; k=fNumTrigg) return kFALSE; + if(fIdxAssoc[k]>=fNumAssoc) return kFALSE; + } + return kTRUE; +} + +TString AliJetCorrelMaker::Descriptor(UInt_t k) const { + if(k>=fNumCorrel) + {std::cerr<<"AliJetCorrelMaker::Descriptor overflow!"<=fNumCorrel) + {std::cerr<<"AliJetCorrelMaker::IdxTrigg overflow!"<=fNumCorrel) + {std::cerr<<"AliJetCorrelMaker::IdxAssoc overflow!"<=fNumCorrel) + {std::cerr<<"AliJetCorrelMaker::TriggType overflow!"<=fNumCorrel) + {std::cerr<<"AliJetCorrelMaker::AssocType overflow!"<NoOfBins(centr); + fNumVertBins = fSelector->NoOfBins(zvert); + fPoolDepth = fSelector->PoolDepth(); + fNumCorrel = fMaker->NoOfCorrel(); + fNumTriggs = fMaker->NoOfTrigg(); + fNumAssocs = fMaker->NoOfAssoc(); + + for(UInt_t vBin=0; vBinSize()<1) return; + PoolType_t pType = partList->PoolID(); + UInt_t pSize = fPool[pType][pIdx][vBin][cBin]->GetSize(); + // when pool depth is reached, pop pool before new event push (keep const depth) + if(pSize>=fPoolDepth) fPool[pType][pIdx][vBin][cBin]->RemoveFirst(); + // incoming list is cleared at end-of-event; hence, store in pool a deep copy: + fPool[pType][pIdx][vBin][cBin]->AddLast(partList->DeepCopy()); +} + +void AliJetCorrelMixer::Mix(UInt_t vBin, UInt_t cBin, UInt_t it, UInt_t ia, UInt_t ic){ + // rolling buffer mixing method + TListIter* iterAssocPool=(TListIter*)fPool[assocs][ia][vBin][cBin]->MakeIterator(); + while(fPool[triggs][it][vBin][cBin]->GetSize()>0){ // evaluate here due to popping + TriggEvnt = (CorrelList_t*)fPool[triggs][it][vBin][cBin]->First(); + TriggIter = TriggEvnt->Head(); + + while((AssocEvnt=(CorrelList_t*)iterAssocPool->Next())){ + AssocIter = AssocEvnt->Head(); + + if(TriggEvnt->EvtID()==AssocEvnt->EvtID()) continue; // don't mix same event! + + while(!TriggIter.HasEnded()){ + while(!AssocIter.HasEnded()){ + fWriter->FillCorrelations(mixed,ic,cBin,vBin,TriggIter.Data(),AssocIter.Data()); // trigg first! + AssocIter.Move(); + } // loop over associated particles + AssocIter = AssocEvnt->Head(); // reset associated particle iterator to list head + TriggIter.Move(); + } // loop over trigger particles + TriggIter = TriggEvnt->Head(); // reset trigger particle iterator to list head + } // loop over associated pool + fPool[triggs][it][vBin][cBin]->RemoveFirst(); + } // if trigger pool is not empty +} + +void AliJetCorrelMixer::CleanPool(PoolType_t pType){ + // pool cleaning + UInt_t size = 0; + if(pType==triggs) size = fNumTriggs; + if(pType==assocs) size = fNumAssocs; + for(UInt_t k=0; kDelete(); // Remove all list objects AND delete all heap based objects + } +} + +UInt_t AliJetCorrelMixer::PoolSize(PoolType_t pType, UInt_t vBin, UInt_t cBin){ + // computes (static) pool size + UInt_t totalPoolSize=0; + UInt_t partSize = sizeof(CorrelParticle_t); + UInt_t listOverhead = sizeof(CorrelListNode_t); + CorrelList_t* partList; TListIter* iter; + UInt_t fNum = fNumAssocs; if(pType==triggs) fNum = fNumTriggs; + for(UInt_t i=0; iMakeIterator(); + while((partList=(CorrelList_t*)iter->Next())) + totalPoolSize += partList->Size()*(partSize+listOverhead); + } + return totalPoolSize/1024; +} + +void AliJetCorrelMixer::ShowSummary(PoolType_t pType, UInt_t pIdx, UInt_t vBin, UInt_t cBin){ + // pool printout method + UInt_t totalPoolSize=0; + TListIter* iter=(TListIter*)fPool[pType][pIdx][vBin][cBin]->MakeIterator(); + CorrelList_t* partList; + while((partList=(CorrelList_t*)iter->Next())) totalPoolSize += partList->Size(); + + if(pType==triggs) std::cout<<"TriggPool["; + if(pType==assocs) std::cout<<"AssocPool["; + std::cout<GetNumberOfTracks(); // ESD no of global tracks + const AliMultiplicity* m = ((AliESDEvent*)fEVT)->GetMultiplicity(); // SPD no of tracklets + return m->GetNumberOfTracklets(); + } else { + return ((AliAODEvent*)fEVT)->GetNTracks(); // AOD no of global tracks + } +} + +Float_t AliJetCorrelReader::GetVertex(){ + // event vertex + if(!fEVT){ + std::cerr<<"AliJetCorrelReader::GetVertex() - ERROR : fEVT not set!"<GetVertex()->GetXYZ(v); + return v[2]; + } else { + return ((AliAODEvent*)fEVT)->GetVertex(0)->GetZ(); + } +} + +void AliJetCorrelReader::FillLists(CorrelList_t *list1, CorrelList_t *list2){ + // fills the trigger&associated particle lists + Bool_t useESD = IsESDEvt(fEVT); + PartType_t partType1 = list1->PartID(); + PartType_t partType2 = list2->PartID(); + Bool_t filled1 = list1->Filled(); + Bool_t filled2 = list2->Filled(); + // when needed, fill both lists simultaneously for speed: + if(!filled1 && !filled2 && partType1==partType2){ + switch(partType1){ + case hadron: + if(useESD) FillESDTrackLists(list1,list2); + else { + std::cerr<<"AliJetCorrelReader::FillLists() - ERROR: AOD dihadron not implemented!"<SetFilled(kTRUE); + list2->SetFilled(kTRUE); + } else { + if(!filled1){ + FillList(list1); + list1->SetFilled(kTRUE); + } + if(!filled2){ + FillList(list2); + list2->SetFilled(kTRUE); + } + } +} + +void AliJetCorrelReader::FillList(CorrelList_t *list){ + // calls the appropriate Fill method for the list's particle type + Bool_t useESD = IsESDEvt(fEVT); + PartType_t partType = list->PartID(); + switch(partType){ + case hadron: + if(useESD) FillESDTrackList(list); + else{ + std::cerr<<"AliJetCorrelReader::FillLists() - ERROR: AOD hadron not implemented!"<PartID(); // by definition the two lists store same particle + + UInt_t nTracks = fEVT->GetNumberOfTracks() ; + if(nTracks<1) return; + for(register UInt_t i=0; iGetTrack(i); + + Float_t pT = track->Pt(); + if(pTMinAssocPt()) continue; + if(fSelector->GenQA()) fWriter->FillTrackQA(track,0); + if(fSelector->LowQualityTrack(track)) continue; + if(!fSelector->PassPID(track,partType)) continue; + if(fSelector->GenQA()) fWriter->FillTrackQA(track,1); + + // fill CorrelList_t object with CorrelTrack_t if two-track cuts (TPC entrance) are used and + // with CorrelParticle_t if not (base particle uses much less memory). Pair (ghost) cuts need + // to be applied for both real/mixed pairs, but it's not clear yet whether this is necessary. + CorrelTrack_t *hadr = new CorrelTrack_t; + const AliExternalTrackParam* tpcEntry = track->GetInnerParam(); + hadr->SetTPCEntry(tpcEntry->GetX(),tpcEntry->GetY(),tpcEntry->GetZ()); +// CorrelParticle_t *hadr = new CorrelParticle_t; // comment out above 4 lines first + hadr->SetPt(pT*track->Charge()); + hadr->SetPhi(track->Phi()); + hadr->SetEta(track->Eta()); + hadr->SetMass(track->GetMass()); + hadr->SetID(partType); + + if(list1->PoolID()==assocs && fSelector->IsAssoc(pT)) list1->Push(hadr->Copy()); + if(list1->PoolID()==triggs && fSelector->IsTrigg(pT)) list1->Push(hadr->Copy()); + if(list2->PoolID()==assocs && fSelector->IsAssoc(pT)) list2->Push(hadr->Copy()); + if(list2->PoolID()==triggs && fSelector->IsTrigg(pT)) list2->Push(hadr->Copy()); + delete hadr; + } // ESD track loop +} + +void AliJetCorrelReader::FillESDTrackList(CorrelList_t *list){ + // this method is called for: (1) associated hadrons, when trigger is not hadron; + // (2) electrons to be used in dielectron reconstruction. Assoc pT cuts apply then... + PartType_t partType = list->PartID(); + + UInt_t nTracks = fEVT->GetNumberOfTracks(); + if(nTracks<1) return; + for(register UInt_t i=0; iGetTrack(i); + + Float_t pT = track->Pt(); + if(pTMinAssocPt()) continue; + if(fSelector->GenQA()) fWriter->FillTrackQA(track,0); + if(fSelector->LowQualityTrack(track)) continue; + if(fSelector->GenQA()) fWriter->FillTrackQA(track,1); + if(!fSelector->PassPID(track,partType)) continue; + + // fill CorrelList_t object with CorrelKFTrack_t if AliKFParticle is used for di-electrons and + // with CorrelParticle_t if this is done via TLorentzVector in CorrelRecoParent_t (less memory). + // AliKFParticle allows for a vertex cut on the reconstructed di-electron + if(partType==electron && kUseAliKF){ + CorrelKFTrack_t *elec = new CorrelKFTrack_t; + const AliExternalTrackParam* tPar = track->GetConstrainedParam(); + elec->SetParam(tPar->GetParameter()); + elec->SetCovar(tPar->GetCovariance()); + elec->SetPt(pT*track->Charge()); + elec->SetPhi(track->Phi()); + elec->SetEta(track->Eta()); + elec->SetMass(track->GetMass()); + elec->SetID(partType); + list->Push(elec); + } else { + CorrelParticle_t *hadr = new CorrelParticle_t; + hadr->SetPt(pT*track->Charge()); + hadr->SetPhi(track->Phi()); + hadr->SetEta(track->Eta()); + hadr->SetMass(track->GetMass()); + hadr->SetID(partType); + list->Push(hadr); + } + } +} + +void AliJetCorrelReader::FillESDPhotonList(CorrelList_t *list){ + // TBI + std::cerr<<"WARNING : FillESDPhotonList() not emplemented yet. Doing nothing..."<Size()<Label(photon,assocs,0); // event number unimportant here + FillESDPhotonList(fPhotonList); + FillParentList(list, fPhotonList); + fWriter->FillParentNtuple(list); + delete fPhotonList; +} + +void AliJetCorrelReader::FillESDDielectronList(CorrelList_t* list){ + // makes a dielectron list + CorrelList_t *fElectronList = new CorrelList_t; + fElectronList->Label(electron,assocs,0); // event number unimportant here + FillESDTrackList(fElectronList); + FillParentList(list, fElectronList); + fWriter->FillParentNtuple(list); + delete fElectronList; +} + +void AliJetCorrelReader::FillParentList(CorrelList_t *ParentList, CorrelList_t *ChildList){ + // makes a list of parent particles from a list of children of same type + if(ChildList->Size()<2) return; + + CorrelListIter_t iterChild1, iterChild2; + iterChild1 = ChildList->Head(); + while(!iterChild1.HasEnded()){ + CorrelParticle_t *child1 = iterChild1.Data(); iterChild1.Move(); + iterChild2 = iterChild1; + while(!iterChild2.HasEnded()){ + CorrelParticle_t *child2 = iterChild2.Data(); iterChild2.Move(); + CorrelRecoParent_t *parent = new CorrelRecoParent_t; + parent->SetEvent(fEVT); + Bool_t goodParent = parent->Reconstruct(child1, child2); + Bool_t inPtRange = (ParentList->PoolID()==assocs && fSelector->IsAssoc(parent->Pt())) || + (ParentList->PoolID()==triggs && fSelector->IsTrigg(parent->Pt())); + if(goodParent && inPtRange) ParentList->Push(parent); + } // 2nd particle loop + } // 1st particle loop +} + +Bool_t AliJetCorrelReader::IsESDEvt(AliVEvent * const inEvt){ + // checks input type + TString inputName = (TString)inEvt->ClassName(); + if(inputName=="AliESDEvent") return kTRUE; + else if(inputName=="AliAODEvent") return kFALSE; + else { + std::cerr<<"AliJetCorrelReader::IsESDEvt() - ERROR: Unknown event input!"<kMAXNUMCORREL){std::cerr<<"AliJetCorrelSelector: correlation array too big!"<99){ + std::cerr<<"AliJetCorrelSelector::SetCorrelTypes - read error? val["<kMAXCENTBIN){std::cerr<<"AliJetCorrelSelector: centrality array too big!"<999.){ + std::cerr<<"AliJetCorrelSelector::SetBinningCentr - read error? val["<kMAXVERTBIN){std::cerr<<"AliJetCorrelSelector: vertex array too big!"<999.){ + std::cerr<<"AliJetCorrelSelector::SetBinningZvert - read error? val["<"<"<Show(); t2->Show(); + return kTRUE; +} + +Bool_t AliJetCorrelSelector::LowQualityTrack(AliESDtrack* track){ + // selects low quality tracks + UInt_t status = track->GetStatus(); + if(fITSRefit && !(status & AliESDtrack::kITSrefit)) return kTRUE; + if(fTPCRefit && !(status & AliESDtrack::kTPCrefit)) return kTRUE; + + UInt_t nClusITS = track->GetITSclusters(0); + UInt_t nClusTPC = track->GetTPCclusters(0); // or track->GetTPCNcls() ? + if(nClusITSGetITSchi2()/Float_t(nClusITS); + if(nClusTPC!=0) chi2TPC = track->GetTPCchi2()/Float_t(nClusTPC); + if(chi2ITS<0 || chi2ITS>fMaxITSChi2) return kTRUE; + if(chi2TPC<0 || chi2TPC>fMaxTPCChi2) return kTRUE; + + if(fRejectKinkChild && track->GetKinkIndex(0)>0) return kTRUE; + if(GetSigmaToVertex(track)>fMaxNsigmaVtx) return kTRUE; + + return kFALSE; +} + +Bool_t AliJetCorrelSelector::PassPID(AliESDtrack* track, PartType_t PartType){ + // checks if a track has the required ID + Bool_t hasReqPID = kFALSE; + Stat_t fPid; + Stat_t fWeight; + GetPID(track, fPid, fWeight); + + switch(PartType){ + case hadron: + // if(fPID!=0) hasReqPID = kTRUE; + hasReqPID = kTRUE; + break; + case electron: + // if(fTRDRefit && !(status & AliESDtrack::kTRDrefit)) hasReqPID = kFALSE; + // if(fPID!=0) hasReqPID = kFALSE; + hasReqPID = kTRUE; + break; + case pion: + // if(fPID!=2) hasReqPID = kFALSE; + hasReqPID = kTRUE; + break; + case kaon: + // if(fPID!=3) hasReqPID = kFALSE; + hasReqPID = kTRUE; + break; + case proton: + // if(fPID!=4) hasReqPID = kFALSE; + hasReqPID = kTRUE; + break; + default: + std::cerr<<"AliJetCorrelSelector::PassPID() - ERROR: wrong type!"<GetImpactParameters(b,bCov); + if(bCov[0]<=0 || bCov[2]<=0) return -1.; + bRes[0] = TMath::Sqrt(bCov[0]); + bRes[1] = TMath::Sqrt(bCov[2]); + + Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2)); + + if(TMath::Exp(-d*d/2)<1e-10) return 1000; + + Float_t nSigma = TMath::ErfInverse(1-TMath::Exp(-d*d/2))*TMath::Sqrt(2); + return nSigma; +} + +void AliJetCorrelSelector::GetPID(AliESDtrack* track, Stat_t& fpid, Stat_t& fweight){ + // Finds most probable particle: 0=Electron, 1=Muon, 2=Pion, 3=Kaon, 4=Proton + fpid = -1; + fweight = -1; + + Double_t wpart[5], wpartbayes[5]; + track->GetESDpid(wpart); // probability of the different particle types + Double_t c[5]={1., 1., 1., 1., 1.}; // Tentative particle type "concentrations" + // Double_t c[5]={0.01, 0.01, 0.85, 0.10, 0.05}; + + //Bayes formula + Double_t rcc = 0.; + for(Int_t i=0; i<5; i++) {rcc += c[i]*wpart[i];} + if(TMath::Abs(rcc)<1e-10) return; + for(Int_t i=0; i<5; i++) {wpartbayes[i] = c[i]*wpart[i]/rcc;} + + Int_t ipid=-1; + Float_t max=0.; + for(Int_t i=0; i<5; i++) { + if(wpartbayes[i]>max) { + ipid = i; + max = wpartbayes[i]; + } + } + + fpid = ipid; + fweight = max; +} diff --git a/PWG4/JetCorrel/AliJetCorrelSelector.h b/PWG4/JetCorrel/AliJetCorrelSelector.h new file mode 100644 index 00000000000..79b9121c6e7 --- /dev/null +++ b/PWG4/JetCorrel/AliJetCorrelSelector.h @@ -0,0 +1,90 @@ +#ifndef __ALIJETCORRELSELECTOR_H__ +#define __ALIJETCORRELSELECTOR_H__ +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ +/* $Id: $ */ + +//__________________________________________ +// Class for user selections. Object is created by ConfigJetCorrel.C macro +// and passed to AddTaskJetCorrel.C running macro. +//-- Author: Paul Constantin + +#include "CorrelTrack.h" +#include "CorrelKFTrack.h" +#include "CorrelRecoParent.h" +#include "CorrelList.h" + +namespace JetCorrelHD { + + class AliJetCorrelSelector : public TObject { + + public: + AliJetCorrelSelector(); + ~AliJetCorrelSelector(); + + // Selection getters: + UInt_t PoolDepth() {return fPoolDepth;} + UInt_t NoOfCorrel() {return fNumCorrel;} + UInt_t* CorrelTypes() {return fCorrelType;} + const UInt_t NoOfBins(BinType_t cType) {return fNumBins[cType]-1;} + Float_t BinBorder(BinType_t cType, UInt_t ii); + Int_t GetBin(BinType_t cType, Float_t val); + Float_t MinAssocPt() {return minAssocPt;} + Float_t MaxAssocPt() {return maxAssocPt;} + UInt_t NumAssocPt() {return UInt_t((maxAssocPt-minAssocPt)/bwAssocPt);} + Float_t MinTriggPt() {return minTriggPt;} + Float_t MaxTriggPt() {return maxTriggPt;} + UInt_t NumTriggPt() {return UInt_t((maxTriggPt-minTriggPt)/bwTriggPt);} + Bool_t GenQA() {return fGenQA;}; + void Show(); + // Selection Setters: + void SetPoolDepth(UInt_t v) {fPoolDepth=v;} + void SetCorrelTypes(UInt_t s, UInt_t * const v); + void SetBinningCentr(UInt_t s, Float_t * const v); + void SetBinningZvert(UInt_t s, Float_t * const v); + void SetBinningTrigg(Float_t min, Float_t max, Float_t bw); + void SetBinningAssoc(Float_t min, Float_t max, Float_t bw); + void SetITSRefit(Bool_t v) {fITSRefit=v;} + void SetTPCRefit(Bool_t v) {fTPCRefit=v;} + void SetTRDRefit(Bool_t v) {fTRDRefit=v;} + void SetMaxITSChi2(Float_t v) {fMaxITSChi2=v;} + void SetMaxTPCChi2(Float_t v) {fMaxTPCChi2=v;} + void SetMinNClusITS(UInt_t v) {fMinNClusITS=v;} + void SetMinNClusTPC(UInt_t v) {fMinNClusTPC=v;} + void SetMaxNsigmaVtx(Float_t v) {fMaxNsigmaVtx=v;} + void SetRejectKinkChild(Bool_t v) {fRejectKinkChild=v;} + void SetQA(Bool_t v) {fGenQA=v;} + // Cutting methods: + Bool_t IsAssoc(Float_t pT) {return (pT>=minAssocPt && pT<=maxAssocPt);} + Bool_t IsTrigg(Float_t pT) {return (pT>=minTriggPt && pT<=maxTriggPt);} + Bool_t GoodTrackPair(CorrelTrack_t* t1, CorrelTrack_t* t2); + Bool_t LowQualityTrack(AliESDtrack* t); + Bool_t PassPID(AliESDtrack* t, PartType_t pType); + Float_t GetSigmaToVertex(AliESDtrack* trk); + void GetPID(AliESDtrack* trk, Stat_t& fpid, Stat_t& fweight); + + private: + // Generic Selections: + UInt_t fNumCorrel, fPoolDepth; // number of correlations, pool depth + UInt_t *fCorrelType; // array of correlation types + UInt_t fNumBins[2]; // number of bins: centr, zvert + Float_t* fBinning[2]; // bin margins: centr, zvert + Bool_t fGenQA; // generate QA histos + Float_t minTriggPt, maxTriggPt, bwTriggPt; // trigg Pt binning + Float_t minAssocPt, maxAssocPt, bwAssocPt; // assoc Pt binning + // Track Selections: + Bool_t fITSRefit, fTPCRefit, fTRDRefit, fRejectKinkChild; // on/off cuts + Float_t fMaxNsigmaVtx; + Float_t fMaxITSChi2, fMaxTPCChi2; + UInt_t fMinNClusITS, fMinNClusTPC; + + // disable (make private) copy constructor, and assignment operator: + AliJetCorrelSelector(const AliJetCorrelSelector&); + AliJetCorrelSelector& operator=(const AliJetCorrelSelector&); + + ClassDef(AliJetCorrelSelector, 1); + }; + +} // namespace + +#endif diff --git a/PWG4/JetCorrel/AliJetCorrelWriter.cxx b/PWG4/JetCorrel/AliJetCorrelWriter.cxx new file mode 100644 index 00000000000..b0832f63c65 --- /dev/null +++ b/PWG4/JetCorrel/AliJetCorrelWriter.cxx @@ -0,0 +1,283 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: $ */ + +//______________________________________________________ +// Class for output (histograms) definition and filling. +//-- Author: Paul Constantin + +#include "AliJetCorrelWriter.h" + +using namespace std; +using namespace JetCorrelHD; + +ClassImp(AliJetCorrelWriter) + +AliJetCorrelWriter::AliJetCorrelWriter() : + fSelector(NULL), fMaker(NULL), hname(""), htit(""), fRecoTrigg(kFALSE), fRndm(6251093), + hBinsCentr(NULL), hBinsZVert(NULL), hCentr(NULL), hZVert(NULL), ntuParent(NULL) { + // constructor + for(UInt_t i=0; iRecoTrigger(); +} + +//////////////////////////////////////////// +// METHODS FOR CREATION OF OUTPUT HISTOGRAMS +//////////////////////////////////////////// + +void AliJetCorrelWriter::CreateGeneric(TList *histosContainer){ + // books generic histograms + UInt_t nTypeTrigg = fMaker->NoOfTrigg(); + UInt_t nBinsCentr = fSelector->NoOfBins(centr); + UInt_t nBinsZVert = fSelector->NoOfBins(zvert); + UInt_t nBinsTrigg = fSelector->NumTriggPt(); + Float_t minTrigg = fSelector->MinTriggPt(); + Float_t maxTrigg = fSelector->MaxTriggPt(); + + for(UInt_t tt=0; ttAddLast(hTriggPt[tt][ic]); + } // centrality binning loop + } // loop over trigger types + + hCentr = new TH1F("hCentr","centrality distribution",100, 0., 100.); + histosContainer->AddLast(hCentr); + hZVert = new TH1F("hZVert","vertex distribution",100, -50., 50.); + histosContainer->AddLast(hZVert); + + hBinsCentr = new TH1F("hBinsCentr","centrality binning", nBinsCentr+1, 0, 1); + histosContainer->AddLast(hBinsCentr); + for(UInt_t i=1;i<=nBinsCentr+1; i++) + hBinsCentr->SetBinContent(i,fSelector->BinBorder(centr,i-1)); + hBinsZVert = new TH1F("hBinsZVert","centrality binning", nBinsZVert+1, 0, 1); + histosContainer->AddLast(hBinsZVert); + for(UInt_t i=1;i<=nBinsZVert+1; i++) + hBinsZVert->SetBinContent(i,fSelector->BinBorder(zvert,i-1)); +} + +void AliJetCorrelWriter::CreateQA(TList *histosContainer){ + // books QA histograms + TString when[2] = {"before cuts","after cuts"}; + for(UInt_t i=0; i<2; i++){ + hname = "hTrkITSQA"; hname += i; + htit = "ITS nClust vs Chi2/nClust "; htit += when[i]; + hTrkITSQA[i] = new TH2F(hname,htit,20,0.,20.,50,0.,10.); + histosContainer->AddLast(hTrkITSQA[i]); + hname = "hTrkTPCQA"; hname += i; + htit = "TPC nClust vs Chi2/nClust "; htit += when[i]; + hTrkTPCQA[i] = new TH2F(hname,htit,30,0.,150.,50,0.,10.); + histosContainer->AddLast(hTrkTPCQA[i]); + hname = "hTrkVTXQA"; hname += i; + htit = "VTX KinkIndex vs nSigma "; htit += when[i]; + hTrkVTXQA[i] = new TH2F(hname,htit,21,-10.,10,50,0.,10.); + histosContainer->AddLast(hTrkVTXQA[i]); + } + + UInt_t nBinsCentr = fSelector->NoOfBins(centr); + UInt_t nBinsTrigg = fSelector->NumTriggPt(); + Float_t minTrigg = fSelector->MinTriggPt(); + Float_t maxTrigg = fSelector->MaxTriggPt(); + UInt_t nBinsAssoc = fSelector->NumAssocPt(); + Float_t minAssoc = fSelector->MinAssocPt(); + Float_t maxAssoc = fSelector->MaxAssocPt(); + for(UInt_t it=0; it<2; it++){ // mixing type loop (real/mixed) + for(UInt_t ic=0; icAddLast(hTrkProx[it][ic]); + } // loop over correlation types + } // loop over mixing type +} + +void AliJetCorrelWriter::CreateCorrelations(TList* histosContainer){ + // books correlation histograms + const Float_t lr=-0.5*pi, ur=1.5*pi, bwPout=0.2; + UInt_t nTypeCorrel = fMaker->NoOfCorrel(); + UInt_t nBinsCentr = fSelector->NoOfBins(centr); + UInt_t nBinsZVert = fSelector->NoOfBins(zvert); + UInt_t nBinsTrigg = fSelector->NumTriggPt(); + Float_t minTrigg = fSelector->MinTriggPt(); + Float_t maxTrigg = fSelector->MaxTriggPt(); + UInt_t nBinsAssoc = fSelector->NumAssocPt(); + Float_t minAssoc = fSelector->MinAssocPt(); + Float_t maxAssoc = fSelector->MaxAssocPt(); + UInt_t nPoutBins = UInt_t(TMath::Ceil(2.2*maxAssoc/bwPout)); // since |p_out|AddLast(ntuParent); + } + for(UInt_t ityp=0; ityp<2; ityp++){ // mixing type loop (real/mixed) + for(UInt_t htc=0; htcDescriptor(htc); + htit+=":"; htit+=ityp; htit+=hic; htit+=hiv; + hname="hDPhi"; hname+=ityp; hname+=htc; hname+=hic; hname+=hiv; + hDPhi[ityp][htc][hic][hiv] = new TH3F(hname, htit, kDPhiNumBins, lr, ur, + nBinsTrigg,minTrigg,maxTrigg, nBinsAssoc,minAssoc,maxAssoc); + histosContainer->AddLast(hDPhi[ityp][htc][hic][hiv]); + hname="hDEta"; hname+=ityp; hname+=htc; hname+=hic; hname+=hiv; + hDEta[ityp][htc][hic][hiv] = new TH3F(hname, htit, kDEtaNumBins, -2., 2., + nBinsTrigg,minTrigg,maxTrigg, nBinsAssoc,minAssoc,maxAssoc); + histosContainer->AddLast(hDEta[ityp][htc][hic][hiv]); + hname="hPout"; hname+=ityp; hname+=htc; hname+=hic; hname+=hiv; + hPout[ityp][htc][hic][hiv] = new TH3F(hname, htit, nPoutBins, -1.1*maxAssoc, 1.1*maxAssoc, + nBinsTrigg,minTrigg,maxTrigg, nBinsAssoc,minAssoc,maxAssoc); + histosContainer->AddLast(hPout[ityp][htc][hic][hiv]); + } // loop over vertex bins + } // loop over centrality bins + } // loop over correlation types + } // loop over mixing type +} + +///////////////////////////////////////////////////////// +// METHODS FOR FILLING THE OUTPUT HISTOGRAMS +///////////////////////////////////////////////////////// + +void AliJetCorrelWriter::FillGlobal(Float_t cent, Float_t zvert){ + // some global event histos + hCentr->Fill(cent); + hZVert->Fill(zvert); +} + +void AliJetCorrelWriter::FillSingleHistos(CorrelList_t * const TrigList, UInt_t cBin, UInt_t pIdx){ + // fils single-particle histograms + if(TrigList->Size()<1) return; + CorrelListIter_t partIter = TrigList->Head(); + while(!partIter.HasEnded()){ + CorrelParticle_t *particle = partIter.Data(); + hTriggPt[pIdx][cBin]->Fill(particle->Pt()); + partIter.Move(); + } +} + +void AliJetCorrelWriter::FillTrackQA(AliESDtrack * const track, UInt_t idx){ + // fills single-particle QA + if(idx>1){std::cerr<<"AliJetCorrelWriter::FillTrackQA: wrong idx!"<GetITSclusters(0); + UInt_t nClusTPC = track->GetTPCclusters(0); // or track->GetTPCNcls() ? + Float_t chi2ITS=-1., chi2TPC=-1.; + if(nClusITS!=0) chi2ITS = track->GetITSchi2()/Float_t(nClusITS); + if(nClusTPC!=0) chi2TPC = track->GetTPCchi2()/Float_t(nClusTPC); + UInt_t kinkIndex = track->GetKinkIndex(0); + Float_t sigVtx = fSelector->GetSigmaToVertex(track); + + hTrkITSQA[idx]->Fill(Float_t(nClusITS),chi2ITS); + hTrkTPCQA[idx]->Fill(Float_t(nClusTPC),chi2TPC); + hTrkVTXQA[idx]->Fill(Float_t(kinkIndex),sigVtx); +} + +void AliJetCorrelWriter::FillParentNtuple(CorrelList_t * const ParentList){ + // fills ntuple of triggers when they are reconstructed parents (pi0,Z0,etc.) + if(!fRecoTrigg) + {std::cerr<<"AliJetCorrelWriter::FillParentNtuple: you shouldn't be here!"<Size()<1) return; + Float_t parVar[8]={0.}; + CorrelListIter_t parIter = ParentList->Head(); + while(!parIter.HasEnded()){ + CorrelRecoParent_t *parent = dynamic_cast(parIter.Data()); + if(!parent) + {std::cerr<<"AliJetCorrelWriter::FillParentNtuple: failed casting!"<ID(); + parVar[1] = parent->Q(); + parVar[2] = parent->M(); + parVar[3] = parent->Pt(); + parVar[4] = parent->Phi(); + parVar[5] = parent->Eta(); + parVar[6] = parent->Assym(); + parVar[7] = parent->OpenAng(); + ntuParent->Fill(parVar); + parIter.Move(); + } +} + +void AliJetCorrelWriter::FillCorrelations(FillType_t fTyp, UInt_t iCorr, UInt_t cBin, UInt_t vBin, + CorrelParticle_t * const Trigg, CorrelParticle_t * const Assoc){ + // fills the correlation (two-particle) histograms + // trigger information (this is why the first particle has to be the trigger): + Float_t ptt = Trigg->Pt(); + Float_t phit = Trigg->Phi(); + Float_t etat = Trigg->Eta(); + // associated information: + Float_t pta = Assoc->Pt(); + Float_t phia = Assoc->Phi(); + Float_t etaa = Assoc->Eta(); + + if(!fSelector->IsAssoc(pta) || !fSelector->IsTrigg(ptt)) return; + if(fabs(ptt-pta)GenQA()) + if(Trigg->ID()==hadron && Assoc->ID()==hadron){ + CorrelTrack_t* trk1 = dynamic_cast(Trigg); + CorrelTrack_t* trk2 = dynamic_cast(Assoc); + if(!trk1 || !trk2) + {std::cerr<<"AliJetCorrelWriter::FillCorrelations: failed casting!"<Fill(trk1->Dist(trk2),ptt,pta); + } + // Fill correlation histograms: + Float_t dphi = DeltaPhi(phit,phia); + Float_t deta = etat-etaa; + Float_t pout = pta*TMath::Sin(dphi); + hDPhi[fTyp][iCorr][cBin][vBin]->Fill(dphi,ptt,pta); + hDEta[fTyp][iCorr][cBin][vBin]->Fill(deta,ptt,pta); + hPout[fTyp][iCorr][cBin][vBin]->Fill(pout,ptt,pta); + + if(fTyp==real) fNumReal[iCorr][cBin]++; else fNumMix[iCorr][cBin]++; +} + +void AliJetCorrelWriter::ShowStats(){ + // stats printout method + UInt_t nTypeCorrel = fMaker->NoOfCorrel(); + UInt_t nBinsCentr = fSelector->NoOfBins(centr); + for(UInt_t i=0; iDescriptor(i)<BinBorder(centr, j); + Float_t cb2 = fSelector->BinBorder(centr, j+1); + std::cout<<" Centrality:"< + +// ROOT headers: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// AliRoot headers: +#include "AliAnalysisManager.h" +#include "AliAnalysisTaskSE.h" +#include "AliVEvent.h" +#include "AliVParticle.h" +#include "AliKFParticle.h" +#include "AliKFVertex.h" +#include "AliESDInputHandler.h" +#include "AliESDEvent.h" +#include "AliESDVertex.h" +#include "AliMultiplicity.h" +#include "AliESDtrack.h" +#include "AliAODInputHandler.h" +#include "AliAODEvent.h" +#include "AliAODVertex.h" +#include "AliAODTrack.h" + +namespace JetCorrelHD { + + enum FillType_t {real, mixed}; + enum PoolType_t {triggs, assocs}; + enum BinType_t {centr, zvert}; + enum PartType_t {unknown, hadron, proton, kaon, pion, photon, electron, jet, + dihadron, diphoton, dielectron, dijet}; + + const Float_t kEPS = 1.e-6; + const Float_t pi = TMath::Pi(); + const Bool_t kUseAliKF = kFALSE; // reconstruction with AliKFParticle or TLorentzVector + const Float_t kZ0MassMean = 91.; + const Float_t kZ0MassSig = 3.; + const Float_t kPi0MassMean = 0.140; // Pi0 mass range for diphoton selection + const Float_t kPi0MassSig = 0.010; + + const UInt_t kDPhiNumBins = 62; // number of bins in DeltaPhi histos (2pi-bin=0.1) + const UInt_t kDEtaNumBins = 40; // number of bins in DeltaEta histos (3.6-bin=0.1) + + const UInt_t kMAXNUMCORREL = 3; // Maximum no of correlations + const UInt_t kMAXVERTBIN = 10; // Maximum no of vertex bins + const UInt_t kMAXCENTBIN = 3; // Maximum no of centrality bins + +} // namespace declaration + +#endif diff --git a/PWG4/JetCorrel/CorrelKFTrack.cxx b/PWG4/JetCorrel/CorrelKFTrack.cxx new file mode 100644 index 00000000000..f0018dc27f5 --- /dev/null +++ b/PWG4/JetCorrel/CorrelKFTrack.cxx @@ -0,0 +1,69 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: $ */ + +//__________________________________________________ +// Container class for a track with AliKF parameters +//-- Author: Paul Constantin + +#include "CorrelKFTrack.h" + +using namespace std; +using namespace JetCorrelHD; + +CorrelKFTrack_t::CorrelKFTrack_t() : CorrelParticle_t(), fParam(NULL), fCovar(NULL){ + // default constructor: +} + +CorrelKFTrack_t::CorrelKFTrack_t(Float_t pt, Float_t p, Float_t e, Float_t m, PartType_t i, + Double_t* par, Double_t* cov) : + CorrelParticle_t(pt,p,e,m,i), fParam(par), fCovar(cov){ + // constructor: +} + +CorrelKFTrack_t::CorrelKFTrack_t(const CorrelKFTrack_t &p) : + CorrelParticle_t(p.fPt,p.fPhi,p.fEta,p.fMass,p.fID), fParam(p.fParam), fCovar(p.fCovar){ + // copy constructor: +} + +CorrelKFTrack_t* CorrelKFTrack_t::operator=(const CorrelKFTrack_t& rhs){ + fPt = rhs.Pt()*rhs.Q(); + fPhi = rhs.Phi(); + fEta = rhs.Eta(); + fMass = rhs.M(); + fID = rhs.ID(); + fParam = rhs.Param(); + fCovar = rhs.Covar(); + return this; +} + +CorrelKFTrack_t* CorrelKFTrack_t::Copy(){ + // creates and returns a copy object + CorrelKFTrack_t *copy = new CorrelKFTrack_t; + copy->fPt = this->Pt()*this->Q(); + copy->fPhi = this->Phi(); + copy->fEta = this->Eta(); + copy->fMass = this->M(); + copy->fID = this->ID(); + copy->fParam = this->Param(); + copy->fCovar = this->Covar(); + return copy; +} + +void CorrelKFTrack_t::Show(){ + // printout method + std::cout<<" Electron pT="<Label(this->PartID(), this->PoolID(), this->EvtID()); + copy->SetFilled(this->Filled()); + // fHead and fSize are set by Push() below + + CorrelListIter_t iter = this->Head(); + while(!iter.HasEnded()){ + CorrelParticle_t* gener = iter.Data(); + CorrelTrack_t* track = dynamic_cast(gener); + CorrelRecoParent_t* recon = dynamic_cast(gener); + if(track) copy->Push(track->Copy()); + else if(recon) copy->Push(recon->Copy()); + else copy->Push(gener->Copy()); + iter.Move(); + } // iterator loop over caller list + + return copy; +} + +void CorrelList_t::Reset(){ + // deep delete + if(fSize>0){ + CorrelListIter_t iter = Head(); + while(!iter.HasEnded()){ + CorrelListIter_t current = iter; // get current node + iter.Move(); // move iterator to next node + if(current.Node()) // redundant deletes happen in same part corr (dihadron) + delete current.Node(); // with overlapping pT bins + fSize--; + } + } + fEvtID = 0; + fFilled = kFALSE; + fPartID = unknown; + fPoolID = assocs; + fHead = NULL; +} + +void CorrelList_t::ShowHead(){ + // top printout + std::cout<<" CorrelList_t("<Show(); else std::cout<GetNext();} + CorrelListNode_t* Node() {Check(); return fCurr;} + CorrelParticle_t* Data() {Check(); return fCurr->GetData();} + + private: + CorrelListNode_t* fCurr; // iterator "current node" + }; + + class CorrelList_t : public TObject { + public: + CorrelList_t(); + virtual ~CorrelList_t() {Reset();} + void Reset(); + const CorrelList_t& operator=(const CorrelList_t& rhs); // makes shallow copy + CorrelList_t* DeepCopy(); // use this method to get a deep copy + + void Push(CorrelParticle_t* p); + UInt_t Size() const {return fSize;} + UInt_t EvtID() const {return fEvtID;} + PartType_t PartID() const {return fPartID;} + PoolType_t PoolID() const {return fPoolID;} + Bool_t Filled() const {return fFilled;} + void SetFilled(Bool_t f) {fFilled=f;} + void Label(PartType_t p, PoolType_t l, UInt_t e) {fPartID=p; fPoolID=l; fEvtID=e;} + CorrelListIter_t Head() const {return CorrelListIter_t(fHead);} + void ShowHead(); + void Show(); + + private: + UInt_t fSize; // list size + UInt_t fEvtID; // event ID + Bool_t fFilled; // is filled + PartType_t fPartID; // particle ID + PoolType_t fPoolID; // pool type + CorrelListNode_t* fHead; // list head + + CorrelList_t(const CorrelList_t& rhs); // forbid copy constructor + }; + +} // namespace declaration + +#endif diff --git a/PWG4/JetCorrel/CorrelParticle.cxx b/PWG4/JetCorrel/CorrelParticle.cxx new file mode 100644 index 00000000000..046bd08fe49 --- /dev/null +++ b/PWG4/JetCorrel/CorrelParticle.cxx @@ -0,0 +1,52 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: $ */ + +//________________________________________________ +// Main container class - stores generic particle. +//-- Author: Paul Constantin + +#include "CorrelParticle.h" + +using namespace std; +using namespace JetCorrelHD; + +CorrelParticle_t::CorrelParticle_t() : fPt(-999.), fPhi(-999.), fEta(-999.), fMass(-999.), fID(unknown){ + // default constructor +} + +CorrelParticle_t::CorrelParticle_t(Float_t pt, Float_t p, Float_t t, Float_t m, PartType_t i) : fPt(pt), fPhi(p), fEta(t), fMass(m), fID(i){ + // constructor +} + +CorrelParticle_t::CorrelParticle_t(const CorrelParticle_t& p) : fPt(p.fPt), fPhi(p.fPhi), fEta(p.fEta), fMass(p.fMass), fID(p.fID){ + // copy constructor +} + +CorrelParticle_t* CorrelParticle_t::Copy(){ + // creates and returns a deep object copy + CorrelParticle_t *copy = new CorrelParticle_t; + copy->fPt = this->Pt()*this->Q(); + copy->fPhi = this->Phi(); + copy->fEta = this->Eta(); + copy->fMass = this->M(); + copy->fID = this->ID(); + return copy; +} + +void CorrelParticle_t::Show(){ + // printout method + std::cout<<" Particle pT="<0)?(Short_t(fPt/Pt())):(-99);} + virtual Float_t Theta() const {return 2.*TMath::ATan(TMath::Exp(-fEta));} + virtual Float_t SinT() const {return TMath::Sin(Theta());} + virtual Float_t TanT() const {return TMath::Tan(Theta());} + virtual Float_t Px() const {return Pt()*TMath::Cos(fPhi);} + virtual Float_t Py() const {return Pt()*TMath::Sin(fPhi);} + virtual Float_t Pz() const {return (TMath::Abs(TanT())>0)?(Pt()/TanT()):(-99.);} + virtual Float_t P() const {return (TMath::Abs(SinT())>0)?(Pt()/SinT()):(-99.);} + virtual Float_t E() const {return TMath::Sqrt(P()*P()+fMass*fMass);} + virtual Float_t Et() const {return TMath::Sqrt(Pt()*Pt()+fMass*fMass);} + virtual Float_t Y() const {return 0.5*TMath::Log((E()+Pz())/(E()-Pz()));} + + virtual void Show(); + + protected: + Float_t fPt; // pt; store charge as its sign + Float_t fPhi; // phi + Float_t fEta; // eta + Float_t fMass; // mass + PartType_t fID; // ID + }; + +} // namespace declaration + +#endif diff --git a/PWG4/JetCorrel/CorrelRecoParent.cxx b/PWG4/JetCorrel/CorrelRecoParent.cxx new file mode 100644 index 00000000000..f14a8e1998e --- /dev/null +++ b/PWG4/JetCorrel/CorrelRecoParent.cxx @@ -0,0 +1,152 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: $ */ + +//______________________________________________________________________________ +// Container class for reconstructed parents. Reconstruction method uses +// AliKFParticle or TLorentzVector as indicated by kUseAliKF set in CorrelDefs.h +//-- Author: Paul Constantin + +#include "CorrelRecoParent.h" + +using namespace std; +using namespace JetCorrelHD; + +CorrelRecoParent_t::CorrelRecoParent_t() : + CorrelParticle_t(), fAssym(-999.), fOpenAng(-999.), fEVT(NULL){ + // default constructor +} + +CorrelRecoParent_t* CorrelRecoParent_t::operator=(const CorrelRecoParent_t& rhs){ + fPt = rhs.Pt()*rhs.Q(); + fPhi = rhs.Phi(); + fEta = rhs.Eta(); + fMass = rhs.M(); + fID = rhs.ID(); + fAssym = rhs.Assym(); + fOpenAng = rhs.OpenAng(); + fEVT = rhs.Evt(); + return this; +} + +CorrelRecoParent_t* CorrelRecoParent_t::Copy(){ + // creates and returns deep object copy + CorrelRecoParent_t *copy = new CorrelRecoParent_t; + copy->fPt = this->Pt()*this->Q(); + copy->fPhi = this->Phi(); + copy->fEta = this->Eta(); + copy->fMass = this->M(); + copy->fID = this->ID(); + copy->fAssym = this->Assym(); + copy->fOpenAng = this->OpenAng(); + copy->fEVT = this->Evt(); + return copy; +} + +Bool_t CorrelRecoParent_t::Reconstruct(CorrelParticle_t *p1, CorrelParticle_t *p2){ + // main method for parent reconstruction + + if(p1->ID()==photon && p2->ID()==photon) fID = diphoton; + else if(p1->ID()==electron && p2->ID()==electron) fID = dielectron; + else if(p1->ID()==jet && p2->ID()==jet) fID = dijet; + else fID = dihadron; + + if(fID==dielectron && kUseAliKF){ + // code for parent reconstruction based on AliKFParticle: + if(!fEVT) + {std::cerr<<"CorrelRecoParent_t::Reconstruct - undefined event"<(fEVT); + if(!fESD) + {std::cerr<<"CorrelRecoParent_t::Reconstruct - failed event casting"<(p1); + CorrelKFTrack_t* e2 = dynamic_cast(p2); + if(!e1 || !e2) + {std::cerr<<"CorrelRecoParent_t::Reconstruct - failed particle casting"<GetPrimaryVertex())); + if(primVtx.GetNContributors()<=0) return kFALSE; + AliKFParticle::SetField(fESD->GetMagneticField()); + AliKFParticle* pKF1 = new AliKFParticle; AliKFParticle* pKF2 = new AliKFParticle; + if(e1->Param()==NULL || e1->Covar()==NULL || e2->Param()==NULL || e2->Covar()==NULL) + {std::cerr<<"CorrelRecoParent_t::Reconstruct - null parameter pointer"<Create(e1->Param(), e1->Covar(), e1->Q(), 11*e1->Q()); // AliKFParticle uses Pythia PIDs + pKF2->Create(e2->Param(), e2->Covar(), e2->Q(), 11*e2->Q()); // so electron=11 and positron=-11 + + AliKFParticle DiElectron(*pKF1,*pKF2); + DiElectron.SetMassConstraint(kZ0MassMean,kZ0MassSig); // the dielectron mass cut (1st=mass,2nd=sigma) + primVtx += DiElectron; + DiElectron.SetProductionVertex(primVtx); + Double_t chi2=100000.; + if(DiElectron.GetNDF()!=0) chi2=DiElectron.GetChi2()/DiElectron.GetNDF(); + if(chi2>3.5) return kFALSE; // the dielectron vertex cut + + Float_t px = DiElectron.GetPx(); + Float_t py = DiElectron.GetPy(); + Float_t pz = DiElectron.GetPz(); + Float_t ener = DiElectron.GetE(); + Float_t theta = TMath::ATan(TMath::Sqrt(px*px+py*py)/pz); + fPt = TMath::Sqrt(px*px+py*py)*Float_t(p1->Q()*p2->Q()); + fPhi = TMath::ATan(py/px); + fEta = -TMath::Log(TMath::Tan(theta/2.)); + fMass = ener - TMath::Sqrt(px*px+py*py+pz*pz); + fAssym = TMath::Abs((e1->P()-e2->P())/(e1->P()+e2->P())); + fOpenAng = -999.; // compute opening angle + + delete pKF1; delete pKF2; + + } else { + + // code for parent reconstruction based on TLorentzVector: + TLorentzVector part1, part2, fPartSum; + part1.SetPxPyPzE(p1->Px(), p1->Py(), p1->Pz(), p1->E()); + part2.SetPxPyPzE(p2->Px(), p2->Py(), p2->Pz(), p2->E()); + + fPartSum.SetPxPyPzE(0.,0.,0.,0.); + fPartSum = part1 + part2; + Float_t pT = fPartSum.Pt(); + if(TMath::Abs(p1->Q())>0 && TMath::Abs(p2->Q())>0) + fPt = pT*Float_t(p1->Q()*p2->Q()); // fPt stores charge as its sign + else + fPt = pT; + fPhi = fPartSum.Phi(); + fEta = fPartSum.Eta(); + fMass = fPartSum.M(); + fAssym = TMath::Abs((p1->P()-p2->P())/(p1->P()+p2->P())); + fOpenAng = part1.Angle(part2.Vect()); + if(NotInMass(fID,fMass)) return kFALSE; + } + + return kTRUE; +} + +Bool_t CorrelRecoParent_t::NotInMass(PartType_t pID, Float_t mass){ + // THE MASS RANGES SHOULD PROBABLY BE MOMENTUM AND CENTRALITY DEPENDENT!!! + if(pID!=dielectron && pID!=diphoton) return kFALSE; + + const Float_t kZ0MassMin = kZ0MassMean - 3*kZ0MassSig; + const Float_t kZ0MassMax = kZ0MassMean + 3*kZ0MassSig; + const Float_t kPi0MassMin = kPi0MassMean - 3*kPi0MassSig; + const Float_t kPi0MassMax = kPi0MassMean + 3*kPi0MassSig; + if(pID==dielectron && mass>kZ0MassMin && masskPi0MassMin && massfPt = this->Pt()*this->Q(); + copy->fPhi = this->Phi(); + copy->fEta = this->Eta(); + copy->fMass = this->M(); + copy->fID = this->ID(); + copy->fTPCx = this->X(); + copy->fTPCy = this->Y(); + copy->fTPCz = this->Z(); + return copy; +} + +Float_t CorrelTrack_t::Dist(CorrelTrack_t * const that) { + return TMath::Sqrt((this->X()-that->X())*(this->X()-that->X()) + + (this->Y()-that->Y())*(this->Y()-that->Y()) + + (this->Z()-that->Z())*(this->Z()-that->Z())); +} + +void CorrelTrack_t::Show(){ + std::cout<<" Track pT="<1GeV/c. + +Particle Container Classes: +(1) CorrelParticle_t class. +Base particle for correlations: implements only the essential kinematics needed +for correlations. Since this is the object to go into the mixing pools (and into +the memory) DON'T CLUTTER IT!!! As it stands now, its size is 20b (4xFloat_t+ +1xUInt_t) on 32b machines. Also, it MUST NOT inherit from TObject since this will +impose an overhead of 12b (>30%) by inheritance, a burden that cannot be carried +in Pb-Pb analysis. BTW, this is the main reason to have CorrelList_t instead of +another TList for particles. +(2) CorrelList_t class. +A custom-designed single-linked list class written because the main two options +(STL and ROOT) couldn't be used - STL because is not allowed in AliRoot and ROOT +because its lists (TList/TClonesArray) store only objects of classes inheriting +from TObject (thus inheriting a significant overhead for small particle objects +like CorrelParticle_t). Note that CorrelList_t itself does inherit from TObject +in order to be storeable in a TList (our mixing pools are TLists of CorrelLists) +but this is OK since we have one CorrelList_t per event, not per particle. There +are two helper classes: CorrelListNode_t for the data node and CorrelListIter_t +provides utilities for list iteration. See CorrelList.h for interface description. +(3) CorrelTrack_t class. +Inherits from CorrelParticle_t and allows storage of global track parameters +(TPC entrance coordinates) to be used in pair cuts (to eliminate detector +resolution effects). Whether this cut (and hence this class altogether) will be +used remains to be seen since it is possible that such effects can be eliminated +thru single-track cuts (like high number of TPC clusters) - highly desireable +because CorrelTrack_t would additionally store 12b for something like TPC entrance +point (x,y,z).Note: any cut applied to the same event pairs must be applied to +mixed event pairs (hence pair cut parameters must be stored in the mixing pools). +On the other hand the high number of TPC clusters cut reduces the efficiency... +(4) CorrelRecoParent_t class. +Inherits from CorrelParticle_t and reconstructs (using TLorentzVector) parent +particles from two children; intended for diphotons (pi0), dielectrons (Z0), etc. +In the case of dielectrons (Z0), a reconstruction via the AliKFParticle class is +provided since this also allows for a vertex cut on the reconstructed mother (see +the CorrelKFTrack_t class). To switch between a TLorentzVector based reconstruction +and a AliKFParticle based reconstruction, set kUseAliKF in CorrelDefs.h. +(5) CorrelKFTrack_t class. +Inherits from CorrelParticle_t and allows storage of ESD track parameters needed +as input by the AliKFParticle to reconstruct the parent particle. + +CorrelList_t class implements a single-linked list with pointer to head node +(last inserted). It is labelled by 3 identifiers: the event number EvtID, the +pool type (triggs/assocs) PoolID, and the particle type PartID. Interface: + - CorrelList_t() creates empty list; ~CorrelList_t() destroys the list; + - Clear() deletes all data nodes but leaves list defined (and empty); + - Push() adds a new data node at head; + - Head() returns iterator to head node; + - assignment operator = performs a deep list copy; + - Size() returns the current size of the list; + - Filled() and SetFilled() gets/sets a boolean with the current fill status; + - EvtID(), PartID(), and PoolID() return the list identifiers; + - Label() sets the above list identifiers. +CorrelList_t must inherit from TObject to be storable in a TList - the mixing +pool becomes a TList of CorrelList. Access to the list data is made thru the +iterator class. +CorrelListIter_t class implements an iterator for CorrelList_t. Interface: + - hasEnded() returns true if current node terminates list; + - Move() moves iterator to next node in list; + - Node() returns the current node pointed to by the iterator; + - Data() returns the data contained in the current node; + + +TO DO LIST AS OF 24 MARCH 2009: +(1) finish the macros for output merging, acceptance study and correlation + building in the analysis directory; +(2) add a dynamic array CorrelArray_t implementation for the particle lists. +(3) implement the official AliRoot logging (AliDebug/AliError/etc) \ No newline at end of file diff --git a/PWG4/Makefile b/PWG4/Makefile index aa8ff70183a..eee666fff4c 100644 --- a/PWG4/Makefile +++ b/PWG4/Makefile @@ -69,6 +69,10 @@ ifneq ($(JETAN_INCLUDE),) ALICEINC += -I../$(JETAN_INCLUDE) endif +ifneq ($(PWG4JetCorrel_INCLUDE),) + ALICEINC += -I../$(PWG4JetCorrel_INCLUDE) +endif + # only if no par file was loaded before #ifeq ($(ALICEINC),-I.) diff --git a/PWG4/PROOF-INF.PWG4JetCorrel/BUILD.sh b/PWG4/PROOF-INF.PWG4JetCorrel/BUILD.sh new file mode 100755 index 00000000000..fc9490a6c2d --- /dev/null +++ b/PWG4/PROOF-INF.PWG4JetCorrel/BUILD.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +make diff --git a/PWG4/PROOF-INF.PWG4JetCorrel/SETUP.C b/PWG4/PROOF-INF.PWG4JetCorrel/SETUP.C new file mode 100644 index 00000000000..09debe0f61a --- /dev/null +++ b/PWG4/PROOF-INF.PWG4JetCorrel/SETUP.C @@ -0,0 +1,11 @@ +void SETUP() +{ + gSystem->Load("libPWG4JetCorrel"); + + // Set the Include paths + gSystem->SetIncludePath("-I$ROOTSYS/include -IPWG4JetCorrel"); + gROOT->ProcessLine(".include PWG4JetCorrel/JetCorrel"); + + // Set our location, so that other packages can find us + gSystem->Setenv("PWG4JetCorrel_INCLUDE", "PWG4JetCorrel/JetCorrel"); +} diff --git a/PWG4/PWG4JetCorrelLinkDef.h b/PWG4/PWG4JetCorrelLinkDef.h new file mode 100644 index 00000000000..69a8956ddbe --- /dev/null +++ b/PWG4/PWG4JetCorrelLinkDef.h @@ -0,0 +1,14 @@ +#ifdef __CINT__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class JetCorrelHD::AliJetCorrelMaker+; +#pragma link C++ class JetCorrelHD::AliJetCorrelSelector+; +#pragma link C++ class JetCorrelHD::AliJetCorrelReader+; +#pragma link C++ class JetCorrelHD::AliJetCorrelMixer+; +#pragma link C++ class JetCorrelHD::AliJetCorrelWriter+; +#pragma link C++ class JetCorrelHD::AliAnalysisTaskJetCorrel+; + +#endif diff --git a/PWG4/libPWG4JetCorrel.pkg b/PWG4/libPWG4JetCorrel.pkg new file mode 100644 index 00000000000..def58a0c654 --- /dev/null +++ b/PWG4/libPWG4JetCorrel.pkg @@ -0,0 +1,21 @@ +#-*- Mode: Makefile -*- + +SRCS = JetCorrel/AliAnalysisTaskJetCorrel.cxx \ + JetCorrel/AliJetCorrelMaker.cxx JetCorrel/AliJetCorrelSelector.cxx JetCorrel/AliJetCorrelReader.cxx JetCorrel/AliJetCorrelMixer.cxx JetCorrel/AliJetCorrelWriter.cxx \ + JetCorrel/CorrelList.cxx JetCorrel/CorrelParticle.cxx JetCorrel/CorrelRecoParent.cxx JetCorrel/CorrelTrack.cxx JetCorrel/CorrelKFTrack.cxx + +HDRS:= JetCorrel/CorrelDefs.h $(SRCS:.cxx=.h) + +DHDR:= PWG4JetCorrelLinkDef.h + +EXPORT:=$(SRCS:.cxx=.h) + +EINCLUDE:= PWG4/JetCorrel ANALYSIS + +ifeq (win32gcc,$(ALICE_TARGET)) +PACKSOFLAGS:= $(SOFLAGS) -L$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET) -lSTEERBase \ + -lESD -lAOD -lANALYSIS -lANALYSISalice \ + -L$(ROOTLIBDIR) -lEG +endif + + diff --git a/PWG4/macros/AddTaskJetCorrel.C b/PWG4/macros/AddTaskJetCorrel.C new file mode 100644 index 00000000000..3789a2ea5e3 --- /dev/null +++ b/PWG4/macros/AddTaskJetCorrel.C @@ -0,0 +1,36 @@ +AliAnalysisTaskJetCorrel *AddTaskJetCorrel(){ + //get the current analysis manager + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if(!mgr) { + ::Error("AddTaskJetCorrel", "No analysis manager found."); + return NULL; + } + if(!mgr->GetInputEventHandler()) { + ::Error("AddTaskJetCorrel", "This task requires an input event handler."); + return NULL; + } + TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" + if(inputDataType.CompareTo("ESD")!=0) { + ::Error("AddTaskJetCorrel", "This task uses ESD as input."); + return NULL; + } + + using namespace JetCorrelHD; + gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/ConfigJetCorrel.C"); + AliJetCorrelSelector* Selector = JetCorrelSelector(); + AliAnalysisTaskJetCorrel *task = new AliAnalysisTaskJetCorrel(Selector); + + //add the task to the current analysis manager + mgr->AddTask(task); + //---------------------- + //create data containers + //---------------------- + AliAnalysisDataContainer *output = + mgr->CreateContainer("JetCorrelHistos", TList::Class(), + AliAnalysisManager::kOutputContainer,"JetCorrelHistos.root"); + mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); + mgr->ConnectOutput(task,0,mgr->GetCommonOutputContainer()); + mgr->ConnectOutput(task,1,output); + + return task; +} diff --git a/PWG4/macros/ConfigJetCorrel.C b/PWG4/macros/ConfigJetCorrel.C new file mode 100644 index 00000000000..d0aee6e1f83 --- /dev/null +++ b/PWG4/macros/ConfigJetCorrel.C @@ -0,0 +1,43 @@ +AliJetCorrelSelector* JetCorrelSelector(){ + + /////////////////////////////////// + // set correlation input parameters + /////////////////////////////////// + // set generic selections: + UInt_t PoolDepth = 10; + UInt_t CorrelTypes[] = {0}; + Float_t TriggBins[] = {5.,7.,10.,15.,25.}; + Float_t AssocBins[] = {0.3,0.5,1.,2.,5.,7.}; + Float_t CentrBins[] = {0.,50.,200.,500.}; + Float_t ZVertBins[] = {-30.,-15.,-5.,-1.,1.,5.,15.,30.}; + // set track selections: + Bool_t ITSRefit = kTRUE; + Bool_t TPCRefit = kTRUE; + Bool_t TRDRefit = kTRUE; // used only for electron tracks + UInt_t MinNClusITS = 1; + UInt_t MinNClusTPC = 50; + Float_t MaxITSChi2 = 3.5; // max track Chi2 per ITS cluster + Float_t MaxTPCChi2 = 3.5; // max track Chi2 per TPC cluster + Float_t MaxNsigVtx = 3.5; // max dist to primary vertex + Bool_t RejectKinkChild = kTRUE; // reject track comming from a kink + + ////////////////////////////////// + // load them into selector object: + ////////////////////////////////// + AliJetCorrelSelector* Selector = new AliJetCorrelSelector(); + Selector->SetPoolDepth(PoolDepth); + Selector->SetCorrelTypes(sizeof(CorrelTypes)/sizeof(Int_t),CorrelTypes); + Selector->SetBinningTrigg(sizeof(TriggBins)/sizeof(Float_t),TriggBins); + Selector->SetBinningAssoc(sizeof(AssocBins)/sizeof(Float_t),AssocBins); + Selector->SetBinningCentr(sizeof(CentrBins)/sizeof(Float_t),CentrBins); + Selector->SetBinningZvert(sizeof(ZVertBins)/sizeof(Float_t),ZVertBins); + Selector->SetITSRefit(ITSRefit); Selector->SetTPCRefit(TPCRefit); + Selector->SetTRDRefit(TRDRefit); + Selector->SetMinNClusITS(MinNClusITS); Selector->SetMinNClusTPC(MinNClusTPC); + Selector->SetMaxITSChi2(MaxITSChi2); Selector->SetMaxTPCChi2(MaxTPCChi2); + Selector->SetMaxNsigmaVtx(MaxNsigVtx); + Selector->SetRejectKinkChild(RejectKinkChild); + Selector->Print(); + + return Selector; +} -- 2.39.3