From: martinez Date: Fri, 28 Nov 2008 09:19:45 +0000 (+0000) Subject: Creation of AOD tag file using the new development of Andreas Morsch (Enrico, Roberta) X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=643fea241a301b91db8d98c5467a1986fa876e3e Creation of AOD tag file using the new development of Andreas Morsch (Enrico, Roberta) --- diff --git a/PWG3/READMEmuon b/PWG3/READMEmuon index b45f02f4862..3f00df79074 100644 --- a/PWG3/READMEmuon +++ b/PWG3/READMEmuon @@ -1,13 +1,40 @@ =================================================== - ESDMuonFilter task for filling the muon information in the AOD from the ESD - Roberta ARNALDI, Torino + Code to include the muon information in the + creation of the standard AOD from the ESD + Roberta ARNALDI, Enrico SCOMPARIN Torino --------------------------------------------------------------- -1) AnalysisTrainMuonLocal.C --> macro to run locally the AliAnalysisTaskESDMuonFilter -2) AliAnalysisTaskESDMuonFilter.h --> analysis task to produce the Muon AOD from ESD -3) AliAnalysisTaskESDMuonFilter.cxx --> analysis task to produce the Muon AOD from ESD -4) libPWG3muon.pkg -5) PWG3muonLinkDef.h +The following filter is used in the official analysis train, in order to copy the muon information from the ESD to the standard AOD. + +1) AliAnalysisTaskESDMuonFilter.h --> analysis task to copy the muon information from the ESD to the standard AOD +2) AliAnalysisTaskESDMuonFilter.cxx --> analysis task to copy the muon information from the ESD to the standard AOD + +In order to test locally the analysis train from the ESD to the Standard AOD production, the following macro is provided + +1) AnalysisTrainMuonLocal.C + - The input file is the ESD + - The outputs are the standard AOD and the AOD tag file + +=================================================== + Creation of the MUON-AOD from the standard AOD + Roberta ARNALDI, Enrico SCOMPARIN Torino +--------------------------------------------------------------- + +Code to produce a muon-AOD, i.e. a replica of the standard AOD containing only events where +at least one muon in the dimuon spectrometer is present + +1) AnalysisTrainFromStandardToMuonAODLocal.C --> macro to produce the MUON-AOD (it runs locally) +2) AliAnalysisTaskFromStandardToMuonAOD.h --> analysis task to replicate the AOD content for interesting events +3) AliAnalysisTaskFromStandardToMuonAOD.cxx --> analysis task to replicate the AOD content for interesting events + +- The input files are the standard AOD and the AOD tag file. + The AOD tag file can be created in the previous step from ESD to Standard AOD, using AnalysisTrainMuonLocal.C, or it can be + produced on the fly with this macro. +- Events containing at least one muon in the muon spectrometer can be selected using the AOD tag files. +- The contents of the MUON-AOD can be defined by the user in the AnalysisTrainFromStandardToMuonAODLocal.C + macro with some settings as + SetNeedsTracksBranchReplication(), SetNeedsVerticesBranchReplication() + (defined in STEER/AliAODHandler.h)... =================================================== Calculation of the LUT diff --git a/PWG3/muon/AnalysisTrainMuonLocal.C b/PWG3/muon/AnalysisTrainMuonLocal.C index 92ca8b75258..2343e3f0950 100644 --- a/PWG3/muon/AnalysisTrainMuonLocal.C +++ b/PWG3/muon/AnalysisTrainMuonLocal.C @@ -1,4 +1,6 @@ -void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", char* fileout = "AliAODs.root") +void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", + char* fileout = "AliAODs.root", + Int_t nev=123456789) // Macro to produce a generic AOD starting from an ESD file. // The AOD is filled with two tasks: @@ -6,28 +8,35 @@ void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", char* fileout = "AliA // all the branches of the AOD are filled apart from the muons. // 2- with the second task (AliAnalysisTaskESDMuonFilter) // muons tracks are added to the tracks branch -// There is the possibility to apply cuts on the muon tracks in order -// to reject muons before filling the AOD +// 3- with a third task (AliAnalysisTaskTagCreator) +// aod tags are created +// There is the possibility to apply cuts on the tracks and muon tracks in +// order to reject them before filling the AOD // This macro works locally -// R. Arnaldi 5/5/08 { gSystem->Load("libTree.so"); gSystem->Load("libGeom.so"); gSystem->Load("libVMC.so"); gSystem->Load("libPhysics.so"); + gSystem->Load("${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}/libPWG3muon.so"); // for aliroot based analysis - // If analysis is .par based: + // Par files for a par based analysis + // SetupPar("STEERBase"); + // SetupPar("ESD"); + // SetupPar("AOD"); + // SetupPar("ANALYSIS"); + // SetupPar("ANALYSISalice"); + // SetupPar("PWG3muon"); + + // Creating ESD Tags on the fly + // The recreation of the ESD tag file is only needed in order to copy the infos on + // run/LHC parameters into the AOD tag file. If the ESD tag file is not recreated, the + // run/LHC info in the AOD tag file will be empty. + AliESDTagCreator *t = new AliESDTagCreator(); + t->SetStorage(0); + t->ReadLocalCollection("."); - // Common packages - SetupPar("STEERBase"); - SetupPar("ESD"); - SetupPar("AOD"); - SetupPar("ANALYSIS"); - SetupPar("ANALYSISalice"); - // Analysis-specific packages - SetupPar("PWG3muon"); - // Input ESD file TChain* chain = new TChain("esdTree"); chain->Add(filein); @@ -37,7 +46,7 @@ void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", char* fileout = "AliA // ESD input handler AliESDInputHandler *esdHandler = new AliESDInputHandler(); - esdHandler->SetInactiveBranches("FMD CaloCluster"); + esdHandler->SetReadTags(); // AOD output handler AliAODHandler* aodHandler = new AliAODHandler(); @@ -46,9 +55,10 @@ void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", char* fileout = "AliA mgr->SetInputEventHandler(esdHandler); mgr->SetOutputEventHandler(aodHandler); - // Set of cuts for the ESD filter + // Set of cuts for the ESD filters. + // Only tracks surviving the cuts will be copied into the AOD // - // standard cut + // standard cut for non-muon tracks AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose"); esdTrackCutsL->SetMinNClustersTPC(50); esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5); @@ -58,7 +68,7 @@ void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", char* fileout = "AliA esdTrackCutsL->SetRequireSigmaToVertex(kTRUE); esdTrackCutsL->SetAcceptKingDaughters(kFALSE); // - // hard cuts + // hard cuts for non-muon tracks AliESDtrackCuts* esdTrackCutsH = new AliESDtrackCuts("AliESDtrackCuts", "Hard"); esdTrackCutsH->SetMinNClustersTPC(100); esdTrackCutsH->SetMaxChi2PerClusterTPC(2.0); @@ -71,38 +81,46 @@ void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", char* fileout = "AliA // // muon cuts AliESDMuonTrackCuts* esdMuonTrackCuts = new AliESDMuonTrackCuts("AliESDMuonTrackCuts", "test"); - esdMuonTrackCuts->SetPRange(0.,20.); - //esdMuonTrackCuts->SetPtRange(0.,0.5); // examples of kinematic cuts that can be applied + esdMuonTrackCuts->SetPRange(0.,12.); + esdMuonTrackCuts->SetPtRange(0.,2.); // examples of kinematic cuts that can be applied esdMuonTrackCuts->SetHistogramsOn(kTRUE); // methods to draw control histos esdMuonTrackCuts->DefineHistograms(); esdMuonTrackCuts->DrawHistograms(); - // track filter (to reject tracks not surviving the cuts - refers to all particles apart from muons) + // track filter (to reject tracks not surviving the previously defined cuts - + // refers to all particles apart from muons) AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter"); trackFilter->AddCuts(esdTrackCutsH); - // muon track filter (to reject muon tracks not surviving the cuts) + // muon track filter (to reject muon tracks not surviving the previously defined cuts) AliAnalysisFilter* trackMuonFilter = new AliAnalysisFilter("trackMuonFilter"); trackMuonFilter->AddCuts(esdMuonTrackCuts); - // ESD filter task putting standard info in the output generic AOD + // ESD filter task to fill standard info in the output generic AOD AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter"); - //esdfilter->SetTrackFilter(trackFilter); + //esdfilter->SetTrackFilter(trackFilter); //uncomment to apply cuts on the tracks esdfilter->SetDebugLevel(10); mgr->AddTask(esdfilter); - // ESD filter task putting muon info in the output generic AOD + // ESD filter task filling muon info in the output generic AOD AliAnalysisTaskESDMuonFilter *esdmuonfilter = new AliAnalysisTaskESDMuonFilter("ESD Muon Filter"); - esdmuonfilter->SetTrackFilter(trackMuonFilter); + //esdmuonfilter->SetTrackFilter(trackMuonFilter); //uncomment to apply cuts on the muon tracks mgr->AddTask(esdmuonfilter); - // Containers for input/output + // Tag Creator + AliAnalysisTaskTagCreator* tagTask = new AliAnalysisTaskTagCreator("AOD Tag Creator"); + mgr->AddTask(tagTask); + + // Input container AliAnalysisDataContainer *cin_esd = mgr->CreateContainer("cESD",TChain::Class(), AliAnalysisManager::kInputContainer); // Output AOD container. AliAnalysisDataContainer *cout_aod = mgr->CreateContainer("cAOD", TTree::Class(), AliAnalysisManager::kOutputContainer, "default"); - + // Tag container + AliAnalysisDataContainer *cout_tags = mgr->CreateContainer("cTag",TTree::Class(), + AliAnalysisManager::kOutputContainer, "AOD.tag.root"); + // Connect containers to tasks slots mgr->ConnectInput (esdfilter, 0, cin_esd ); mgr->ConnectOutput (esdfilter, 0, cout_aod ); @@ -110,12 +128,15 @@ void AnalysisTrainMuonLocal(char* filein = "AliESDs.root", char* fileout = "AliA mgr->ConnectInput (esdmuonfilter, 0, cin_esd); mgr->ConnectOutput (esdmuonfilter, 0, cout_aod ); + mgr->ConnectInput (tagTask, 0, cin_esd); + mgr->ConnectOutput (tagTask, 1, cout_tags); + // // Run the analysis // if (mgr->InitAnalysis()) { mgr->PrintStatus(); - mgr->StartAnalysis("local",chain); + mgr->StartAnalysis("local",chain,nev); } }