#include #include #include #include #include #include #include #include #include #include #include #include #include "COMETGeomId.hxx" #include #include #include TApplication *theApp; /// Checks whether the geometry file has overlaps. /// It will print a set of information containing the rotation, origin, and the dimensions of the geometrical volume that is causing the overlap. /// It will also draw the state of overlap with the volumes that are in conflict. int main(int argc, char* argv[]) { int argc2 = 0; char **argv2 = NULL; theApp = new TApplication("App",&argc2,argv2); if (argc != 2) std::cout<<"The command is ./oaApplyAlign_CheckOverlaps.exe "<CheckOverlaps(); int numOverlaps = gGeoManager->GetListOfOverlaps()->GetEntries(); TCanvas* ovlp[numOverlaps]; TIter next(gGeoManager->GetListOfOverlaps()); TGeoOverlap* overlap; int count = 0; char cName[100]; //TPostScript *ps = new TPostScript("Overlaps.ps",112); while ( (overlap = (TGeoOverlap*)next()) ) { if (count >= 0 && countNewPage(); sprintf(cName, "c%d", count+1); ovlp[count] = new TCanvas(cName, cName, 1024, 384); ovlp[count]->Divide(3,1); ovlp[count]->cd(1); // Draw how the volumes are overlapping and print information overlap->Draw(); // Draw the volumes causing overlaps ovlp[count]->cd(2); overlap->GetFirstVolume()->Draw(); ovlp[count]->cd(3); overlap->GetSecondVolume()->Draw(); ovlp[count]->Update(); count++; } } //ps->Close(); if (count > 0) theApp->Run(kTRUE); else std::cout << "No geometry overlaps found" << std::endl; } }