本文整理汇总了C++中AliAnalysisManager::SetInputEventHandler方法的典型用法代码示例。如果您正苦于以下问题:C++ AliAnalysisManager::SetInputEventHandler方法的具体用法?C++ AliAnalysisManager::SetInputEventHandler怎么用?C++ AliAnalysisManager::SetInputEventHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliAnalysisManager
的用法示例。
在下文中一共展示了AliAnalysisManager::SetInputEventHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InputHandlerSetup
Bool_t InputHandlerSetup(TString format = "esd", Bool_t useRP=kFALSE, Bool_t useKine = kFALSE)
{
format.ToLower();
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
AliAnalysisDataContainer *cin = mgr->GetCommonInputContainer();
if (cin) return;
if (!format.CompareTo("esd"))
{
AliESDInputHandler *esdInputHandler = dynamic_cast<AliESDInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
if (!esdInputHandler)
{
Info("CustomAnalysisTaskInputSetup", "Creating esdInputHandler ...");
if (useRP) esdInputHandler = new AliESDInputHandlerRP();
else esdInputHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(esdInputHandler);
}
if (useKine)
{
AliMCEventHandler* mcInputHandler = dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
if (!mcInputHandler)
{
Info("CustomAnalysisTaskInputSetup", "Creating mcInputHandler ...");
AliMCEventHandler* mcInputHandler = new AliMCEventHandler();
mgr->SetMCtruthEventHandler(mcInputHandler);
}
}
}
else if (!format.CompareTo("aod"))
{
AliAODInputHandler *aodInputHandler = dynamic_cast<AliAODInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
if (!aodInputHandler)
{
Info("CustomAnalysisTaskInputSetup", "Creating aodInputHandler ...");
aodInputHandler = new AliAODInputHandler();
mgr->SetInputEventHandler(aodInputHandler);
}
}
else
{
Info("Wrong input format!!! Only ESD and AOD are supported. Skipping Task ...");
return kFALSE;
}
return kTRUE;
}
示例2: 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);
}
}
示例3: 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);
}
示例4: 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);
}
}
示例5: 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();
}
示例6: CreateInputHandlers
Bool_t CreateInputHandlers(TString input,TString inputMC,Bool_t useAODOut=kFALSE,Bool_t useMultiHandler=kTRUE) {
input.ToLower();
inputMC.ToLower();
Bool_t useMC = !inputMC.CompareTo("mc");
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) { Printf("Error [CreateInputHandlers] : mgr is null !!!"); return kFALSE; }
if (useMultiHandler) {
AliMultiInputEventHandler *inputHandler = new AliMultiInputEventHandler();
if (!input.CompareTo("esd")) {
Printf("Adding ESD Input Handler ...");
inputHandler->AddInputEventHandler(new AliESDInputHandler());
if (useMC) inputHandler->AddInputEventHandler(new AliMCEventHandler());
} else if (!input.CompareTo("aod")) {
inputHandler->AddInputEventHandler(new AliAODInputHandler());
}
mgr->SetInputEventHandler(inputHandler);
} else {
if (!input.CompareTo("esd")) {
mgr->SetInputEventHandler(new AliESDInputHandler());
if (useMC) mgr->SetMCtruthEventHandler(new AliMCEventHandler());
} else if (!input.CompareTo("aod")) {
mgr->SetInputEventHandler(new AliAODInputHandler());
}
}
if (useAODOut) {
AliAODHandler *aodHandler = new AliAODHandler();
aodHandler->SetOutputFileName("AliAOD.root");
mgr->SetOutputEventHandler(aodHandler);
}
return kTRUE;
}
示例7: AddAnalysisManagerMixRsn
void AddAnalysisManagerMixRsn(TString analysisSource = "proof", TString analysisMode = "test", TString opts = "")
{
Bool_t useMC = kFALSE;
TString format = "esd";
// ALICE stuff
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) mgr = new AliAnalysisManager("Martin Vala's AM");
gROOT->LoadMacro("SetupAnalysisPlugin.C");
AliAnalysisGrid *analysisPlugin = SetupAnalysisPlugin(analysisMode.Data());
if (!analysisPlugin) return;
gSystem->Load("libXMLParser.so");
gSystem->Load("libANALYSIS.so");
gSystem->Load("libANALYSISalice.so");
gSystem->Load("libCORRFW.so");
gSystem->Load("libEventMixing.so");
gSystem->Load("libPWG2resonances.so");
analysisPlugin->SetAliRootMode("ALIROOT"); // Loads AF libs by default
// sets additional settings to plubin
analysisPlugin->SetAdditionalLibs("libXMLParser.so libCORRFW.so libEventMixing.so libPWG2resonances.so");
// analysisPlugin->SetAdditionalLibs("libXMLParser.so libCORRFW.so libEventMixing.so PWG2resonances.par RESONANCESMV.par");
// analysisPlugin->SetAdditionalLibs("libXMLParser.so libCORRFW.so libEventMixing.so libPWG2resonances.so");
// sets plugin to manager
mgr->SetGridHandler(analysisPlugin);
Info("AddAnalysisManagerMixRsn.C", "Creating AliMultiInputEventHandler ...");
AliMultiInputEventHandler *mainInputHandler = new AliMultiInputEventHandler();
Info("AddAnalysisManagerMixRsn.C", "Creating esdInputHandler ...");
AliESDInputHandler *esdInputHandler = new AliESDInputHandler();
mainInputHandler->AddInputEventHandler(esdInputHandler);
if (useMC) {
Info("AddAnalysisManagerMixRsn.C", "Creating mcInputHandler ...");
AliMCEventHandler* mcInputHandler = new AliMCEventHandler();
mainInputHandler->AddInputEventHandler(mcInputHandler);
}
// add main input handler (with mixing handler)
mgr->SetInputEventHandler(mainInputHandler);
// add mixing handler (uncomment to turn on Mixnig)
gROOT->LoadMacro("MixingSetting.C");
mainInputHandler->AddInputEventHandler(MixingSetting());
// adds all tasks
gROOT->LoadMacro("AddAnalysisTaskAllRsn.C");
AddAnalysisTaskAllRsn(format, useMC, opts);
}
示例8: 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");
}
示例9: 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);
}
示例10: 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();
}
示例11: 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);
}
示例12: InputHandlerSetup
//________________________________________________________________
Bool_t InputHandlerSetup(TString esdFName)
{
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
AliAnalysisDataContainer *cin = mgr->GetCommonInputContainer();
if (cin) return;
AliESDInputHandler *esdInputHandler =
dynamic_cast<AliESDInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
if (!esdInputHandler) {
Info("CustomAnalysisTaskInputSetup", "Creating esdInputHandler ...");
esdInputHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(esdInputHandler);
}
esdInputHandler->SetFriendFileName(esdFName.Data());
// esdInputHandler->SetActiveBranches("ESDfriend*");
esdInputHandler->SetReadFriends(kTRUE);
return kTRUE;
}
示例13: CreateAnalysisTrain
//______________________________________________________________________________
void CreateAnalysisTrain()
{
/// create the analysis train and configure it
// analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("MuonPhysicsAnalysis");
// Debug mode
//mgr->SetDebugLevel(3);
// AOD handler
AliInputEventHandler* aodH = new AliAODInputHandler;
mgr->SetInputEventHandler(aodH);
// Fill the trigger list with desired trigger combinations (See on ALICE log book for denomination)
//==============================================================================
TList* triggers = new TList; // Create pointer for trigger list
triggers->SetOwner(kTRUE); // Give rights to trigger liser
if (!isMC)
{
// PbPb trigger
triggers->Add(new TObjString("CINT7-B-NOPF-MUFAST"));//MB &0MUL
triggers->Add(new TObjString("CINT7-B-NOPF-MUFAST&0MSL"));//MB &0MUL
triggers->Add(new TObjString("CINT7-B-NOPF-MUFAST&0MUL"));//MB &0MUL
triggers->Add(new TObjString("CMUL7-B-NOPF-MUFAST"));// MUL
triggers->Add(new TObjString("CMSL7-B-NOPF-MUFAST"));// MSL
triggers->Add(new TObjString("CMSL7-B-NOPF-MUFAST&0MUL"));// MSL &0MUL
}
// Load centrality task
//==============================================================================
gROOT->LoadMacro("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C");
AddTaskMultSelection(kFALSE); // user
// Load task
//==============================================================================
TString outputname = AliAnalysisManager::GetAnalysisManager()->GetCommonFileName(); // Create output name in case of no dataset selected
gROOT->LoadMacro("AddTaskMuMu.C");
AddTaskMuMu(outputname.Data(),triggers,"PbPb2015",isMC);
cout <<"add task mumu done"<< endl;
}
示例14: 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);
}
}
示例15: runAAF
//.........这里部分代码省略.........
// case 1: // ch fluct
// break;
// case 2: // high pt dedx
// alienHandler->SetAnalysisSource(Form("DebugClasses.C %s", alienHandler->GetAnalysisSource()));
// alienHandler->SetAdditionalLibs(Form("DebugClasses.C %s", alienHandler->GetAdditionalLibs()));
// break;
// case 3: // high pt v0s
// alienHandler->SetAnalysisSource(Form("DebugClasses.C %s", alienHandler->GetAnalysisSource()));
// alienHandler->SetAdditionalLibs(Form("DebugClasses.C %s", alienHandler->GetAdditionalLibs()));
// break;
// default:
// 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();