void SetEventCuts(AliRsnMiniAnalysisTask *task, Bool_t isMC, ERsnCollisionType collisionType, Double_t vzCut, Bool_t rejectPileUp) { // cut on primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors to vtx // - 4th argument --> tells if TPC stand-alone vertexes must be accepted AliRsnCutPrimaryVertex *cutVertex = 0; cutVertex = new AliRsnCutPrimaryVertex("cutEVertex", vzCut, 0, kFALSE); AliRsnCutEventUtils *cutEventUtils = 0; cutEventUtils = new AliRsnCutEventUtils("cutEUtils", kTRUE, rejectPileUp); if ((collisionType == kPP) && (!isMC) && cutVertex) { cutVertex->SetCheckPileUp(rejectPileUp); // set the check for pileup ::Info("AddTaskRsnPhiSpinPol", Form(":::::::::::::::::: Pile-up rejection mode: %s", (rejectPileUp) ? "ON" : "OFF")); } // define and fill cut set for event cut AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutEventUtils); eventCuts->AddCut(cutVertex); TString cutScheme = TString::Format("%s&%s", cutEventUtils->GetName(), cutVertex->GetName()); eventCuts->SetCutScheme(cutScheme.Data()); task->SetEventCuts(eventCuts); }
AliRsnCutSet* EventCuts() { // primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted // we switch on the check for pileup AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); cutVertex->SetCheckPileUp(kTRUE); // primary vertex is always used AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutVertex); eventCuts->SetCutScheme(cutVertex->GetName()); return eventCuts; }
AliRsnMiniAnalysisTask * AddTaskDeltaPP7TeV ( Bool_t isMC, Bool_t isPP, const char *path, Int_t nmix ) { // // -- INITIALIZATION ---------------------------------------------------------------------------- // // retrieve analysis manager AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); // create the task and connect with physics selection AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask("RSN", isMC); if (isAOD049 && !isMC && !isPP){ task->SetUseCentralityPatch(kTRUE); } mgr->AddTask(task); // settings if (isPP) task->UseMultiplicity("QUALITY"); else task->UseCentrality("V0M"); // set mixing task->UseContinuousMix(); //task->UseBinnedMix(); task->SetNMix(nmix); task->SetMaxDiffVz(1.0); task->SetMaxDiffMult(5.0); task->SetMaxDiffAngle(1E20); // // -- EVENT CUTS (same for all configs) --------------------------------------------------------- // // cut on primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); // set the check for pileup if (isPP) cutVertex->SetCheckPileUp(kTRUE); // define and fill cut set AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutVertex); eventCuts->SetCutScheme(cutVertex->GetName()); // 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 (useDelta) { gROOT->LoadMacro("${ALICE_PHYSICS}/PWGLF/RESONANCES/macros/mini/ConfigDeltaPP7TeV.C"); ConfigDeltaPP7TeV(task, isMC, "", cutsPair); if (isMC) { gROOT->LoadMacro("${ALICE_PHYSICS}/PWGLF/RESONANCES/macros/mini/ConfigDeltaPP7TeV_MC.C"); ConfigDeltaPP7TeV_MC(task, isPP, "", cutsPair); } } // // -- CONTAINERS -------------------------------------------------------------------------------- // const char *file = AliAnalysisManager::GetCommonFileName(); AliAnalysisDataContainer *output = mgr->CreateContainer("RsnOut", TList::Class(), AliAnalysisManager::kOutputContainer, file); mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); mgr->ConnectOutput(task, 1, output); return task; }
AliRsnMiniAnalysisTask * AddTaskKStarPP5TeV ( Bool_t isMC = kFALSE, Bool_t isPP = kTRUE, Int_t Strcut = 2011, TString outNameSuffix = "tofveto3stpc2s", Int_t customQualityCutsID = AliRsnCutSetDaughterParticle::kDisableCustom, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate=AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s, Float_t nsigmaPi = 2.0, Float_t nsigmaK = 2.0, Bool_t enableMonitor = kTRUE, Int_t nmix = 5, Float_t maxDiffVzMix = 1.0, Float_t maxDiffMultMix = 5.0 ) { UInt_t triggerMask = AliVEvent::kINT7; Bool_t rejectPileUp = kTRUE; Double_t vtxZcut = 10.0;//cm, default cut on vtx z if(!isPP || isMC) rejectPileUp = kFALSE; // // -- INITIALIZATION ---------------------------------------------------------------------------- // retrieve analysis manager // AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); if (!mgr) { ::Error("AddTaskKStarPP5TeV", "No analysis manager to connect to."); return NULL; } // create the task and configure TString taskName = Form("KStar%s%s", (isPP? "pp" : "PbPb"), (isMC ? "MC" : "Data")); AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC); //task->SelectCollisionCandidates(AliVEvent::kMB); task->UseESDTriggerMask(triggerMask); if (isPP) task->UseMultiplicity("QUALITY"); else task->UseCentrality("V0M"); // set event mixing options task->UseContinuousMix(); //task->UseBinnedMix(); task->SetNMix(nmix); task->SetMaxDiffVz(maxDiffVzMix); task->SetMaxDiffMult(maxDiffMultMix); task->UseMC(isMC); ::Info("AddTaskKStarPP5TeV", Form("Event mixing configuration: \n events to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f \n", nmix, maxDiffVzMix, maxDiffMultMix)); mgr->AddTask(task); // // -- EVENT CUTS (same for all configs) --------------------------------------------------------- // // cut on primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); if (isPP && (!isMC)) cutVertex->SetCheckPileUp(rejectPileUp); // set the check for pileup cutVertex->SetCheckZResolutionSPD(); cutVertex->SetCheckDispersionSPD(); cutVertex->SetCheckZDifferenceSPDTrack(); AliRsnCutEventUtils* cutEventUtils=new AliRsnCutEventUtils("cutEventUtils",kTRUE,rejectPileUp); cutEventUtils->SetCheckIncompleteDAQ(); cutEventUtils->SetCheckSPDClusterVsTrackletBG(); // define and fill cut set for event cut AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutEventUtils); eventCuts->AddCut(cutVertex); eventCuts->SetCutScheme(Form("%s&%s",cutEventUtils->GetName(),cutVertex->GetName())); // set cuts in task task->SetEventCuts(eventCuts); // // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- // //vertex Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE); AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT"); outVtx->AddAxis(vtxID, 400, -20.0, 20.0); //multiplicity or centrality Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT"); if (isPP) outMult->AddAxis(multID, 400, 0.0, 400.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()); // // -- CONFIG ANALYSIS -------------------------------------------------------------------------- // gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/ConfigKStarPP5TeV.C"); if (!ConfigKStarPP5TeV(task, isMC, isPP, "", cutsPair, Strcut, customQualityCutsID,cutKaCandidate,nsigmaPi,nsigmaK, enableMonitor)) return 0x0; // // -- CONTAINERS -------------------------------------------------------------------------------- // TString outputFileName = AliAnalysisManager::GetCommonFileName(); // outputFileName += ":Rsn"; Printf("AddTaskKStarPP5TeV - Set OutputFileName : \n %s\n", outputFileName.Data() ); AliAnalysisDataContainer *output = mgr->CreateContainer(Form("RsnOut_%s",outNameSuffix.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName); mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); mgr->ConnectOutput(task, 1, output); return task; }
AliRsnMiniAnalysisTask * AddAnalysisTaskSigmaStarPbPb ( Bool_t isMC, Bool_t isPP, Float_t cutV = 10.0, Int_t aodFilterBit = 5, Int_t piPIDCut = 3.0, Int_t pPIDCut = 3.0, Float_t trackDCAcut = 7.0, Float_t massTol = 0.01, Float_t lambdaDCA = 0.3, Float_t lambdaCosPoinAn = 0.99, Float_t lambdaDaughDCA = 0.5, Int_t NTPCcluster = 70, Int_t nmix = 5, Float_t maxDiffVzMix = 1.0, Float_t maxDiffMultMix = 10.0, Float_t maxDiffAngleMixDeg = 20.0, Int_t aodN = 68, TString outNameSuffix = "Sigma1385" ) { // // -- INITIALIZATION ---------------------------------------------------------------------------- // retrieve analysis manager // AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); if (!mgr) { ::Error("AddAnalysisTaskSigmaStarPbPb", "No analysis manager to connect to."); return NULL; } // create the task and configure TString taskName = Form("SigmaStar%s%s_%.1f_%d_%.1f_%.1f_%.2f_%.2f_%.1f_%.2f_%.1f", (isPP? "pp" : "PbPb"), (isMC ? "MC" : "Data"),cutV,NTPCcluster,piPIDCut,pPIDCut,trackDCAcut,massTol,lambdaDCA,lambdaCosPoinAn,lambdaDaughDCA); AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC); if (!isMC && !isPP){ Printf(Form("========== SETTING USE CENTRALITY PATCH AOD049 : %s", (aodN==49)? "yes" : "no")); task->SetUseCentralityPatch(aodN==49); } if (isPP) task->UseMultiplicity("QUALITY"); else task->UseCentrality("V0M"); // set event mixing options task->UseContinuousMix(); //task->UseBinnedMix(); task->SetNMix(nmix); task->SetMaxDiffVz(maxDiffVzMix); task->SetMaxDiffMult(maxDiffMultMix); if (!isPP) task->SetMaxDiffAngle(maxDiffAngleMixDeg*TMath::DegToRad()); //set angle diff in rad ::Info("AddAnalysisTaskSigmaStarPbPb", Form("Event mixing configuration: \n events to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f \n max diff EP angle = %5.3f deg", nmix, maxDiffVzMix, maxDiffMultMix, (isPP ? 0.0 : maxDiffAngleMixDeg))); mgr->AddTask(task); // // -- EVENT CUTS (same for all configs) --------------------------------------------------------- // // cut on primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", cutV, 0, kFALSE); if (isPP) cutVertex->SetCheckPileUp(kTRUE); // set the check for pileup // define and fill cut set for event cut AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutVertex); eventCuts->SetCutScheme(cutVertex->GetName()); // set cuts in task task->SetEventCuts(eventCuts); // // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- // //vertex Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE); AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT"); outVtx->AddAxis(vtxID, 400, -20.0, 20.0); //multiplicity or centrality Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT"); if (isPP) outMult->AddAxis(multID, 400, 0.0, 400.0); else outMult->AddAxis(multID, 100, 0.0, 100.0); //event plane (only for PbPb) Int_t planeID = task->CreateValue(AliRsnMiniValue::kPlaneAngle, kFALSE); AliRsnMiniOutput *outPlane = 0x0; //task->CreateOutput("eventPlane", "HIST", "EVENT"); if (!isPP){ outPlane = task->CreateOutput("eventPlane", "HIST", "EVENT"); outPlane->AddAxis(planeID, 180, 0.0, TMath::Pi()); } // // -- 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()); // // -- CONFIG ANALYSIS -------------------------------------------------------------------------- gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/ConfigSigmaStarPbPb.C"); if (isMC) { Printf("========================== MC analysis - PID cuts not used"); } else Printf("========================== DATA analysis - PID cuts used"); if (!ConfigSigmaStarPbPb(task, isPP, isMC, piPIDCut, pPIDCut, aodFilterBit, piDCAcut, massTol, lambdaDCA, lambdaCosPoinAn, lambdaDaughDCA, NTPCcluster, "", cutsPair)) return 0x0; // // -- CONTAINERS -------------------------------------------------------------------------------- // TString outputFileName = AliAnalysisManager::GetCommonFileName(); // outputFileName += ":Rsn"; Printf("AddAnalysisTaskSigmaStarPbPb - Set OutputFileName : \n %s\n", outputFileName.Data() ); AliAnalysisDataContainer *output = mgr->CreateContainer(Form("RsnOut_%s_%.1f_%d_%.1f_%.1f_%.2f_%.2f_%.1f_%.2f_%.1f",outNameSuffix.Data(),cutV,NTPCcluster,piPIDCut,pPIDCut,trackDCAcut,massTol,lambdaDCA,lambdaCosPoinAn,lambdaDaughDCA), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName); mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); mgr->ConnectOutput(task, 1, output); return task; }
Bool_t AddRsnEventComputations(Bool_t isMC, const char *options = "", const char *taskName = "RSNtask") { // ================================================================================================================== // == PRELIMINARY OPERATIONS ======================================================================================== // ================================================================================================================== // retrieve task from manager, using its name AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); AliRsnAnalysisTask *task = (AliRsnAnalysisTask*)mgr->GetTask(taskName); if (!task) { Error("RsnConfigMonitor", "Task not found"); return kFALSE; } TString opt(options); opt.ToUpper(); opt.ReplaceAll(" ", ""); Bool_t central = opt.Contains("CENT"); Bool_t peripheral = opt.Contains("PERI"); // ================================================================================================================== // == EVENT CUTS ==================================================================================================== // ================================================================================================================== // event cuts are added directly to a cutSet in the task // we create all and then add thos which are needed // primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted // we switch on the check for pileup AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); cutVertex->SetCheckPileUp(kTRUE); // centrality: // - 2nd argument --> one of the centrality evaluation methods // - 3rd, 4th argument --> centrality ranges in percentile (0-10 for central, 60-70 for peripheral) AliRsnCutValue *cutCentrality = 0x0; if (central) cutCentrality = new AliRsnCutValue("cutCentral", AliRsnValue::kEventCentralityV0, 0.0, 10.0); else if (peripheral) cutCentrality = new AliRsnCutValue("cutPeripheral", AliRsnValue::kEventCentralityV0, 60.0, 70.0); // primary vertex is always used task->GetEventCuts()->AddCut(cutVertex); // set cut scheme as AND of primary vertex and centrality, if initialized if (cutCentrality) { task->GetEventCuts()->AddCut(cutCentrality); task->GetEventCuts()->SetCutScheme(Form("%s & %s", cutVertex->GetName(), cutCentrality->GetName())); } else { task->GetEventCuts()->SetCutScheme(cutVertex->GetName()); } ::Info("AddEventStuff", "Scheme for event cuts: %s", task->GetEventCuts()->GetCutScheme().Data()); // ================================================================================================================== // == EVENT FUNCTIONS =============================================================================================== // ================================================================================================================== // we want to add an AliRsnFunction to compute multiplicity distribution // it is needed in order to know how many events we have in each multiplicity bin // axes AliRsnValue *axisEvMultSPD = new AliRsnValue("MultSPD", AliRsnValue::kEventMultSPD, 0.0, 150.0, 1.0); AliRsnValue *axisEvMultMC = new AliRsnValue("MultMC" , AliRsnValue::kEventMultMC , 0.0, 150.0, 1.0); // create function and add axis AliRsnFunction *fcnEv = new AliRsnFunction; if (!fcnEv->AddAxis(axisEvMultSPD)) return kFALSE; if (isMC && !fcnEv->AddAxis(axisEvMultMC)) return kFALSE; // add functions to pairs task->GetInfo()->AddEventFunction(fcnEv); return kTRUE; }
AliRsnMiniAnalysisTask * AddAnalysisTaskTPCKStar ( Bool_t isMC, Bool_t isPP, Int_t aodFilterBit = 5, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutPiCandidate = AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, Float_t nsigmaPi = 2.0, Float_t nsigmaKa = 2.0, Bool_t enableMonitor = kTRUE, Bool_t IsMcTrueOnly = kFALSE, UInt_t triggerMask = AliVEvent::kMB, Int_t PbPb2011CentFlat = 0, Int_t nmix = 0, Float_t maxDiffVzMix = 1.0, Float_t maxDiffMultMix = 10.0, Float_t maxDiffAngleMixDeg = 20.0, Int_t aodN = 0, TString outNameSuffix = "" ) { // // -- INITIALIZATION ---------------------------------------------------------------------------- // retrieve analysis manager // AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); if (!mgr) { ::Error("AddAnalysisTaskTPCKStar", "No analysis manager to connect to."); return NULL; } // create the task and configure TString taskName = Form("TPCKStar%s%s_%i%i_%s", (isPP? "pp" : "PbPb"), (isMC ? "MC" : "Data"), (Int_t)cutPiCandidate,(Int_t)cutKaCandidate, outNameSuffix.Data() ); AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC); if (!isMC && !isPP){ Printf(Form("========== SETTING USE CENTRALITY PATCH AOD049 : %s", (aodN==49)? "yes" : "no")); task->SetUseCentralityPatch(aodN==49); } //centrality flatening patch LHC11h if(PbPb2011CentFlat) task->SetUseCentralityPatchPbPb2011(PbPb2011CentFlat); //task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral); task->SelectCollisionCandidates(triggerMask); if (isPP) task->UseMultiplicity("QUALITY"); else task->UseCentrality("V0M"); // set event mixing options task->UseContinuousMix(); //task->UseBinnedMix(); task->SetNMix(nmix); task->SetMaxDiffVz(maxDiffVzMix); task->SetMaxDiffMult(maxDiffMultMix); if (!isPP) task->SetMaxDiffAngle(maxDiffAngleMixDeg*TMath::DegToRad()); //set angle diff in rad ::Info("AddAnalysisTaskTPCKStar", Form("Event mixing configuration: \n events to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f \n max diff EP angle = %5.3f deg", nmix, maxDiffVzMix, maxDiffMultMix, (isPP ? 0.0 : maxDiffAngleMixDeg))); mgr->AddTask(task); // // -- EVENT CUTS (same for all configs) --------------------------------------------------------- // // cut on primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); if (isPP) cutVertex->SetCheckPileUp(kTRUE); // set the check for pileup // define and fill cut set for event cut AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutVertex); eventCuts->SetCutScheme(cutVertex->GetName()); // set cuts in task task->SetEventCuts(eventCuts); // // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- // //vertex Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE); AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT"); outVtx->AddAxis(vtxID, 400, -20.0, 20.0); //multiplicity or centrality Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT"); if (isPP) outMult->AddAxis(multID, 400, 0.0, 400.0); else outMult->AddAxis(multID, 100, 0.0, 100.0); //event plane (only for PbPb) Int_t planeID = task->CreateValue(AliRsnMiniValue::kPlaneAngle, kFALSE); AliRsnMiniOutput *outPlane = task->CreateOutput("eventPlane", "HIST", "EVENT"); if (!isPP) outPlane->AddAxis(planeID, 180, 0.0, TMath::Pi()); // // -- 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()); // // -- CONFIG ANALYSIS -------------------------------------------------------------------------- if(!isMC){ gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/ConfigTPCanalysisKStar.C"); if (!ConfigTPCanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, aodN)) return 0x0; } else { gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/ConfigTPCanalysisKStarMC.C"); if (!ConfigTPCanalysisKStarMC(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, 313, aodN)) return 0x0; //K* if (!ConfigTPCanalysisKStarMC(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, -313, aodN)) return 0x0; //anti-K* } // // -- CONTAINERS -------------------------------------------------------------------------------- // TString outputFileName = AliAnalysisManager::GetCommonFileName(); // outputFileName += ":Rsn"; Printf("AddAnalysisTaskTPCKStar - Set OutputFileName : \n %s\n", outputFileName.Data() ); AliAnalysisDataContainer *output = mgr->CreateContainer(Form("RsnOut_%s",outNameSuffix.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName); mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); mgr->ConnectOutput(task, 1, output); return task; }
// // Test config macro for RSN package. // It configures: // 1) a monitor for all tracks passing quality cuts // 2) a monitor for all tracks passing quality + PID cuts // 3) an unlike-sign invariant-mass + pt distribution for K+K- pairs // Bool_t RsnConfigPhiKaonTest ( AliRsnAnalysisTask *task, Bool_t isMC ) { if (!task) { ::Error("RsnConfigPhiKaonTest.C", "NULL task"); return kFALSE; } const char *suffix = "test"; // ---------------------------------------------------------------------------------------------- // -- DEFINITIONS ------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- // daughter definition for monitor loops // since it is intended to loop over all 'track' like objects (in the sense that we exclude V0s and cascades), // we initialize it using the constructor that requires an AliRsnDaughter::EType and a charge, but since // we want to loop over both charges, we set it to anything which is not '+' '-' or '0', which are tokens for // selecting only positive, only negative or only neutral AliRsnDaughterDef *tracks = new AliRsnDaughterDef(AliRsnDaughter::kTrack, 0); // definition of pair decay tree for phi resonance // here we *must* specify a particle species and a charge, in order to check the decay tree // last arguments are the PDG code and nominal mass of the resonance, which are needed when // one wants to select true pairs only and/or he wants to compute rapidity or Mt AliRsnPairDef *pairDef = new AliRsnPairDef(AliRsnDaughter::kKaon, '+', AliRsnDaughter::kKaon, '-', 333, 1.019455); // definition of loop objects: // (a) 1 monitor for all tracks passing quality cuts // (b) 1 monitor for all tracks passing quality+PID cuts // (c) 1 pair filled with all tracks passing same cuts as (b) // (d) 1 pair like (c) but for mixing // (e) 1 pair like (c) but with true pairs only // NOTE: (c) and (d) are instantiated with same settings, they will be made // different after some settings done in second moment AliRsnLoopDaughter *loopQuality = new AliRsnLoopDaughter(Form("%s_mon_quality", suffix), 0, tracks); AliRsnLoopDaughter *loopPID = new AliRsnLoopDaughter(Form("%s_mon_pid" , suffix), 0, tracks); AliRsnLoopPair *loopPhi = new AliRsnLoopPair (Form("%s_unlike" , suffix), pairDef); AliRsnLoopPair *loopPhiMix = new AliRsnLoopPair (Form("%s_unlike" , suffix), pairDef); AliRsnLoopPair *loopPhiTrue = new AliRsnLoopPair (Form("%s_trues" , suffix), pairDef); // set additional option for true pairs (slot [0]) loopPhiTrue->SetOnlyTrue(kTRUE); loopPhiTrue->SetCheckDecay(kTRUE); // set mixing options loopPhi ->SetMixed(kFALSE); loopPhiMix ->SetMixed(kTRUE); loopPhiTrue->SetMixed(kFALSE); // assign the ID of the entry lists to be used by each pair to get selected daughters // in our case, the AliRsnInputHandler contains only one list for selecting kaons Int_t idQuality, idPID; AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); AliMultiInputEventHandler *multi = dynamic_cast<AliMultiInputEventHandler*>(mgr->GetInputEventHandler()); if (!multi) { myError("Needed a multi input handler!"); return kFALSE; } TObjArray *array = multi->InputEventHandlers(); AliRsnInputHandler *rsn = (AliRsnInputHandler*)array->FindObject("rsnInputHandler"); if (!rsn) { myError("Needed an RSN event handler"); return kFALSE; } AliRsnDaughterSelector *sel = rsn->GetSelector(); idQuality = sel->GetID("qualityTPC", kTRUE); idPID = sel->GetID("kaonTPC", kTRUE); if (idQuality < 0 || idPID < 0) { myError("List problems"); return kFALSE; } loopQuality->SetListID(idQuality); loopPID ->SetListID(idPID); loopPhi ->SetListID(0, idPID); loopPhi ->SetListID(1, idPID); loopPhiMix ->SetListID(0, idPID); loopPhiMix ->SetListID(1, idPID); loopPhiTrue->SetListID(0, idPID); loopPhiTrue->SetListID(1, idPID); // ---------------------------------------------------------------------------------------------- // -- EVENT CUTS -------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- // primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted // we switch on the check for pileup AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); cutVertex->SetCheckPileUp(kTRUE); // primary vertex is always used AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutVertex); eventCuts->SetCutScheme(cutVertex->GetName()); // add the event cuts to all loops loopQuality->SetEventCuts(eventCuts); loopPID ->SetEventCuts(eventCuts); loopPhi ->SetEventCuts(eventCuts); loopPhi ->SetEventCuts(eventCuts); loopPhiMix ->SetEventCuts(eventCuts); loopPhiMix ->SetEventCuts(eventCuts); loopPhiTrue->SetEventCuts(eventCuts); loopPhiTrue->SetEventCuts(eventCuts); // ---------------------------------------------------------------------------------------------- // -- PAIR CUTS --------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- // for pairs we define a rapidity windows, defined through a cut // --> NOTE: it needs a support AliRsnPairDef from which it takes the mass AliRsnValueStd *valRapidity = new AliRsnValueStd("valY", AliRsnValueStd::kPairY); AliRsnCutValue *cutRapidity = new AliRsnCutValue("cutY", -0.5, 0.5, isMC); valRapidity->SetSupportObject(pairDef); cutRapidity->SetValueObj(valRapidity); // cut set AliRsnCutSet *pairCuts = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother); pairCuts->AddCut(cutRapidity); pairCuts->SetCutScheme(cutRapidity->GetName()); // add cut to pair loops only loopPhi ->SetPairCuts(pairCuts); loopPhi ->SetPairCuts(pairCuts); loopPhiMix ->SetPairCuts(pairCuts); loopPhiMix ->SetPairCuts(pairCuts); loopPhiTrue->SetPairCuts(pairCuts); loopPhiTrue->SetPairCuts(pairCuts); // ---------------------------------------------------------------------------------------------- // -- COMPUTED VALUES & OUTPUTS ----------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- AliRsnValueStd *axisIM = new AliRsnValueStd("IM" , AliRsnValueStd::kPairInvMass , 0.9, 1.4, 0.001); AliRsnValueStd *axisPt = new AliRsnValueStd("PT" , AliRsnValueStd::kPairPt , 0.0, 5.0, 0.1 ); AliRsnValueStd *axisMomTPC = new AliRsnValueStd("pTPC", AliRsnValueStd::kTrackPtpc , 0.0, 5.0, 0.01 ); AliRsnValueStd *axisSigTPC = new AliRsnValueStd("sTPC", AliRsnValueStd::kTrackTPCsignal, 0.0, 500.0, 2.0 ); // output for monitors: // 2D histogram with TPC signal vs TPC momentum AliRsnListOutput *outMonitor = new AliRsnListOutput("mon", AliRsnListOutput::kHistoDefault); outMonitor->AddValue(axisMomTPC); outMonitor->AddValue(axisSigTPC); // output for pairs: // 2D histogram with inv.mass vs pt AliRsnListOutput *outPair = new AliRsnListOutput("pair", AliRsnListOutput::kHistoDefault); outPair->AddValue(axisIM); outPair->AddValue(axisPt); // add outputs to loops loopQuality->AddOutput(outMonitor); loopPID ->AddOutput(outMonitor); loopPhi ->AddOutput(outPair); loopPhiMix ->AddOutput(outPair); loopPhiTrue->AddOutput(outPair); // ---------------------------------------------------------------------------------------------- // -- CONCLUSION -------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- task->Add(loopQuality); task->Add(loopPID ); task->Add(loopPhi ); task->Add(loopPhiMix ); task->Add(loopPhiTrue); return kTRUE; }
Bool_t AddAnalysisTaskRsn ( Bool_t isMC, Bool_t useCentrality, Bool_t checkPileUp, const char *path = "$(HOME)/code/resonances/alice-rsn-package/PWG2resonances/RESONANCES/macros/test/pulvir" ) { // // -- INITIALIZATION ---------------------------------------------------------------------------- // // retrieve analysis manager AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); // create the task and connect with physics selection AliRsnAnalysisTask *task = new AliRsnAnalysisTask("RSN"); task->SelectCollisionCandidates(); mgr->AddTask(task); // // -- EVENT CUTS (same for all configs) --------------------------------------------------------- // // cut on primary vertex: // - 2nd argument --> |Vz| range // - 3rd argument --> minimum required number of contributors // - 4th argument --> tells if TPC stand-alone vertexes must be accepted AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); // set the check for pileup ::Info("AddAnalysisTaskRsn", "Check of pile-up from SPD is %s", (checkPileUp ? "active" : "disabled")); cutVertex->SetCheckPileUp(checkPileUp); // define and fill cut set AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); eventCuts->AddCut(cutVertex); eventCuts->SetCutScheme(cutVertex->GetName()); // // -- CONFIGS ----------------------------------------------------------------------------------- // // add configs and count how many are added // will return kFALSE if none is added Int_t added = 0; if (useTest) { // NOTE: this is a test and will had its own definition of event cuts // ----> will not use those defined above gROOT->LoadMacro(Form("%s/RsnConfigTest.C", path)); if (!RsnConfigTest(task, isMC)) return kFALSE; added++; } if (useEvent) { gROOT->LoadMacro(Form("%s/RsnConfigEvent.C", path)); if (!RsnConfigEvent(task, isMC, useCentrality, eventCuts)) return kFALSE; added++; } if (useKaonMonitor) { gROOT->LoadMacro(Form("%s/RsnConfigMonitorTPC.C", path)); if (!RsnConfigMonitorTPC(task, isMC, useCentrality, eventCuts)) return kFALSE; added++; } if (usePhiTPC) { gROOT->LoadMacro(Form("%s/RsnConfigPhiTPC.C", path)); if (!RsnConfigPhiTPC(task, isMC, useCentrality, eventCuts)) return kFALSE; added++; } if (useKStarTPC) { gROOT->LoadMacro(Form("%s/RsnConfigKStarTPC.C", path)); if (!RsnConfigKStarTPC(task, isMC, useCentrality, eventCuts)) return kFALSE; added++; } ::Info("AddAnalysisTaskRsn.C", "Added %d configs", added); if (!added) { ::Error("AddAnalysisTaskRsn.C", "Cannot process an empty task!"); return kFALSE; } // // -- CONTAINERS -------------------------------------------------------------------------------- // const char *file = AliAnalysisManager::GetCommonFileName(); AliAnalysisDataContainer *output = mgr->CreateContainer("RsnOut", TList::Class(), AliAnalysisManager::kOutputContainer, file); mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); mgr->ConnectOutput(task, 1, output); return kTRUE; }