int eventDisplay(TString inFile = "sim.root", TString parFile="par.root", TString hitFile = "hit.root", TString outid="n"){ // ----- Reconstruction run ------------------------------------------- FairRunAna *fRun= new FairRunAna(); fRun->SetInputFile(inFile); fRun->AddFriend(hitFile); fRun->SetOutputFile("tst.root"); FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parInput1 = new FairParRootFileIo(); parInput1->open(parFile); rtdb->setFirstInput(parInput1); FairEventManager *fMan= new FairEventManager(); FairMCTracks *Track = new FairMCTracks ("Monte-Carlo Tracks"); FairMCPointDraw *PndBarPoint = new FairMCPointDraw ("DrcBarPoint",kViolet, kFullSquare); FairMCPointDraw *PndEVPoint = new FairMCPointDraw ("DrcEVPoint",kViolet, kFullSquare); FairMCPointDraw *PndPdPoint = new FairMCPointDraw ("DrcPDPoint",kBlue, kFullSquare); PndDrcAccuDigiPixelDraw *PndAccuDigi = new PndDrcAccuDigiPixelDraw ("DrcPDHit",hitFile,7); //7. //3 //0.5 fMan->AddTask(Track); fMan->AddTask(PndBarPoint); fMan->AddTask(PndEVPoint); fMan->AddTask(PndPdPoint); fMan->AddTask(PndAccuDigi); fMan->Init(1,5); gGeoManager->SetNsegments(100); TIter next((TObjArray*)gGeoManager->GetListOfVolumes()); TGeoVolume *vol; while((vol=(TGeoVolume*)next())){ TString volumename = vol->GetName(); if(!volumename.Contains("Drc")) vol->SetVisibility(kFALSE); if(volumename.Contains("DrcBarSupport")) vol->SetVisibility(kFALSE); if(volumename.Contains("DrcAirBox")) vol->SetTransparency(80); if(volumename.Contains("DrcEVSensor")) vol->SetTransparency(80); if(volumename.Contains("DrcBarSensor")) vol->SetTransparency(80); if(volumename.Contains("DrcLENS")) vol->SetTransparency(90); if(volumename.Contains("DrcMirr")) vol->SetTransparency(50); if(volumename.Contains("DrcEVgrease")) vol->SetTransparency(90); //vol->SetTransparency(0); // vol->SetLineColor(17); } TFile* fi = new TFile("vgeo.root","RECREATE"); TGeoVolume *topvol = gGeoManager->GetVolume("cave"); topvol->CheckOverlaps(0.0001, ""); gGeoManager->CheckOverlaps(0.00001,""); // [cm] TObjArray *listOfOverlaps = gGeoManager->GetListOfOverlaps(); cout<GetEntries()<Print(); gGeoManager->SetTopVolume(topvol); gGeoManager->CloseGeometry(); topvol->Write(); FairEventManager* fm = FairEventManager::Instance(); fm->NextEvent(); TEveTrackList *eltrack = (TEveTrackList*) fm->FindChild("Cherenkov"); int b=0; Double_t x,y,z; Bool_t storePYtracks = false; if(storePYtracks){ TEveElement::List_t ll = eltrack->RefChildren(); ofstream file; file.open ("trackst.py"); for ( TEveElement::List_i ii = ll.begin(); ii != ll.end();++ii){ TEveTrack * tr = (TEveTrack*)(*ii); Int_t size = tr->Size(); if(size<10) continue; TString blendtrack = "listOfVectors = ["; for(Int_t i=0; iGetPoint(i,x,y,z); blendtrack += Form("Vector((%f,%f,%f)),",x,y,z); } blendtrack = blendtrack.Strip(TString::kTrailing,',') + "] \n"; blendtrack += Form("MakePolyLine(\"Track_%d\", \"TrackN_%d\", listOfVectors) \n",i,i); file<< blendtrack; } file.close(); } // //fm->DisableListElements(); // TEveElement *el = fm->FindChild("DrcPDPoint"); // el->Destroy(); // el = fm->FindChild("DrcEVPoint"); // el->Destroy(); TGLViewer *v = gEve->GetDefaultGLViewer(); //v->SetClearColor(0); v->SetIgnoreSizesOnUpdate(kTRUE); v->UpdateScene(kTRUE); //v->GetLightSet()->SetSpecularPower(0.6); v->GetLightSet()->SetFrontPower(0.8); TGLSAViewer *sav = (TGLSAViewer *)v; sav->SetDrawCameraCenter(false); // TGLCamera & cam=(TGLOrthoCamera &)v->CurrentCamera(); // Double_t c[] = {46.8, 8.9, -120.}; // Double_t c[] = {10, 125, -125}; // cam.Configure(16.5,1,c,-0.3,1.8); // cam.SetExternalCenter(false); // TGLCamera & cam=(TGLOrthoCamera &)v->CurrentCamera(); // Double_t c[] = {180, 0, -200}; // for hits // cam.Configure(13,1,c,-0.2,1.3); // for hits // Double_t c[] = {90, 8.9, -150.}; // cam.Configure(25,1,c,-0.4,0.9); // for geom // cam.SetExternalCenter(false); v->DoDraw(); fm->EnableListElements(); gEve->DoRedraw3D(); v->DoDraw(); v->SavePicture("geometry.png"); // v->SavePicture("anim_"+outid+".png"); return 0; }