fEvNum(0),
fUseCentrality(kFALSE),
fCentralityType("QUALITY"),
+ fContinuousMix(kTRUE),
fNMix(0),
fMaxDiffMult(10),
fMaxDiffVz(1.0),
fEvBuffer(0x0),
fTriggerAna(0x0),
fESDtrackCuts(0x0),
- fMiniEvent(0x0)
+ fMiniEvent(0x0),
+ fBigOutput(kFALSE)
{
//
// Dummy constructor ALWAYS needed for I/O.
fEvNum(0),
fUseCentrality(kFALSE),
fCentralityType("QUALITY"),
+ fContinuousMix(kTRUE),
fNMix(0),
fMaxDiffMult(10),
fMaxDiffVz(1.0),
fEvBuffer(0x0),
fTriggerAna(0x0),
fESDtrackCuts(0x0),
- fMiniEvent(0x0)
+ fMiniEvent(0x0),
+ fBigOutput(kFALSE)
{
//
// Default constructor.
fEvNum(0),
fUseCentrality(copy.fUseCentrality),
fCentralityType(copy.fCentralityType),
+ fContinuousMix(copy.fContinuousMix),
fNMix(copy.fNMix),
fMaxDiffMult(copy.fMaxDiffMult),
fMaxDiffVz(copy.fMaxDiffVz),
fEvBuffer(0x0),
fTriggerAna(copy.fTriggerAna),
fESDtrackCuts(copy.fESDtrackCuts),
- fMiniEvent(0x0)
+ fMiniEvent(0x0),
+ fBigOutput(copy.fBigOutput)
{
//
// Copy constructor.
fUseMC = copy.fUseMC;
fUseCentrality = copy.fUseCentrality;
fCentralityType = copy.fCentralityType;
+ fContinuousMix = copy.fContinuousMix;
fNMix = copy.fNMix;
fMaxDiffMult = copy.fMaxDiffMult;
fMaxDiffVz = copy.fMaxDiffVz;
fTrackCuts = copy.fTrackCuts;
fTriggerAna = copy.fTriggerAna;
fESDtrackCuts = copy.fESDtrackCuts;
+ fBigOutput = copy.fBigOutput;
return (*this);
}
fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
// create list and set it as owner of its content (MANDATORY)
+ if (fBigOutput) OpenFile(1);
fOutput = new TList();
fOutput->SetOwner();
// text next entry
fEvBuffer->GetEntry(imix);
// skip if events are not matched
- if (TMath::Abs(evMain.Vz() - fMiniEvent->Vz() ) > fMaxDiffVz ) continue;
- if (TMath::Abs(evMain.Mult() - fMiniEvent->Mult() ) > fMaxDiffMult ) continue;
- if (TMath::Abs(evMain.Angle() - fMiniEvent->Angle()) > fMaxDiffAngle) continue;
+ if (!EventsMatch(&evMain, fMiniEvent)) continue;
// check that the array of good matches for mixed does not already contain main event
if (matched[imix].Contains(Form("|%d|", ievt))) continue;
// add new mixing candidate
}
}
}
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnMiniAnalysisTask::EventsMatch(AliRsnMiniEvent *event1, AliRsnMiniEvent *event2)
+{
+//
+// Check if two events are compatible.
+// If the mixing is continuous, this is true if differences in vz, mult and angle are smaller than
+// the specified values.
+// If the mixing is binned, this is true if the events are in the same bin.
+//
+
+ if (!event1 || !event2) return kFALSE;
+ Int_t ivz1, ivz2, imult1, imult2, iangle1, iangle2;
+
+ if (fContinuousMix) {
+ if (TMath::Abs(event1->Vz() - event2->Vz() ) > fMaxDiffVz ) return kFALSE;
+ if (TMath::Abs(event1->Mult() - event2->Mult() ) > fMaxDiffMult ) return kFALSE;
+ if (TMath::Abs(event1->Angle() - event2->Angle()) > fMaxDiffAngle) return kFALSE;
+ return kTRUE;
+ } else {
+ ivz1 = (Int_t)(event1->Vz() / fMaxDiffVz);
+ ivz2 = (Int_t)(event2->Vz() / fMaxDiffVz);
+ imult1 = (Int_t)(event1->Mult() / fMaxDiffMult);
+ imult2 = (Int_t)(event2->Mult() / fMaxDiffMult);
+ iangle1 = (Int_t)(event1->Angle() / fMaxDiffAngle);
+ iangle2 = (Int_t)(event2->Angle() / fMaxDiffAngle);
+ if (ivz1 != ivz2) return kFALSE;
+ if (imult1 != imult2) return kFALSE;
+ if (iangle1 != iangle2) return kFALSE;
+ return kTRUE;
+ }
+}
+
+
void UseMC(Bool_t yn = kTRUE) {fUseMC = yn;}
void UseCentrality(const char *type) {fUseCentrality = kTRUE; fCentralityType = type; fCentralityType.ToUpper();}
void UseMultiplicity(const char *type) {fUseCentrality = kFALSE; fCentralityType = type; fCentralityType.ToUpper();}
+ void UseContinuousMix() {fContinuousMix = kTRUE;}
+ void UseBinnedMix() {fContinuousMix = kFALSE;}
void SetNMix(Int_t nmix) {fNMix = nmix;}
void SetMaxDiffMult (Double_t val) {fMaxDiffMult = val;}
void SetMaxDiffVz (Double_t val) {fMaxDiffVz = val;}
void FillTrueMotherESD(AliRsnMiniEvent *event);
void FillTrueMotherAOD(AliRsnMiniEvent *event);
void StoreTrueMother(AliRsnMiniPair *pair, AliRsnMiniEvent *event);
+ Bool_t EventsMatch(AliRsnMiniEvent *event1, AliRsnMiniEvent *event2);
Bool_t fUseMC; // use or not MC info
Int_t fEvNum; //! absolute event counter
Bool_t fUseCentrality; // if true, use centrality for event, otherwise use multiplicity
TString fCentralityType; // definition used to choose what centrality or multiplicity to use
+ Bool_t fContinuousMix; // mixing --> technique chosen (continuous or binned)
Int_t fNMix; // mixing --> required number of mixes
Double_t fMaxDiffMult; // mixing --> max difference in multiplicity
Double_t fMaxDiffVz; // mixing --> max difference in Vz of prim vert
AliTriggerAnalysis *fTriggerAna; //! trigger analysis
AliESDtrackCuts *fESDtrackCuts; //! quality cut for ESD tracks
AliRsnMiniEvent *fMiniEvent; //! mini-event cursor
+ Bool_t fBigOutput; // flag if open file for output list
- ClassDef(AliRsnMiniAnalysisTask, 1); // AliRsnMiniAnalysisTask
+ ClassDef(AliRsnMiniAnalysisTask, 2); // AliRsnMiniAnalysisTask
};
inline Int_t AliRsnMiniAnalysisTask::CreateValue(AliRsnMiniValue::EType type, Bool_t useMC)
//
Bool_t usePhi = 1;
-Bool_t usePhiMC = 1;
+Bool_t useKStar = 1;
AliRsnMiniAnalysisTask * AddAnalysisTaskRsnMini
(
Bool_t isMC,
+ Bool_t isPP,
const char *path,
Int_t nmix = 0
)
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
// create the task and connect with physics selection
- AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask("RSN");
+ AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask("RSN", isMC);
mgr->AddTask(task);
// settings
- task->UseMultiplicity("TRACKS");
+ if (isPP)
+ task->UseMultiplicity("QUALITY");
+ else
+ task->UseCentrality("V0M");
// set mixing
+ task->UseContinuousMix();
+ //task->UseBinnedMix();
task->SetNMix(nmix);
- task->SetMaxDiffVz(2.0);
+ task->SetMaxDiffVz(1.0);
task->SetMaxDiffMult(10.0);
task->SetMaxDiffAngle(1E20);
AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
// set the check for pileup
- cutVertex->SetCheckPileUp(kTRUE);
+ if (isPP) cutVertex->SetCheckPileUp(kTRUE);
// define and fill cut set
AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent);
// set cuts in task
task->SetEventCuts(eventCuts);
+ //
+ // -- EVENT-ONLY COMPUTATIONS -------------------------------------------------------------------
+ //
+
+ // initialize value computation for multiplicity/centrality
+ // second argument tells if the value must be taken from MC
+ // (when this can be done)
+ // after creating the value, the task returns its ID
+ Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
+
+ // create event-related output
+ AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT");
+ // set axes, by passing value ID and defining the binning
+ if (isPP)
+ outMult->AddAxis(multID, 300, 0.0, 300.0);
+ else
+ outMult->AddAxis(multID, 100, 0.0, 100.0);
+
+ //
+ // -- PAIR CUTS (common to all resonances) ------------------------------------------------------
+ //
+
+ AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange);
+ cutY->SetRangeD(-0.5, 0.5);
+
+ AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother);
+ cutsPair->AddCut(cutY);
+ cutsPair->SetCutScheme(cutY->GetName());
+
//
// -- CONFIGS -----------------------------------------------------------------------------------
//
if (usePhi) {
- gROOT->LoadMacro(Form("%s/ConfigPhi.C", path));
- if (!ConfigPhi(task, isMC, "default")) return 0x0;
+ if (isPP) {
+ gROOT->LoadMacro(Form("%s/ConfigPhi.C", path));
+ if (!ConfigPhi(task, isMC, "", cutsPair)) return 0x0;
+ } else {
+ gROOT->LoadMacro(Form("%s/ConfigPhiPbPb.C", path));
+ if (!ConfigPhiPbPb(task, isMC, "", cutsPair)) return 0x0;
+ }
+ if (isMC) {
+ gROOT->LoadMacro(Form("%s/ConfigPhiMC.C", path));
+ if (!ConfigPhiMC(task, isPP, "", cutsPair)) return 0x0;
+ }
}
- if (isMC && usePhiMC) {
- gROOT->LoadMacro(Form("%s/ConfigPhiMC.C", path));
- if (!ConfigPhiMC(task, "default")) return 0x0;
+ if (useKStar) {
+ gROOT->LoadMacro(Form("%s/ConfigKStar.C", path));
+ if (!ConfigKStar(task, isMC, "", cutsPair)) return 0x0;
+ if (isMC) {
+ gROOT->LoadMacro(Form("%s/ConfigKStarMC.C", path));
+ if (!ConfigKStarMC(task, isPP, "", cutsPair)) return 0x0;
+ }
}
//
opt.ToUpper();
Bool_t isMC = opt.Contains("MC") || (!opt.Contains("DATA"));
+ Bool_t isPP = opt.Contains("PP") || (!opt.Contains("PBPB"));
Bool_t isESD = opt.Contains("ESD");
Bool_t useTender = opt.Contains("TENDER");
Bool_t noV0 = opt.Contains("NOV0");
gSystem->Load("libCORRFW.so");
// tender-related libraries
- if (useTender) {
+ if (isESD && useTender) {
::Info("AnalysisSetup", "Loading tender libraries");
gSystem->Load("libTENDER.so");
gSystem->Load("libTENDERSupplies.so");
+ } else if (!isESD) {
+ useTender = kFALSE;
}
// load development RSN library
// === INPUT / OUTPUT HANDLER CONFIGURATION =====================================================
//
- // create multi input event handler
- AliMultiInputEventHandler *multiHandler = new AliMultiInputEventHandler();
-
if (isESD) {
out = "esdTree";
::Info("AnalysisSetup", "Creating ESD handler");
//
if (isESD) {
- // setup physics selection
::Info("AnalysisSetup", "Add physics selection by default on ESD analysis");
gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPhysicsSelection.C");
AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(isMC);
}
}
+ //
+ // === CENTRALITY/PLANE (ESD only) ==============================================================
+ //
+
+ if (isESD && !isPP) {
+ ::Info("AnalysisSetup", "Add centrality and event plane computation tasks");
+ gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskCentrality.C");
+ gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskEventplane.C");
+ AddTaskCentrality();
+ AddTaskEventplane();
+ }
+
//
// === PID RESPONSE =============================================================================
//
gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDResponse.C");
AddTaskPIDResponse(isMC);
+ //gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDqa.C ");
+ //AddTaskPIDqa();
+
//
// === OTHER TASKS ==============================================================================
//
// add RSN task
gROOT->LoadMacro(Form("%s/AddAnalysisTaskRsnMini.C", macroPath));
- if (!AddAnalysisTaskRsnMini(isMC, macroPath, nmix)) return kFALSE;
+ if (!AddAnalysisTaskRsnMini(isMC, isPP, macroPath, nmix)) return "";
::Info("AnalysisSetup", "Setup successful");
return out;
--- /dev/null
+//
+// *** Configuration script for phi->KK analysis with 2010 runs ***
+//
+// A configuration script for RSN package needs to define the followings:
+//
+// (1) decay tree of each resonance to be studied, which is needed to select
+// true pairs and to assign the right mass to all candidate daughters
+// (2) cuts at all levels: single daughters, tracks, events
+// (3) output objects: histograms or trees
+//
+Bool_t ConfigKStar
+(
+ AliRsnMiniAnalysisTask *task,
+ Bool_t isMC,
+ const char *suffix,
+ AliRsnCutSet *cutsPair
+)
+{
+ // manage suffix
+ if (strlen(suffix) > 0) suffix = Form("_%s", suffix);
+
+ //
+ // -- Define track cuts -------------------------------------------------------------------------
+ //
+
+ // integrated pion cut
+ AliRsnCutDaughterKStar2010PP *cutPi = new AliRsnCutDaughterKStar2010PP("cutPionForKStar", AliPID::kPion);
+ // cut set
+ AliRsnCutSet *cutSetPi = new AliRsnCutSet("setPionForKStar", AliRsnTarget::kDaughter);
+ cutSetPi->AddCut(cutPi);
+ cutSetPi->SetCutScheme(cutPi->GetName());
+ // add to task
+ Int_t iCutPi = task->AddTrackCuts(cutSetPi);
+
+ // integrated kaon cut
+ AliRsnCutDaughterKStar2010PP *cutK = new AliRsnCutDaughterKStar2010PP("cutKaonForKStar", AliPID::kKaon);
+ // cut set
+ AliRsnCutSet *cutSetK = new AliRsnCutSet("setKaonForKStar", AliRsnTarget::kDaughter);
+ cutSetK->AddCut(cutK);
+ cutSetK->SetCutScheme(cutK->GetName());
+ // add to task
+ Int_t iCutK = task->AddTrackCuts(cutSetK);
+
+ //
+ // -- Values ------------------------------------------------------------------------------------
+ //
+
+ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
+ /* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE);
+ /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
+ /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
+
+ //
+ // -- Create all needed outputs -----------------------------------------------------------------
+ //
+
+ // use an array for more compact writing, which are different on mixing and charges
+ // [0] = unlike
+ // [1] = mixing
+ // [2] = like ++
+ // [3] = like --
+ Bool_t use [10] = { 1 , 1 , 1 , 1 , 1 , 1 , isMC , isMC , isMC , isMC };
+ Bool_t useIM [10] = { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 };
+ TString name [10] = {"Unlike1", "Unlike2", "Mixing1", "Mixing2", "LikePP", "LikeMM", "Trues1", "Trues2", "Res1" , "Res2" };
+ TString comp [10] = {"PAIR" , "PAIR" , "MIX" , "MIX" , "PAIR" , "PAIR" , "TRUE" , "TRUE" , "TRUE" , "TRUE" };
+ TString output [10] = {"HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" };
+ Char_t charge1 [10] = {'+' , '-' , '+' , '-' , '+' , '-' , '+' , '-' , '+' , '-' };
+ Char_t charge2 [10] = {'-' , '+' , '-' , '+' , '+' , '-' , '-' , '+' , '-' , '+' };
+ Int_t cutID1 [10] = { iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK };
+ Int_t cutID2 [10] = { iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi , iCutPi };
+
+ for (Int_t i = 0; i < 10; i++) {
+ if (!use[i]) continue;
+ // create output
+ AliRsnMiniOutput *out = task->CreateOutput(Form("kstar_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data());
+ // selection settings
+ out->SetCutID(0, cutID1[i]);
+ out->SetCutID(1, cutID2[i]);
+ out->SetDaughter(0, AliRsnDaughter::kKaon);
+ out->SetDaughter(1, AliRsnDaughter::kPion);
+ out->SetCharge(0, charge1[i]);
+ out->SetCharge(1, charge2[i]);
+ out->SetMotherPDG(313);
+ out->SetMotherMass(0.896);
+ // pair cuts
+ out->SetPairCuts(cutsPair);
+ // axis X: invmass (or resolution)
+ if (useIM[i])
+ out->AddAxis(imID, 90, 0.6, 1.5);
+ else
+ out->AddAxis(resID, 200, -0.02, 0.02);
+ // axis Y: transverse momentum
+ out->AddAxis(ptID, 100, 0.0, 10.0);
+ }
+
+ return kTRUE;
+}
--- /dev/null
+//
+// *** Configuration script for phi->KK analysis with 2010 runs ***
+//
+// A configuration script for RSN package needs to define the followings:
+//
+// (1) decay tree of each resonance to be studied, which is needed to select
+// true pairs and to assign the right mass to all candidate daughters
+// (2) cuts at all levels: single daughters, tracks, events
+// (3) output objects: histograms or trees
+//
+Bool_t ConfigKStarMC
+(
+ AliRsnMiniAnalysisTask *task,
+ Bool_t isPP,
+ const char *suffix,
+ AliRsnCutSet *cutsPair
+)
+{
+ // manage suffix
+ if (strlen(suffix) > 0) suffix = Form("_%s", suffix);
+
+ //
+ // -- Define track cuts -------------------------------------------------------------------------
+ //
+
+ /*** EMPTY FOR TRUE PAIRS COMPUTATION ***/
+
+ //
+ // -- Values ------------------------------------------------------------------------------------
+ //
+
+ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
+ /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
+ /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
+
+ //
+ // -- Create all needed outputs -----------------------------------------------------------------
+ //
+
+ TString mode = "HIST";
+ if (!isPP) mode = "SPARSE";
+
+ // create output
+ AliRsnMiniOutput *out = task->CreateOutput(Form("kstar_TrueMC%s", suffix), mode.Data(), "MOTHER");
+ // selection settings
+ out->SetDaughter(0, AliRsnDaughter::kKaon);
+ out->SetDaughter(1, AliRsnDaughter::kPion);
+ out->SetMotherPDG(313);
+ out->SetMotherMass(0.896);
+ // pair cuts
+ out->SetPairCuts(cutsPair);
+ // binnings
+ out->AddAxis(imID, 90, 0.6, 1.5);
+ out->AddAxis(ptID, 100, 0.0, 10.0);
+ if (!isPP) out->AddAxis(centID, 100, 0.0, 100.0);
+
+ return kTRUE;
+}
// (2) cuts at all levels: single daughters, tracks, events
// (3) output objects: histograms or trees
//
-Bool_t ConfigPhi(AliRsnMiniAnalysisTask *task, Bool_t isMC, const char *suffix)
+Bool_t ConfigPhi
+(
+ AliRsnMiniAnalysisTask *task,
+ Bool_t isMC,
+ const char *suffix,
+ AliRsnCutSet *cutsPair
+)
{
+ // manage suffix
+ if (strlen(suffix) > 0) suffix = Form("_%s", suffix);
+
//
// -- Define track cuts -------------------------------------------------------------------------
//
// integrated kaon cut
- AliRsnCutKaonForPhi2010PP *cutStd = new AliRsnCutKaonForPhi2010PP("cutStd");
+ AliRsnCutKaonForPhi2010PP *cutStd = new AliRsnCutKaonForPhi2010PP("cutStdPP");
// cut set
AliRsnCutSet *cutSetStd = new AliRsnCutSet("kaonForPhi", AliRsnTarget::kDaughter);
cutSetStd->AddCut(cutStd);
cutSetStd->SetCutScheme(cutStd->GetName());
// add to task
- Int_t iCutStd = task->AddTrackCuts(cutSetStd);
+ Int_t icut = task->AddTrackCuts(cutSetStd);
//
// -- Values ------------------------------------------------------------------------------------
//
- // invariant mass
- Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
-
- // transverse momentum
- Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
-
- //
- // -- Pair cuts ---------------------------------------------------------------------------------
- //
-
- AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange);
- cutY->SetRangeD(-0.5, 0.5);
-
- AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother);
- cutsPair->AddCut(cutY);
- cutsPair->SetCutScheme(cutY->GetName());
+ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
+ /* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE);
+ /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
+ /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
//
// -- Create all needed outputs -----------------------------------------------------------------
// [1] = mixing
// [2] = like ++
// [3] = like --
- Bool_t use [5] = { 1 , 1 , 1 , 1 , 1 };
- TString name [5] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues" };
- TString comp [5] = {"PAIR" , "MIX" , "PAIR" , "PAIR" , "TRUE" };
- TString output [5] = {"HIST" , "HIST" , "HIST" , "HIST" , "HIST" };
- Char_t charge1 [5] = {'+' , '+' , '+' , '-' , '+' };
- Char_t charge2 [5] = {'-' , '-' , '+' , '-' , '-' };
- Int_t cutID [5] = { iCutStd, iCutStd, iCutStd, iCutStd, iCutStd };
+ Bool_t use [6] = { 1 , 1 , 1 , 1 , isMC , isMC };
+ Bool_t useIM [6] = { 1 , 1 , 1 , 1 , 1 , 0 };
+ TString name [6] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues" , "Res" };
+ TString comp [6] = {"PAIR" , "MIX" , "PAIR" , "PAIR" , "TRUE" , "TRUE" };
+ TString output [6] = {"HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" };
+ Char_t charge1 [6] = {'+' , '+' , '+' , '-' , '+' , '+' };
+ Char_t charge2 [6] = {'-' , '-' , '+' , '-' , '-' , '-' };
+ Int_t cutID [6] = { icut , icut , icut , icut , icut , icut };
- for (Int_t i = 0; i < 5; i++) {
+ for (Int_t i = 0; i < 6; i++) {
if (!use[i]) continue;
// create output
- AliRsnMiniOutput *out = task->CreateOutput(Form("phi_%s_%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data());
+ AliRsnMiniOutput *out = task->CreateOutput(Form("phi_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data());
// selection settings
out->SetCutID(0, cutID[i]);
out->SetCutID(1, cutID[i]);
out->SetMotherMass(1.019455);
// pair cuts
out->SetPairCuts(cutsPair);
- // binnings
- out->AddAxis(imID, 500, 0.9, 1.4);
- out->AddAxis(ptID, 200, 0.0, 10.0);
+ // axis X: invmass (or resolution)
+ if (useIM[i])
+ out->AddAxis(imID, 500, 0.9, 1.4);
+ else
+ out->AddAxis(resID, 200, -0.02, 0.02);
+ // axis Y: transverse momentum
+ out->AddAxis(ptID, 100, 0.0, 10.0);
}
return kTRUE;
// (2) cuts at all levels: single daughters, tracks, events
// (3) output objects: histograms or trees
//
-Bool_t ConfigPhiMC(AliRsnMiniAnalysisTask *task, const char *suffix)
+Bool_t ConfigPhiMC
+(
+ AliRsnMiniAnalysisTask *task,
+ Bool_t isPP,
+ const char *suffix,
+ AliRsnCutSet *cutsPair
+)
{
+ // manage suffix
+ if (strlen(suffix) > 0) suffix = Form("_%s", suffix);
+
//
// -- Define track cuts -------------------------------------------------------------------------
//
// -- Values ------------------------------------------------------------------------------------
//
- // invariant mass
- Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kTRUE);
-
- // transverse momentum
- Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kTRUE);
-
- //
- // -- Pair cuts ---------------------------------------------------------------------------------
- //
-
- AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidityMC", AliRsnCutMiniPair::kRapidityRangeMC);
- cutY->SetRangeD(-0.5, 0.5);
-
- AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCutsMC", AliRsnTarget::kMother);
- cutsPair->AddCut(cutY);
- cutsPair->SetCutScheme(cutY->GetName());
-
+ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
+ /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
+ /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
+
//
// -- Create all needed outputs -----------------------------------------------------------------
//
+ TString mode = "HIST";
+ if (!isPP) mode = "SPARSE";
+
// create output
- AliRsnMiniOutput *out = task->CreateOutput(Form("phi_TrueMC_%s", suffix), "HIST", "MOTHER");
+ AliRsnMiniOutput *out = task->CreateOutput(Form("phi_TrueMC%s", suffix), mode.Data(), "MOTHER");
// selection settings
out->SetDaughter(0, AliRsnDaughter::kKaon);
out->SetDaughter(1, AliRsnDaughter::kKaon);
out->SetPairCuts(cutsPair);
// binnings
out->AddAxis(imID, 500, 0.9, 1.4);
- out->AddAxis(ptID, 200, 0.0, 10.0);
+ out->AddAxis(ptID, 100, 0.0, 10.0);
+ if (!isPP) out->AddAxis(centID, 100, 0.0, 100.0);
return kTRUE;
}
--- /dev/null
+//
+// *** Configuration script for phi->KK analysis with 2010 runs ***
+//
+// A configuration script for RSN package needs to define the followings:
+//
+// (1) decay tree of each resonance to be studied, which is needed to select
+// true pairs and to assign the right mass to all candidate daughters
+// (2) cuts at all levels: single daughters, tracks, events
+// (3) output objects: histograms or trees
+//
+Bool_t ConfigPhiPbPb
+(
+ AliRsnMiniAnalysisTask *task,
+ Bool_t isMC,
+ const char *suffix,
+ AliRsnCutSet *cutsPair
+)
+{
+ // manage suffix
+ if (strlen(suffix) > 0) suffix = Form("_%s", suffix);
+
+ //
+ // -- Define track cuts -------------------------------------------------------------------------
+ //
+
+ // standard kaon cut
+ AliRsnCutKaonForPhi2010 *cutStd = new AliRsnCutKaonForPhi2010("cutStdPbPb", 3.0, 3.0, 0.8);
+ // cut set
+ AliRsnCutSet *cutSetStd = new AliRsnCutSet("setStdPbPb", AliRsnTarget::kDaughter);
+ cutSetStd->AddCut(cutStd);
+ cutSetStd->SetCutScheme(cutStd->GetName());
+ // add to task
+ Int_t icutStd = task->AddTrackCuts(cutSetStd);
+
+ // TPC kaon cut
+ AliRsnCutKaonForPhi2010 *cutTPC = new AliRsnCutKaonForPhi2010("cutTPCPbPb", 3.0, 3.0, 0.8);
+ cutTPC->SetOnlyTPC();
+ // cut set
+ AliRsnCutSet *cutSetTPC = new AliRsnCutSet("setTPCPbPb", AliRsnTarget::kDaughter);
+ cutSetTPC->AddCut(cutTPC);
+ cutSetTPC->SetCutScheme(cutTPC->GetName());
+ // add to task
+ Int_t icutTPC = task->AddTrackCuts(cutSetTPC);
+
+ // TOF kaon cut
+ AliRsnCutKaonForPhi2010 *cutTOF = new AliRsnCutKaonForPhi2010("cutTOFPbPb", 3.0, 3.0, 0.8);
+ cutTOF->SetOnlyTOF();
+ // cut set
+ AliRsnCutSet *cutSetTOF = new AliRsnCutSet("setTOFPbPb", AliRsnTarget::kDaughter);
+ cutSetTOF->AddCut(cutTOF);
+ cutSetTOF->SetCutScheme(cutTOF->GetName());
+ // add to task
+ Int_t icutTOF = task->AddTrackCuts(cutSetTOF);
+
+ // No-PID kaon cut
+ AliRsnCutKaonForPhi2010 *cutNOPID = new AliRsnCutKaonForPhi2010("cutNOPIDPbPb", 3.0, 3.0, 0.8);
+ cutNOPID->SetOnlyQuality();
+ // cut set
+ AliRsnCutSet *cutSetNOPID = new AliRsnCutSet("setNOPIDPbPb", AliRsnTarget::kDaughter);
+ cutSetNOPID->AddCut(cutNOPID);
+ cutSetNOPID->SetCutScheme(cutNOPID->GetName());
+ // add to task
+ Int_t icutNOPID = task->AddTrackCuts(cutSetNOPID);
+
+ //
+ // -- Values ------------------------------------------------------------------------------------
+ //
+
+ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
+ /* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE);
+ /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
+ /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
+
+ //
+ // -- Create all needed outputs -----------------------------------------------------------------
+ //
+
+ // use an array for more compact writing, which are different on mixing and charges
+ // [0] = unlike
+ // [1] = mixing
+ // [2] = like ++
+ // [3] = like --
+ //Bool_t use [6] = { 1 , 1 , 1 , 1 , isMC , isMC };
+ //Bool_t useIM [6] = { 1 , 1 , 1 , 1 , 1 , 0 };
+ //TString name [6] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues" , "Res" };
+ //TString comp [6] = {"PAIR" , "MIX" , "PAIR" , "PAIR" , "TRUE" , "TRUE" };
+ //TString output [6] = {"HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" };
+ //Char_t charge1 [6] = {'+' , '+' , '+' , '-' , '+' , '+' };
+ //Char_t charge2 [6] = {'-' , '-' , '+' , '-' , '-' , '-' };
+ //Int_t cutID [6] = { icut , icut , icut , icut , icut , icut };
+
+ Bool_t use [12] = { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 };
+ Bool_t useIM [12] = { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 };
+ TString name [12] = {"STDPM" , "STDMIX", "STDTRUE", "TPCPM" , "TPCMIX", "TPCTRUE", "TOFPM" , "TOFMIX", "TOFTRUE", "NOPIDPM" , "NOPIDMIX", "NOPIDTRUE" };
+ TString comp [12] = {"PAIR" , "MIX" , "TRUE" , "PAIR" , "MIX" , "TRUE" , "PAIR" , "MIX" , "TRUE" , "PAIR" , "MIX" , "TRUE" };
+ TString output [12] = {"SPARSE", "SPARSE", "SPARSE" , "SPARSE", "SPARSE", "SPARSE" , "SPARSE", "SPARSE", "SPARSE" , "SPARSE" , "SPARSE" , "SPARSE" };
+ Char_t charge1 [12] = {'+' , '+' , '+' , '+' , '+' , '+' , '+' , '+' , '+' , '+' , '+' , '+' };
+ Char_t charge2 [12] = {'-' , '-' , '-' , '-' , '-' , '-' , '-' , '-' , '-' , '-' , '-' , '-' };
+ Int_t cutID [12] = { icutStd, icutStd, icutStd , icutTPC, icutTPC, icutTPC , icutTOF, icutTOF, icutTOF , icutNOPID, icutNOPID, icutNOPID };
+
+ for (Int_t i = 0; i < 12; i++) {
+ if (!use[i]) continue;
+ // create output
+ AliRsnMiniOutput *out = task->CreateOutput(Form("phi_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data());
+ // selection settings
+ out->SetCutID(0, cutID[i]);
+ out->SetCutID(1, cutID[i]);
+ out->SetDaughter(0, AliRsnDaughter::kKaon);
+ out->SetDaughter(1, AliRsnDaughter::kKaon);
+ out->SetCharge(0, charge1[i]);
+ out->SetCharge(1, charge2[i]);
+ out->SetMotherPDG(333);
+ out->SetMotherMass(1.019455);
+ // pair cuts
+ out->SetPairCuts(cutsPair);
+ // axis X: invmass (or resolution)
+ if (useIM)
+ out->AddAxis(imID, 500, 0.9, 1.4);
+ else
+ out->AddAxis(resID, 200, -0.02, 0.02);
+ // axis Y: transverse momentum
+ out->AddAxis(ptID, 100, 0.0, 10.0);
+ // axis Z: centrality
+ out->AddAxis(centID, 100, 0.0, 100.0);
+ }
+
+ return kTRUE;
+}
(
Int_t nReadFiles = 0,
Int_t nSkipFiles = 0,
- Int_t nmix = 10,
+ Int_t nmix = 2,
//const char *inputSource = "file-collections/AOD048_LHC11a10b.txt",
- //const char *options = "aod",
+ //const char *options = "aod_mc_pbpb",
//const char *inputSource = "file-collections/AOD049_LHC10h_pass2.txt",
- //const char *options = "aod",
+ //const char *options = "aod_data_pbpb",
const char *inputSource = "file-collections/ESD_LHC10d1.txt",
const char *options = "esd_mc",
+ //const char *inputSource = "000117112.xml",
+ //const char *options = "esd_data",
+ //const char *inputSource = "aod_test.xml",
+ //const char *options = "aod_data",
+ //const char *inputSource = "LHC11a10a_bis_test.xml",
+ //const char *options = "esd_mc_pbpb",
const char *outName = "test.root",
const char *macroPath = ".",
const char *setupName = "AnalysisSetupRsnMini.C"
// === PREPARATION ==============================================================================
//
-// AliLog::SetClassDebugLevel("AliRsnMiniOutput" , 2);
-// AliLog::SetClassDebugLevel("AliRsnMiniAnalysisTask", 1);
+ //AliLog::SetClassDebugLevel("AliRsnMiniOutput" , 2);
+ //AliLog::SetClassDebugLevel("AliRsnMiniAnalysisTask", 2);
+ //AliLog::SetClassDebugLevel("AliRsnCutKaonForPhi2010", 2);
// execute the general setup from the apposite macro
// it returns also a TString value with the input tree name
-void testOut(const char *file = "test.root", Double_t scale = 0.1, Int_t p1 = 0, Int_t p2 = -1)
+void testOut(const char *file = "test.root", Int_t p1 = 0, Int_t p2 = -1)
{
TFile *f = TFile::Open(file);
TList *l = (TList*)f->Get("RsnOut");
l->Print();
- TH2F *hhPM = (TH2F*)RsnOut->FindObject("hist_RSN_phi_Unlike_default");
- TH2F *hhPP = (TH2F*)RsnOut->FindObject("hist_RSN_phi_LikePP_default");
- TH2F *hhMM = (TH2F*)RsnOut->FindObject("hist_RSN_phi_LikeMM_default");
- TH2F *hhMX = (TH2F*)RsnOut->FindObject("hist_RSN_phi_Mixing_default");
+ TH2F *hhPM = (TH2F*)RsnOut->FindObject("RSN_phi_Unlike");
+ TH2F *hhPP = (TH2F*)RsnOut->FindObject("RSN_phi_LikePP");
+ TH2F *hhMM = (TH2F*)RsnOut->FindObject("RSN_phi_LikeMM");
+ TH2F *hhMX = (TH2F*)RsnOut->FindObject("RSN_phi_Mixing");
TH1D *hPM = 0x0; if (hhPM) hPM = hhPM->ProjectionX(Form("px1_%d_%d", p1, p2), p1, p2);
TH1D *hPP = 0x0; if (hhPP) hPP = hhPP->ProjectionX(Form("px2_%d_%d", p1, p2), p1, p2);
hPM->SetLineColor(kBlack);
- hPP->SetLineColor(kGreen);
- hPP->Add(hMM);
+ if (hPP) {
+ hPP->SetLineColor(kGreen);
+ hPP->Add(hMM);
+ }
- hMX->SetLineColor(kRed);
- hMX->Scale(scale);
+ if (hMX) {
+ hMX->SetLineColor(kRed);
+ Double_t intS = hPM->Integral(hPM->GetXaxis()->FindBin(1.1), hPM->GetXaxis()->FindBin(1.2));
+ Double_t intM = hMX->Integral(hMX->GetXaxis()->FindBin(1.1), hMX->GetXaxis()->FindBin(1.2));
+ hMX->Scale(intS / intM);
+ }
- TCanvas *c1 = new TCanvas("c1");
+ TCanvas *c1 = new TCanvas("c1", "", 0, 0, 1100, 600);
hPM->Draw();
- hPP->Draw("same");
- hMX->Draw("same");
+ if (hPP) hPP->Draw("same");
+ if (hMX) hMX->Draw("same");
+
+ TH3F *hhRes = (TH3F*)RsnOut->FindObject("RSN_phi_Res");
+ TH3F *hhNum = (TH3F*)RsnOut->FindObject("RSN_phi_Trues");
+ TH3F *hhDen = (TH3F*)RsnOut->FindObject("RSN_phi_TrueMC");
+ if (hhNum && hhDen) {
+ TCanvas *c2 = new TCanvas("c2", "EFF", 0, 650, 800, 600);
+ Double_t pt[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 3.0, 4.0, 5.0, 7.5, 10.0};
+ Int_t npt = sizeof(pt) / sizeof(pt[0]);
+
+ TH1D *hNum = hhNum->ProjectionY("num");
+ TH1D *hDen = hhDen->ProjectionY("den");
+ TH1D *hrNum = hNum->Rebin(npt - 1, "neff", pt);
+ TH1D *hrDen = hDen->Rebin(npt - 1, "deff", pt);
+ hrNum->Divide(hrDen);
+ hrNum->Draw();
+
+ TCanvas *c3 = new TCanvas("c3", "", 500, 500, 600, 600);
+ TH1D *hRes = hhRes->ProjectionX();
+ hRes->Draw();
+ }
}