290 likes | 478 Views
MPD Simulation&Analysis Framework. Mohammad Al-Turany, Ilse K ő nig, Denis Bertini, Florian Uhlig, Oleg Rogachevsky. VHMP-2007 Dubna. Motivations The Virtual Monte Carlo concept CbmRoot Features Geometry Interface Runtime Database and Parameter Handling
E N D
MPD Simulation&Analysis Framework Mohammad Al-Turany, Ilse Kőnig, Denis Bertini, Florian Uhlig, Oleg Rogachevsky VHMP-2007 Dubna
Motivations The Virtual Monte Carlo concept CbmRoot Features Geometry Interface Runtime Database and Parameter Handling Examples (Simulation and Analysis) Summary Overview NICA@VHMP
Which simulation engine to choose? Need to move to modern and maintained MC: GEANT4 Need for Working fast ! ( LOI, TDR deadlines … ) Making reliable simulation Usually: better knowledge of “old” MC’s: GEANT3, FLUKA … A cross-check of simulation results between different MC is needed Better understanding of GEANT4 ( intrinsic cuts / physics list …) Preparing for full simulation Use of VMC (Virtual Monte Carlo ) : an interface between MCs With the same code, the user can switch between different MCs Motivations NICA@VHMP
G3 G3 transport User Code VMC G4 G4 transport FLUKA transport FLUKA Reconstruction Geometrical Modeller Visualisation Virtual Monte Carlo (VMC) NICA@VHMP
The same framework can be used for Simulation and Analysis Fully ROOT based: VMC for simulation IO scheme (TChain, friend TTrees, TFolders ) for persistency TTask to organize the analysis data flow Completely configurable via ROOT macros Easy to maintain (only ROOT standard services are used) Geometry / navigation system models G3/G4 Native geometrical models Geometry Modeller (TGeoManager) ( G3/FLUKA + G4?) CbmRoot Features NICA@VHMP
Geant3 ROOT Geometry Manager Virtual MC Geant4 Magnet FLUKA Target IO Manager GeoInterface Run Manager PIPE RunTime DataBase Cave Module Primary Generator Magnetic Field STS Root files Configuration, Parameters, Geometry Detector TRD EVGEN Tasks TOF Oracle Configuration, Parameters, Geometry Particle Generator RICH Pluto Field Map ECAL ASCII Urqmd CbmRoot: Simulation NICA@VHMP
Oracle Configuration, Parameters, Geometry MpdRoot: Simulation Geant3 ROOT Geometry Manager Virtual MC Geant4 Magnet FLUKA PIPE IO Manager GeoInterface Run Manager Cave RunTime DataBase Module Primary Generator Magnetic Field TPC Root files Configuration, Parameters, Geometry Detector IT Tasks EVGEN TOF Particle Generator ZDC Field Map Pluto ECAL Urqmd ASCII NICA@VHMP
Root files MCPoints, Hits, Digits, Tracks ROOT Geometry Manager IO Manager GeoInterface Run Manager RunTime DataBase Module Primary Generator Magnetic Field Root files Configuration, Parameters, Geometry Detector Tasks EVGEN Oracle Configuration, Parameters, Geometry digitizers Delta Tracking CbmRoot: Analysis NICA@VHMP
Creation of a volume Volume name Shape Shape parameters Medium Positioning of the volume in a mother (Node) Mother Transformation (position and rotation matrix) ASCII: Input format for the Geometry TUBE NICA@VHMP
Advantage: more flexibility : different inputs can be used. Material & Geometry Interface TGeo Geometry/Material TGeoVolume TGeoNode TGeoMaterial Oracle DB CbmGeoInterface ASCII G3 Geometry/Material G3Builder RootBuilder XYZ Geometry/Material Root files XYZBuilder NICA@VHMP
The Runtime Database is the manager class for all Parameter containers: Creation, Initialization, Output Runtime Database Created in the init() function of the tasks via the container factories or in the macro Container Factories 2 Inputs 1 Output List of Parameter Containers List of Runs read() write() Filled during initialization ASCII File ROOT File Oracle IO defined in the macro CBM Runtime Database NICA@VHMP
Dynamic Tree creation at initialisation time Simulation: CbmDetector::Init() Analysis: CbmTask::Init() ( automatic partial IO ) Chaining Input data TChain services Connection of Data levels Use of Root Friend mechanism Combined Chaining & Friend Mechanism IO Features NICA@VHMP
Simulation Macro – loading Libs // Load basic libraries gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); // Load CBMROOT libraries gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libCbm"); gSystem->Load("libPassive"); gSystem->Load("libGen"); gSystem->Load("libSts"); gSystem->Load("libTrd"); gSystem->Load("libTof"); gSystem->Load("libRich"); Base Libs Cbm Spec. Libs NICA@VHMP
//create the Run Class CbmRunSim *fRun = new CbmRunSim(); // set the MC version used fRun->SetName("TGeant3"); //for G4 use "TGeant4" //Choose the Geant 3 Navigation System fRun->SetGeoModel("G3Native"); // "TGeo" flag in case of TGeoManager // choose an output file name fRun->SetOutputFile("test.root"); Simulation Macro NICA@VHMP
CbmModule *Cave= new CbmCave("WORLD"); Cave->SetGeometryFileName("PASSIVE/CAVE", "v03a"); fRun->AddModule(Cave); CbmModule *Target= new CbmTarget("Target"); Target->SetGeometryFileName("PASSIVE/TARGET", "v03a"); fRun->AddModule(Target); CbmModule *Pipe= new CbmPIPE("PIPE"); Pipe->SetGeometryFileName("PASSIVE/PIPE", "v03a"); fRun->AddModule(Pipe); CbmModule *Magnet= new CbmMagnet("MAGNET"); Magnet->SetGeometryFileName("PASSIVE/MAGNET", "v03a"); fRun->AddModule(Magnet); Simulation Macro- Create Modules NICA@VHMP
CbmDetector *STS= new CbmSts("STS", kTRUE); STS->SetGeometryFileName("STS/STS", "v03c"); fRun->AddModule(STS); CbmDetector *TOF= new CbmTof("TOF", kTRUE ); TOF->SetGeometryFileName("TOF/TOF", "v03_v10"); fRun->AddModule(TOF); CbmDetector *TRD= new CbmTRD("TRD",kFALSE ); TRD->SetGeometryFileName("TRD/TRD", "v04b_9" ); fRun->AddModule(TRD); Simulation Macro- Create Detectors NICA@VHMP
CbmPrimaryGenerator *priGen= new CbmPrimaryGenerator(); fRun->SetGenerator(priGen); CbmUrqmdGenerator *fGen1= new CbmUrqmdGenerator("00-03fm.100ev.f14"); CbmPlutoGenerator *fGen2= new CbmPlutoGenerator("jpsi.root"); CbmParticleGenerator *fGen3= new CbmParticleGenerator(); fRun->AddGenerator(fGen1); fRun->AddGenerator(fGen2); fRun->AddGenerator(fGen3); Simulation Macro-Event Generators NICA@VHMP
// setting a field map CbmField *fMagField= new CbmField("Dipole Field"); fMagField->readAsciifile("FieldIron.map"); // read ASCII file fMagField->readRootfile("FieldIron.root"); // read Root file // setting a constant field CbmConstField *fMagField=new CbmConstField(); fMagField->SetFieldXYZ(0, 30 ,0 ); // values are in kG // MinX=-75, MinY=-40,MinZ=-12 ,MaxX=75, MaxY=40 ,MaxZ=124 ); fMagField->SetFieldRegions(-74, -39 ,-22 , 74, 39 , 160 ); // values are in cm fRun->SetField(fMagField); Simulation Macro-Magnetic Field NICA@VHMP
fRun->Init(); // Initialize the simulation Simulation: 1. Initialize the VMC (Simulation) 2. Initialize Tasks (if they are used in Simulation) fRun->Run(NoOfEvent); //Run the Simulation Simulation Macro- Run Simulation NICA@VHMP
CBM Detector Geometry NICA@VHMP
MPD Detector Geometry NICA@VHMP
{ gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libCbm"); gSystem->Load("libITrack"); CbmRunAna *fRun= new CbmRunAna(); fRun->SetInputFile(“/d/STS_AuAu25Gev_Urqmd.root"); fRun->SetOutputFile(“trackOutput.root"); Analysis Macro NICA@VHMP
Tasks can be organized into a hierarchy and displayed in the browser. The CBMTask base class (TTask): Init(); //Initialization Exec(Option_t * option); In Analysis macro: { // Algorithm definition CbmStsTrackFinder *tr = CbmStsTrackFinder("track finder"); // Add the algorithm in the list of algorithms fRun->AddTask(tr); } Algorithms : CBMTask NICA@VHMP
Tasks Mechanism • CBMTask *Task1=new CBMTask("Task1") CBMTask *Task2=new CBMTask("Task2") • CBMTask *Task3=new CBMTask("Task3") • CBMTask *Task4=new CBMTask("Task4") • CBMTask *Task5=new CBMTask("Task5") • CBMTask *Task6=new CBMTask("Task6") • Task1->Add(Task2) • Task1->Add(Task3) • Task2->Add(Task4) • Task2->Add(Task5) • Task3->Add(Task6) NICA@VHMP
CbmTask Parameters Data CbmParIo RunId1 RunId1 CbmTask::SetContainers() CbmTask::init() Par. Cont. Sim. Data CbmTask::Exec() CbmParIo CbmTask::Reinit() RunId2 RunId2 Par. Cont Sim. Data CbmTask::Exec() Initialisation scheme (Analysis) File=1 File=2 NICA@VHMP
Track Visualization NICA@VHMP
FAIRROOT was tested for CBM, PANDA, HADES and NUSTAR experiments New branch of FAIRROOT – MpdRoot framework for MPD detector is implemented now First released will be in October 2007 Work on detector geometry and tracking is going on. Summary NICA@VHMP
{ gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libCbm"); ...... TFile* file = new TFile("test.root"); TGeoManager *geoMan = (TGeoManager*) file->Get("CBMGeom"); TCanvas* c1 = new TCanvas("c1", "", 100, 100, 800, 800); c1->SetFillColor(10); geoMan->DrawTracks("same/Nneutron"); geoMan->SetVisLevel(3); geoMan->GetMasterVolume()->Draw("same"); } Example: Visualization macro NICA@VHMP
CBM Silicon Tracker Station NICA@VHMP