From 9372eb77ef8895a2d095bb133354d8baa9f32ed8 Mon Sep 17 00:00:00 2001 From: jotwinow Date: Sun, 29 Nov 2009 19:13:07 +0000 Subject: [PATCH] new cuts and tasks added --- PWG1/macros/AddTaskPerformanceTPC.C | 59 +++++++- PWG1/macros/RunPerformanceTrain.C | 226 +++++++++++++++++++++++++++- 2 files changed, 273 insertions(+), 12 deletions(-) diff --git a/PWG1/macros/AddTaskPerformanceTPC.C b/PWG1/macros/AddTaskPerformanceTPC.C index afad8d2dbe6..b5fee3edf2e 100644 --- a/PWG1/macros/AddTaskPerformanceTPC.C +++ b/PWG1/macros/AddTaskPerformanceTPC.C @@ -79,7 +79,54 @@ AliPerformanceTask* AddTaskPerformanceTPC(Bool_t bUseMCInfo=kTRUE, Bool_t bUseES // // Create TPC-ESD track reconstruction cuts + // MB tracks + // + AliRecInfoCuts *pRecInfoCutsTPC = new AliRecInfoCuts(); + if(pRecInfoCutsTPC) { + pRecInfoCutsTPC->SetMaxDCAToVertexXY(3.0); + pRecInfoCutsTPC->SetMaxDCAToVertexZ(30.0); + pRecInfoCutsTPC->SetRequireSigmaToVertex(kFALSE); + pRecInfoCutsTPC->SetRequireTPCRefit(kFALSE); + pRecInfoCutsTPC->SetAcceptKinkDaughters(kTRUE); + pRecInfoCutsTPC->SetMinNClustersTPC(50); + pRecInfoCutsTPC->SetMaxChi2PerClusterTPC(1000000.); + pRecInfoCutsTPC->SetDCAToVertex2D(kFALSE); + + pRecInfoCutsTPC->SetHistogramsOn(kFALSE); + } + else { + Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!"); + return NULL; + } + // + // Create TPC-ESD track reconstruction cuts + // MATCH tracks + // + AliRecInfoCuts *pRecInfoCutsMATCH = new AliRecInfoCuts(); + if(pRecInfoCutsMATCH) { + pRecInfoCutsMATCH->SetMaxDCAToVertexXY(3.0); + pRecInfoCutsMATCH->SetMaxDCAToVertexZ(3.0); + pRecInfoCutsMATCH->SetRequireSigmaToVertex(kFALSE); + pRecInfoCutsMATCH->SetRequireTPCRefit(kFALSE); + pRecInfoCutsMATCH->SetAcceptKinkDaughters(kTRUE); + pRecInfoCutsMATCH->SetMinNClustersTPC(50); + pRecInfoCutsMATCH->SetMaxChi2PerClusterTPC(1000000.); + pRecInfoCutsMATCH->SetDCAToVertex2D(kFALSE); + pRecInfoCutsMATCH->SetTPCITSMatchingRadius(70); + pRecInfoCutsMATCH->SetTPCTRDMatchingRadius(260); + pRecInfoCutsMATCH->SetMinNClustersITS(2); + + pRecInfoCutsMATCH->SetHistogramsOn(kFALSE); + } + else { + Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!"); + return NULL; + } + + // + // Create TPC-ESD track reconstruction cuts + // standard cuts AliRecInfoCuts *pRecInfoCuts = new AliRecInfoCuts(); if(pRecInfoCuts) { pRecInfoCuts->SetMaxDCAToVertexXY(3.0); @@ -168,32 +215,32 @@ AliPerformanceTask* AddTaskPerformanceTPC(Bool_t bUseMCInfo=kTRUE, Bool_t bUseES if(!pCompTPC0) { Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceTPC"); } - pCompTPC0->SetAliRecInfoCuts(pRecInfoCuts); + pCompTPC0->SetAliRecInfoCuts(pRecInfoCutsTPC); pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts); // // TPC+ITS matching performance // - AliPerformanceMatch *pCompMatch0 = new AliPerformanceMatch("AliPerformanceMatchTPCITS","AliPerformanceMatch",0,kFALSE); + AliPerformanceMatch *pCompMatch0 = new AliPerformanceMatch("AliPerformanceMatchTPCITS","AliPerformanceMatchTPCITS",0,kFALSE); if(!pCompMatch0) { Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCITS"); } - pCompMatch0->SetAliRecInfoCuts(pRecInfoCuts); + pCompMatch0->SetAliRecInfoCuts(pRecInfoCutsMATCH); pCompMatch0->SetAliMCInfoCuts(pMCInfoCuts); // // TPC+TRD matching performance // - AliPerformanceMatch *pCompMatch1 = new AliPerformanceMatch("AliPerformanceMatchTPCTRD","AliPerformanceMatch",1,kFALSE); + AliPerformanceMatch *pCompMatch1 = new AliPerformanceMatch("AliPerformanceMatchTPCTRD","AliPerformanceMatchTPCTRD",1,kFALSE); if(!pCompMatch1) { Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCTRD"); } - pCompMatch1->SetAliRecInfoCuts(pRecInfoCuts); + pCompMatch1->SetAliRecInfoCuts(pRecInfoCutsMATCH); pCompMatch1->SetAliMCInfoCuts(pMCInfoCuts); AliPerformanceMatch *pCompMatch2 = new AliPerformanceMatch("AliPerformanceMatchTPCEFF","AliPerformanceMatchTPCEFF",2,kFALSE); if(!pCompMatch2) { Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCEFF"); } - pCompMatch2->SetAliRecInfoCuts(pRecInfoCuts); + pCompMatch2->SetAliRecInfoCuts(pRecInfoCutsMATCH); pCompMatch2->SetAliMCInfoCuts(pMCInfoCuts); // diff --git a/PWG1/macros/RunPerformanceTrain.C b/PWG1/macros/RunPerformanceTrain.C index 78c3246617d..3323f54fc8f 100644 --- a/PWG1/macros/RunPerformanceTrain.C +++ b/PWG1/macros/RunPerformanceTrain.C @@ -4,10 +4,89 @@ // // //13.10.2009 - J.Otwinowski@gsi.de +// +// + +/* +Quick Start: + +1. Start train macro (real data from GSI::SE). Source your own Alien environment. + +source /u/jacek/alien/set_alien_env.sh +aliroot -b -q 'RunPerformanceTrainTPC.C("AliESDs.root",2,kFALSE,kTRUE,kTRUE)' + +3. Start train macro (real data from lustre) + +aliroot -b -q 'RunPerformanceTrainTPC.C("AliESDs.root",2,kFALSE,kTRUE,kFALSE)' + +*/ //_____________________________________________________________________________ -void RunPerformanceTrain(Char_t *list="esdList.txt", Int_t nFiles=20, Int_t fistFile=0, Bool_t bUseMCInfo=kTRUE, Bool_t bUseESDfriend=kTRUE) +void RunPerformanceTrainTPC(Char_t *file="esd.root", Int_t magField = 2, Bool_t bUseMCInfo=kFALSE, Bool_t bUseESDfriend=kTRUE, Bool_t bGrid=kTRUE) { + // + // Grid settings + // use GSI::SE + if(bGrid) { + gSystem->Setenv("alien_CLOSE_SE","ALICE::GSI::SE"); + TGrid * alien = TGrid::Connect("alien://",0,0,"t"); + gSystem->Setenv("alien_CLOSE_SE","ALICE::GSI::SE"); + } + + // + // Train Configuration + // + Int_t iPWG1perfTPC = 1; // Test TPC performance + Int_t iPWG1perfTRD = 0; // Test TRD performance + Int_t iPWG1perfITS = 0; // Test ITS performance + Int_t iPWG1perfCalo = 0; // Test Calo performance + Int_t iPWG1perfMuonTrig = 0; // Test Muon Trigger performance + Int_t iPWG1perfMuonEff = 0; // Test Muon Efficiency performance + Int_t iPWG1perfTOF = 0; // Test TOF-TPC matching performance + Int_t iPWG1perfPrimVertex = 0; // Test Primary Vertex performance + Int_t iPWG1v0QA = 0; // V0 algorithm QA task + + // + // Load Libraries + // + gSystem->Load("libANALYSIS"); + gSystem->Load("libANALYSISalice"); + gSystem->Load("libTENDER"); + gSystem->Load("libCORRFW"); + + gSystem->Load("libTPCcalib.so"); + gSystem->Load("libPWG1"); + + gSystem->Load("libPHOSUtils"); + gSystem->Load("libEMCALUtils"); + gSystem->Load("libPWG4PartCorrBase"); + gSystem->Load("libPWG4PartCorrDep"); + + gSystem->Load("libPWG3muon.so"); // The class is here + + // + // OCDB Configuration + // + AliCDBManager *cdbManager = AliCDBManager::Instance(); + cdbManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + cdbManager->SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd())); + cdbManager->SetRun(0); + //cdbManager->SetCacheFlag(kFALSE); + // initialize magnetic field from the GRP manager. + if(magField==0) TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 0., 0., AliMagF::k2kG)); + if(magField==1) TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k2kG)); + if(magField==2) TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG)); + + //AliGRPManager grpMan; + //grpMan.ReadGRPEntry(); + //grpMan.SetMagField(); + //AliRunInfo *runInfo = grpMan.GetRunInfo(); + + // + // Load geometry + // + AliGeomManager::LoadGeometry(); + // // Swtich off all AliInfo (too much output!) // @@ -16,12 +95,20 @@ void RunPerformanceTrain(Char_t *list="esdList.txt", Int_t nFiles=20, Int_t fist // // Create input ESD chain // + /* gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); TChain* chain = CreateESDChain(list,nFiles,fistFile); if(!chain) { Error("RunPerformanceTrain","ESD chain not created!"); return; } + */ + TChain *chain = new TChain("esdTree"); + if(!chain) { + Error("RunPerformanceTrain","ESD chain not created!"); + return; + } + chain->Add(file); chain->Lookup(); // @@ -44,26 +131,152 @@ void RunPerformanceTrain(Char_t *list="esdList.txt", Int_t nFiles=20, Int_t fist if(bUseESDfriend) esdH->SetActiveBranches("ESDfriend"); mgr->SetInputEventHandler(esdH); + /* + // + // Set RecPoints and ESD input handler + // + AliESDInputHandlerRP* rpH = new AliESDInputHandlerRP; + if(!rpH) { + Error("RunPerformanceTrain","AliESDInputHandlerRP not created!"); + return; + } + if(bUseESDfriend) rpH->SetActiveBranches("ESDfriend"); + mgr->SetInputEventHandler(rpH); + */ + // // Set MC input handler // if(bUseMCInfo) { AliMCEventHandler* mcH = new AliMCEventHandler; - if(!esdH) { + if(!mcH) { Error("RunPerformanceTrain","AliMCEventHandler not created!"); return; } mcH->SetReadTR(kTRUE); mgr->SetMCtruthEventHandler(mcH); } + + // // Add task to AliAnalysisManager // - gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPC.C"); - AliPerformanceTask *tpcQA = AddTaskPerformanceTPC(bUseMCInfo,bUseESDfriend); - if(!tpcQA) { - Error("RunPerformanceTrain","TaskPerformanceTPC not created!"); + + // + // TPC performance + // + if(iPWG1perfTPC) { + gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPC.C"); + AliPerformanceTask *tpcQA = AddTaskPerformanceTPC(bUseMCInfo,bUseESDfriend); + if(!tpcQA) { + Error("RunPerformanceTrain","AliPerformanceTask not created!"); return; + } + } + else { + Printf("RunPerformanceTrain: TPC Performance - EXCLUDED!"); + } + // + // TRD perormance + // + if(iPWG1perfTRD) { + gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTrainPerformanceTRD.C"); + if(!AddTrainPerformanceTRD(bUseMCInfo,bUseESDfriend)) { + Error("RunPerformanceTrain","TrainPerformanceTRD not created!"); + return; + } + } else { + Printf("RunPerformanceTrain: TRD TrainPerformanceTRD - EXCLUDED!"); + } + // + // ITS performance + // + if(iPWG1perfITS) { + gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceITS.C"); + AliAnalysisTaskITSTrackingCheck *itsQA = AddTaskPerformanceITS(bUseMCInfo); + if(!itsQA) { + Error("RunPerformanceTrain","AliAnalysisTaskITSTrackingCheck not created!"); + return; + } + } + else { + Printf("RunPerformanceTrain: AliAnalysisTaskITSTrackingCheck - EXCLUDED!"); + } + // + // Calorimeter Performance + // + if(iPWG1perfCalo) { + gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskCalorimeterQA.C"); + AliAnalysisTaskParticleCorrelation *taskCaloQA = AddTaskCalorimeterQA("ESD",bUseMCInfo,kFALSE); + if(!taskCaloQA) { + Error("RunPerformanceTrain","AliAnalysisTaskParticleCorrelation not created!"); + return; + } + mgr->AddTask(taskCaloQA); + } + else { + Printf("RunPerformanceTrain: AliAnalysisTaskParticleCorrelation - EXCLUDED!"); + } + // + // Muon Trigger + // + if(iPWG1perfMuonTrig) { + gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskMTRchamberEfficiency.C"); + AliAnalysisTaskTrigChEff *taskMuonTrig = AddTaskMTRchamberEfficiency(); + if(!taskMuonTrig) { + Error("RunPerformanceTrain","AliAnalysisTaskTrigChEff not created!"); + return; + } + mgr->AddTask(taskMuonTrig); + } + else { + Printf("RunPerformanceTrain: AliAnalysisTaskTrigChEff - EXCLUDED!"); + } + // + // Muon Efficiency + // + if(iPWG1perfMuonEff) { + // + } + else { + Printf("RunPerformanceTrain: Muon Efficiency - EXCLUDED!"); + } + // + // TOF performance + // + if(iPWG1perfTOF) { + // + } + else { + Printf("RunPerformanceTrain: TOF - EXCLUDED!"); + } + // + // PWG1 Primary Vertex + // + if(iPWG1perfPrimVertex) { + gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskVertexESD.C"); + AliAnalysisTaskVertexESD *taskPrimVertex = AddTaskVertexESD(); + if(!taskPrimVertex) { + Error("RunPerformanceTrain","AliAnalysisTaskVertexESD not created!"); + return; + } + } + else { + Printf("RunPerformanceTrain: AliAnalysisTaskVertexESD - EXCLUDED!"); + } + // + // PWG1 V0 QA + // + if (iPWG1v0QA) { + gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskV0QA.C"); + AliAnalysisTaskV0QA *taskv0QA = AddTaskV0QA(bUseMCInfo); + if(!taskv0QA) { + Error("RunPerformanceTrain","AliAnalysisTaskV0QA not created!"); + return; + } + } + else { + Printf("RunPerformanceTrain: AliAnalysisTaskV0QA - EXCLUDED!"); } // @@ -75,6 +288,7 @@ void RunPerformanceTrain(Char_t *list="esdList.txt", Int_t nFiles=20, Int_t fist return; mgr->PrintStatus(); + //mgr->StartAnalysis("local",chain, nEvents, firstEvent); mgr->StartAnalysis("local",chain); } -- 2.39.3