void runClusterVisualisation(TString filename, TString paramFile, int paramSet=0, // 0 = FOPI, 1 = PANDA, 2 = ALICE bool sim=false, bool pre=false, TString digifile="", TString mcfilename="") { // ---- Load libraries ------------------------------------------------- //gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C"); rootlogon(); char * clustvis; clustvis = getenv ("CLUSTVIS"); if (clustvis==NULL){ std::cerr<<"WARNING: environment variable CLUSTVIS is not set, TpcClustVis is not built!"<DynamicPathName("libTpcEve", kTRUE)) != TString("")) gSystem->Load("libTpcEve"); else{ std::cerr<<"Library TpcEve not found. Make sure your ROOT is compiled with EVE"<Get("cbmsim"); if (sim) { if(digifile=="") { TString digifile=filename; digifile.ReplaceAll("reco.root", "raw.root"); } if(mcfilename=="") { TString mcfilename=filename; mcfilename.ReplaceAll("reco.root", "mc.root"); } } if(digifile.Length()>2){ tree->AddFriend("cbmsim",digifile); } TEveManager::Create(); TpcClustVis* clustVis = TpcClustVis::getInstance(); clustVis->reset(); clustVis->setTree(tree); if(mcfilename.Length()>2 && sim) { TFile* mcfile = new TFile(mcfilename); TTree* mctree = (TTree*)mcfile->Get("cbmsim"); clustVis->setMCTree(mctree); } TString geoFile; double MagField; TString basedir = gSystem->Getenv("VMCWORKDIR"); TString geoFile; geoFile.Form("$FOPI2ROOT/fopigeometry/FopiGeom_s339%5.1f.root",0); TString cmd; cmd.Form(".! root -b -q '$FOPI2ROOT/fopigeometry/FopiGeom.C(%f,\"%s\",\"%s\",\"%s\",kFALSE)'",0.,"carbon","tpc/parfiles/dummyAlignment.tpc.txt",geoFile.Data(),kTRUE,kFALSE); gROOT->ProcessLine(cmd); //geoFile="$VMCWORKDIR/geometry/tpc_prototype_long_ArCO2.root"; if(paramSet==0){ // standard testBench Settings MagField=6.; //geoFile="$VMCWORKDIR/geometry/tpc_prototype_long_ArCO2.root"; // todo: kalman crashes // geoFile="$VMCWORKDIR/tpc/TestBench/FOPIGeo.root"; // this works clustVis->setRiemannscale(8.6); } else if(paramSet==1){ // standard PANDA SIM Settings MagField=20.; //geoFile="$VMCWORKDIR/geometry/TPC_V1.1.root"; // todo: kalman crashes //geoFile="$VMCWORKDIR/tpc/TestBench/FOPIGeo.root"; // this works // geoFile="$VMCWORKDIR/geometry/tpc_prototype_ArCo2.root"; //geoFile="$VMCWORKDIR/geometry/tpc_prototype_ArCO2.root"; clustVis->setRiemannscale(24.6); } else if(paramSet==2){ // ALICE IROC Prototype Settings MagField=0.; //geoFile="$VMCWORKDIR/geometry/TPC_V1.1.root"; // todo: kalman crashes //geoFile="$VMCWORKDIR/tpc/TestBench/FOPIGeo.root"; // this works // geoFile="$VMCWORKDIR/geometry/tpc_prototype_ArCo2.root"; //geoFile="$VMCWORKDIR/geometry/tpc_prototype_ArCO2.root"; clustVis->setRiemannscale(80); //coordinates in x: 85.225 - 131.725, y: -21.4 - 21.4, z: 0 - 10.6 cm, therefore riemann scale was blown up to } else{ std::cout<<"use paramSet 0 or 1"<Getenv("VMCWORKDIR"); FairRunAna* fRun = new FairRunAna(); //fRun->SetInputFile(filename); fRun->SetOutputFile("dummy.out.root"); //--- Parameter database --- FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParAsciiFileIo* parInput1 = new FairParAsciiFileIo(); parInput1->open(paramFile.Data(),"in"); rtdb->setFirstInput(parInput1); rtdb->Print(); TpcDigiPar* par = (TpcDigiPar*) rtdb->getContainer("TpcDigiPar"); par->setInputVersion(fRun->GetRunId(),1); par->setChanged(kTRUE); fRun->SetGeomFile(geoFile); PndConstField *fMagField=new PndConstField(); fMagField->SetField(0., 0. , MagField ); fMagField->SetFieldRegion(-500, 500,-500, 500, -2000, 2000); fRun->SetField(fMagField); GFFieldManager::getInstance()->init(new PndFieldAdaptor(fRun->GetField())); GFMaterialEffects::getInstance()->init(new GFTGeoMaterialInterface()); // ----- Intialise and run -------------------------------------------- std::cout<<"initializing\n"; fRun->Init(); std::cout<<"done initializing\n"; // Initialize the Digimapper: TpcDigiPar* tpcpar = FairRun::Instance()->GetRuntimeDb()->getContainer("TpcDigiPar"); TpcDigiMapper::getInstance()->init(tpcpar); //TpcDigiMapper::getInstance()->forceManualDriftVel(false); // DONE Initialize the Digimapper with a dummy run clustVis->setFieldZ(MagField); clustVis->init(tpcpar->getGain()); clustVis->setDigiBranchName("TpcDigi"); if (pre) clustVis->setClusterBranchName("TpcPreCluster"); else clustVis->setClusterBranchName("TpcCluster"); TGeoManager* geom = new TGeoManager("Geometry", "Geane geometry"); TGeoManager::Import(geoFile); clustVis->open(); }