本文整理汇总了C++中AliAnalysisManager::GetCommonOutputContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ AliAnalysisManager::GetCommonOutputContainer方法的具体用法?C++ AliAnalysisManager::GetCommonOutputContainer怎么用?C++ AliAnalysisManager::GetCommonOutputContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliAnalysisManager
的用法示例。
在下文中一共展示了AliAnalysisManager::GetCommonOutputContainer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AliAnalysisTaskMuonAODCreation
AliAnalysisTaskMuonAODCreation *AddTaskMuonAODCreation()
{
// Creates a filter task to copy muon tracks from the Standard AOD to the Muon AOD
// R. Arnaldi - 6/10/09
// Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskMuonAODCreation", "No analysis manager to connect to.");
return NULL;
}
// Get input handler
TString type = mgr->GetInputEventHandler()->GetDataType();
// Define output
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist0",TList::Class(),AliAnalysisManager::kOutputContainer,"MuonPlots.root");
// Create the task, add it to the manager and configure it.
//===========================================================================
AliAnalysisTaskMuonAODCreation *muonAODtask = new AliAnalysisTaskMuonAODCreation("Muon AOD creation");
mgr->AddTask(muonAODtask);
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
mgr->ConnectInput (muonAODtask, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput (muonAODtask, 0, mgr->GetCommonOutputContainer());
mgr->ConnectOutput (muonAODtask, 1, coutput1);
return muonAODtask;
}
示例2: RegisteredDataset
/**
* Get the name of the registered data set
*
*
* @return Name of the registered data set
*/
static TString RegisteredDataset()
{
TString ret;
AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
AliVEventHandler* oh = mgr->GetOutputEventHandler();
if (!oh) {
Warning("OutputUtilities::GetOutputDataSet",
"No outout event handler defined");
return ret;
}
AliAnalysisDataContainer* co = mgr->GetCommonOutputContainer();
if (!co) {
Warning("OutputUtilities::GetOutputDataSet",
"No common output container defined");
return ret;
}
if (!co->IsRegisterDataset()) {
Info("OutputUtilities::GetOutputDataSet",
"Common output is not registered as dataset");
return ret;
}
ret = oh->GetOutputFileName();
// ret.ReplaceAll("TTree", "");
ret.ReplaceAll(".root", "");
// ret.Append(co->GetTitle());
return ret;
}
示例3: RegisterStorage
/**
* Register special putput storage
*
* @param url Url (root://host/full_path)
*
* @return true on success
*/
static Bool_t RegisterStorage(const TString& url)
{
if (url.IsNull()) {
Error("OutputUtilities::RegisterStorage", "No storage URI specified");
return false;
}
// Get the manager
AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
// Get the container
AliAnalysisDataContainer* cont = mgr->GetCommonOutputContainer();
if (!cont) {
Warning("OutputUtilities::RegisterStorage",
"No common output container defined");
return false;
}
TString u(url);
if (u.EqualTo("auto")) {
if (!StartXrootd(u)) {
Warning("OutputUtilities::RegisterStorage",
"Couldn't start the XRootD server");
return false;
}
}
cont->SetSpecialOutput();
mgr->SetSpecialOutputLocation(u);
return true;
}
示例4: AliAnalysisTaskFilterFriend
AliAnalysisTaskFilterFriend *AddTaskFilterFriend()
{
// pointer to the analysis manager
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTaskTOFCalib", "No analysis manager to connect to.");
return NULL;
}
// check the input handler
if (!mgr->GetInputEventHandler()) {
::Error("AddTask", "This task requires an input event handler");
return NULL;
}
TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
// create the task
AliAnalysisTaskFilterFriend* filter = new AliAnalysisTaskFilterFriend("filter_1");
mgr->AddTask(filter);
// connecting the input/output containers
AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput0 = mgr->GetCommonOutputContainer();
mgr->ConnectInput (filter, 0, cinput0 );
//mgr->ConnectOutput(filter, 0, coutput0);
return filter;
}
示例5: RunLinkToMCAnalysisExample
void RunLinkToMCAnalysisExample(const char* esdFile = "./AliESDs.root")
{
// Load needed libraries
gSystem->Load("libTree");
gSystem->Load("libGeom");
gSystem->Load("libVMC");
gSystem->Load("libPhysics");
gSystem->Load("libSTEERBase");
gSystem->Load("libESD");
gSystem->Load("libAOD");
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->Load("libPWGHFbase");
gSystem->Load("libPWGmuon");
// Create the TChain for esdTrees in the AliESDs.root file.
TChain* chain = new TChain("esdTree");
chain->Add(esdFile);
if (!chain) return;
// Create the analysis manager and event handlers.
AliAnalysisManager* mgr = new AliAnalysisManager("Analysis Train", "An example analysis train setup for AliAnalysisTaskLinkToMC.");
AliESDInputHandler* esdHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(esdHandler);
AliMCEventHandler* mcHandler = new AliMCEventHandler();
mgr->SetMCtruthEventHandler(mcHandler);
mcHandler->SetReadTR(kTRUE);
AliAODHandler* aodHandler = new AliAODHandler();
mgr->SetOutputEventHandler(aodHandler);
aodHandler->SetOutputFileName("AliAOD.root");
// Create the analysis task and setup the parameters.
AliAnalysisTaskLinkToMC* linktask = new AliAnalysisTaskLinkToMC("Task to link ESD tracks to corresponding MC tracks.");
linktask->MinClusters(6);
linktask->HardCutLimitX(4);
linktask->HardCutLimitY(4);
linktask->SigmaCut(5.);
linktask->MinClustersInSt45(3);
linktask->StationMustMatch(1, true); // At least one cluster in station 1 must match.
linktask->StationMustMatch(2, true); // At least one cluster in station 2 must match.
linktask->StationMustMatch(3, true); // At least one cluster in station 3 must match.
linktask->GenerateHistograms(true);
mgr->AddTask(linktask);
// Create the input and output containers and connect them up to the analysis task.
AliAnalysisDataContainer* cinEsd = mgr->GetCommonInputContainer();
AliAnalysisDataContainer* coutAod = mgr->GetCommonOutputContainer();
AliAnalysisDataContainer* coutHists = mgr->CreateContainer("cHists", TList::Class(), AliAnalysisManager::kOutputContainer, "hists.root");
mgr->ConnectInput(linktask, 0, cinEsd);
mgr->ConnectOutput(linktask, 0, coutAod);
mgr->ConnectOutput(linktask, 1, coutHists);
if (mgr->InitAnalysis())
{
mgr->PrintStatus();
mgr->StartAnalysis("local", chain);
}
}
示例6: AliMuonEventCuts
AliAnalysisTask* AddTaskAOD2AODMuonOnly(const char* triggerinputs,Bool_t withSPDtracklets, Int_t mcMode)
{
AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr)
{
::Error("AddTaskAOD2AODMuonOnly", "No analysis manager to connect to.");
return 0x0;
}
AliInputEventHandler* input = mgr->GetInputEventHandler();
if (!input)
{
::Error("AddTaskAOD2AODMuonOnly", "This task requires an input event handler");
return 0x0;
}
TString inputDataType = input->GetDataType(); // can be "ESD" or "AOD"
if (inputDataType != "AOD")
{
::Error("AddTaskAOD2AODMuonOnly", "This task requires an AOD input event handler");
return 0x0;
}
AliAODHandler* aodHandler = dynamic_cast<AliAODHandler*>(mgr->GetOutputEventHandler());
if (!aodHandler)
{
::Error("AddTaskAOD2AODMuonOnly", "This task requires an AOD output event handler");
return 0x0;
}
aodHandler->SetCreateNonStandardAOD();
AliMuonEventCuts* eventCuts = new AliMuonEventCuts("L0cutter","");
eventCuts->SetTrigClassPatterns("0MSL|0MUL|0MSH|0MLL",triggerinputs);
AliAnalysisTask* task = new AliAnalysisTaskAOD2MuonAOD(mcMode,withSPDtracklets,eventCuts);
mgr->AddTask(task);
// Connect input/output
mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput(task, 0, mgr->GetCommonOutputContainer());
return task;
}
示例7: RegisterDataset
/**
* Register output data set
*
* @param dsname Data set name
*
* @return true on success
*/
static Bool_t RegisterDataset(const TString& dsname)
{
// Get the manager
AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
// If we are asked to make a data-set, get the output handler and
// common output container.
AliVEventHandler* handler = mgr->GetOutputEventHandler();
if (!handler) return true;
// Get the container
AliAnalysisDataContainer* cont = mgr->GetCommonOutputContainer();
if (!cont) {
Warning("OutputUtilities::RegisterDataset",
"No common output container defined");
return false;
}
// Make the name
TString nme(dsname);
if (nme.IsNull()) nme = mgr->GetName();
if (nme.IsNull()) {
Error("OutputUtilities::RegisterDataset", "No data set name specified");
return false;
}
// Flag for data-set creation
cont->SetRegisterDataset(true);
handler->SetOutputFileName(nme);
// cont->SetFileName(nme);
TString base(handler->GetOutputFileName());
base.ReplaceAll(".root","");
Info("OutputUtilities::RegisterDataset",
"Will register tree output AODs (%s%s) as dataset",
base.Data(), cont->GetTitle());
return true;
}
示例8: outputFile
//.........这里部分代码省略.........
clus->SetAODTrackInput(kTRUE);
clus->SetAODMCInput(kTRUE);
}
if (typeRec.Contains("AODMCHF")){
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODMCHF);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if(typeRec.Contains("AODMC2b")){// work down from the top AODMC2b -> AODMC2 -> AODMC -> AOD
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODMCChargedAcceptance);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AODMC2")){
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODMCCharged);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(5);
}
else if (typeRec.Contains("AODMCextraonly")) {
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODMCextraonly);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AODMCextra")) {
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODMCextra);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AODMC")){
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODMCAll);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(5);
}
else if (typeRec.Contains("AODextraonly")) {
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODextraonly);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AODextra")) {
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAODextra);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AOD")) {
clus->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAOD);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
clus->SetRparam(radius);
clus->SetGhostArea(0.005);
clus->SetGhostEtamax(kTrackEtaWindowCl);
switch (jf) {
case "ANTIKT":
clus->SetAlgorithm(2); // antikt from fastjet/JetDefinition.hh
break;
case "CA":
clus->SetAlgorithm(1); // CA from fastjet/JetDefinition.hh
break;
case "KT":
clus->SetAlgorithm(0); // kt from fastjet/JetDefinition.hh
break;
default:
::Error("AddTaskJetCluster", "Wrong jet finder selected\n");
return 0;
}
if(kWriteAOD){
if(outputFile.Length())clus->SetJetOutputFile(outputFile);
clus->SetJetOutputBranch(Form("clusters%s_%s%s",bRec,jf,cAdd.Data()));
clus->SetJetOutputMinPt(0); // store only jets / clusters above a certain threshold
}
clus->SetNSkipLeadingRan(nSkip);
clus->SetNSkipLeadingCone(nSkipCone);
if(iPhysicsSelectionFlag)clus->SelectCollisionCandidates(iPhysicsSelectionFlag);
if(useOADB) {
clus->SetUseTrResolutionFromOADB();
clus->SetUseTrEfficiencyFromOADB();
clus->SetChangeEfficiencyFraction(changeEfficiencyFraction);
}
mgr->AddTask(clus);
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
AliAnalysisDataContainer *coutput1_clus = mgr->CreateContainer(Form("cluster_%s_%s_%s%s",bRec,bGen,jf,cAdd.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWGJE_cluster_%s_%s_%s%s",AliAnalysisManager::GetCommonFileName(),bRec,bGen,jf,cAdd.Data()));
mgr->ConnectInput (clus, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput (clus, 0, mgr->GetCommonOutputContainer());
mgr->ConnectOutput (clus, 1, coutput1_clus );
return clus;
}
示例9: AnalysisTrainMuonCAF
//.........这里部分代码省略.........
gProof->EnablePackage("ANALYSIS");
gProof->UploadPackage("ANALYSISalice.par");
gProof->EnablePackage("ANALYSISalice");
// Analysis-specific
// --- Enable the PWG3base Package
gProof->UploadPackage("PWG3muon.par");
gProof->EnablePackage("PWG3muon");
// Chain from files staged on CAF
// gROOT->LoadMacro("CreateESDChain.C");
// TChain* chain = CreateESDChain("ESD1503X_v1.txt",3);
// TChain* chain = CreateESDChain("ESD82XX_30Kshort.txt", 10);
// Chain from datasets
gROOT->LoadMacro("CreateChainFromDataSet.C");
ds = gProof->GetDataSet(datasetname)->GetStagedSubset();
chain = CreateChainFromDataSet(ds, "esdTree");
// Make the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("Analysis Train", "Analysis train");
// ESD input handler
AliESDInputHandler *esdHandler = new AliESDInputHandler();
esdHandler->SetInactiveBranches("FMD CaloCluster");
// AOD output handler
AliAODHandler* aodHandler = new AliAODHandler();
aodHandler->SetOutputFileName(fileout);
//aodHandler->SetOutputFileName("AOD.root");
mgr->SetInputEventHandler(esdHandler);
mgr->SetOutputEventHandler(aodHandler);
// Set of cuts plugged into the ESD filter
//
// standard
AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
esdTrackCutsL->SetMinNClustersTPC(50);
esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
esdTrackCutsL->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
esdTrackCutsL->SetRequireTPCRefit(kTRUE);
esdTrackCutsL->SetMinNsigmaToVertex(3);
esdTrackCutsL->SetRequireSigmaToVertex(kTRUE);
esdTrackCutsL->SetAcceptKingDaughters(kFALSE);
//
// hard cuts
AliESDtrackCuts* esdTrackCutsH = new AliESDtrackCuts("AliESDtrackCuts", "Hard");
esdTrackCutsH->SetMinNClustersTPC(100);
esdTrackCutsH->SetMaxChi2PerClusterTPC(2.0);
esdTrackCutsH->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
esdTrackCutsH->SetRequireTPCRefit(kTRUE);
esdTrackCutsH->SetMinNsigmaToVertex(2);
esdTrackCutsH->SetRequireSigmaToVertex(kTRUE);
esdTrackCutsH->SetAcceptKingDaughters(kFALSE);
esdTrackCutsH->SetPRange(0.,2.);
//
// muon cuts
AliESDMuonTrackCuts* esdMuonTrackCuts = new AliESDMuonTrackCuts("AliESDMuonTrackCuts", "test");
esdMuonTrackCuts->SetPRange(0.,20.);
//esdMuonTrackCuts->SetPtRange(0.,0.5); // example of kinematic cuts that can be applied
// track filter (to reject tracks not surviving the cuts - refers to all particles apart from muons)
AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
trackFilter->AddCuts(esdTrackCutsH);
// muon track filter (to reject muon tracks not surviving the cuts)
AliAnalysisFilter* trackMuonFilter = new AliAnalysisFilter("trackMuonFilter");
trackMuonFilter->AddCuts(esdMuonTrackCuts);
// ESD filter task putting standard info to output generic AOD
AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
//esdfilter->SetTrackFilter(trackFilter);
esdfilter->SetDebugLevel(10);
mgr->AddTask(esdfilter);
// ESD filter task putting muon info to output generic AOD
AliAnalysisTaskESDMuonFilter *esdmuonfilter = new AliAnalysisTaskESDMuonFilter("ESD Muon Filter");
esdmuonfilter->SetTrackFilter(trackMuonFilter);
mgr->AddTask(esdmuonfilter);
// Containers for input/output
AliAnalysisDataContainer *cin_esd = mgr->GetCommonInputContainer();
// Output AOD container.
AliAnalysisDataContainer *cout_aod = mgr->GetCommonOutputContainer();
// Connect containers to tasks slots
mgr->ConnectInput (esdfilter, 0, cin_esd );
mgr->ConnectOutput (esdfilter, 0, cout_aod );
mgr->ConnectInput (esdmuonfilter, 0, cin_esd);
mgr->ConnectOutput (esdmuonfilter, 0, cout_aod );
//
// Run the analysis
//
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
mgr->StartAnalysis("proof",chain,nev);
}
}
示例10: runAODFilterMC
void runAODFilterMC()
{
// PROOF example
gSystem->Load("libTree");
gSystem->Load("libPhysics");
gSystem->Load("libGeom");
gSystem->Load("libVMC");
bool bKineFilter = true;
// TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice_dbg");
TProof::Open("alicecaf");
// gProof->SetParallel(1);
char *dataset = "/COMMON/COMMON/LHC08c11_10TeV_0.5T";
// char *dataset = "/PWG4/kleinb/LHC08q_jetjet100";
// gProof->ClearPackages();
gProof->UploadPackage("${ALICE_ROOT}/STEERBase.par");
gProof->EnablePackage("STEERBase");
gProof->UploadPackage("${ALICE_ROOT}/ESD.par");
gProof->EnablePackage("ESD");
gProof->UploadPackage("${ALICE_ROOT}/AOD.par");
gProof->EnablePackage("AOD");
gProof->UploadPackage("${ALICE_ROOT}/ANALYSIS.par");
gProof->EnablePackage("ANALYSIS");
gProof->UploadPackage("${ALICE_ROOT}/ANALYSISalice.par");
gProof->EnablePackage("ANALYSISalice");
//
if (gApplication) gApplication->InitializeGraphics();
// Create the chain
//
///////////////////////////////////////////////////////////////////////////////////
// Create the analysis manager
//
// Input
AliESDInputHandler* inpHandler = new AliESDInputHandler();
// Output
AliAODHandler* aodHandler = new AliAODHandler();
aodHandler->SetOutputFileName("aod_ckb2.root");
// MC Truth
AliMCEventHandler* mcHandler = new AliMCEventHandler();
AliAnalysisManager *mgr = new AliAnalysisManager("Filter Manager", "Filter Manager");
if(bKineFilter){
mgr->SetMCtruthEventHandler(mcHandler);
}
mgr->SetInputEventHandler (inpHandler);
mgr->SetOutputEventHandler (aodHandler);
aodHandler->Dump();
mgr->SetDebugLevel(10);
// Filtering of MC particles (decays conversions etc)
// this task is also needed to set the MCEventHandler
// to the AODHandler, this will not be needed when
// AODHandler goes to ANALYSISalice
AliAnalysisTaskMCParticleFilter *kinefilter = new AliAnalysisTaskMCParticleFilter("Particle Filter");
if(bKineFilter)mgr->AddTask(kinefilter);
//
AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
esdTrackCutsL->SetMinNClustersTPC(50);
esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
esdTrackCutsL->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
esdTrackCutsL->SetRequireTPCRefit(kTRUE);
esdTrackCutsL->SetDCAToVertexZ(3.0);
esdTrackCutsL->SetDCAToVertexXY(3.0);
esdTrackCutsL->SetDCAToVertex2D(kTRUE);
esdTrackCutsL->SetRequireSigmaToVertex(kFALSE);
esdTrackCutsL->SetAcceptKinkDaughters(kFALSE);
AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("AliESDtrackCuts", "ITS stand-alone");
esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);
AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
trackFilter->AddCuts(esdTrackCutsL);
trackFilter->AddCuts(esdTrackCutsITSsa);
AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
esdfilter->SetTrackFilter(trackFilter);
mgr->AddTask(esdfilter);
//
// Create containers for input/output
AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
coutput1->SetSpecialOutput();
if(bKineFilter){
mgr->ConnectInput (kinefilter, 0, cinput1 );
mgr->ConnectOutput (kinefilter, 0, coutput1 );
AliAnalysisDataContainer *coutputEx = mgr->CreateContainer("cFilterList", TList::Class(),
AliAnalysisManager::kOutputContainer,"pyxsec_hists.root");
//.........这里部分代码省略.........
示例11: if
//.........这里部分代码省略.........
filter->SetEMCALEnergyCut(minE);
filter->SetEMCALNcellsCut(minN);
filter->SetPHOSEnergyCut(minE);
filter->SetPHOSNcellsCut(minN);
filter->SetTrackPtCut(minE);
printf("AddTaskCaloFilter --- Select MC events with bias in EMCal ---\n");
}
else if(bias) // select events with significant signal in EMCAL or TPC or PHOS
{
filter->SetEventSelection(1,0,0); // Select events depending on EMCAL, PHOS and tracks criteria
filter->SwitchOnAcceptAllMBEvent();
filter->SetEMCALEnergyCut(minE);
filter->SetEMCALNcellsCut(minN);
filter->SetPHOSEnergyCut(minE);
filter->SetPHOSNcellsCut(minN);
filter->SetTrackPtCut(minE);
//filter->SetMBTriggerMask(AliVEvent::kAnyINT);
filter->SetMBTriggerMask(AliVEvent::kINT7); // not working for all productions
filter->SelectCollisionCandidates(AliVEvent::kAny) ;
printf("AddTaskCaloFilter --- Select events with bias in EMCal ---\n");
}
else // Do not bias the signal in EMCAL, select MB events
{
filter->SetEventSelection(0,0,0);
filter->SwitchOnAcceptAllMBEvent();
filter->SetEMCALEnergyCut(-1);
filter->SetEMCALNcellsCut(0);
filter->SetPHOSEnergyCut(-1);
filter->SetPHOSNcellsCut(0);
filter->SetTrackPtCut(-1);
filter->SelectCollisionCandidates(AliVEvent::kINT7);// | AliVEvent::kCentral | AliVEvent::kSemiCentral ) ;
printf("AddTaskCaloFilter --- Select INT7 events ---\n");
}
// Activate the cluster corrections (calibration, bad map...)
//
if(correct) filter->SwitchOnClusterCorrection();
else filter->SwitchOffClusterCorrection();
// Exoticity cut settings
//
AliEMCALRecoUtils * reco = filter->GetEMCALRecoUtils();
reco->SwitchOnRejectExoticCluster() ;
reco->SetExoticCellFractionCut(0.97);
reco->SetExoticCellMinAmplitudeCut(4.);
// Track storing
//
if(fillTrack) { filter->SwitchOnFillTracks() ; filter->SwitchOnFillHybridTracks() ; }
else { filter->SwitchOffFillTracks() ; filter->SwitchOffFillHybridTracks() ; }
// Other options to store in event
//
filter->SwitchOffFillv0s() ; // Put ON if you know what you do.
filter->SwitchOnFillVZERO(); // Be able to recalculate centrality and event plane
// afterwards even it is stored in header
// AOD output storing
//
if(fillAOD) filter->SwitchOnFillAODFile();
else filter->SwitchOffFillAODFile();
// Pass the task to the manager, print first set parameters
filter->PrintInfo();
mgr->AddTask(filter);
// Create containers for input/output
//
printf("AddTaskCaloFilter --- Created input/output containers ---\n");
AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
printf("AddTaskCaloFilter --- Created containers, add them ---\n");
mgr->ConnectInput (filter, 0, cinput1 );
mgr->ConnectOutput (filter, 0, coutput1 );
printf("AddTaskCaloFilter --- End ---\n");
return filter;
}
示例12: if
//.........这里部分代码省略.........
anaisol->SwitchOffSeveralIsolation();
// anaisol->SetPtThresholds(0, 1.0);
// anaisol->SetPtThresholds(1, 2.0);
// anaisol->SetPtThresholds(2, 3.0);
// anaisol->SetPtThresholds(3, 4.0);
// anaisol->SetPtThresholds(4, 5.0);
// anaisol->SetPtFractions(0, 0.4);
// anaisol->SetPtFractions(1, 0.3);
// anaisol->SetPtFractions(2, 0.1);
// anaisol->SetPtFractions(3, 0.08);
// anaisol->SetPtFractions(4, 0.05);
// anaisol->SetNCones(5);
// anaisol->SetConeSizes(0, 0.50);
// anaisol->SetConeSizes(1, 0.60);
// anaisol->SetConeSizes(2, 0.70);
// anaisol->SetConeSizes(3, 0.80);
// anaisol->SetConeSizes(4, 0.90);
if(kPrintSettings) anaisol->Print("");
// //===========================
// //Correlation analysis
// //===========================
// // ### Correlation with Jet Finder AOD output
// AliAnaParticleJetFinderCorrelation *anacorrjet = new AliAnaParticleJetFinderCorrelation();
// anacorrjet->SetInputAODName("ConversionGamma");//,calorimeter.Data()));
// anacorrjet->SwitchOffFiducialCut();
// anacorrjet->SetDebug(debugLevel);
// anacorrjet->SetConeSize(1);
// anacorrjet->SelectIsolated(kTRUE); // do correlation with isolated photons
// anacorrjet->SetPtThresholdInCone(0.2);
// anacorrjet->SetDeltaPhiCutRange(0.5,5.5);//Mostly Open Cuts
// anacorrjet->SetRatioCutRange(0.01,3); //Mostly Open Cuts
// anacorrjet->UseJetRefTracks(kFALSE); //Not working now
// //Set Histograms bins and ranges
// anacorrjet->SetHistoPtRangeAndNBins(0, 50, 200) ;
// // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
// // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
// if(kPrintSettings) anacorrjet->Print("");
// #### Configure Maker ####
AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
maker->SetReader(reader);//pointer to reader
maker->SetCaloUtils(cu); //pointer to calorimeter utils
Int_t n = 0;//Analysis number, order is important
maker->AddAnalysis(anaisol,n++);
//maker->AddAnalysis(anacorrjet, n++);
maker->SetAnaDebug(-1);
maker->SwitchOnHistogramsMaker() ;
if(kPrintSettings) maker->Print("");
printf("======================== \n");
printf(" End Configuration of PartCorr analysis with detector %s \n",calorimeter.Data());
printf("======================== \n");
// Create task
//===========================================================================
AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation (Form("PartCorr%s",calorimeter.Data()));
task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
task->SetDebugLevel(debugLevel);
task->SetAnalysisMaker(maker);
if(inputDataType=="ESD" && !kSimulation) task->SelectCollisionCandidates(); //AliPhysicsSelection has to be attached before.
mgr->AddTask(task);
//Create containers
char name[128];
sprintf(name,"PartCorr_%s",calorimeter.Data());
cout<<"Name of task "<<name<<endl;
TString outputfile = AliAnalysisManager::GetCommonFileName();
AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(calorimeter.Data(), TList::Class(),
AliAnalysisManager::kOutputContainer,
Form("%s:PartCorr",outputfile.Data()));
AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("%sCuts",calorimeter.Data()), TList::Class(),
AliAnalysisManager::kParamContainer,
Form("%s:PartCorrCuts",outputfile.Data()));
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
// AOD output slot will be used in a different way in future
if(!inputDataType.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
mgr->ConnectOutput (task, 1, cout_pc);
mgr->ConnectOutput (task, 2, cout_cuts);
return task;
}
示例13: anaCaloFilter
void anaCaloFilter(Int_t mode=mLocal)
{
// Main
char cmd[200] ;
sprintf(cmd, ".! rm -rf AliAOD.root") ;
gROOT->ProcessLine(cmd) ;
//--------------------------------------------------------------------
// Load analysis libraries
// Look at the method below,
// change whatever you need for your analysis case
// ------------------------------------------------------------------
LoadLibraries(mode) ;
//-------------------------------------------------------------------------------------------------
//Create chain from ESD and from cross sections files, look below for options.
//-------------------------------------------------------------------------------------------------
if(kInputData == "ESD") kTreeName = "esdTree" ;
else if(kInputData == "AOD") kTreeName = "aodTree" ;
else {
cout<<"Wrong data type "<<kInputData<<endl;
break;
}
TChain *chain = new TChain(kTreeName) ;
CreateChain(mode, chain);
if(chain){
AliLog::SetGlobalLogLevel(AliLog::kError);//Minimum prints on screen
//--------------------------------------
// Make the analysis manager
//-------------------------------------
AliAnalysisManager *mgr = new AliAnalysisManager("Manager", "Manager");
// AOD output handler
AliAODHandler* aodoutHandler = new AliAODHandler();
aodoutHandler->SetOutputFileName("AliAOD.root");
////aodoutHandler->SetCreateNonStandardAOD();
mgr->SetOutputEventHandler(aodoutHandler);
//input
if(kInputData == "ESD")
{
// ESD handler
AliESDInputHandler *esdHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(esdHandler);
esdHandler->SetReadFriends(kFALSE);
cout<<"ESD handler "<<mgr->GetInputEventHandler()<<endl;
}
if(kInputData == "AOD")
{
// AOD handler
AliAODInputHandler *aodHandler = new AliAODInputHandler();
mgr->SetInputEventHandler(aodHandler);
cout<<"AOD handler "<<mgr->GetInputEventHandler()<<endl;
}
// mgr->SetDebugLevel(1);
//-------------------------------------------------------------------------
//Define task, put here any other task that you want to use.
//-------------------------------------------------------------------------
// ESD physics selection task
if(kInputData == "ESD" && kUsePhysSel)
{
gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
}
gROOT->LoadMacro("AddTaskCaloFilter.C");
AliAnalysisTaskCaloFilter* filter = AddTaskCaloFilter();
//AliAnalysisTaskCaloFilter * filter = new AliAnalysisTaskCaloFilter();
//filter->SetConfigFileName("ConfigCaloFilter.C");
//mgr->AddTask(filter);
// Create containers for input/output
AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
AliAnalysisDataContainer *coutntuple = mgr->CreateContainer("EventNtuple", TNtuple::Class(),
AliAnalysisManager::kOutputContainer, "eventselection.root");
mgr->ConnectInput (filter, 0, cinput1);
mgr->ConnectOutput (filter, 0, coutput1 );
mgr->ConnectOutput (filter, 1, coutntuple );
//-----------------------
// Run the analysis
//-----------------------
TString smode = "";
if (mode==mLocal || mode == mLocalCAF)
smode = "local";
else if (mode==mPROOF)
smode = "proof";
else if (mode==mGRID)
smode = "local";
mgr->InitAnalysis();
mgr->PrintStatus();
//.........这里部分代码省略.........
示例14: outputFile
//.........这里部分代码省略.........
cAdd += Form("_constConePhi%02dEta%02d",constConePhi,constConeEta);
}
Printf("%s %E",cAdd.Data(),kPtTrackCutCl);
AliAnalysisTaskJetHBOM* hbom = new AliAnalysisTaskJetHBOM(Form("JetHBOM%s_%s%s",bRec,jf,cAdd.Data()));
hbom->SetFilterMask(filterMask);
// hbom->SetUseGlobalSelection(kTRUE);
hbom->SetVtxCuts(kVertexWindowCl,1);//sets fVtxZCut and fVtxR2Cut
if(type == "AOD"){
// Assume all jet are produced already
hbom->SetAODTrackInput(kTRUE);
hbom->SetAODMCInput(kTRUE);
}
if(typeRec.Contains("AODMC2b")){// work down from the top AODMC2b -> AODMC2 -> AODMC -> AOD
hbom->SetTrackTypeRec(AliAnalysisTaskJetHBOM::kTrackAODMCChargedAcceptance);
hbom->SetTrackPtCut(kPtTrackCutCl);
hbom->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AODMC2")){
hbom->SetTrackTypeRec(AliAnalysisTaskJetHBOM::kTrackAODMCCharged);
hbom->SetTrackPtCut(kPtTrackCutCl);
hbom->SetTrackEtaWindow(5);
}
else if (typeRec.Contains("AODMC")){
hbom->SetTrackTypeRec(AliAnalysisTaskJetHBOM::kTrackAODMCAll);
hbom->SetTrackPtCut(kPtTrackCutCl);
hbom->SetTrackEtaWindow(5);
}
else if (typeRec.Contains("AODextraonly")) {
hbom->SetTrackTypeRec(AliAnalysisTaskJetHBOM::kTrackAODextraonly);
hbom->SetTrackPtCut(kPtTrackCutCl);
hbom->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AODextra")) {
cout << "AliAnalysisTaskJetHBOM::kTrackAODextra: " << AliAnalysisTaskJetHBOM::kTrackAODextra << endl;
hbom->SetTrackTypeRec(AliAnalysisTaskJetHBOM::kTrackAODextra);
hbom->SetTrackPtCut(kPtTrackCutCl);
hbom->SetTrackEtaWindow(kTrackEtaWindowCl);
}
else if (typeRec.Contains("AOD")) {
hbom->SetTrackTypeRec(AliAnalysisTaskJetHBOM::kTrackAOD);
hbom->SetTrackPtCut(kPtTrackCutCl);
hbom->SetTrackEtaWindow(kTrackEtaWindowCl);
}
hbom->SetRparam(radius);
hbom->SetGhostArea(0.005);
hbom->SetGhostEtamax(kTrackEtaWindowCl);
switch (jf) {
case "ANTIKT":
hbom->SetAlgorithm(2); // antikt from fastjet/JetDefinition.hh
break;
case "CA":
hbom->SetAlgorithm(1); // CA from fastjet/JetDefinition.hh
break;
case "KT":
hbom->SetAlgorithm(0); // kt from fastjet/JetDefinition.hh
break;
default:
::Error("AddTaskJetHBOM", "Wrong jet finder selected\n");
return 0;
}
//Constant Cone analysis
if(constCone){
hbom->SetRandConePos(constConeEta,constConePhi);
}
if(kWriteAOD){
if(outputFile.Length())hbom->SetJetOutputFile(outputFile);
hbom->SetJetOutputBranch(Form("hbom%s_%s%s",bRec,jf,cAdd.Data()));
hbom->SetJetOutputMinPt(0); // store only jets above a certain threshold
}
//sets number of detector hits
hbom->SetfNHBOM(fNHBOM);
//physics Selection
if(iPhysicsSelectionFlag)hbom->SelectCollisionCandidates(iPhysicsSelectionFlag);
mgr->AddTask(hbom);
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
AliAnalysisDataContainer *coutput1_Spec = mgr->CreateContainer(Form("hbom_%s_%s_%s%s",bRec,bGen,jf,cAdd.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWGJE_hbom_%s_%s_%s%s",AliAnalysisManager::GetCommonFileName(),bRec,bGen,jf,cAdd.Data()));
mgr->ConnectInput (hbom, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput (hbom, 0, mgr->GetCommonOutputContainer());
mgr->ConnectOutput (hbom, 1, coutput1_Spec );
//loads efficiencies
hbom->SetEfficiencyPt(GetEfficiencyPt(effLoc));
hbom->SetEfficiencyPhi(GetEfficiencyPhi(effLoc));
return hbom;
}
示例15: outputFile
AliAnalysisTaskJetClusterKine *AddTaskJetClusterKine(char* bGen, Char_t *jf, Float_t radius, Int_t kWriteAOD, char *deltaFile, Float_t ptTrackCut, Float_t etaTrackWindow, Float_t vertexWindow){
// Creates a jet fider task, configures it and adds it to the analysis manager.
kPtTrackCutCl = ptTrackCut;
kTrackEtaWindowCl = etaTrackWindow;
kVertexWindowCl = vertexWindow;
TString outputFile(deltaFile);
// Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if(!mgr){
::Error("AddTaskJetClusterKine", "No analysis manager to connect to.");
return NULL;
}
// Check the analysis type using the event handlers connected to the analysis manager.
//==============================================================================
if(!mgr->GetMCtruthEventHandler()){
::Error("AddTaskJetClusterKine", "This task requires an input MC event handler");
return NULL;
}
TString typeGen(bGen);
typeGen.ToUpper();
// Create the task and configure it.
//===========================================================================
TString cAdd = "";
cAdd += Form("%02d_",TMath::Nint(radius*10.));
cAdd += Form("Cut%05d",TMath::Nint(1000.*kPtTrackCutCl));
Printf("%s %s%s", typeGen.Data(), jf, cAdd.Data());
AliAnalysisTaskJetClusterKine* clus = new AliAnalysisTaskJetClusterKine(Form("JetCluster%s_%s%s",bGen,jf,cAdd.Data()));
// or a config file
clus->SetVtxCuts(kVertexWindowCl);
if(typeGen.Contains("KINECHARGED")){
clus->SetTrackTypeGen(AliAnalysisTaskJetClusterKine::kTrackKineCharged);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}else if(typeGen.Contains("KINEFULL")){
clus->SetTrackTypeGen(AliAnalysisTaskJetClusterKine::kTrackKineAll);
clus->SetTrackPtCut(kPtTrackCutCl);
clus->SetTrackEtaWindow(kTrackEtaWindowCl);
}
clus->SetRparam(radius);
clus->SetGhostArea(0.005);
clus->SetGhostEtamax(kTrackEtaWindowCl);
clus->SetDebugLevel(0);
switch (jf) {
case "ANTIKT":
clus->SetAlgorithm(2); // antikt from fastjet/JetDefinition.hh
break;
case "CA":
clus->SetAlgorithm(1); // CA from fastjet/JetDefinition.hh
break;
case "KT":
clus->SetAlgorithm(0); // kt from fastjet/JetDefinition.hh
break;
default:
::Error("AddTaskJetClusterKine", "Wrong jet finder selected\n");
return 0;
}
TString nameOutArray = Form("clusters%s_%s%s",bGen,jf,cAdd.Data()); //FF//
if(kWriteAOD){
if(outputFile.Length())clus->SetJetOutputFile(outputFile);
Printf("Output branch: %s",nameOutArray.Data());//FF//
clus->SetJetOutputBranch(nameOutArray.Data());//FF//
clus->SetJetOutputMinPt(0); // store only jets / clusters above a certain threshold
}
clus->SetJetOutputContainer(kWriteAOD); //0=no output 1=AOD 2=Exchange
mgr->AddTask(clus);
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
AliAnalysisDataContainer *coutput1_clus = mgr->CreateContainer(Form("cluster_%s_%s%s",bGen,jf,cAdd.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWGJE_cluster_%s_%s%s",AliAnalysisManager::GetCommonFileName(),bGen,jf,cAdd.Data()));
mgr->ConnectInput (clus, 0, mgr->GetCommonInputContainer());
if(kWriteAOD==1){//FF//
mgr->ConnectOutput (clus, 0, mgr->GetCommonOutputContainer());
}
mgr->ConnectOutput (clus, 1, coutput1_clus );
if(kWriteAOD==2){//FF//
//.........这里部分代码省略.........