本文整理汇总了C++中AliAnalysisManager::PrintStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ AliAnalysisManager::PrintStatus方法的具体用法?C++ AliAnalysisManager::PrintStatus怎么用?C++ AliAnalysisManager::PrintStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliAnalysisManager
的用法示例。
在下文中一共展示了AliAnalysisManager::PrintStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runAlien
//___________________________________________________________
void runAlien(TString data, TString mode = "test", Bool_t MC = kFALSE){
if(!gSystem->Getenv("ALICE_ROOT")){
printf("AliRoot has to be initialized\n");
return;
}
// check for valid modes
const int kModes = 5;
TString allowed_modes[kModes] = {"proof", "prooftest", "test", "full", "submit"};
Bool_t isValid = kFALSE;
mode.ToLower();
for(int imode = 0; imode < kModes; imode++){
if(!mode.CompareTo(allowed_modes[imode])) isValid = kTRUE;
}
if(!isValid){
printf("invalid analysis mode selected\n");
return;
}
analysis_mode = mode;
Bool_t proofmode = mode.Contains("proof");
// libraries to be loaded
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->Load("libCORRFW");
gSystem->Load("libPWGhfe");
// Create Analysis Manager
AliAnalysisManager *runAnalysis = new AliAnalysisManager("Heavy Flavour Electron Analysis");
runAnalysis->SetCommonFileName(output_file.Data());
runAnalysis->SetInputEventHandler(new AliESDInputHandler);
if(MC) runAnalysis->SetMCtruthEventHandler(new AliMCEventHandler);
AliAnalysisAlien *alienhandler = CreateAlienHandler(proofmode);
printf("alienhandler %p\n", alienhandler);
runAnalysis->SetGridHandler(alienhandler);
//return;
// Specify input (runs or dataset)
if(!proofmode){
// Query sample ID and runs
TString sample;
TArrayI listofruns;
DecodeDataString(data, sample, listofruns);
AddInput(alienhandler, sample, listofruns, MC);
} else {
alienhandler->SetProofDataSet(data);
}
// Add Tasks
gROOT->LoadMacro(Form("%s/OADB/macros/AddTaskPhysicsSelection.C", gSystem->Getenv("ALICE_ROOT")));
gROOT->LoadMacro(Form("%s/PWG3/hfe/macros/AddTaskHFE.C", gSystem->Getenv("ALICE_ROOT")));
AddTaskPhysicsSelection(MC);
AddTaskHFE(); // @TODO: MC and PbPb flag to be fixed
// Run Analysis
TString anamode = proofmode ? "proof" : "grid";
if(runAnalysis->InitAnalysis()){
runAnalysis->PrintStatus();
runAnalysis->StartAnalysis(anamode);
}
}
示例2: runProofFwdDetsQA
void runProofFwdDetsQA(const char * dataset = "/COMMON/COMMON/LHC09a4_run8101X",Long64_t nentries=100000, Long64_t firstentry=0)
{
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->AddIncludePath("-I$ALICE_ROOT/include");
// Connect to Proof
gEnv->SetValue("XSec.GSI.DelegProxy","2");
TProof::Open("cheshkov:[email protected]");
// Upload and enable packages: please use the correct version!
gProof->UploadPackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
gProof->EnablePackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
// Create the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("AliAnaFwdDetsQA");
AliVEventHandler* esdH = new AliESDInputHandler();
mgr->SetInputEventHandler(esdH);
// Enable MC event handler
AliVEventHandler* handler = new AliMCEventHandler;
mgr->SetMCtruthEventHandler(handler);
// Create task
gProof->Load(Form("%s/PWGPP/AliAnaFwdDetsQA.cxx++g",
gSystem->Getenv("ALICE_ROOT")));
AliAnalysisTask *task = new AliAnaFwdDetsQA("AliAnaFwdDetsQA");
// Add task
mgr->AddTask(task);
// Create containers for input/output
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput =
mgr->CreateContainer("coutput", TList::Class(),
AliAnalysisManager::kOutputContainer, "FwdDetsQA.root");
// Connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
// Enable debug printouts
mgr->SetDebugLevel(3);
if (!mgr->InitAnalysis())
return;
mgr->PrintStatus();
TFileCollection *proofColl = gProof->GetDataSet(dataset);
TChain *chain = new TChain("esdTree");
chain->AddFileInfoList((TCollection*)(proofColl->GetList()));
mgr->StartAnalysis("proof", chain, nentries, firstentry);
// mgr->StartAnalysis("proof",dataset,nentries,firstentry);
}
示例3: 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);
}
}
示例4: runTOFCalibTaskOnProof
void runTOFCalibTaskOnProof() {
TStopwatch timer;
timer.Start();
printf("*** Open PROOF ***");
gEnv->SetValue("XSec.GSI.DelegProxy","2");
TProof::Open("alicecaf");
gProof->UploadPackage("STEERBase.par");
gProof->EnablePackage("STEERBase");
gProof->UploadPackage("ESD.par");
gProof->EnablePackage("ESD");
gProof->UploadPackage("AOD.par");
gProof->EnablePackage("AOD");
gProof->UploadPackage("ANALYSIS.par");
gProof->EnablePackage("ANALYSIS");
gProof->UploadPackage("ANALYSISalice.par");
gProof->EnablePackage("ANALYSISalice");
gProof->Load("AliTOFArray.cxx++g");
gProof->Load("AliTOFCalibTask.cxx++g");
gROOT->LoadMacro("AddTaskTOFCalib.C");
cout << "Loaded AddTaskTOFCalib macro "<< endl;
gProof->ShowEnabledPackages();
//ANALYSIS PART
//____________________________________________//
// Make the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
AliESDInputHandler* esdH = new AliESDInputHandler;
esdH->SetInactiveBranches("FMD CaloCluster");
mgr->SetInputEventHandler(esdH);
Bool_t domc = kFALSE;
if (domc) {
AliMCEventHandler *mcH = new AliMCEventHandler;
mgr->SetMCtruthEventHandler(mcH);
}
//____________________________________________//
// 1st TOFCalib task
AliTOFCalibTask *taskTOFCalib = AddTaskTOFCalib();
if (!mgr->InitAnalysis()) return;
mgr->PrintStatus();
mgr->StartAnalysis("proof","/COMMON/COMMON/LHC08c11_10TeV_0.5T",1000);
timer.Stop();
timer.Print();
}
示例5: rundStarTask
void rundStarTask(const char* mode = "test", bool isMC=true){
// Include AliPhysics and AliRoot libraries
gSystem->AddIncludePath("-I$ALICE_ROOT/include -I$ALICE_PHYSICS/include");
//Check the run mode
if(std::strcmp(mode,"local")!=0 && std::strcmp(mode,"grid")!=0 && std::strcmp(mode,"test")!=0){
Printf("\n\tIncorrect run option, check first argument of run macro");
Printf("\tmode = local, test or grid\n");
return;
}
Printf("%s analysis chosen",mode);
//Define the plugin
AliAnalysisGrid *plugin = 0x0;
TChain *chain = 0x0;
if(std::strcmp(mode,"local")!=0) {
plugin = CreateAlienHandler(mode,isMC);
if(!plugin) return;
}
else {
gROOT->LoadMacro("$ALICE_PHYSICS/PWG/EMCAL/macros/CreateAODChain.C");
chain = CreateAODChain("localdata.txt");
}
// Create the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager(kTaskName);
if(plugin) mgr->SetGridHandler(plugin);
// Define input handlers
if(isMC){
AliMCEventHandler* mcHandler = new AliMCEventHandler();
if (plugin) mgr->SetMCtruthEventHandler(mcHandler);
}
AliAODInputHandler *aodH = new AliAODInputHandler();
mgr->SetInputEventHandler(aodH);
// Compile the class
gROOT->LoadMacro("AliAnalysisTaskdStar.cxx++g");
// PID response
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
AliAnalysisTaskPIDResponse *pidTask = AddTaskPIDResponse(isMC); // useMC
// dStar task
gROOT->LoadMacro("AddTaskdStar.C");
AliAnalysisTaskdStar *task = AddTaskdStar(isMC);
// Disbale debug printouts
mgr->SetDebugLevel(3);
AliLog::SetGlobalLogLevel(AliLog::kFatal);
AliLog::SetGlobalDebugLevel(0);
if (!mgr->InitAnalysis()) return;
mgr->PrintStatus();
// Start analysis in grid.
if (std::strcmp(mode,"local")==0)
mgr->StartAnalysis(mode,chain);
else
mgr->StartAnalysis("grid");
}
示例6: runProofT0analysis
void runProofT0analysis(const char * dataset = "/COMMON/COMMON/LHC09a4_10TeV_200k#esdTree",Long64_t nentries=20000, Long64_t firstentry=0)
{
// Connect to Proof
TProof::Open("proof://[email protected]");
//TProof::Open("lxb6046");
// Upload and enable packages: please use the correct version!
gProof->UploadPackage("AF-v4-16");
gProof->EnablePackage("AF-v4-16");
gProof->ShowDataSets();
// Create the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("AliT0MultiplicityTask");
AliVEventHandler* esdH = new AliESDInputHandler();
mgr->SetInputEventHandler(esdH);
// Enable MC event handler
AliVEventHandler* handler = new AliMCEventHandler;
mgr->SetMCtruthEventHandler(handler);
// Create task
// gProof->Load("AliMCComparisonTrack.cxx++g");
gProof->Load("AliT0MultiplicityTask.cxx++g");
AliAnalysisTask *task = new AliT0MultiplicityTask("AliT0MultiplicityTask");
// Add task
mgr->AddTask(task);
// Create containers for input/output
AliAnalysisDataContainer *cinput =
mgr->CreateContainer("cchain", TChain::Class(), AliAnalysisManager::kInputContainer);
AliAnalysisDataContainer *coutput =
mgr->CreateContainer("coutput", TList::Class(),
AliAnalysisManager::kOutputContainer, "MultHist.root");
// Connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
// Enable debug printouts
mgr->SetDebugLevel(3);
if (!mgr->InitAnalysis())
return;
mgr->PrintStatus();
mgr->StartAnalysis("proof",dataset,nentries,firstentry);
}
示例7: QAmerge
void QAmerge(const char *dir, Int_t stage)
{
// Merging method
TStopwatch timer;
timer.Start();
TString outputDir = dir;
TString outputFiles = "QAresults.root,EventStat_temp.root";
TString mergeExcludes = "";
TObjArray *list = outputFiles.Tokenize(",");
TIter *iter = new TIter(list);
TObjString *str;
TString outputFile;
Bool_t merged = kTRUE;
while((str=(TObjString*)iter->Next())) {
outputFile = str->GetString();
// Skip already merged outputs
if (!gSystem->AccessPathName(outputFile)) {
printf("Output file <%s> found. Not merging again.",outputFile.Data());
continue;
}
if (mergeExcludes.Contains(outputFile.Data())) continue;
merged = AliAnalysisAlien::MergeOutput(outputFile, outputDir, 10, stage);
if (!merged) {
printf("ERROR: Cannot merge %s\n", outputFile.Data());
continue;
}
}
TString infolog = "fileinfo.log";
AliAnalysisAlien::MergeInfo(infolog, dir);
// read the analysis manager from file
if (!outputDir.Contains("Stage")) {
ofstream out;
out.open("outputs_valid", ios::out);
out.close();
return;
}
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
mgr->SetRunFromPath(mgr->GetRunFromAlienPath(dir));
mgr->SetSkipTerminate(kFALSE);
if (!mgr->InitAnalysis()) return;
mgr->PrintStatus();
AliLog::SetGlobalLogLevel(AliLog::kError);
TTree *tree = NULL;
gROOT->cd();
mgr->StartAnalysis("gridterminate", tree);
ofstream out;
out.open("outputs_valid", ios::out);
out.close();
timer.Print();
}
示例8: runProofTRDComparison
void runProofTRDComparison(const char *dataset="/PWG0/COMMON/run30000X_10TeV_0.5T",Long64_t nentries=1000, Long64_t firstentry=0)
{
// Connect to Proof
TProof::Open("lxb6046");
// Upload and enable packages: please use the correct version!
gProof->UploadPackage("AF-v4-14");
gProof->EnablePackage("AF-v4-14");
// Create the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("AliTRDComparison");
AliVEventHandler* esdH = new AliESDInputHandler();
mgr->SetInputEventHandler(esdH);
// Enable MC event handler
AliVEventHandler* handler = new AliMCEventHandler;
mgr->SetMCtruthEventHandler(handler);
// Create task
gProof->Load("AliMCComparisonTrack.cxx++g");
gProof->Load("AliTRDComparisonTask.cxx++g");
AliAnalysisTask *task = new AliTRDComparisonTask("AliTRDComparisonTask");
// Add task
mgr->AddTask(task);
// Create containers for input/output
AliAnalysisDataContainer* cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer* coutput =
mgr->CreateContainer("coutput", TList::Class(),
AliAnalysisManager::kOutputContainer, "AliTRDComparisonHist.root");
// Connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
// Enable debug printouts
mgr->SetDebugLevel(3);
if (!mgr->InitAnalysis())
return;
mgr->PrintStatus();
mgr->StartAnalysis("proof",dataset,nentries,firstentry);
}
示例9: runAliTask
void runAliTask() {
TStopwatch timer;
timer.Start();
// gSystem->Load("libTree.so");
// gSystem->Load("libGeom.so");
// gSystem->Load("libVMC.so");
// gSystem->Load("libPhysics.so");
// //____________________________________________________//
// //_____________Setting up required packages___________//
// //____________________________________________________//
// gSystem->Load("libSTEERBase.so");
// gSystem->Load("libESD.so");
// gSystem->Load("libAOD.so");
// gSystem->Load("libANALYSIS.so");
// gSystem->Load("libANALYSISalice.so");
// gROOT->ProcessLine(".include $ALICE_ROOT/include");
//
// //___________Compile analysis task using AClic____________//
// gROOT->LoadMacro("../task/AliAnalysisTaskPt.cxx+g");
//
//
// gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
TChain* chain = CreateESDChain("files.txt", 2);
//____________________________________________//
// Make the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
AliESDInputHandler* esdH = new AliESDInputHandler();
mgr->SetInputEventHandler(esdH);
//____________________________________________//
// 1st Pt task
AliAnalysisTaskPt *task1 = new AliAnalysisTaskPt("TaskPt");
mgr->AddTask(task1);
// Create containers for input/output
AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),AliAnalysisManager::kOutputContainer,"Pt.ESD.root");
//____________________________________________//
mgr->ConnectInput(task1,0,cinput1);
mgr->ConnectOutput(task1,0,coutput1);
if (!mgr->InitAnalysis()) return;
mgr->PrintStatus();
//mgr->StartAnalysis("local",chain);
timer.Stop();
timer.Print();
}
示例10: RunAnalysisManager
Bool_t RunAnalysisManager(TString anSrc = "proof", TString anMode = "test", Long64_t nEvents = 1e10, Long64_t nSkip = 0) {
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) { Printf("Error [RunAnalysisManager] : mgr is null !!!"); return kFALSE; }
// Run analysis
mgr->InitAnalysis();
mgr->PrintStatus();
if ((!anSrc.CompareTo("proof")) || (!anSrc.CompareTo("local"))) {
mgr->StartAnalysis(anSrc.Data(), nEvents, nSkip);
} else {
mgr->StartAnalysis(anSrc.Data());
}
return kTRUE;
}
示例11: PrintManager
void PrintManager(TObject *mgrObj) {
AliAnalysisManager *mgr = (AliAnalysisManager *)mgrObj;
if (!mgr->InitAnalysis()) return;
mgr->RunLocalInit();
mgr->PrintStatus();
Printf("Analysis Manager : %s '%s'",mgr->GetName(),mgr->GetTitle() );
TObjArray *a = mgr->GetTasks();
if (a) Printf("Tasks total : %d",a->GetEntries());
TIter next(mgr->GetTasks());
AliAnalysisTask *task;
while ((task = (AliAnalysisTask *) next())) {
if (task->IsA() == AliRsnMiniAnalysisTask::Class()) {
Printf(" Task [RSN-MINI] : %s '%s'",task->GetName(),task->GetTitle());
AliRsnMiniAnalysisTask *rsnMiniTask = (AliRsnMiniAnalysisTask *)task;
rsnMiniTask->Print();
} else if (task->IsA() == AliRsnAnalysisTask::Class()) {
Printf(" Task [RSN-----] : %s '%s'",task->GetName(),task->GetTitle());
AliRsnAnalysisTask *rsnTask = (AliRsnAnalysisTask *)task;
rsnTask->Print();
AliVEventHandler *ih = mgr->GetInputEventHandler();
if (ih == AliMultiInputEventHandler::Class()) {
AliMultiInputEventHandler *ihMulti = (AliMultiInputEventHandler *) ih;
TIter nextIH(ihMulti->InputEventHandlers());
AliRsnInputHandler *rsnIH = 0;
while ((ih = (AliVEventHandler *) nextIH())) {
if (ih->IsA() == AliRsnInputHandler::Class()) {
rsnIH = ih;
AliRsnDaughterSelector *ds = rsnIH->GetSelector();
ds->Print();
}
}
}
} else {
Printf(" Task [--------] : %s '%s'",task->GetName(),task->GetTitle());
}
}
}
示例12: runGridpPb
void runGridpPb(const char *config = "config.txt"){
//
// run analysis
//
TGrid::Connect("alien://");
// Create Lookup with sample information
TMap sampleinfos;
Generate_Sample_Lookup(sampleinfos);
ConfigParser(config);
// Configure alien plugin
AliAnalysisAlien *plugin = CreateGridHandler();
if(!CreateTrainDir(plugin, sampleinfos)){
printf("Cannot setup output directory\n");
return;
}
if(!MakeSample(plugin, sampleinfos)){
printf("Cannot create data sample\n");
return;
}
if(!g_plugin_mode.CompareTo("full")){
// full mode, creating config files for the merging stage
GenerateMergeConfigs();
}
AliAnalysisManager *mgr = new AliAnalysisManager("tpctofanalysis");
mgr->SetGridHandler(plugin);
SetupTrain(sampleinfos);
// Run train
if (!mgr->InitAnalysis()) return;
mgr->PrintStatus();
// Start analysis in grid.
mgr->StartAnalysis("grid");
}
示例13: TaskBuzzer
void TaskBuzzer(UInt_t config, const char *collection="wn.xml")
{
printf("Running buzzer with: %s\n", ConfigName(config));
TGrid::Connect("alien://");
if (!gGrid || !gGrid->IsConnected()) {
::Error("PilotAnalysis", "No grid connection");
return;
}
TChain *chain = CreateChain(collection, "ESD");
// Load libraries
gSystem->SetIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD");
LoadLibraries();
// Create manager
AliAnalysisManager *mgr = new AliAnalysisManager("ESDfiltering", "Production train");
mgr->SetNSysInfo(100);
// Input handler
AliESDInputHandlerRP *esdHandler = new AliESDInputHandlerRP();
// AliESDInputHandler *esdHandler = new AliESDInputHandler();
esdHandler->SetReadFriends(kTRUE);
esdHandler->SetActiveBranches("ESDfriend");
mgr->SetInputEventHandler(esdHandler);
if (config & kAOD) {
// AOD output handler
AliAODHandler* aodHandler = new AliAODHandler();
aodHandler->SetOutputFileName("AliAOD.root");
if (!mergeExcludes.IsNull()) mergeExcludes += " ";
mergeExcludes += "AliAOD.root";
mgr->SetOutputEventHandler(aodHandler);
}
// AnalysisTasks
AddAnalysisTasks(config);
mgr->SetDebugLevel(1);
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
mgr->StartAnalysis("local", chain);
}
}
示例14: AnalysisTrainLocalEmcalFjetSparseMaker
void AnalysisTrainLocalEmcalFjetSparseMaker()
{
const TString sDataset = "/DATA04/xzhang/alice/lists/LHC11hPass2AOD145.txt";
//=============================================================================
if (LoadLibraries()) {
::Error("AnalysisTrainLocalEmcalFjetSparseMaker.C::AnalysisTrainLocalEmcalFjetSparseMaker","Load libraries failed!");
return;
}
TChain *chain = CreateChain(sDataset);
if (!chain) {
::Error("AnalysisTrainLocalEmcalFjetSparseMaker.C::AnalysisTrainLocalEmcalFjetSparseMaker", "Creating input chain failed!");
return;
}
//=============================================================================
AliAnalysisManager *mgr = new AliAnalysisManager("AnalysisTrainLocalEmcalFjetSparseMaker", "Analysis Train Local EMCal Bkg SM");
//mgr->SetDebugLevel(3);
gROOT->LoadMacro("AddTasksEmcalFjetSparseMaker.C"); if (AddTasksEmcalFjetSparseMaker()) return;
if (mgr->InitAnalysis()) { mgr->PrintStatus(); mgr->StartAnalysis("local",chain); }
return;
}
示例15: runAAF
//.........这里部分代码省略.........
// printf("Unknown task\n");
// return;
// }
// Connect plugin to the analysis manager
mgr->SetGridHandler(alienHandler);
break;
case 0: // LOCAL
// Process data - chain
AliXRDPROOFtoolkit tool;
TChain* chain = tool.MakeChain(textFileName,treeName, 0, 100);
chain->Lookup();
break;
default:
printf("Unknown mode");
return;
}
// ESD input handler
if(esdAna) {
AliESDInputHandler *esdHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(esdHandler);
} else {
AliAODInputHandler* aodHandler = new AliAODInputHandler();
mgr->SetInputEventHandler(aodHandler);
}
// Monte Carlo handler
if (analysisMC) {
AliMCEventHandler* mcHandler = new AliMCEventHandler();
if(esdAna)
mgr->SetMCtruthEventHandler(mcHandler);
mcHandler->SetReadTR(readTR);
}
// Debug if needed
if (debug)
mgr->SetDebugLevel(3);
// ######### Centrality task ###############
cout<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<<endl;
cout<<"esdAna="<<esdAna<<" runtype="<<runtype<<endl;
// ######### PHYSICS SELECTION ###############
if (esdAna) { // PC: 17/8-15: this does not work for AODs.....
cout << "Adding task physics selection" << endl;
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
if (analysisMC) {
AliPhysicsSelection* physSel = physSelTask->GetPhysicsSelection();
physSel->SetAnalyzeMC();
}
}
if(esdAna && runtype==2) { // only for ESD and PbPb
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
//taskCentrality->SetPass(2);
if (analysisMC)
taskCentrality->SetMCInput();
}
// ######### PID task ###############
if(task == 2) {
cout << "Loading macro in AliRoot!" << endl;
gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/SPECTRA/IdentifiedHighPt/train/macros/AddTask.C");
cout << "Adding task!" << endl;
AliAnalysisTask* taskPid = AddTask(analysisMC, taskname, runtype, kTriggerInt, minCent, maxCent);
} else {
cout << "Adding AliAnaTaskV0EffDecomposition" << endl;
gROOT->LoadMacro("AddTask.C");
AliAnalysisTask* taskPid = AddTask(taskname);
}
// Run the analysis
if (mgr->InitAnalysis()){
mgr->PrintStatus();
switch(mode){
case 1: // PROOF
mgr->StartAnalysis("proof",chain);
break;
case 2: // GRID
mgr->StartAnalysis("grid");
break;
case 0:
mgr->StartAnalysis("local",chain);
break;
default:
printf("Unknown mode\n");
return;
}
}
}