#include "AliVTrack.h"
#include "AliEventplane.h"
+using std::cout;
+using std::endl;
ClassImp(AliEPSelectionTask)
//________________________________________________________________________
delete fEPContainer;
fEPContainer = 0;
}
- if (fPhiDist && fPeriod.CompareTo("LHC11h")==0){
+ if (fPeriod.CompareTo("LHC11h")==0){
for(Int_t i = 0; i < 4; i++) {
if(fPhiDist[i]){
delete fPhiDist[i];
}
esdEP = aod->GetHeader()->GetEventplaneP();
+ if(!esdEP) return; // protection against missing EP branch (nanoAODs)
esdEP->Reset();
Int_t maxID = 0;
}
}
}
+ } else if (fSplitMethod == AliEPSelectionTask::kCharge) {
+
+ for (Int_t i = 0; i < nt; i++) {
+ weight = 1;
+ track = dynamic_cast<AliVTrack*> (tracklist->At(i));
+ if (!track) continue;
+ weight = GetWeight(track);
+ Short_t cha = track->Charge();
+ idtemp = track->GetID();
+ if ((fAnalysisInput.CompareTo("AOD")==0) && (fAODfilterbit == 128)) idtemp = idtemp*(-1) - 1;
+
+ if (cha > 0) {
+ mQx1 += (weight*cos(2*track->Phi()));
+ mQy1 += (weight*sin(2*track->Phi()));
+ if (fSaveTrackContribution){
+ EP->GetQContributionXArraysub1()->AddAt(weight*cos(2*track->Phi()),idtemp);
+ EP->GetQContributionYArraysub1()->AddAt(weight*sin(2*track->Phi()),idtemp);
+ }
+ } else if (cha < 0) {
+ mQx2 += (weight*cos(2*track->Phi()));
+ mQy2 += (weight*sin(2*track->Phi()));
+ if (fSaveTrackContribution){
+ EP->GetQContributionXArraysub2()->AddAt(weight*cos(2*track->Phi()),idtemp);
+ EP->GetQContributionYArraysub2()->AddAt(weight*sin(2*track->Phi()),idtemp);
+ }
+ }
+ }
} else {
printf("plane resolution determination method not available!\n\n ");
return;
}
//________________________________________________________________________
-void AliEPSelectionTask::SetPersonalAODtrackCuts(UInt_t filterbit, Float_t etalow, Float_t etaup, Float_t ptlow, Float_t ptup){
+void AliEPSelectionTask::SetPersonalAODtrackCuts(UInt_t filterbit, Float_t etalow, Float_t etaup, Float_t ptlow, Float_t ptup, Int_t ntpc){
if(fESDtrackCuts){
delete fESDtrackCuts;
fUsercuts = kTRUE;
fESDtrackCuts = new AliESDtrackCuts();
fESDtrackCuts->SetPtRange(ptlow,ptup);
+ fESDtrackCuts->SetMinNClustersTPC(ntpc);
fESDtrackCuts->SetEtaRange(etalow,etaup);
fAODfilterbit = filterbit;
}
Double_t phiweight=1;
AliVTrack* track = dynamic_cast<AliVTrack*>(track1);
- TH1F *phiDist = SelectPhiDist(track);
+ TH1F *phiDist = 0x0;
+ if(track) phiDist = SelectPhiDist(track);
if (fUsePhiWeight && phiDist && track) {
Double_t nParticles = phiDist->Integral();
//__________________________________________________________________________
void AliEPSelectionTask::SetPhiDist()
{
- if(!fUserphidist) { // if it's already set and custom class is required, we use the one provided by the user
+ if(!fUserphidist && (fPeriod.CompareTo("LHC10h") == 0 || fPeriod.CompareTo("LHC11h") == 0)) { // if it's already set and custom class is required, we use the one provided by the user
if (fPeriod.CompareTo("LHC10h")==0)
{
if (!fPhiDist[0]) AliFatal(Form("Cannot find OADB phi distribution for run %d", fRunNumber));
}
- else {
- AliInfo("Using Custom Phi Distribution");
- }
+
if (fPeriod.CompareTo("LHC10h")==0 || fUserphidist){
Bool_t emptybins;
AliError("After Maximum of rebinning still empty Phi-bins!!!");
}
}
+ if (fPeriod.CompareTo("LHC10h") != 0 && fPeriod.CompareTo("LHC11h") != 0 && !fUserphidist){
+ AliInfo("No Phi-weights available. All Phi weights set to 1");
+ SetUsePhiWeight(kFALSE);
+ }
}
//__________________________________________________________________________
Float_t etaup = 0;
fESDtrackCuts->GetPtRange(ptlow,ptup);
fESDtrackCuts->GetEtaRange(etalow,etaup);
+ Int_t ntpc = fESDtrackCuts->GetMinNClusterTPC();
for (Int_t i = 0; i < aod->GetNumberOfTracks() ; i++){
tr = aod->GetTrack(i);
if(maxidtemp > -1 && fAODfilterbit == 128) continue;
if (fAODfilterbit == 128) maxidtemp = maxidtemp*(-1) - 1;
if (maxidtemp > maxid1) maxid1 = maxidtemp;
- if(tr->TestFilterBit(fAODfilterbit) && tr->Pt() < ptup && tr->Pt() > ptlow && tr->Eta() < etaup && tr->Eta() > etalow){
+ if(tr->TestFilterBit(fAODfilterbit) && tr->Pt() < ptup && tr->Pt() > ptlow && tr->Eta() < etaup && tr->Eta() > etalow && tr->GetTPCNcls() > ntpc){
acctracks->Add(tr);
}
}
fSparseDist = (THnSparse*) foadb->Get("Default");
if (!fSparseDist) AliFatal("Cannot fetch OADB container for EP selection");
foadb->Close();
- if(!fHruns) fHruns = (TH1F*)fSparseDist->Projection(0); //projection on run axis;
+ if(!fHruns){
+ fHruns = (TH1F*)fSparseDist->Projection(0); //projection on run axis;
+ fHruns->SetName("runsHisto");
+ }
}
}
}