Example #1
0
void MSFT_AddQCmethod(char *name, TString myFolder, char *thecuts, int harmonic, 
		      AliAnalysisDataContainer *flowEvent, 
		      AliFlowTrackSimpleCuts *cutsPOI=NULL) {
  TString fileName = AliAnalysisManager::GetCommonFileName();
  myFolder.Append( Form("v%d",harmonic) );
  TString myName = Form("%sv%d_%s", name, harmonic, thecuts);
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  AliAnalysisDataContainer *flowEvent2 
    = mgr->CreateContainer( Form("Filter_%s", myName.Data()),
			    AliFlowEventSimple::Class(),
			    AliAnalysisManager::kExchangeContainer );
  AliAnalysisTaskFilterFE *tskFilter 
    = new AliAnalysisTaskFilterFE( Form("TaskFilter_%s",myName.Data()),
				   NULL, cutsPOI);
  mgr->AddTask(tskFilter);
  mgr->ConnectInput( tskFilter, 0, flowEvent);
  mgr->ConnectOutput(tskFilter, 1, flowEvent2);

  AliAnalysisDataContainer *outQC 
    = mgr->CreateContainer( myName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer,
			    Form("%s:FlowCascade_QC_%s", fileName.Data(), myFolder.Data()) );
  AliAnalysisTaskQCumulants *tskQC 
    = new AliAnalysisTaskQCumulants( Form("TaskQCumulants_%s",myName.Data()),kFALSE );
  tskQC->SetApplyCorrectionForNUA(kTRUE);
  tskQC->SetHarmonic(harmonic);
  tskQC->SetBookOnlyBasicCCH(kTRUE);
  mgr->AddTask(tskQC);
  mgr->ConnectInput( tskQC, 0, flowEvent2);
  mgr->ConnectOutput(tskQC, 1, outQC);
}
Example #2
0
void MSFT_AddSPmethod(char *name, TString myFolder, char *thecuts, int harmonic,
		      AliAnalysisDataContainer *flowEvent, AliFlowTrackSimpleCuts *cutsPOI=NULL,
		      char *Qvector) {
  TString fileName = AliAnalysisManager::GetCommonFileName();
  myFolder.Append( Form("v%d",harmonic) );
  TString myNameSP = Form("%sv%d%s_%s", name, harmonic, Qvector, thecuts);
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  AliAnalysisDataContainer *flowEvent2 
    = mgr->CreateContainer( Form("Filter_%s", myNameSP.Data()),
			    AliFlowEventSimple::Class(),
			    AliAnalysisManager::kExchangeContainer );
  AliAnalysisTaskFilterFE *tskFilter 
    = new AliAnalysisTaskFilterFE( Form("TaskFilter_%s",myNameSP.Data()),
				   NULL, cutsPOI);
  tskFilter->SetSubeventEtaRange( -5.0, -1.0, 1.0, +5.0 );
  mgr->AddTask(tskFilter);
  mgr->ConnectInput( tskFilter, 0, flowEvent);
  mgr->ConnectOutput(tskFilter, 1, flowEvent2);
  AliAnalysisDataContainer *outSP 
    = mgr->CreateContainer( myNameSP.Data(),TList::Class(),AliAnalysisManager::kOutputContainer,
			    Form("%s:FlowCascade_SP_%s",fileName.Data(),myFolder.Data()) );
  AliAnalysisTaskScalarProduct *tskSP 
    = new AliAnalysisTaskScalarProduct( Form("TaskScalarProduct_%s",myNameSP.Data()),kFALSE);
  tskSP->SetApplyCorrectionForNUA(kTRUE);
  tskSP->SetHarmonic(harmonic);
  tskSP->SetTotalQvector(Qvector);
  tskSP->SetBookOnlyBasicCCH(kTRUE);
  mgr->AddTask(tskSP);
  mgr->ConnectInput( tskSP,0,flowEvent2);
  mgr->ConnectOutput(tskSP,1,outSP);
}
Example #3
0
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;
}   
AliAnalysisTaskStrangenessVsMultiplicityMC *AddTaskStrangenessVsMultiplicityMC( Bool_t lSaveV0 = kFALSE, Bool_t lSaveCascade = kTRUE, const TString lMasterJobSessionFlag = "")
{
// Creates, configures and attaches to the train a cascades check task.
   // Get the pointer to the existing analysis manager via the static access method.
   //==============================================================================
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
      ::Error("AddTaskStrangenessVsMultiplicity", "No analysis manager to connect to.");
      return NULL;
   }   

   // Check the analysis type using the event handlers connected to the analysis manager.
   //==============================================================================
   if (!mgr->GetInputEventHandler()) {
      ::Error("AddTaskStrangenessVsMultiplicity", "This task requires an input event handler");
      return NULL;
   }   
   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"

  // Create and configure the task
  AliAnalysisTaskStrangenessVsMultiplicityMC *taskAuxiliary = new AliAnalysisTaskStrangenessVsMultiplicityMC("taskAuxiliary");
  mgr->AddTask(taskAuxiliary);
  TString outputFileName = AliAnalysisManager::GetCommonFileName();
   
  outputFileName += ":PWGLF_StrVsMult";
  if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
   
  Printf("Set OutputFileName : \n %s\n", outputFileName.Data() );

  AliAnalysisDataContainer *coutputList = mgr->CreateContainer("cList",
							     TList::Class(),
							     AliAnalysisManager::kOutputContainer,
							     outputFileName );
  AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cTreeEvent",
  					       TTree::Class(),
						       AliAnalysisManager::kOutputContainer,
						       outputFileName );
  AliAnalysisDataContainer *coutputTreeV0 = mgr->CreateContainer("cTreeV0",
  					       TTree::Class(),
						       AliAnalysisManager::kOutputContainer,
						       outputFileName );
  AliAnalysisDataContainer *coutputTreeCascade = mgr->CreateContainer("cTreeCascade",
  					       TTree::Class(),
						       AliAnalysisManager::kOutputContainer,
						       outputFileName );
   
  //This one you should merge in file-resident ways...
  coutputTree->SetSpecialOutput();
  coutputTreeV0->SetSpecialOutput();
  coutputTreeCascade->SetSpecialOutput();

  //Recommendation: Tree as a single output slot
  mgr->ConnectInput (taskAuxiliary, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput(taskAuxiliary, 1, coutputList);
  mgr->ConnectOutput(taskAuxiliary, 2, coutputTree);
  mgr->ConnectOutput(taskAuxiliary, 3, coutputTreeV0);
  mgr->ConnectOutput(taskAuxiliary, 4, coutputTreeCascade);
  
  return taskAuxiliary;
}   
void AddClusterSelectionTask(TString name = "ClusterSelectionTask")
{
    gSystem->AddIncludePath("-I$ALICE_ROOT/include");

    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
    if (!mgr) {
        ::Error("AddTaskPHOSPi0Flow", "No analysis manager to connect to");
        return NULL;
    }

    if (!mgr->GetInputEventHandler()) {
        ::Error("AddTaskPHOSPi0Flow", "This task requires an input event handler");
        return NULL;
    }

    gROOT->LoadMacro("ClusterSelectionTask.cxx+g");
    ClusterSelectionTask * task = new ClusterSelectionTask(name);

    mgr->AddTask(task);
    mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );

    TString cname(Form("HistList", name));
    TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name));
    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
    mgr->ConnectOutput(task, 1, coutput1);

    cname = Form("SelectedPhotons", name);
    AliAnalysisDataContainer *cexchange2 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kExchangeContainer, pname.Data());
    mgr->ConnectOutput(task, 2, cexchange2);

    return task;
}
AliAnalysisTaskSEF01710fromAODtracks *AddTaskF01710fromAODtracks(
    Int_t antype = 0,
    Bool_t theMCon=kFALSE,
    Bool_t writeVariableTree=kFALSE,
    Int_t nTour=0
    )

{

  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskLc2V0YW", "No analysis manager to connect to.");
    return NULL;
  }  

  //CREATE THE TASK
  printf("CREATE TASK\n");
  AliAnalysisTaskSEF01710fromAODtracks *task = new AliAnalysisTaskSEF01710fromAODtracks("AliAnalysisTaskSEF01710fromAODtracks",writeVariableTree);
  task->SetMC(theMCon);
  task->SetDebugLevel(1);
  task->SetAnalysisType(antype);

  if(antype==2 || antype == 3){
    task->SetProdV0DaughterDcaToPrimVertex(0.1);
    task->SetProdRfidMinV0(5.);
  }

  task->SetEventMixingWithPools();
  //task->SetEventMixingOff();

  Double_t pvzbinlimits[] = {-12,-10,-8,-6,-4,-2,0,2,4,6,8,10,12};
  Int_t pvzbinnumb = sizeof(pvzbinlimits)/sizeof(Double_t) - 1;
  task->SetPoolPVzBinLimits(pvzbinnumb,pvzbinlimits);

  Double_t cent_mult_binlimitspp[] = { 0,100};
  Int_t cent_mult_bin_numbpp = sizeof(cent_mult_binlimitspp)/sizeof(Double_t) - 1;
  task->SetPoolCentBinLimits(cent_mult_bin_numbpp,cent_mult_binlimitspp);
  task->SetNumberOfEventsForMixing(10);//pp

  mgr->AddTask(task);

  // Create and connect containers for input/output  
  TString outputfile = AliAnalysisManager::GetCommonFileName();
  outputfile += ":PWGLF_RES_F01710_";
  outputfile += nTour;

  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());

  // ----- output data -----
  AliAnalysisDataContainer *coutput1   = mgr->CreateContainer(Form("f0hist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
  mgr->ConnectOutput(task,1,coutput1);
  AliAnalysisDataContainer *coutputL2 = mgr->CreateContainer(Form("F0variables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); 
  mgr->ConnectOutput(task,2,coutputL2);
  AliAnalysisDataContainer *coutputL3 = mgr->CreateContainer(Form("F0All%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
  mgr->ConnectOutput(task,3,coutputL3);

  return task;

}
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);
	}
}
Example #8
0
AliMultSelectionTask *AddTaskMultSelection( Bool_t lCalibration = kFALSE, TString lExtraOptions = "", Int_t lNDebugEstimators = 1, const TString lMasterJobSessionFlag = "")
{
    // Creates, configures and attaches to the train a Multiplicity Selection Task
    // Get the pointer to the existing analysis manager via the static access method.
    //==============================================================================
    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
    if (!mgr) {
        ::Error("AddTaskMultSelection", "No analysis manager to connect to.");
        return NULL;
    }
    
    // Check the analysis type using the event handlers connected to the analysis manager.
    //==============================================================================
    if (!mgr->GetInputEventHandler()) {
        ::Error("AddTaskMultSelection", "This task requires an input event handler");
        return NULL;
    }
    TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
    
    // Create and configure the task
    
    //Special options interpreting: will be taken care of by the task
    // A - Add Extra AliCentrality V0M branch for cross-checks
    // A - Add Extra AliPPVsMultUtils V0M branch for cross-checks    
    
    AliMultSelectionTask *taskMultSelection = new AliMultSelectionTask("taskMultSelection", lExtraOptions.Data(), lCalibration, lNDebugEstimators);
    mgr->AddTask(taskMultSelection);
    TString outputFileName = AliAnalysisManager::GetCommonFileName();
    
    outputFileName += ":MultSelection";
    if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
    
    Printf("Set OutputFileName : \n %s\n", outputFileName.Data() );
    
    AliAnalysisDataContainer *coutputList = mgr->CreateContainer("cListMultSelection",
                                                                 TList::Class(),
                                                                 AliAnalysisManager::kOutputContainer,
                                                                 outputFileName );
    
    //Recommendation: Tree as a single output slot
    mgr->ConnectInput (taskMultSelection, 0, mgr->GetCommonInputContainer());
    mgr->ConnectOutput(taskMultSelection, 1, coutputList);
    
    if ( lCalibration ) {
      AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cCalibrationTree",
                                                                   TTree::Class(),
                                                                   AliAnalysisManager::kOutputContainer,
                                                                   outputFileName );
      //This one you should merge in file-resident ways...
      coutputTree->SetSpecialOutput();
      mgr->ConnectOutput(taskMultSelection, 2, coutputTree);
    }
    
    return taskMultSelection;
}   
Example #9
0
AliAnalysisTaskUpcEtaC *AddTaskUpcEtaC(Bool_t runTree = kTRUE,Bool_t runHist = kTRUE,Bool_t runSyst = kFALSE,Int_t tracking = 0){

  
  //--- get the current analysis manager ---//
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
      Error("AddTask_UpcEtaC", "No analysis manager found.");
      return 0;
   }
  
  // Check the analysis type using the event handlers connected to the analysis manager.
  //==============================================================================
  if (!mgr->GetInputEventHandler()) {
    Error("AddTask_UpcEtaC", "This task requires an input event handler");
    return 0;
  }
        
  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
  Bool_t isMC;
  if(mgr->GetMCtruthEventHandler()) isMC = kTRUE;
  
  // Create tasks
  AliAnalysisTaskUpcEtaC *task = new AliAnalysisTaskUpcEtaC(inputDataType.Data());
  task->SetRunTree(runTree);
  task->SetRunHist(runHist);
  task->SetIsMC(isMC);
  task->SetRunSyst(runSyst);
  task->SetTracking(tracking);
  mgr->AddTask(task);


  // Create containers for input/output
  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
  AliAnalysisDataContainer *coutput = mgr->CreateContainer("EtaCK0sChannelTree", TTree::Class(), AliAnalysisManager::kOutputContainer,Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));
  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("EtaCTree", TTree::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));
  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ListTrig", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));
  AliAnalysisDataContainer *coutput4 = mgr->CreateContainer("ListHist", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));  
  AliAnalysisDataContainer *coutput5 = mgr->CreateContainer("ListHistKstar", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));  
  AliAnalysisDataContainer *coutput6 = mgr->CreateContainer("ListHist2Rho4Pion", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));  
  AliAnalysisDataContainer *coutput7 = mgr->CreateContainer("ListHistK0s3PiPi4K", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));  
  AliAnalysisDataContainer *coutput8 = mgr->CreateContainer("ListHistZDC", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EtaCUpc", AliAnalysisManager::GetCommonFileName()));  

  // Connect input/output
  mgr->ConnectInput(task, 0, cinput);
  mgr->ConnectOutput(task, 1, coutput);
  mgr->ConnectOutput(task, 2, coutput2);
  mgr->ConnectOutput(task, 3, coutput3);
  mgr->ConnectOutput(task, 4, coutput4);
  mgr->ConnectOutput(task, 5, coutput5);
  mgr->ConnectOutput(task, 6, coutput6);
  mgr->ConnectOutput(task, 7, coutput7);
  mgr->ConnectOutput(task, 8, coutput8);

return task;
}
Example #10
0
AliAnalysisTask *AddTaskLambdaBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=4,Int_t typeCol=2,Bool_t toEP=kFALSE,Int_t species=4){

  //get the current analysis manager
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("No manager found in AddTaskVZERO. Why?");
    return 0;
  }
  // currently don't accept AOD input
  if (!mgr->GetInputEventHandler()->InheritsFrom(AliAODInputHandler::Class())) {
    Error("AddTaskLambdaBayes","This task works only with AOD input!");
    return 0;
  }

  //========= Add tender to the ANALYSIS manager and set default storage =====
  char mytaskName[100];
  snprintf(mytaskName,100,"AliAnalysisTaskLambdaBayes.cxx"); 

  AliAnalysisTaskLambdaBayes *task = new AliAnalysisTaskLambdaBayes(mytaskName);
  if(ismc) task->SetMC();
  if(qa) task->SetQA();
  task->SetEtaCut(0.8);
  task->SetFilterBit(filterbit);
  task->SetTypeCollisions(typeCol);
  task->SetCorrEP(toEP);
  task->SetRefSpecies(species);

  AliPIDmaxProb *userCut = new AliPIDmaxProb("maxProbProton");
  userCut->RequireTPC();
  userCut->RequireTOF();
  task->SetPIDuserCut(userCut);

  mgr->AddTask(task);

  //Attach input to my tasks
  AliAnalysisDataContainer *cinput = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());

  // Attach output to my tasks
  AliAnalysisDataContainer *cOutputL= mgr->CreateContainer("contLambdaBayes1",TList::Class(), AliAnalysisManager::kOutputContainer, 
AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(task, 1, cOutputL);

  AliAnalysisDataContainer *cOutputL2= mgr->CreateContainer("contLambdaBayes2",TList::Class(), AliAnalysisManager::kOutputContainer, 
AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(task, 2, cOutputL2);

  AliAnalysisDataContainer *cOutputL3= mgr->CreateContainer("contLambdaBayes3",TList::Class(), AliAnalysisManager::kOutputContainer, 
AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(task, 3, cOutputL3);

  return task;
}
Example #11
0
AliAnalysisTaskEpRatio* AddTaskPHOSEpRatio (Bool_t kMC = kFALSE,
					    const char* name = "PHOSEpRatio",
					    const char* options = "",
					    UInt_t offlineTriggerMask = AliVEvent::kINT7 )
{
  //Add a task AliAnalysisTaskEpRatio to the analysis train.
  //Author: Boris Polishchuk.
  
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskPHOSEpRatio", "No analysis manager to connect to");
    return NULL;
  }
  
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskPHOSEpRatio", "This task requires an input event handler");
    return NULL;
  }
  
  AliAnalysisTaskEpRatio* task = new AliAnalysisTaskEpRatio(Form("%sTask", name));  
  if(!kMC) task->SelectCollisionCandidates(offlineTriggerMask);
  
  mgr->AddTask(task);
  mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
  
  TString cname(Form("%sCoutput1", name));
  TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name));
  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
  mgr->ConnectOutput(task, 1, coutput1);
  
  return task;
}
Example #12
0
AliAnalysisTaskPIDCORR *AddTaskPIDCORR()
{
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
	if (!mgr) {
		
		return NULL;
	} 
AliAnalysisTaskPIDCORR* task = new AliAnalysisTaskPIDCORR("PIDCORR_pp7TeV");

mgr->AddTask(task);

 TString outputFileName = AliAnalysisManager::GetCommonFileName();
 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
 AliAnalysisDataContainer *coutput = mgr->CreateContainer("PIDCORR_pp7TeV", TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName.Data());
        

outputFileName.Data()


    // connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);

return task;

}
Example #13
0
AliAnalysisTaskADQA *AddTaskADQA(){

  
  //--- get the current analysis manager ---//
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
      Error("AddTask_ADQA", "No analysis manager found.");
      return 0;
   }
  
  // Check the analysis type using the event handlers connected to the analysis manager.
  //==============================================================================
  if (!mgr->GetInputEventHandler()) {
    Error("AddTask_ADQA", "This task requires an input event handler");
    return 0;
  }
	
    
  // Create tasks
  AliAnalysisTaskADQA *task = new AliAnalysisTaskADQA("ESD");
  mgr->AddTask(task);

   // Create containers for input/output
  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
  AliAnalysisDataContainer *coutput = mgr->CreateContainer("ADQAListHist", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:ADQA", AliAnalysisManager::GetCommonFileName()));  

  // Connect input/output
  mgr->ConnectInput(task, 0, cinput);
  mgr->ConnectOutput(task, 1, coutput);

return task;
}
AliAnalysisTask *AddEventMixingTestTask(TString format = "esd", Bool_t useMC = kFALSE,TString postfix="")
{
   // create manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) mgr = new AliAnalysisManager("MIX test");

   // create our task
   AliAnalysisTaskEx02 *task = new AliAnalysisTaskEx02("AliAnalysisTaskEx02");

   // create output container
   AliAnalysisDataContainer *output1 = mgr->CreateContainer("cEx2", TList::Class(), AliAnalysisManager::kOutputContainer, "MixTestOutput.root");

   // add our task to the manager
   mgr->AddTask(task);

   // finaly connect input and output
   mgr->ConnectInput(task, 0,  mgr->GetCommonInputContainer());
   mgr->ConnectOutput(task, 1, output1);

   // Option for test (only experts)
//    task->SetLoopInUserExecMix(kTRUE);
//    task->SetUseLoopMixedEvent(kTRUE);
//    task->SetLoopV0(kTRUE);
   
   return task;
}
Example #15
0
//_____________________________________________________________________
AliAnalysisTask *AddTaskJCORRANEfficiency(TString taskName, int fTriggerMask){
    // Load Custom Configuration and parameters
    // override values with parameters

    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();

    //==== JCORRAN Efficiency TASK
    AliJEfficiencyTask *jefftask = new AliJEfficiencyTask(taskName.Data(),"JOD");
    jefftask->SetDebugLevel(0);
    jefftask->SetFilterTaskName("PWGCFJCORRANTask");

    AliJEfficiencyScanner *fEffScanner;
    fEffScanner = new AliJEfficiencyScanner("EfficiencyScanner");
    fEffScanner->SetMBTriggMask( fTriggerMask );
    jefftask->SetJEfficiencyScanner( fEffScanner );

    mgr->AddTask((AliAnalysisTask*) jefftask);


    // Create containers for input/output
    AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();

    // Connect input/output
	mgr->ConnectInput(jefftask, 0, cinput);
	// Connect input/output
	AliAnalysisDataContainer *effHist = mgr->CreateContainer(Form("%scontainer",jefftask->GetName()),  TDirectory::Class(), AliAnalysisManager::kOutputContainer, Form("%s:%s",AliAnalysisManager::GetCommonFileName(), jefftask->GetName()));
	mgr->ConnectOutput(jefftask, 1, effHist );

	return jefftask;
}
Example #16
0
AliAnalysisTaskADCalib* AddTaskADCalib(Int_t bcExtrapolationMin=9,
				       Int_t bcExtrapolationMax=15) {  
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("AddTask_ADCalib", "No analysis manager found.");
    return NULL;
  }
  
  if (!mgr->GetInputEventHandler()) {
    Error("AddTask_ADCalib", "This task requires an input event handler");
    return 0;
  }
      
  AliAnalysisTaskADCalib *task = new AliAnalysisTaskADCalib();
  task->SetBCRangeExtrapolation(bcExtrapolationMin, bcExtrapolationMax);
  mgr->AddTask(task);
  
  // Create containers for input/output
  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
  AliAnalysisDataContainer *coutput = mgr->CreateContainer("ADCalibListHist",
							   TList::Class(),
							   AliAnalysisManager::kOutputContainer,
							   Form("%s:ADCalib", AliAnalysisManager::GetCommonFileName()));

  // Connect input/output
  mgr->ConnectInput (task, 0, cinput);
  mgr->ConnectOutput(task, 1, coutput);
  
  return task;
}
Example #17
0
AliAnalysisTaskPsEfficiency* AddTaskPsEfficiency(bool isMC=true,TString suffix = ""){

  // Creates, configures and attaches to the train the task for pi, K , p spectra
  // with ITS standalone tracks
  // Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  ::Info("AddTaskPsEfficiency","Adding a new task with this settings isMC = %i",isMC);

  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskPsEfficiency", "No analysis manager to connect to.");
    return NULL;
  }
  // Check the analysis type using the event handlers connected to the analysis manager.
  //==============================================================================
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskPsEfficiency", "This task requires an input event handler");
    return NULL;
  }

  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
  if(type.Contains("ESD")){
    ::Error("AddTaskPsEfficiency", "This task requires to run on AOD");
    return NULL;
  }

  // Add MC handler (for kinematics)
  if(isMC){
    AliMCEventHandler* handler = new AliMCEventHandler;
    handler->SetReadTR(kFALSE);
    mgr->SetMCtruthEventHandler(handler);
  }

  // Create and configure the task

  TString tskname = "Pentaquark";
  tskname.Append(Form("%s",suffix.Data()));
  AliAnalysisTaskPsEfficiency *taskPs = new AliAnalysisTaskPsEfficiency(tskname);
  //taskPs->SetMC(isMC);
  mgr->AddTask(taskPs);

  // 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
  //==============================================================================
  TString outputFileName = AliAnalysisManager::GetCommonFileName();
  outputFileName += ":AODpentaquark";

  AliAnalysisDataContainer *coutput =0x0;

  coutput = mgr->CreateContainer(Form("lbariogl_%s",tskname.Data()),
				 TList::Class(),
				 AliAnalysisManager::kOutputContainer,
				 AliAnalysisManager::GetCommonFileName());

  mgr->ConnectInput(taskPs, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput(taskPs, 1, coutput);

  return taskPs;
}
Example #18
0
AliAnalysisTaskFemto *AddTaskFemto(const char *configMacroName="ConfigFemtoAnalysis.C", const char *configMacroParameters="" )
{
// Creates a proton analysis task and adds it to the analysis manager.

  // A. Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("AddTaskFemto", "No analysis manager to connect to.");
    return NULL;
  }

  // B. Check the analysis type using the event handlers connected to the analysis
  //    manager. The availability of MC handler cann also be checked here.
  //==============================================================================
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskFemto", "This task requires an input event handler");
    return NULL;
  }
  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
  cout << "Found " <<type << " event handler" << endl;

  // C. Create the task, add it to manager.
  //===========================================================================
//  gSystem->SetIncludePath("-I$ROOTSYS/include  -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_PHYSICS/include");

  if (TProofMgr::GetListOfManagers()->GetEntries()) {
//     if (dynamic_cast<TProofLite *> gProof) {
//       char *macrocommand[10000];
//       sprintf(macrocommand, ".L %s", configMacroName);
//       gProof->Exec(macrocommand);
//     }
//     else
    gProof->Load(configMacroName);
  }
  //  gROOT->LoadMacro("ConfigFemtoAnalysis.C++");

  AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,configMacroParameters);
  mgr->AddTask(taskfemto);

  // D. Configure the analysis task. Extra parameters can be used via optional
  // arguments of the AddTaskXXX() function.
  //===========================================================================

  // E. 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
  //==============================================================================
  TString outputfile = AliAnalysisManager::GetCommonFileName();
  outputfile += ":PWGCFEMTO_PLam";
  AliAnalysisDataContainer *cout_femto  = mgr->CreateContainer("femtolist_PLam",  TList::Class(),
  							       AliAnalysisManager::kOutputContainer,outputfile);


   mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
   mgr->ConnectOutput(taskfemto, 0, cout_femto);

   // Return task pointer at the end
   return taskfemto;
}
Example #19
0
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);
}
Example #20
0
AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(Bool_t kSimulation = kFALSE, TString outputFile = "")
{
  // Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) 
  {
    ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to.");
    return NULL;
  }  
  
  // Check the analysis type using the event handlers connected to the analysis manager.
  //==============================================================================
  if (!mgr->GetInputEventHandler()) 
  {
    ::Error("AddTaskEMCALTriggerQA", "This task requires an input event handler");
    return NULL;
  }
  
  TString taskName = "QAEMCALTrigger";
  
  AliAnalysisTaskEMCALTriggerQA * qatrigger = new AliAnalysisTaskEMCALTriggerQA(taskName);
    
  // Configuration
  
  Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
    
  if(kUseKinematics) kSimulation = kTRUE;
    
  if(kSimulation) qatrigger->SwitchOnMCData();
  else            qatrigger->SwitchOffMCData();
  
  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
    
  if(inputDataType.Contains("AOD")) qatrigger->SwitchOffV0SignalHistograms();
  else                              qatrigger->SwitchOnV0SignalHistograms();
  
  // Define the input/output containers
    
  qatrigger->GetRecoUtils()->SwitchOnBadChannelsRemoval ();
  
  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
    
  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
 
  printf("*** Task Name %s; Output file name: %s ***\n",taskName.Data(),outputFile.Data());
  
  AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("%s",taskName.Data()), 
                                                           TList::Class(), AliAnalysisManager::kOutputContainer,
                                                           Form("%s",outputFile.Data()));

  mgr->AddTask(qatrigger);
  mgr->ConnectInput  (qatrigger, 0, cinput1);
  mgr->ConnectOutput (qatrigger, 1, coutput);
  
  return qatrigger;
}
AliAnalysisTaskPrepareInputForEmbedding *AddTaskPrepareInputForEmbedding(
   TString njet = "Jet_AKTChargedR040_PicoTracks_pT0150_E_scheme",
   /*TString njetClosest = "Jet_AKTChargedR040_MCParticlesSelected_pT0150_E_scheme",*/
   Double_t R = 0.4,
   Double_t jetptcut = 1,
   Double_t jetareacut = 0.6,
   TString ntrack = "PicoTracks", 
   TString accType = "TPC", 
   Bool_t  useLeadingJet = kFALSE,
   Bool_t  usedHCtagging = kFALSE){
   
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr){
      Error("AddTaskPrepareInputForEmbedding","No analysis manager found.");
      return 0;
   }
   if (!mgr->GetInputEventHandler())
    {
      ::Error("AddTaskPrepareInputForEmbedding", "This task requires an input event handler");
      return NULL;
    }
    TString wagonName = Form("PrepareInputForEmbedding%s%s", useLeadingJet ? "L" : "", usedHCtagging ? "HC" : "");
    AliAnalysisTaskPrepareInputForEmbedding *task = new AliAnalysisTaskPrepareInputForEmbedding(wagonName);
    
    task->SetLeadingJetOnly(useLeadingJet);
    task->SetDetHardCoreTagging(usedHCtagging);
    
    AliParticleContainer *partCont  = task->AddParticleContainer(ntrack);
       
    AliJetContainer *jetCont  = task->AddJetContainer(njet, accType, R);
    if(jetCont){
       //jetCont->SetRhoName(rhoname);
       //jetCont->SetRhoMassName(rhoMname);
       jetCont->ConnectParticleContainer(partCont);
       jetCont->SetJetPtCut(jetptcut);
       jetCont->SetPercAreaCut(jetareacut);
       
    }
    //AliJetContainer *jetContClosest  = task->AddJetContainer(njetClosest, accType, R);
    
    mgr->AddTask(task);
    
    //Connnect input
    mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
    //Connect output
    TString contName(wagonName);
    TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
    contName.Append("Tree");
    AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(contName.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile);
    
    mgr->ConnectOutput(task,1,coutput1);
    mgr->ConnectOutput(task,2,coutput2);

    return task;
}
Example #22
0
// runV0ChCorrelations.C
//
// AddTask for AliAnalysisTaskV0ChCorrelations task
//
AliAnalysisTaskV0ChCorrelations *AddTaskV0ChCorrelations(const char * outfilename,
													     const Bool_t bMCtruth=kTRUE,
														 Float_t DcaDToPV = 0.05,
														 Float_t DcaV0D = 3.0,
														 const Bool_t bChCh=kTRUE,
														 Int_t OStatus
														)
{
  // Creates a V0Ch correlations analysis task and adds it to the analysis manager.

  // Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================

    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
    if (!mgr) {
      ::Error("AddTaskV0ChCorrelations", "No analysis manager to connect to.");
      return NULL;
    }

    // mc event handlerrunEx01.C
    /*
	if(bMCtruth) {
		cout << "I am here too! " << endl;
        AliAODMCEventHandler* mchandler = new AliAODMCEventHandler();
        // Not reading track references
        mchandler->SetReadTR(kFALSE);
        mgr->SetMCtruthEventHandler(mchandler);
    }   
*/
	// create task
    AliAnalysisTaskV0ChCorrelations* task = new AliAnalysisTaskV0ChCorrelations("V0ChCorrelations_task");
    task->SetAnalysisMC(bMCtruth);
	task->SetDcaDToPV(DcaDToPV);
	task->SetDcaV0D(DcaV0D);
	task->SetWithChCh(bChCh);
	task->SetOStatus(OStatus);
    mgr->AddTask(task);
    
    // 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
    //==============================================================================
    TString outputFileName = AliAnalysisManager::GetCommonFileName();
    //outputFileName = "list.grid.v0ch.root";

    // create containers for input/output
    AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(outfilename, TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
        
    // connect input/output
    mgr->ConnectInput(task, 0, cinput);
    mgr->ConnectOutput(task, 1, coutput1);
        
    // Return task pointer at the end
    return task;
}
Example #23
0
//
// This macro serves to add the RSN analysis task to the steering macro.
//
// Inputs:
//   - dataLabel   = a string with informations about the type of data
//                   which could be needed to be ported to the config macro
//                   to set up some cuts
//   - configMacro = macro which configures the analysis; it has *ALWAYS*
//                   defined inside a function named 'RsnConfigTask()',
//                   whatever the name of the macro itself, whose first two
//                   arguments must have to be the task and the 'dataLabel' argument.
//
Bool_t AddRsnAnalysisTask
(
   Bool_t      isMC,
   Bool_t      isMix,
   const char *options,
   const char *path     = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train",
   const char *taskName = "RSNtask"
)
{
   // retrieve analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();

   // create the task and connect with physics selection
   AliRsnAnalysisTask *task = new AliRsnAnalysisTask(taskName);
   task->SetZeroEventPercentWarning(100.0);
   task->SelectCollisionCandidates();
   task->SetMixing(isMix);
   ::Info("AddRsnAnalysisTask.C", "Mixing: %s", (task->IsMixing() ? "YES" : "NO"));
   ::Info("AddRsnAnalysisTask.C", "MC:     %s", (isMC ? "YES" : "NO"));

   // add the task to manager
   mgr->AddTask(task);
   
   // add the event computations with the options to eventually select centrality cut
   gROOT->LoadMacro(Form("%s/AddRsnEventComputations.C", path));
   AddRsnEventComputations(isMC, options);
   
   // add all configs for phi
   gROOT->LoadMacro(Form("%s/RsnConfigPhi.C", path));
   RsnConfigPhi(isMC, "tpcpid_tofpid", path, taskName);
   //RsnConfigPhi(isMC, "itspid_tpcpid_tofpid", path, taskName);
   
   // in case of MC, add efficiency tasks
   if (isMC && !isMix) {
      ::Info("Adding efficiency");
      gROOT->LoadMacro(Form("%s/AddRsnAnalysisTaskEffPhi.C", path));
      AddRsnAnalysisTaskEffPhi(options, "tpcpid_tofpid");
      //AddRsnAnalysisTaskEffPhi(options, "itspid_tpcpid_tofpid");
   }

   // connect input container according to source choice
   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());

   // create paths for the output in the common file
   Char_t commonPath[500];
   sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());

   // create containers for output
   AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
   AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
   mgr->ConnectOutput(task, 1, outputInfo);
   mgr->ConnectOutput(task, 2, outputHist);

   return kTRUE;
}
Example #24
0
AliAnalysisTaskCmeEse* AddTaskCmeEse(UInt_t filterbit = 768,
                                 Double_t etaCut = 0.8,
                                 Double_t vtxCut = 10.,
                                 Double_t minPt = 0.2,
                                 Double_t maxPt = 5.0,
                                 Int_t noclus = 70,
                                 Bool_t IsLHC10h = kTRUE,
                                 Bool_t IsPileUp = kTRUE,
                                 Bool_t IsRecEff = kFALSE,
                                 Short_t nCentFl = 0,
                                 Bool_t IsQAV0 = kFALSE,
                                 Bool_t IsQATrk = kFALSE,
                                 TString uniqueID = "def")
{

    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
    if (!mgr) {
        Error("AddTaskCmeEse", "No analysis manager to connect to.");
        return NULL;
    }

    
    if (!mgr->GetInputEventHandler()) {
        Error("AddTaskCmeEse", "This task requires an input event handler");
        return NULL;
    }


    AliAnalysisTaskCmeEse* taskD = new AliAnalysisTaskCmeEse(Form("taskCMEESE_%s", uniqueID.Data()));
    
    taskD->SetDebugLevel(3);
    taskD->SetFilterbit(filterbit);
    taskD->SetNoClus(noclus);
    taskD->SetEtaCut(etaCut);
    taskD->SetVtxCut(vtxCut);
    taskD->SetMinPt(minPt);
    taskD->SetMaxPt(maxPt);
    taskD->SetFlagLHC10h(IsLHC10h);
    taskD->SetFlagPileUp(IsPileUp);
    taskD->SetCentFlag(nCentFl);
    taskD->SetFlagRecEff(IsRecEff);
    taskD->SetFlagQAV0(IsQAV0);
    taskD->SetFlagQATrk(IsQATrk);
    
    mgr->AddTask(taskD);

    AliAnalysisDataContainer* cinput = mgr->GetCommonInputContainer();
    AliAnalysisDataContainer* cout = mgr->CreateContainer(Form("output_%s", uniqueID.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, Form("cme_psi2V0A.root:%s", uniqueID.Data()));
    mgr->ConnectInput (taskD, 0, cinput);
    mgr->ConnectOutput(taskD, 1, cout);
  
    // Return task pointer at the end
    return taskD;
}
AliAnalysisTask *AddTaskFlowd(Bool_t fillTree = kFALSE){


  //get the current analysis manager
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("AddTaskFlowd", "No analysis manager found.");
    return 0;
  }

  // Check the analysis type using the event handlers connected to the analysis manager.
   //==============================================================================
   if (!mgr->GetInputEventHandler()) {
      ::Error("AddTaskFlowd", "This task requires an input event handler");
      return NULL;
   }  


  //========= Add task to the ANALYSIS manager =====
  AliAnalysisTaskFlowd *task = new AliAnalysisTaskFlowd("Flowd");

  mgr->AddTask(task);

  AliAnalysisDataContainer *coutput1 = 
      mgr->CreateContainer("mpuccio_Flowd", TList::Class(),
                           AliAnalysisManager::kOutputContainer,"mpuccio_Flowd.root");

  //connect containers
  mgr->ConnectInput  (task,  0,  mgr->GetCommonInputContainer());
  mgr->ConnectOutput (task,  1, coutput1);
  task->SetFillTree(fillTree);
  if (fillTree) {
    AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("mpuccio_FlowdTree", TTree::Class(),
                                                              AliAnalysisManager::kOutputContainer,
                                                              "mpuccio_Flowdnt.root");
    coutput2->SetSpecialOutput();
    mgr->ConnectOutput (task,  2, coutput2);
  }

  return task;
}
Example #26
0
AliAnalysisTask *AddTask_HypTritEventTree(UInt_t triggerMask = AliVEvent::kINT7, Bool_t pidQa = kTRUE, Bool_t betheSplines = kTRUE, Int_t period = 2015) {
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("AddTask_lkreis_HypTritEventTree", "No analysis manager found.");
    return 0;
  }
  AliAnalysisTaskHypTritEventTree *task = new AliAnalysisTaskHypTritEventTree("lkreisTaskHypTritEventTree");
  task->SelectCollisionCandidates(triggerMask);
  task->SetPidQa(pidQa);
  //task->SetPeriod(period);
  task->SetBetheSplines(betheSplines);
  // MC LHC12d3
//  Double_t he3Params[6] = {1.79043,18.0066,0.00212257,2.24677,4.25945,0.06892};
//  Double_t tParams[6] = {2.32603,19.2492,30.7943,2.16971,-8.11114, 0.09311};
  // DATA LHC15o
  if(period == 2015){
    Double_t he3Params[6] = {2.45605,19.8067,-0.774729,1.96279,0.172695, 0.05655};
    Double_t tParams[6] = {2.32603,19.2492,30.7943,2.16971,-8.11114, 0.09311};
  }
  else if(period == 2016){
    Double_t he3Params[6] = {1.69155, 27.4992, 4.00313e-15, 2.48485, 8.31768, 0.05655};
    Double_t tParams[6] = {1.69155, 27.4992, 4.00313e-15, 2.48485, 8.31768, 0.09311};
  }
  task->SetParamsHe(he3Params);
  task->SetParamsT(tParams);
  //Data Containers
  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
  AliAnalysisDataContainer *coutput1 =
    mgr->CreateContainer("histograms", TList::Class(),AliAnalysisManager::kOutputContainer,mgr->GetCommonFileName());
  AliAnalysisDataContainer *coutput2 =
    mgr->CreateContainer("tree", TTree::Class(),AliAnalysisManager::kOutputContainer,mgr->GetCommonFileName());
  AliAnalysisDataContainer *coutput3 =
    mgr->CreateContainer("tree_mc", TTree::Class(),AliAnalysisManager::kOutputContainer,mgr->GetCommonFileName());
  mgr->ConnectInput(task, 0, cinput);
  mgr->ConnectOutput(task, 1, coutput1);
  mgr->ConnectOutput(task, 2, coutput2);
  mgr->ConnectOutput(task, 3, coutput3);
  return task;
}
Example #27
0
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);
}
Example #28
0
//_________________________________________________________//
AliEbyEFluctuationAnalysisTask *AddTaskFluctuations(const char* analysisType = "ESD", 
						    const char *analysisMode = "TPC") {
  // Creates a fluctuations analysis task and adds it to the analysis manager.
  // Get the pointer to the existing analysis manager via the static access method.
  //===========================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskFluctuations", "No analysis manager to connect to.");
    return NULL;
  }

  // Check the analysis type using the event handlers connected to the analysis manager.
  //===========================================================================
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskFluctuations", "This task requires an input event handler");
    return NULL;
  }
  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"

  // Create the task, add it to manager and configure it.
  //===========================================================================
  AliEbyEFluctuationAnalysisTask *taskFluctuations = new AliEbyEFluctuationAnalysisTask("FluctuationsTask");
  mgr->AddTask(taskFluctuations);
  taskFluctuations->SetAnalysisType(analysisType);
  if(analysisType == "ESD") {
    taskFluctuations->SetAnalysisMode(analysisMode);
    taskFluctuations->SetVertexDiamond(3.,3.,10.);
    taskFluctuations->SetCentralityEstimator(centralityEstimator);
    taskFluctuations->SetCentralityBins20();
    taskFluctuations->SelectCollisionCandidates(AliVEvent::kMB);
  }

  TString type = analysisType;
  if (analysisType=="ESD") {
    gROOT->LoadMacro("configFluctuationsAnalysis.C");
    AliESDtrackCuts *trackCuts = GetTrackCutsObject();
    taskFluctuations->SetAnalysisCutObject(trackCuts);
  }
  
  // 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
  //==============================================================================
  TString outputFileName = AliAnalysisManager::GetCommonFileName();
  outputFileName += ":outputFluctuationAnalysis.root";
  AliAnalysisDataContainer *coutFA = mgr->CreateContainer("fluctuationsOutput", TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data());
  mgr->ConnectInput(taskFluctuations, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput(taskFluctuations, 1, coutFA);

  // Return task pointer at the end
  return taskFluctuations;
}
Example #29
0
void AddParticleMonitor(AliAnalysisTaskSE *task, Bool_t isMC, Int_t listID1,AliRsnCutSet *commonEventCuts=0,AliRsnCutSet *cutPair=0,TString name = "")
{
   Bool_t valid;
   Int_t isRsnMini = AliAnalysisManager::GetGlobalInt("rsnUseMiniPackage",valid);
   Int_t useMCMon = AliAnalysisManager::GetGlobalInt("rsnUseMCMonitoring",valid);

   if (isRsnMini) {
//       Printf("Monitoring by mini is not supported now. It will be soon !!!");
//       return ;
      AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
      AliRsnMiniMonitorTask *monTask = new AliRsnMiniMonitorTask(name.Data(),useMCMon);
      AddMonitorOutputMini(monTask,listID1,name);
//       AddMonitorOutputMini(monTask,listID1,name,'+');
//       AddMonitorOutputMini(monTask,listID1,name,'-');
      mgr->AddTask(monTask);
      // connect input container according to source choice
      mgr->ConnectInput(monTask, 0, mgr->GetCommonInputContainer());

      // create paths for the output in the common file
      TString commonPath = AliAnalysisManager::GetCommonFileName();

      // create containers for output
      AliAnalysisDataContainer *output = mgr->CreateContainer(Form("RsnMonMini%s", name.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath.Data());

      mgr->ConnectOutput(monTask, 1, output);



   } else {

      TList *listLoops = new TList;
      // monitor definition
      AliRsnDaughterDef *tracksAll = new AliRsnDaughterDef(AliRsnDaughter::kTrack /*'+' or '-'*/);
// //       AliRsnDaughterDef *tracksPos = new AliRsnDaughterDef(AliRsnDaughter::kTrack,'+');
// //       AliRsnDaughterDef *tracksNeg = new AliRsnDaughterDef(AliRsnDaughter::kTrack,'-');
//
      AliRsnLoopDaughter *lm =0;
//       // loop object
      listLoops->Add(new AliRsnLoopDaughter(Form("ALL_%s", name.Data()), listID1, tracksAll));
//
// //       listLoops->Add(new AliRsnLoopDaughter(Form("%s_pos", name.Data()), listID1, tracksPos));
// //       listLoops->Add(new AliRsnLoopDaughter(Form("%s_neg", name.Data()), listID1, tracksNeg));
//
      TIter next(listLoops);
      while ((lm = (AliRsnLoopDaughter *)next.Next())) {
//          if (commonEventCuts) lm->SetEventCuts(commonEventCuts);
         AddMonitorOutput(0,"mc_loop",lm);
         ((AliRsnAnalysisTask *)task)->AddLoop(lm);
      }
   }
}
AliAnalysisTaskEventCutsValidation* AddTaskEventCutsValidation(bool storeCuts = true, TString tskname = "EventCutsValidation",TString suffix = "") {

  // Get the current analysis manager
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskEventCutsValidation", "No analysis manager found.");
    return 0x0;
  }

  // Check the analysis type using the event handlers connected to the analysis manager.
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskEventCutsValidation", "This task requires an input event handler");
    return 0x0;
  }

  tskname.Append(Form("%s",suffix.Data()));
  AliAnalysisTaskEventCutsValidation *ev = new AliAnalysisTaskEventCutsValidation(storeCuts,tskname);
  mgr->AddTask(ev);

  TString output = "AnalysisResults.root";
  AliAnalysisDataContainer *evCont = mgr->CreateContainer(Form("%s",tskname.Data()),
      TList::Class(),
      AliAnalysisManager::kOutputContainer,
      output.Data());

  mgr->ConnectInput  (ev,  0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput (ev,  1, evCont);
  
  if (storeCuts) {
    AliAnalysisDataContainer *cutCont = mgr->CreateContainer("EventCuts",
        AliEventCuts::Class(),
        AliAnalysisManager::kParamContainer,
        output.Data());
    mgr->ConnectOutput(ev, 2, cutCont);
  }

  return ev;
}