220 likes | 476 Views
CBM Simulation & Analysis Framework Cbmroot. Mohammad Al-Turany Denis Bertini Ilse König. The same framework can be used for Simulation and Analysis Fully ROOT based: VMC for simulation
E N D
CBM Simulation & Analysis FrameworkCbmroot Mohammad Al-Turany Denis Bertini Ilse König
The same framework can be used for Simulation and Analysis Fully ROOT based: VMC for simulation Geometry Modeller (TGeoManager) : Overlaps checking, visualization and/or navigation system of G3 IO scheme (TChain, friend TTrees, TFolders ) for persistency TTask to organize analysis data flow Completely configurable via ROOT macros Easy to maintain (only ROOT standard services are used) Reuse of HADES Geometry Interface. Reuse of HADES Parameter containers. Event merging before and/or after transport CBM Framework: Features CBM Collaboration Meeting
CBM Simulation (Old) ROOT Geant3 Geometry Manager Virtual MC Geant4 Root files MCPoints, Configuration Magnet FLUKA Target IO Manager GeoInterface Run Manager PIPE Primary Generator Cave Module STS Magnetic Field Detector Tasks Urqmd EVGEN TRD Pluto TOF Particle Generator RICH Delta Tracking Field Map ASCII ECAL digitizers CBM Collaboration Meeting
Oracle Configuration, Parameters, Geometry CBM Simulation ROOT Geant3 Root files MCPoints Geometry Manager Virtual MC Magnet Geant4 Target FLUKA PIPE GeoInterface Run Manager IO Manager Cave RunTime DataBase Module Primary Generator STS Root files Configuration, Parameters, Geometry TRD Magnetic Field Detector Tasks EVGEN TOF RICH Field Map Particle Generator ECAL ASCII Urqmd Pluto CBM Collaboration Meeting
CBM Analysis (Old) ROOT ROOT FILES Input: MC Points, Configuration Output: Hits, Digits, Tracks Geometry Manager Virtual MC IO Manager GeoInterface Run Manager Primary Generator Module Magnetic Field Detector Tasks EVGEN Delta Tracking digitizers CBM Collaboration Meeting
Oracle Configuration, Parameters, Geometry CBM Analysis Root files MCPoints, Hits, Digits, Tracks IO Manager GeoInterface Run Manager RunTime DataBase Module Primary Generator Magnetic Field Detector Tasks EVGEN Root files Configuration, Parameters, Geometry Delta digitizers Tracking CBM Collaboration Meeting
Use the copy mechanism reduce the size of ASCII files Reduce the number of Volumes in Geant Improve Geant tracking performance Oracle interface Hades geometry table design reusable Advantage: more flexibility : different inputs can be used. closer to technical drawings and analysis coordinate systems CBM Geometry Interface CBM Collaboration Meeting
Material & Geometry Interface Oracle DB TGeo Geometry/Material TGeoVolume TGeoNode TGeoMaterial CbmGeoInterface ASCII G3 Geometry/Material G3Builder RootBuilder CBM Collaboration Meeting
Simulation Macro – loading Libs // Load basic libraries gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); // Load Cbmroot libraries gSystem->Load("libGeoBase"); gSystem->Load("libCbm"); gSystem->Load("libPassive"); gSystem->Load("libGen"); gSystem->Load("libSts"); gSystem->Load("libTrd"); gSystem->Load("libTof"); gSystem->Load("libRich"); ......... CBM Collaboration Meeting
//create the Simulation Run Class CbmRunSim *fRun = new CbmRunSim(); // set the MC version used fRun->SetName("TGeant3"); //for G4 use "TGeant4" fRun->SetGeoModel("G3Native"); //use G3 native geometry // chose an output file name fRun->SetOutputFile("test.root"); Simulation Macro CBM Collaboration Meeting
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 CBM Collaboration Meeting
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 CBM Collaboration Meeting
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 CBM Collaboration Meeting
// setting a field map CbmFieldMap *fMagField= new CbmFieldMap("FIELD.v03b.map"); // 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 CBM Collaboration Meeting
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 CBM Collaboration Meeting
//Fill the Parameter containers for this run */ CbmRuntimeDb *rtdb=fRun->GetRuntimeDb(); rtdb->addRun(1); //add run with run Id CbmParRootFileIo* output=new CbmParRootFileIo(); output->open("SimPar.root","RECREATE"); rtdb->setOutput(output); CbmBaseParSet* par=(CbmBaseParSet*)(rtdb->getContainer("CbmBaseParSet")); par->SetField(fMagField); par->SetGen(primGen); par->setChanged(); par->setInputVersion(1,1); rtdb->saveOutput(); Saving Parameters: ROOT Files CBM Collaboration Meeting
gSystem->Load ( "libOra" ); CbmRuntimeDb* rtdb=fRun->GetRuntimeDb(); CbmParOraIo* ora=new CbmParOraIo; ora->open("cbm_sts_oper"); rtdb->setOutput(ora); CbmParTest* par=(CbmParTest*)(rtdb->getContainer("CbmParTest")); par->setAuthor("M. Al-Turany"); par->setDescription("Analysis interface test"); par->write(ora); Saving Parameters: Oracle CBM Collaboration Meeting
{ gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libCbm"); gSystem->Load("libTrack"); CbmRunAna *fRun= new CbmRunAna(); fRun->SetInputFile(“/d/STS_AuAu25Gev_Urqmd.root"); fRun->SetOutputFile(“trackOutput.root"); Analysis Macro CBM Collaboration Meeting
CbmTrack *tr= new CbmTrack("Tracking Algorithm"); fRun->AddTask(tr); CbmRuntimeDb* rtdb=fRun->GetRuntimeDb(); CbmParRootFileIo* input=new CbmParRootFileIo(); input->open("test.root"); rtdb->setFirstInput(input); CbmBaseParSet* par = (CbmBaseParSet*)(rtdb->getContainer ("CbmBaseParSet") ); rtdb->initContainers(1); // runId = 1 par->print(); fRun->Init(); fRun->Run(); Analysis Macro: Reading Parameters CBM Collaboration Meeting
gSystem->Load ( "libOra" ); CbmRunAna * fRun = new CbmRunAna(); CbmRuntimeDb* rtdb=fRun->GetRuntimeDb(); CbmParOraIo* ora=new CbmParOraIo(); ora->open(); rtdb->setFirstInput(ora); CbmGenericParOraIo* genio= (CbmGenericParOraIo*)(ora->getDetParIo("CbmGenericParIo")); CbmParTest* par=(CbmParTest*)(rtdb->getContainer("CbmParTest")); genio->readFromLoadingTable(par,1); // runId =1 par->print(); par->printParams(); Reading Parameters: Oracle CBM Collaboration Meeting
Chaining mechanism supported in the Analysis: { // … CbmRunAna *fRun = new CbmRunAna(); fRun->SetInputFile(“myfile1.root”); fRun->AddFile(“myfile2.root”); fRun->AddFile(“myfile3.root”); // loop over all entries fRun->Run(); } Chaining root files CBM Collaboration Meeting
The G3 Native geometry builder is implemented, the validation of the modified G3 is being performed. (TGeo as a navigation system for G3) Inconsistency in the Cerenkov effect has been found and a report has been send to the VMC group. Hades spectrometer has been fully integrated Gives us the opportunity to tune Geant4 (cuts/physics list …) and compare with real Data ! Validate TGeo and G3 with data Realistic test of the framework. HADES Parameter containers are implemented and ready to use The Hades Oracle interface is integrated within the framework Summary CBM Collaboration Meeting