fOutList = new TList;
fRsnAnalysisManager.InitAllPairs(fOutList);
-
- AliError("\n\n***LIST***\n\n");
- fOutList->Print();
PostData(2, fOutList);
//_________________________________________________________________________________________________
AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex
-(const char *name, Int_t nContributors, Bool_t acceptTPC) :
+(const char *name, Double_t maxVz, Int_t nContributors, Bool_t acceptTPC) :
AliRsnCut(name, AliRsnCut::kEvent, 0, nContributors - 1),
fAcceptTPC(acceptTPC)
{
// Since the range check uses the '>=' and '<=', the high edge
// must be decreased by 1 to get the right behaviour, since this is integer.
//
+
+ fMinD = 0.0;
+ fMaxD = maxVz;
}
//_________________________________________________________________________________________________
AliRsnEvent *rsn = dynamic_cast<AliRsnEvent*>(obj1);
if (!rsn) return kFALSE;
AliESDEvent *esd = dynamic_cast<AliESDEvent*>(rsn->GetRef());
- if (!esd) {
+ if (!esd)
+ {
AliDebug(AliLog::kDebug+2, "NO ESD");
return kFALSE;
}
- // get the three possible primary vertexes of the event:
- // 0 = default one
- // 1 = SPD
- // 2 = TPC
- // then, if the default vertex is TPC, the event is rejected,
- // otherwise, the event is rejected only if its vertex status is 'false'
- // get primary vertexes
- const AliESDVertex *vert[3];
- vert[0] = esd->GetPrimaryVertex();
- vert[1] = esd->GetPrimaryVertexSPD();
- vert[2] = esd->GetPrimaryVertexTPC();
-
- // if TPC vertexes are rejected by default do this now
- if (!fAcceptTPC && (vert[0] == vert[2])) {
- AliDebug(AliLog::kDebug+2, "Rejecting TPC vertex");
- return kFALSE;
+ // get the best primary vertex:
+ // first try the one with tracks
+ const AliESDVertex *vTrk = esd->GetPrimaryVertexTracks();
+ const AliESDVertex *vSPD = esd->GetPrimaryVertexSPD();
+ const AliESDVertex *vTPC = esd->GetPrimaryVertexTPC();
+ Double_t vzTrk = 2.0 * fMaxD;
+ Double_t vzSPD = 2.0 * fMaxD;
+ Double_t vzTPC = 2.0 * fMaxD;
+ if (vTrk) vzTrk = TMath::Abs(vTrk->GetZv());
+ if (vSPD) vzSPD = TMath::Abs(vSPD->GetZv());
+ if (vTPC) vzTPC = TMath::Abs(vTPC->GetZv());
+ AliDebug(AliLog::kDebug + 1, Form("Vertex with tracks: contributors = %d, abs(vz) = %f", vTrk->GetNContributors(), vzTrk));
+ AliDebug(AliLog::kDebug + 1, Form("Vertex with SPD, contributors = %d, abs(vz) = %f", vSPD->GetNContributors(), vzSPD));
+ AliDebug(AliLog::kDebug + 1, Form("Vertex with TPC, contributors = %d, abs(vz) = %f", vTPC->GetNContributors(), vzTPC));
+ if(vTrk->GetStatus())
+ {
+ fCutValueI = vTrk->GetNContributors();
+ fCutValueD = vzTrk;
}
-
- // if we are here, vert[0] contains the default primary vertex
- // in case it is with tracks or SPD, its status must be OK
- // because otherwise the ESD event returns the lower level vertex
- // then, we can check just the first element in the array
- if (!vert[0]->GetStatus()) {
- AliDebug(AliLog::kDebug+2, "Bad vertex status");
- return kFALSE;
+ else if (vSPD->GetStatus())
+ {
+ fCutValueI = vSPD->GetNContributors();
+ fCutValueD = vzSPD;
}
-
- // if we are here, the status of default vertex is OK
- // and then we check the number of contributors:
- // it must be *outside* the 'allowed' range
- fCutValueI = vert[0]->GetNContributors();
- return /*there is a NOT operator */!/*here*/OkRange();
+ else if (vTPC->GetStatus() && fAcceptTPC)
+ {
+ fCutValueI = vTPC->GetNContributors();
+ fCutValueD = vzTPC;
+ }
+ else
+ return kFALSE;
+
+ return OkRangeI() && OkRangeD();
}
public:
AliRsnCutPrimaryVertex();
- AliRsnCutPrimaryVertex(const char *name, Int_t minContributors, Bool_t acceptTPC = kFALSE);
+ AliRsnCutPrimaryVertex(const char *name, Double_t maxVz, Int_t minContributors = 0, Bool_t acceptTPC = kFALSE);
virtual ~AliRsnCutPrimaryVertex() {;};
virtual Bool_t IsSelected(TObject *obj1, TObject *obj2 = 0x0);
AliRsnPairDef *pairDefMM = new AliRsnPairDef(AliPID::kKaon, '-', AliPID::kKaon, '-', 333, 1.019455);
// computation objects
- AliRsnPairNtuple *pairPM = new AliRsnPairNtuple("PairPM" , pairDefPM);
- AliRsnPairNtuple *truePM = new AliRsnPairNtuple("TruePM" , pairDefPM);
- AliRsnPairNtuple *pairPP = new AliRsnPairNtuple("PairPP" , pairDefPP);
- AliRsnPairNtuple *pairMM = new AliRsnPairNtuple("PairMM" , pairDefMM);
+ //AliRsnPairNtuple *pairPM = new AliRsnPairNtuple("PairPM" , pairDefPM);
+ //AliRsnPairNtuple *truePM = new AliRsnPairNtuple("TruePM" , pairDefPM);
+ //AliRsnPairNtuple *pairPP = new AliRsnPairNtuple("PairPP" , pairDefPP);
+ //AliRsnPairNtuple *pairMM = new AliRsnPairNtuple("PairMM" , pairDefMM);
+ AliRsnPairFunctions *pairPM = new AliRsnPairNtuple("PairPM" , pairDefPM);
+ AliRsnPairFunctions *truePM = new AliRsnPairNtuple("TruePM" , pairDefPM);
+ AliRsnPairFunctions *pairPP = new AliRsnPairNtuple("PairPP" , pairDefPP);
+ AliRsnPairFunctions *pairMM = new AliRsnPairNtuple("PairMM" , pairDefMM);
//
// -- Setup cuts ----------------------------------------------------------------------------------
//
// function axes
- AliRsnValue *axisIM = new AliRsnValue(AliRsnValue::kPairInvMass, 50, 0.9, 1.4);
- AliRsnValue *axisPt = new AliRsnValue(AliRsnValue::kPairPt, 50, 0.0, 10.0);
- AliRsnValue *axisEta = new AliRsnValue(AliRsnValue::kPairEta, 30, -1.5, 1.5);
+ AliRsnValue *axisIM = new AliRsnValue(AliRsnValue::kPairInvMass, 4000, 0.9, 4.9);
+ AliRsnValue *axisPt = new AliRsnValue(AliRsnValue::kPairPt, 100, 0.0, 10.0);
+ AliRsnValue *axisY = new AliRsnValue(AliRsnValue::kPairY, 30, -1.5, 1.5);
// the ntuple output requires to get directly the values
- pairPM->AddValue(axisIM);
- pairPM->AddValue(axisPt);
- pairPM->AddValue(axisEta);
- truePM->AddValue(axisIM);
- truePM->AddValue(axisPt);
- truePM->AddValue(axisEta);
- pairPP->AddValue(axisIM);
- pairPP->AddValue(axisPt);
- pairPP->AddValue(axisEta);
- pairMM->AddValue(axisIM);
- pairMM->AddValue(axisPt);
- pairMM->AddValue(axisEta);
-
+ //pairPM->AddValue(axisIM);
+ //pairPM->AddValue(axisPt);
+ //pairPM->AddValue(axisEta);
+ //truePM->AddValue(axisIM);
+ //truePM->AddValue(axisPt);
+ //truePM->AddValue(axisEta);
+ //pairPP->AddValue(axisIM);
+ //pairPP->AddValue(axisPt);
+ //pairPP->AddValue(axisEta);
+ //pairMM->AddValue(axisIM);
+ //pairMM->AddValue(axisPt);
+ //pairMM->AddValue(axisEta);
+
+ // functions
+ AliRsnFunction *fcnImPtY = new AliRsnFunction;
+ // --> add axes
+ fcnImPtY->AddAxis(axisIM);
+ fcnImPtY->AddAxis(axisPt);
+ fcnImPtY->AddAxis(axisEta);
+
+ // add functions to pairs
+ pairPM->AddFunction(fcnImPtY);
+ truePM->AddFunction(fcnImPtY);
+ pairPP->AddFunction(fcnImPtY);
+ pairMM->AddFunction(fcnImPtY);
+
//
// -- Conclusion ----------------------------------------------------------------------------------
//