void runTTSim(Int_t seed,Int_t pdg,Int_t nEvents,Double_t mom,std::string path,Int_t TS,Int_t Pcb, Int_t Alu) { TStopwatch timer; timer.Start(); gDebug=0; int verboseLevel = 0; // Int_t nEvents = 5000000; //FileNames TString simOutput= Form("%sSim_%lf_%d_%d.root",path.c_str(),mom,pdg,seed); TString parOutput= Form("%sParSim_%lf_%d_%d.root",path.c_str(),mom,pdg,seed); //std::string geo = "TSCracow.root"; std::string geoStandard = "TSCracow.root"; std::string geoClose = "TSCracowClose.root"; std::string geoBefore = "TSCracowCloseBefore.root"; std::string geoCloseReal = "TSCracowCloseRealistic.root"; std::string vol = "CracowDevice.root"; std::string pcbBefore = "CracowDeviceOnlyPcbBefore.root"; std::string pcbAfter = "CracowDeviceOnlyPcbAfter.root"; std::string aluBefore = "CracowDeviceOnlyAluBefore.root"; std::string aluAfter = "CracowDeviceOnlyAluAfter.root"; // Load basic libraries gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); gSystem->Load("libLmd"); FairRunSim *fRun = new FairRunSim(); // set the MC version used // ------------------------ fRun->SetName("TGeant3"); // Choose the Geant Navigation System fRun->SetOutputFile(simOutput); // Set Material file Name //----------------------- fRun->SetMaterials("media_pnd.geo"); // Create and add detectors //------------------------- FairModule *Cave= new PndCave("CAVE"); Cave->SetGeometryFileName("pndcave.geo"); fRun->AddModule(Cave); FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE); if (TS==1) Mvd->SetGeometryFileName(geoStandard.c_str()); if (TS==2) Mvd->SetGeometryFileName(geoClose.c_str()); if (TS==3) Mvd->SetGeometryFileName(geoBefore.c_str()); if (TS==4) Mvd->SetGeometryFileName(geoCloseReal.c_str()); Mvd->SetVerboseLevel(verboseLevel); fRun->AddModule(Mvd); // FairDetector FairDetector *Vol = new PndLmdDetector("LUM", kTRUE); // Vol->SetBranchNames("Device","PndMvd"); Vol->SetGeometryFileName(vol.c_str()); Vol->SetVerboseLevel(verboseLevel); fRun->AddModule(Vol); if(Alu==1 || Alu==2) { FairDetector *VolAlu = new PndGemDetector("GEM", kFALSE); if (Alu==1) VolAlu->SetGeometryFileName(aluBefore.c_str()); if (Alu==2) VolAlu->SetGeometryFileName(aluAfter.c_str()); VolAlu->SetVerboseLevel(verboseLevel); fRun->AddModule(VolAlu); } if (Pcb==1 || Pcb==2) { FairDetector *VolPcb = new PndGemDetector("GEM", kFALSE); if (Pcb==1)VolPcb->SetGeometryFileName(pcbBefore.c_str()); if (Pcb==2)VolPcb->SetGeometryFileName(pcbAfter.c_str()); VolPcb->SetVerboseLevel(verboseLevel); fRun->AddModule(VolPcb); } FairPrimaryGenerator* primGen = new FairPrimaryGenerator(); fRun->SetGenerator(primGen); // Box Generator FairBoxGenerator *fBox = new FairBoxGenerator(pdg, 1); fBox->SetPRange(mom,mom); fBox->SetThetaRange(0,0); fBox->SetPhiRange(0.,360); primGen->AddGenerator(fBox); //fRun->SetBeamMom(15); fRun->SetStoreTraj(kFALSE); // toggle this for use with EVE fRun->SetRadLenRegister(kFALSE); // toggle for material budget study fRun->Init(); // Fill the Parameter containers for this run //------------------------------------------- FairRuntimeDb *rtdb=fRun->GetRuntimeDb(); Bool_t kParameterMerged=kTRUE; FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged); output->open(parOutput.Data(),"RECREATE"); rtdb->setOutput(output); // Transport nEvents // ----------------- fRun->Run(nEvents); rtdb->saveOutput(); rtdb->print(); timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime); }