fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), fRef[i].M());
}
}
+
+//__________________________________________________________________________________________________
+void AliRsnMiniPair::FillRef(Double_t mass)
+{
+//
+// Fill ref 4-vectors using the passed mass and the values in 'sum'
+//
+
+ Int_t i;
+ for (i = 0; i < 2; i++) {
+ fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
+ }
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::InvMassRes() const
+{
+//
+// Return invariant mass resolution
+//
+
+ if (fSum[1].M() <= 0.0) return 1E20;
+
+ return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::InvMassDiff() const
+{
+//
+// Return invariant mass resolution
+//
+
+ if (fSum[1].M() <= 0.0) return 1E20;
+
+ return (fSum[0].M() - fSum[1].M());
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
+{
+//
+// Return ratio of transverse momenta of daughters
+//
+
+ Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
+ Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
+
+ if (den <= 0.0) return 1E20;
+
+ return num / den;
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
+{
+//
+// Opening angle in a Z-T space
+//
+
+ const TLorentzVector &p1 = fP1[ID(mc)];
+ const TLorentzVector &p2 = fP2[ID(mc)];
+
+ return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
+}
+
+//__________________________________________________________________________________________________
+Double_t AliRsnMiniPair::DaughterPt(Int_t daughterId, Bool_t mc)
+{
+ //returns pt of the <id> daughter
+ // if MC returns generated momenta
+ if (daughterId==0)
+ return fP1[ID(mc)].Pt();
+ else
+ return fP2[ID(mc)].Pt();
+}
+
+//__________________________________________________________________________________________________
+void AliRsnMiniPair::DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz)
+{
+ //returns px,py,pz of the <id> daughter by saving them into pxpypz
+ // if MC returns generated momenta
+ if (!pxpypz) return;
+
+ if (daughterId==0){
+ pxpypz[0]=fP1[ID(mc)].Px();
+ pxpypz[1]=fP1[ID(mc)].Py();
+ pxpypz[2]=fP1[ID(mc)].Pz();
+ } else {
+ pxpypz[0]=fP2[ID(mc)].Px();
+ pxpypz[1]=fP2[ID(mc)].Py();
+ pxpypz[2]=fP2[ID(mc)].Pz();
+ }
+ return;
+}
Double_t PtRatio(Bool_t mc) const;
Double_t DipAngle(Bool_t mc) const;
Double_t CosThetaStar(Bool_t mc);
-
-private:
-
+ Double_t DaughterPt(Int_t daughterId, Bool_t mc);
+ void DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz);
+
+ private:
+
TLorentzVector fP1 [2]; // 1st daughter momentum
TLorentzVector fP2 [2]; // 2nd daughter momentum
TLorentzVector fSum[2]; // sum of momenta
TLorentzVector fRef[2]; // same as 'fSum' but with nominal resonance mass
-
+
Int_t fMother; // label of mothers (when common)
Int_t fMotherPDG; // PDG code of mother (when common)
-
+
ClassDef(AliRsnMiniPair,1)
-};
-
-inline void AliRsnMiniPair::FillRef(Double_t mass)
-{
-//
-// Fill ref 4-vectors using the passed mass and the values in 'sum'
-//
-
- Int_t i;
- for (i = 0; i < 2; i++) {
- fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
- }
-}
-
-inline Double_t AliRsnMiniPair::InvMassRes() const
-{
-//
-// Return invariant mass resolution
-//
-
- if (fSum[1].M() <= 0.0) return 1E20;
-
- return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
-}
-
-inline Double_t AliRsnMiniPair::InvMassDiff() const
-{
-//
-// Return invariant mass resolution
-//
-
- if (fSum[1].M() <= 0.0) return 1E20;
-
- return (fSum[0].M() - fSum[1].M());
-}
-
-inline Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
-{
-//
-// Return ratio of transverse momenta of daughters
-//
-
- Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
- Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
-
- if (den <= 0.0) return 1E20;
-
- return num / den;
-}
-
-inline Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
-{
-//
-// Opening angle in a Z-T space
-//
-
- const TLorentzVector &p1 = fP1[ID(mc)];
- const TLorentzVector &p2 = fP2[ID(mc)];
-
- return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
-}
+ };
#endif
case kDipAngle: return "DipAngle";
case kCosThetaStar: return "CosThetaStar";
case kAngleLeading: return "AngleToLeading";
+ case kFirstDaughterPt: return "FirstDaughterPt";
+ case kSecondDaughterPt: return "SecondDaughterPt";
+ case kFirstDaughterP: return "FirstDaughterP";
+ case kSecondDaughterP: return "SecondDaughterP";
default: return "Undefined";
}
}
// the computation is not doable due to any problem
// (not initialized support object, wrong values, risk of floating point errors)
// the method returng kFALSE and sets the computed value to a meaningless number
+ Double_t p3[3]={0.,0.,0.};
+
switch (fType) {
// ---- event values -------------------------------------------------------------------------
case kVz:
return pair->CosThetaStar(fUseMCInfo);
case kAngleLeading:
AliWarning("This method is not yet implemented");
- return 1E20;
+ return 1E20;
+ case kFirstDaughterPt:
+ return pair->DaughterPt(0,fUseMCInfo);
+ case kSecondDaughterPt:
+ return pair->DaughterPt(1,fUseMCInfo);
+ case kFirstDaughterP:
+ pair->DaughterPxPyPz(0,fUseMCInfo, p3);
+ return TMath::Sqrt(p3[0]*p3[0]+p3[1]*p3[1]+p3[2]*p3[2]);
+ case kSecondDaughterP:
+ pair->DaughterPxPyPz(1,fUseMCInfo, p3);
+ return TMath::Sqrt(p3[0]*p3[0]+p3[1]*p3[1]+p3[2]*p3[2]);
default:
AliError("Invalid value type");
return 1E20;
kDipAngle, // inverse cosine of the angle between daughter vector momenta
kCosThetaStar, // polarization angle
kAngleLeading, // angle to leading particle
+ kFirstDaughterPt, //pt of the first daughter of the pair
+ kSecondDaughterPt, //pt of the second daughter of the pair
+ kFirstDaughterP, //p of the first daughter of the pair
+ kSecondDaughterP, //p of the second daughter of the pair
kTypes // -- general limit ----------------------------------------------------------
};
Int_t signedPdg = 313,
TString monitorOpt = "",
Double_t minYlab = -0.5,
- Double_t maxYlab = 0.5
-)
+ Double_t maxYlab = 0.5,
+ AliRsnMiniValue::EType yaxisvar = AliRsnMiniValue::kPt
+ )
{
//
// -- INITIALIZATION ----------------------------------------------------------------------------
// retrieve analysis manager
//
-
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddAnalysisTaskTOFKStar", "No analysis manager to connect to.");
Printf("========================== MC analysis - PID cuts used");
} else
Printf("========================== DATA analysis - PID cuts used");
- if (!ConfigTOFanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, useMixLS, signedPdg, monitorOpt.Data())) return 0x0;
+ if (!ConfigTOFanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, useMixLS, signedPdg, monitorOpt.Data(), yaxisvar)) return 0x0;
//
// -- CONTAINERS --------------------------------------------------------------------------------
/****************************************************************/
/*************** MONITOR TOF ********************/
/****************************************************************/
+ // output:3D histogram of TOF Nsigma pi vs. TPC Nsigma pi vs momentum
+ AliRsnListOutput *outMonitorTOFvsTPCnsigmaPi = new AliRsnListOutput("TOFnsigmaPi_TPCnsigmaPi", AliRsnListOutput::kHistoDefault);
+ outMonitorTOFvsTPCnsigmaPi->AddValue(axisTOFnsigmaPi);
+ outMonitorTOFvsTPCnsigmaPi->AddValue(axisTPCnsigmaPi);
+ outMonitorTOFvsTPCnsigmaPi->AddValue(axisMomP);
+ if (mon) mon->Add(outMonitorTOFvsTPCnsigmaPi);
+ if (lm) lm->AddOutput(outMonitorTOFvsTPCnsigmaPi);
+
// // output: 2D histogram of TOF signal vs. momentum
// AliRsnListOutput *outMonitorTimeTOF = new AliRsnListOutput("time_VsP", AliRsnListOutput::kHistoDefault);
// outMonitorTimeTOF->AddValue(axisMomP);
Bool_t IsMcTrueOnly = kFALSE,
Bool_t useMixLS = 0,
Int_t signedPdg = 313,
- TString monitorOpt = ""
+ TString monitorOpt = "",
+ AliRsnMiniValue::EType yaxisVar = AliRsnMiniValue::kPt
)
{
// manage suffix
/* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
/* pseudorapidity */ Int_t etaID = task->CreateValue(AliRsnMiniValue::kEta, kFALSE);
/* rapidity */ Int_t yID = task->CreateValue(AliRsnMiniValue::kY, kFALSE);
+ /* 1st daughter pt */ Int_t fdpt = task->CreateValue(AliRsnMiniValue::kFirstDaughterPt, kFALSE);
+ /* 2nd daughter pt */ Int_t sdpt = task->CreateValue(AliRsnMiniValue::kSecondDaughterPt, kFALSE);
+ /* 1st daughter p */ Int_t fdp = task->CreateValue(AliRsnMiniValue::kFirstDaughterP, kFALSE);
+ /* 2nd daughter p */ Int_t sdp = task->CreateValue(AliRsnMiniValue::kSecondDaughterP, kFALSE);
// -- Create all needed outputs -----------------------------------------------------------------
// use an array for more compact writing, which are different on mixing and charges
// [1] = mixing
// [2] = like ++
// [3] = like --
+
Bool_t use [12] = { !IsMcTrueOnly, !IsMcTrueOnly, !IsMcTrueOnly, !IsMcTrueOnly , !IsMcTrueOnly, !IsMcTrueOnly, isMC , isMC , isMC , isMC , useMixLS, useMixLS };
Bool_t useIM [12] = { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 };
TString name [12] = {"UnlikePM", "UnlikeMP", "MixingPM", "MixingMP", "LikePP", "LikeMM", "TruesPM", "TruesMP", "ResPM" , "ResMP", "MixingPP", "MixingMM" };
else
out->AddAxis(resID, 200, -0.02, 0.02);
- // axis Y: transverse momentum
- out->AddAxis(ptID, 100, 0.0, 10.0);
-
+ // axis Y: transverse momentum of pair as default - else chosen value
+ if (yaxisVar==AliRsnMiniValue::kFirstDaughterPt)
+ out->AddAxis(fdpt, 100, 0.0, 10.0);
+ else
+ if (yaxisVar==AliRsnMiniValue::kSecondDaughterPt)
+ out->AddAxis(sdpt, 100, 0.0, 10.0);
+ else
+ if (yaxisVar==AliRsnMiniValue::kFirstDaughterP)
+ out->AddAxis(fdp, 100, 0.0, 10.0);
+ else
+ if (yaxisVar==AliRsnMiniValue::kSecondDaughterP)
+ out->AddAxis(sdp, 100, 0.0, 10.0);
+ else
+ out->AddAxis(ptID, 100, 0.0, 10.0); //default use mother pt
+
// axis Z: centrality-multiplicity
if (!isPP)
out->AddAxis(centID, 100, 0.0, 100.0);
else
out->AddAxis(centID, 400, 0.0, 400.0);
-
+
// axis W: pseudorapidity
- // out->AddAxis(etaID, 20, -1.0, 1.0);
+ // out->AddAxis(etaID, 20, -1.0, 1.0);
// axis J: rapidity
// out->AddAxis(yID, 10, -0.5, 0.5);
}
if (isMC){
- // create output
+ // create output
AliRsnMiniOutput *outm = task->CreateOutput(Form("kstar_Mother%s", suffix), "SPARSE", "MOTHER");
- outm->SetDaughter(0, AliRsnDaughter::kKaon);
- outm->SetDaughter(1, AliRsnDaughter::kPion);
- outm->SetMotherPDG(signedPdg);
- outm->SetMotherMass(0.89594);
- // pair cuts
- outm->SetPairCuts(cutsPair);
- // binnings
- outm->AddAxis(imID, 90, 0.6, 1.5);
- outm->AddAxis(ptID, 100, 0.0, 10.0);
- if (!isPP){
- outm->AddAxis(centID, 100, 0.0, 100.0);
- } else {
- outm->AddAxis(centID, 400, 0.0, 400.0);
- }
+ outm->SetDaughter(0, AliRsnDaughter::kKaon);
+ outm->SetDaughter(1, AliRsnDaughter::kPion);
+ outm->SetMotherPDG(signedPdg);
+ outm->SetMotherMass(0.89594);
+ // pair cuts
+ outm->SetPairCuts(cutsPair);
+ // binnings
+ outm->AddAxis(imID, 90, 0.6, 1.5);
+ outm->AddAxis(ptID, 100, 0.0, 10.0);
+ if (!isPP){
+ outm->AddAxis(centID, 100, 0.0, 100.0);
+ } else {
+ outm->AddAxis(centID, 400, 0.0, 400.0);
+ }
}
return kTRUE;
}