From ae8c1d56e1c91ed534e3e32b1341baf69d3a25b4 Mon Sep 17 00:00:00 2001 From: cvetan Date: Wed, 18 Feb 2009 10:01:49 +0000 Subject: [PATCH] Updated event embedding test suite (Adam) --- test/embedding/Config.C | 61 ++++++++++++----------------------------- test/embedding/rec.C | 38 ++++++++++++++++++++----- test/embedding/sim.C | 30 +++++++++++++++++--- test/embedding/simrun.C | 35 +++++++++++++++-------- 4 files changed, 97 insertions(+), 67 deletions(-) diff --git a/test/embedding/Config.C b/test/embedding/Config.C index f9f952805c7..e96e7813bfd 100644 --- a/test/embedding/Config.C +++ b/test/embedding/Config.C @@ -40,7 +40,8 @@ #include "FMD/AliFMDv1.h" #include "MUON/AliMUONv1.h" #include "PHOS/AliPHOSv1.h" -#include "PHOS/AliPHOSSimParam.h" + +#include "PHOS/AliPHOSv1.h" #include "PMD/AliPMDv1.h" #include "T0/AliT0v1.h" #include "EMCAL/AliEMCALv2.h" @@ -222,6 +223,8 @@ void Config() Float_t thmin = EtaToTheta(1); // theta min. <---> eta max Float_t thmax = EtaToTheta(-1); // theta max. <---> eta min gener->SetThetaRange(thmin,thmax); + gener->SetProjectile("A",208,82); + gener->SetTarget("A",208,82); AliGenTherminator *genther = new AliGenTherminator(); genther->SetFileName("event.out"); @@ -276,23 +279,27 @@ void Config() // FIELD // - AliMagF* field = 0x0; +// Field + + // AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG); + // field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagFCheb("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::kNoField)); +// field = new AliMagFCheb("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); } printf("\n \n Comment: %s \n \n", comment.Data()); - TGeoGlobalMagField::Instance()->SetField(field); + // TGeoGlobalMagField::Instance()->SetField(field); rl->CdGAFile(); Int_t iABSO = 1; Int_t iACORDE= 0; Int_t iDIPO = 1; - Int_t iEMCAL = 0; + Int_t iEMCAL = 1; Int_t iFMD = 1; Int_t iFRAME = 1; Int_t iHALL = 1; @@ -301,7 +308,7 @@ void Config() Int_t iMUON = 1; Int_t iPHOS = 1; Int_t iPIPE = 1; - Int_t iPMD = 0; + Int_t iPMD = 1; Int_t iHMPID = 1; Int_t iSHIL = 1; Int_t iT0 = 1; @@ -412,23 +419,6 @@ void Config() //=================== TRD parameters ============================ AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator"); - AliTRDgeometry *geoTRD = TRD->GetGeometry(); - // Partial geometry: modules at 0,8,9,17 - // starting at 3h in positive direction - geoTRD->SetSMstatus(1,0); - geoTRD->SetSMstatus(2,0); - geoTRD->SetSMstatus(3,0); - geoTRD->SetSMstatus(4,0); - geoTRD->SetSMstatus(5,0); - geoTRD->SetSMstatus(6,0); - geoTRD->SetSMstatus(7,0); - geoTRD->SetSMstatus(10,0); - geoTRD->SetSMstatus(11,0); - geoTRD->SetSMstatus(12,0); - geoTRD->SetSMstatus(13,0); - geoTRD->SetSMstatus(14,0); - geoTRD->SetSMstatus(15,0); - geoTRD->SetSMstatus(16,0); } if (iFMD) @@ -449,25 +439,7 @@ void Config() if (iPHOS) { //=================== PHOS parameters =========================== - AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP"); - //Set simulation parameters different from the default ones. - AliPHOSSimParam* simEmc = AliPHOSSimParam::GetInstance() ; - - // APD noise of warm (+20C) PHOS: - // a2 = a1*(Y1/Y2)*(M1/M2), where a1 = 0.012 is APD noise at -25C, - // Y1 = 4.3 photo-electrons/MeV, Y2 = 1.7 p.e/MeV - light yields at -25C and +20C, - // M1 = 50, M2 = 50 - APD gain factors chosen for t1 = -25C and t2 = +20C, - // Y = MeanLightYield*APDEfficiency. - - Float_t apdNoise = 0.012*2.5; - simEmc->SetAPDNoise(apdNoise); - - //Raw Light Yield at +20C - simEmc->SetMeanLightYield(18800); - - //ADC channel width at +18C. - simEmc->SetADCchannelW(0.0125); } @@ -531,9 +503,10 @@ AliGenerator* MbPhojet() // // DPMJET #if defined(__CINT__) - gSystem->Load("libdpmjet"); // Parton density functions - gSystem->Load("libTDPMjet"); // Parton density functions #endif + gSystem->Load("libdpmjet"); // Parton density functions + gSystem->Load("libTDPMjet"); // Parton density functions + AliGenDPMjet* dpmjet = new AliGenDPMjet(-1); dpmjet->SetMomentumRange(0, 999999.); dpmjet->SetThetaRange(0., 180.); diff --git a/test/embedding/rec.C b/test/embedding/rec.C index a1060f443c2..0e4974cf31e 100644 --- a/test/embedding/rec.C +++ b/test/embedding/rec.C @@ -1,17 +1,41 @@ void rec(Int_t embrun=0) { - new AliRun("gAlice","The ALICE Off-line Simulation Framework"); +// new AliRun("gAlice","The ALICE Off-line Simulation Framework"); AliReconstruction reco; reco.SetUniformFieldTracking(kFALSE); reco.SetWriteESDfriend(kTRUE); reco.SetWriteAlignmentData(kFALSE); - AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam(); - AliTPCReconstructor::SetRecoParam(tpcRecoParam); - AliTPCReconstructor::SetStreamLevel(0); +// reco.SetRecoParam("ITS",AliITSRecoParam::GetHighFluxParam()); +// reco.SetRecoParam("TPC",AliTPCRecoParam::GetHighFluxParam()); +// reco.SetRecoParam("TRD",AliTRDrecoParam::GetHighFluxParam()); +// reco.SetRecoParam("PHOS",AliPHOSRecoParam::GetDefaultParameters()); +// reco.SetRecoParam("MUON",AliMUONRecoParam::GetHighFluxParam()); + +// AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam(); +// AliTPCReconstructor::SetRecoParam(tpcRecoParam); +// AliTPCReconstructor::SetStreamLevel(0); reco.SetRunReconstruction("ITS TPC TRD TOF"); - reco.SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-12-Release/Ideal/"); - reco.SetRunQA(kFALSE); - reco.SetRunGlobalQA(kFALSE); +// reco.SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"); +// reco.SetRunQA(kFALSE); +// reco.SetRunGlobalQA(kFALSE); + reco.SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + if (embrun == 1) { + reco.SetSpecificStorage("GRP/GRP/Data", + Form("local://%s/../BackgroundFull",gSystem->pwd())); + } + else { + reco.SetSpecificStorage("GRP/GRP/Data", + Form("local://%s",gSystem->pwd())); + } + reco.SetRunQA("ALL:ALL") ; + + AliQA::SetQARefStorage("local://$ALICE_ROOT/OCDB") ; + + for (Int_t det = 0 ; det < AliQA::kNDET ; det++) { + reco.SetQACycles(det, 999) ; + reco.SetQAWriteExpert(det) ; + } + TStopwatch timer; timer.Start(); reco.Run(); diff --git a/test/embedding/sim.C b/test/embedding/sim.C index 87f22d73692..2fd042c5bd2 100644 --- a/test/embedding/sim.C +++ b/test/embedding/sim.C @@ -1,6 +1,17 @@ void sim(Int_t embrun) { AliSimulation sim; + if (embrun == 4) { + AliCDBManager *cdbm = AliCDBManager::Instance(); + cdbm->SetRun(atoi(gSystem->Getenv("DC_RUN"))); + cdbm->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + cdbm->SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd())); + sim.SetMakeSDigits("ITS TPC TRD TOF"); + + sim.ConvertRaw2SDigits("raw.root","AliESDs.root"); + return; + } + if (embrun == 2) { sim.SetRunGeneration(kFALSE); sim.SetMakeSDigits(""); @@ -13,10 +24,21 @@ void sim(Int_t embrun) sim.SetMakeDigits("ITS TPC TRD TOF"); sim.SetWriteRawData("ITS TPC TRD TOF","raw.root",kTRUE); if (embrun == 1) - sim.MergeWith("../Background/galice.root",1); - sim.SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-12-Release/Full/"); - sim.SetRunHLT(""); - sim.SetQA(kFALSE); + sim.MergeWith("../BackgroundSDigits/galice.root",1); + + sim.SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + sim.SetSpecificStorage("GRP/GRP/Data", + Form("local://%s",gSystem->pwd())); + sim.SetRunQA(":") ; + AliQA::SetQARefStorage("local://$ALICE_ROOT/OCDB") ; + + for (Int_t det = 0 ; det < AliQA::kNDET ; det++) { + sim.SetQACycles(det, 1) ; + } + +// sim.SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-15-Release/Full/"); +// sim.SetRunHLT(""); +// sim.SetQA(kFALSE); sim.Run(1); } diff --git a/test/embedding/simrun.C b/test/embedding/simrun.C index f5e27acde9d..e1c5d8a1be3 100644 --- a/test/embedding/simrun.C +++ b/test/embedding/simrun.C @@ -70,11 +70,7 @@ gSystem->Setenv("ALIMDC_RAWDB2","./mdc2"); gSystem->Setenv("ALIMDC_TAGDB","./mdc1/tag"); gSystem->Setenv("ALIMDC_RUNDB","./mdc1/meta"); - cout<< "SIMRUN:: Run " << gSystem->Getenv("DC_RUN") << " Event " << gSystem->Getenv("DC_EVENT") - << " Process " << gSystem->Getenv("DC_RUN_TYPE") - << " minpthard " << gSystem->Getenv("PTHARDMIN") - << " maxpthard " << gSystem->Getenv("PTHARDMAX") - << " minpt " << gSystem->Getenv("PTGAMMAPI0MIN") + cout << "SIMRUN:: Run " << gSystem->Getenv("DC_RUN") << " Event " << gSystem->Getenv("DC_EVENT") << endl; @@ -82,16 +78,31 @@ gSystem->Setenv("CONFIG_EMBEDDING","kBackground"); cout<<">>>>> BACKGROUND SIMULATION <<<<<"<Exec("mkdir Background"); - gSystem->Exec("cp Config.C Background/"); - gSystem->Exec("cp sim.C Background/"); - gSystem->Exec("cp rec.C Background/"); - gSystem->ChangeDirectory("Background/"); + gSystem->Exec("mkdir BackgroundFull"); + gSystem->Exec("cp Config.C BackgroundFull/"); + gSystem->Exec("cp sim.C BackgroundFull/"); + gSystem->Exec("cp rec.C BackgroundFull/"); + gSystem->ChangeDirectory("BackgroundFull/"); gSystem->Exec("aliroot -b -q 'sim.C(0)' > sim.log 2>&1"); cout<<">>>>> BACKGROUND RECONSTRUCTION <<<<<"<Exec("aliroot -b -q 'rec.C(0)' > rec.log 2>&1"); gSystem->ChangeDirectory("../"); + // Convert Raw to SDigits + cout << ">>>>> CONVERTING RAW 2 SDIGITS <<<<<" << endl; + gSystem->Exec("mkdir Background"); + gSystem->Exec("cp BackgroundFull/raw.root Background/"); + gSystem->Exec("cp BackgroundFull/AliESDs.root Background/"); + gSystem->Exec("cp -a BackgroundFull/GRP Background/"); + gSystem->Exec("cp sim.C Background/"); + gSystem->ChangeDirectory("Background/"); + gSystem->Exec("aliroot -b -q 'sim.C(4)' > sim.log 2>&1"); + gSystem->ChangeDirectory("../"); + gSystem->Exec("mkdir BackgroundSDigits"); + gSystem->Exec("cp Background/*SDigits.root BackgroundSDigits"); + gSystem->Exec("cp BackgroundFull/galice.root BackgroundSDigits/"); + gSystem->Exec("cp BackgroundFull/AliESDs.root BackgroundSDigits/"); + // Merged simulation gSystem->Setenv("CONFIG_EMBEDDING","kMerged"); @@ -108,7 +119,7 @@ // Pure signal re-reconstruction gSystem->Setenv("CONFIG_EMBEDDING","kSignal"); - + cout<<">>>>> SIGNAL SIMULATION <<<<<<"<< endl; gSystem->Exec("mkdir Signal"); gSystem->Exec("cp Config.C Signal/"); @@ -122,7 +133,7 @@ cout<<">>>>> SIGNAL RECONSTRUCTION <<<<<"<Exec("aliroot -b -q 'rec.C(2)' > rec.log 2>&1"); gSystem->ChangeDirectory("../"); - + // cout<<">>>>> TAG <<<<<"<Exec("aliroot -b -q tag.C > tag.log 2>&1"); // cout<<">>>>> CHECK ESD <<<<<"<