Changeset 100 in svn for trunk/Utilities
- Timestamp:
- Dec 18, 2008, 2:39:26 PM (16 years ago)
- Location:
- trunk/Utilities
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/FROG/Includes/FROG/FROG_Chunk.h
r95 r100 114 114 #define C_PRIMITIVE_PARTIALSPHERE 41031 // Contains a sphere 115 115 #define C_PRIMITIVE_CYLINDER 41040 // Contains a cylinder 116 #define C_PRIMITIVE_CONE 41080 // Contains a cylinder 116 117 117 118 #define C_PRIMITIVE_SURFACE 42000 // Contains Chunks related to Surface Primtive (Plane, Disc, ...) -
trunk/Utilities/FROG/Includes/FROG/FROG_Element_Tools.cpp
r95 r100 139 139 } 140 140 break; 141 142 case C_PRIMITIVE_CONE : 143 NObjs = (chunk_size-chunk_read)/(FROG_Element_Primitive_Cone::sizeOf()-6); 144 for(int i=0;i<NObjs;i++){ 145 mother->addDaughter(new FROG_Element_Primitive_Cone(pFile)); 146 chunk_read += FROG_Element_Primitive_Cone::sizeOf()-6; 147 } 148 break; 149 141 150 142 151 case C_PRIMITIVE_CUSTOM_SURFACE : -
trunk/Utilities/FROG/Includes/FROG/FROG_Element_Tools.h
r95 r100 25 25 #include "FROG_Element_Primitive_PartialSphere.h" 26 26 #include "FROG_Element_Primitive_Cylinder.h" 27 #include "FROG_Element_Primitive_Cone.h" 27 28 28 29 #include "FROG_Element_Primitive_CustomSurface.h" -
trunk/Utilities/FROG/main.cpp
r95 r100 5 5 void Loading() 6 6 { 7 char Buffer[1024]; 8 7 9 switch(mLoading_I) 8 10 { … … 43 45 ViewScreen = new FROG_View_Screen("Screen"); 44 46 ViewScreen->Reshape(WINDOW_WIDTH,WINDOW_HEIGHT); 45 ViewScreen->LoadingInProgress(0.0f,"Reading config.txt",Fonts,LogoTexture); 47 sprintf(Buffer,"Reading %s",inputConfig.c_str()); 48 ViewScreen->LoadingInProgress(0.0f,Buffer,Fonts,LogoTexture); 46 49 47 50 48 LoadCard( "config.txt");51 LoadCard(inputConfig.c_str()); 49 52 if(!Card->IsTagPresent("InputGeom") && !Card->IsTagPresent("InputVisFile")){ 50 53 printf("There is no .geom file neither than .vis file in the Config card\n"); 51 printf("FROG will stop. Please update the Config card ( config.txt)\n");54 printf("FROG will stop. Please update the Config card (%s)\n",inputConfig.c_str()); 52 55 exit(0); 53 56 } … … 61 64 inputGeom = Card->GetStringVector("InputGeom"); 62 65 for(unsigned int g=0;g<inputGeom.size();g++){ 63 inputGeom[g] = string((char*)DownLoadFile( (char*)inputGeom[g].c_str() ) );66 inputGeom[g] = string((char*)DownLoadFile( (char*)inputGeom[g].c_str(), AbsolutePath.c_str() ) ); 64 67 } 65 68 } … … 67 70 68 71 case 2: 72 /* 69 73 ViewScreen->LoadingInProgress(10.0f,"Downloading Events\n(if necessary)",Fonts,LogoTexture); 70 74 … … 72 76 inputVisFileFromCard = Card->GetString("InputVisFile"); 73 77 } 74 inputVisFile = string((char*)DownLoadFile( (char*)inputVisFileFromCard.c_str() ) ); 78 inputVisFile = string((char*)DownLoadFile( (char*)inputVisFileFromCard.c_str(), AbsolutePath.c_str() ) ); 79 */ 75 80 break; 76 81 … … 87 92 } 88 93 frogObjects_ = new FROG_Objects_Extended(geom,NULL,Card, Fonts); 94 89 95 90 96 }break; 91 97 92 98 case 4:{ 93 if(strcmp(inputVisFile.c_str(),"")==0){ 94 ViewScreen->LoadingInProgress(80.0f,"No Event Files has been Given",Fonts,LogoTexture); 95 }else{ 96 ViewScreen->LoadingInProgress(80.0f,(char*)inputVisFile.c_str(),Fonts,LogoTexture); 97 } 99 ViewScreen->LoadingInProgress(80.0f,"Loading .vis Files",Fonts,LogoTexture); 98 100 99 101 if(events)delete events; 100 events = new FROG_Events(); 101 events->Load(inputVisFile.c_str()); 102 events->frogObjects_ = frogObjects_; 103 events->Init(frogObjects_); 102 events = new FROG_Events(frogObjects_); 103 events->Load(inputVisFileFromCommand); 104 104 events->readEventToDisplay(Card); 105 if(SCREENSAVER)eventNumber = rand()%((int)events->NumberOfEvents()); 105 if(SCREENSAVER)eventNumber = rand()%((int)events->NumberOfEvents()); 106 106 event = events->GoToEvent(eventNumber); 107 108 107 }break; 109 108 110 case 5:{ 109 case 5:{ 111 110 ViewScreen->LoadingInProgress(95.0f,"Views Initialisation",Fonts,LogoTexture); 112 111 113 112 ViewScreen->displayFunc_ = displaytext; 114 113 std::vector<string> ViewsName = Card->GetStringVector("ActiveViews"); 115 ViewMain = ViewScreen; 116 for(unsigned int i=0;i<ViewsName.size();i++){ 114 ViewMain = ViewScreen; 115 for(unsigned int i=0;i<ViewsName.size();i++){ 117 116 char* tmp = new char[ViewsName[i].size()+1]; 118 117 strcpy(tmp,ViewsName[i].c_str()); 119 ActiveViews.push_back(FROG_VIEW::Create(tmp,frogObjects_)); 120 } 118 ActiveViews.push_back(FROG_VIEW::Create(tmp,frogObjects_)); 119 } 121 120 ViewScreen->Reshape(WINDOW_WIDTH,WINDOW_HEIGHT); 121 122 122 for(unsigned int j=0;j<ActiveViews.size();j++){ 123 123 if(ViewMain==ViewScreen && ActiveViews[j]->IsSwapPossible()){ViewMain = ActiveViews[j];} … … 125 125 ActiveViews[j]->displayFunc_ = &display2; 126 126 } 127 ViewMain->IsActive = true; 127 ViewMain->IsActive = true; 128 128 geom->updateGeomToDisplay((void*)frogObjects_); 129 129 130 130 ViewMenu = new FROG_View_Menu("ViewMenu2",frogObjects_); 131 ViewMenu->Reshape(WINDOW_WIDTH,WINDOW_HEIGHT); 131 ViewMenu->Reshape(WINDOW_WIDTH,WINDOW_HEIGHT); 132 132 }break; 133 133 … … 155 155 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ; 156 156 157 157 158 mLoading = false; 158 159 end = time ( NULL ); … … 161 162 glutDisplayFunc (display); 162 163 glutIdleFunc (display); 164 165 glutKeyboardFunc (processNormalKeys); 166 glutSpecialFunc (processSpecialKeys); 167 168 glutMouseFunc(processMouse); 169 glutMotionFunc(processMotion); 170 if(SCREENSAVER){ 171 eventTime = 20; 172 glutPassiveMotionFunc(processPassiveMotion); 173 glutFullScreen(); 174 } 175 163 176 164 177 if(SHOOTER){ … … 207 220 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH-126,WINDOW_HEIGHT - 30,"% 10i FPS", ViewScreen->FPS); 208 221 if(mHelpScreen){ 209 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 45 ,"F1 = Open this Screen for Help"); 210 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 60 ,"F2 = Open the Display Menu"); 211 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 75 ,"F3 = use only for debug"); 212 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 90 ,"F4 = Automatic ScreenShooter (Warning)"); 213 214 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 125 ,"F5 = SimTrack : ON/OFF"); 215 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 140 ,"F6 = SimVertex : ON/OFF"); 216 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 155 ,"F7 = PSimHits : ON/OFF"); 217 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 170 ,"F8 = RecoTrack : ON/OFF"); 218 219 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 205 ,"F9 = SiStripCluster : ON/OFF"); 220 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 220 ,"F10 = EcalHits : ON/OFF"); 221 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 235 ,"F11 = HcalHits : ON/OFF"); 222 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 250 ,"F12 = MuonHit/Seg : ON/OFF"); 223 224 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 285 ,"0 = Geometry to Display : NONE"); 225 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 300 ,"9 = Geometry to Display : FULL"); 226 227 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 335 ,"LEFT = Previous Event"); 228 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 350 ,"RIGHT = Next Event"); 229 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 375 ,"UP = Increase Rotation"); 230 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 390 ,"DOWN = Decrease Rotation"); 231 232 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 425 ,"p = Zoom In"); 233 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 440 ,"m = Zoom Out"); 234 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 455 ,"f = Maximize the active view"); 235 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 470 ,"s = SlideShow : ON/OFF"); 236 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 485 ,"t = TreeMenu : ON/OFF"); 237 238 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 515 ,"ENTER = Screenshot"); 239 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 530 ,"SPACE = Rotation : ON/OFF"); 240 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 545 ,"ESCAPE = Exit"); 241 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 560 ,"q = Exit"); 242 Fonts->Font_Fixed_9_by_15->glPrint(WINDOW_WIDTH/3,WINDOW_HEIGHT - 575 ,"a = Full Screen"); 222 if(events) Fonts->Font_Fixed_9_by_15->glPrint(0,WINDOW_HEIGHT - 14,"CurrentFile = ...%s",events->CurrentFile()); 223 224 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 45 ,"F1 = Open this Screen for Help"); 225 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 60 ,"F2 = Open the Display Menu"); 226 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 75 ,"F3 = use only for debug"); 227 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 90 ,"F4 = Automatic ScreenShooter (Warning)"); 228 229 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 125 ,"F5 = SimTrack : ON/OFF"); 230 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 140 ,"F6 = SimVertex : ON/OFF"); 231 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 155 ,"F7 = PSimHits : ON/OFF"); 232 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 170 ,"F8 = RecoTrack : ON/OFF"); 233 234 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 205 ,"F9 = SiStripCluster : ON/OFF"); 235 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 220 ,"F10 = EcalHits : ON/OFF"); 236 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 235 ,"F11 = HcalHits : ON/OFF"); 237 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 250 ,"F12 = MuonHit/Seg : ON/OFF"); 238 239 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 285 ,"0 = Geometry to Display : NONE"); 240 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 300 ,"9 = Geometry to Display : FULL"); 241 242 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 335 ,"LEFT = Previous Event"); 243 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 350 ,"RIGHT = Next Event"); 244 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 375 ,"UP = Increase Rotation"); 245 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 390 ,"DOWN = Decrease Rotation"); 246 247 Fonts->Font_Fixed_9_by_15->glPrint(500,WINDOW_HEIGHT - 375 ,"PAGE UP = Previous VisFile"); 248 Fonts->Font_Fixed_9_by_15->glPrint(500,WINDOW_HEIGHT - 390 ,"PAGE DOWN = Next VisFile"); 249 250 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 425 ,"p = Zoom In"); 251 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 440 ,"m = Zoom Out"); 252 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 455 ,"f = Maximize the active view"); 253 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 470 ,"s = SlideShow : ON/OFF"); 254 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 485 ,"t = TreeMenu : ON/OFF"); 255 256 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 515 ,"ENTER = Screenshot"); 257 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 530 ,"SPACE = Rotation : ON/OFF"); 258 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 545 ,"ESCAPE = Exit"); 259 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 560 ,"q = Exit"); 260 Fonts->Font_Fixed_9_by_15->glPrint(150,WINDOW_HEIGHT - 575 ,"a = Full Screen"); 243 261 244 262 Fonts->Font_Fixed_9_by_15->glPrint(120,3,"This program has been created by Loic Quertenmont, loic.quertenmont@cern.ch"); … … 334 352 // if required by the variable updateVisFileTime 335 353 336 #ifdef linux 337 if( updateVisFileTime>0 && !Thread_Run) { 338 char* argtosend = (char*)inputVisFileFromCard.c_str(); 339 if (pthread_create (&Thread_H, NULL, DownLoadFile, (void*)argtosend) < 0) { 340 printf("pthread_create error for Thread_H\n"); 341 exit (1); 342 } 343 Thread_Run=true; 344 } 345 346 static time_t upstart = time (NULL ); 347 time_t upstop = time( NULL ); 348 if(upstop - upstart > updateVisFileTime && Thread_Run) { 349 (void)pthread_join (Thread_H, NULL); 350 351 Thread_Run=false; 352 glutDisplayFunc (Loading); 353 glutIdleFunc (Loading); 354 355 mLoading_I = 30; 356 mLoading = true; 357 start = time ( NULL ); 358 } 359 #elif macos 360 if( updateVisFileTime>0 && !Thread_Run) { 361 char* argtosend = (char*)inputVisFileFromCard.c_str(); 362 if (pthread_create (&Thread_H, NULL, DownLoadFile, (void*)argtosend) < 0) { 363 printf("pthread_create error for Thread_H\n"); 364 exit (1); 365 } 366 Thread_Run=true; 367 } 368 369 static time_t upstart = time (NULL ); 370 time_t upstop = time( NULL ); 371 if(upstop - upstart > updateVisFileTime && Thread_Run) { 372 (void)pthread_join (Thread_H, NULL); 373 374 Thread_Run=false; 375 glutDisplayFunc (Loading); 376 glutIdleFunc (Loading); 377 378 mLoading_I = 30; 379 mLoading = true; 380 start = time ( NULL ); 381 } 382 #else 354 /* 355 #ifdef windows 383 356 if( updateVisFileTime>0 && !Thread_Run) { 384 357 char* argtosend = (char*)inputVisFileFromCard.c_str(); … … 408 381 upstart = time (NULL ); 409 382 } 383 #else 384 if( updateVisFileTime>0 && !Thread_Run) { 385 char* argtosend = (char*)inputVisFileFromCard.c_str(); 386 if (pthread_create (&Thread_H, NULL, DownLoadFile, (void*)argtosend) < 0) { 387 printf("pthread_create error for Thread_H\n"); 388 exit (1); 389 } 390 Thread_Run=true; 391 } 392 393 static time_t upstart = time (NULL ); 394 time_t upstop = time( NULL ); 395 if(upstop - upstart > updateVisFileTime && Thread_Run) { 396 (void)pthread_join (Thread_H, NULL); 397 398 Thread_Run=false; 399 glutDisplayFunc (Loading); 400 glutIdleFunc (Loading); 401 402 mLoading_I = 30; 403 mLoading = true; 404 start = time ( NULL ); 405 } 406 410 407 #endif 411 408 */ 412 409 413 410 } … … 424 421 break; 425 422 case 13 :{ 426 char temp[255]; sprintf(temp," screenshot%02i.%s",SCREENSHOT,SCREENSHOT_FORMAT);423 char temp[255]; sprintf(temp,"%s%02i.%s",ScreenShotName,SCREENSHOT,SCREENSHOT_FORMAT); 427 424 SaveScreenshot(temp,WINDOW_WIDTH,WINDOW_HEIGHT, displayForScreenShot ); 428 425 SCREENSHOT++; … … 439 436 case 'r' : 440 437 case 'R' : 441 LoadCard( "config.txt");438 LoadCard(inputConfig.c_str()); 442 439 /* geom->updateGeomToDisplay(Card); 443 440 events->prim->setDisplay(0); … … 586 583 } 587 584 break; 585 586 case GLUT_KEY_PAGE_UP : 587 events->NextFile(); 588 event = events->GoToEvent(0); 589 break; 590 case GLUT_KEY_PAGE_DOWN : 591 events->PreviousFile(); 592 event = events->GoToEvent(0); 593 break; 594 588 595 case GLUT_KEY_HOME : 589 596 if(ViewMain->Type_==VIEW3D) ViewMain->cam_->Reset(); … … 681 688 ViewMain->Display_Begin(); 682 689 683 GLuint buff[ 256] = {0};690 GLuint buff[1024] = {0}; 684 691 GLint hits, view[4]; 685 692 686 glSelectBuffer( 256, buff);693 glSelectBuffer(1024, buff); 687 694 glGetIntegerv(GL_VIEWPORT, view); 688 695 glRenderMode(GL_SELECT); … … 693 700 glPushMatrix(); 694 701 glLoadIdentity(); 695 gluPickMatrix(x- 2, y-2, 4.0, 4.0, view);702 gluPickMatrix(x-4, y-4, 8.0, 8.0, view); 696 703 ViewMain->ProjectionMatrix(); 697 704 glMatrixMode(GL_MODELVIEW); … … 723 730 for (i = 0; (int)i < hits; i++) { 724 731 unsigned int tmp = names[i * 4 + 3]; 725 //printf("--> %i > %i\n",i,tmp);732 //printf("--> %i/%i > %i\n",i,hits,tmp); 726 733 if(i == NearestHit && tmp!=0){ 727 734 if(tmp>1000000){ … … 734 741 } 735 742 736 void LoadCard(const char* inputCard ) 743 void LoadCard(const char* inputCard ){ 737 744 if(Card)delete Card; 738 Card = new FROG_ReadCards( inputCard);739 745 Card = new FROG_ReadCards(AbsolutePath.c_str(),inputCard); 746 740 747 Card->GetInt (&updateVisFileTime , "updateVisFileTime"); 741 748 … … 745 752 746 753 Card->GetChar (SCREENSHOT_FORMAT,256, "Screenshot_Format"); 754 Card->GetChar (ScreenShotName,1024 , "Screenshot_Name"); 747 755 748 756 Card->GetColor(BackGround_Color , "BackGround_Color"); … … 778 786 } 779 787 if(!mAutomaticShooter){ 780 if(eventTime> 0)glutTimerFunc(1+eventTime*1000,AutomaticEventChanging, 0);788 if(eventTime>=0)glutTimerFunc(1+eventTime*1000,AutomaticEventChanging, 0); 781 789 }else{ 782 790 if(mAutomaticShooter_LastEvent == events->Current_Event){ … … 788 796 789 797 EventI++; 790 if(event && events)printf("%8u | Run %4i Event %4i | Event %4i in File Containing %4i Events\n",EventI,event->NRun_,event->NEvent_,events->Current_Event, (int)events->NumberOfEvents() -1);798 if(event && events)printf("%8u | Run %4i Event %4i | Event %4i in File Containing %4i Events\n",EventI,event->NRun_,event->NEvent_,events->Current_Event, (int)events->NumberOfEvents()); 791 799 } 792 800 … … 794 802 int main (int argc, char *argv[]) 795 803 { 796 #ifdef linux 797 #elif macos 798 799 #else 800 string ExePath = string(argv[0]); 801 unsigned int n = ExePath.rfind("frog"); 802 ExePath = ExePath.substr(0,n); 803 804 USES_CONVERSION; 805 if(SetCurrentDirectory(A2W(ExePath.c_str()))==0){ 806 printf("Was not able to change directory to %s\n",ExePath.c_str()); 807 } 808 #endif 804 string ExePath = string(argv[0]); 805 unsigned int n = ExePath.rfind("frog"); 806 AbsolutePath = ExePath.substr(0,n); 809 807 810 808 … … 821 819 if( strcmp(LowCase,"-shooter" )==0){SHOOTER = true; 822 820 }else if(strcmp(LowCase,"-s" )==0){SCREENSAVER = true; 823 }else if(len>=4 && strcmp(LowCase+len-4,".vis" )==0){inputVisFileFromCard = string(argv[i]); 824 }else if(len>=7 && strcmp(LowCase+len-7,".vis.gz")==0){inputVisFileFromCard = string(argv[i]); 821 }else if(strcmp(LowCase,"-v" )==0){ 822 printf("Fast and Realistic OpenGl Event Display : FROG\n"); 823 printf("Version : %6.3f of %s\n",FROG_VERSION,__DATE__); 824 printf("Authors List : \n"); 825 printf("%s\n",FROG_AUTHORLIST); 826 exit(0); 827 }else if(strcmp(LowCase,"-c" )==0 && i+1<argc){ 828 i++; inputConfig = string(argv[i]); 829 }else if(len>=4 && strcmp(LowCase+len-4,".vis" )==0){inputVisFileFromCommand.push_back(string(argv[i])); 830 }else if(len>=7 && strcmp(LowCase+len-7,".vis.gz")==0){inputVisFileFromCommand.push_back(string(argv[i])); 825 831 }else{ 826 832 printf("\n"); 827 printf("######################################################################\n"); 828 printf("# http://projects.hepforge.org/frog/ #\n"); 829 printf("# Please have a look at the website for latest versions and news #\n"); 830 printf("# Also register to the Frog mailing list if you are not a member yet #\n"); 831 printf("######################################################################\n"); 832 printf("# HELP SCREEN #\n"); 833 printf("######################################################################\n"); 834 printf("# Supported Commands are : #\n"); 835 printf("# filename.vis --> open the file : filename.vis #\n"); 836 printf("# filename.vis.gz --> open the file : filename.vis.gz #\n"); 837 printf("# -help --> Print this screen #\n"); 838 printf("# -s --> ScreenSaver Mode #\n"); 839 printf("# -shooter --> Scan events, make a screenshot and exit #\n"); 840 printf("######################################################################\n"); 841 printf("\n"); 833 printf("#######################################################################\n"); 834 printf("# http://projects.hepforge.org/frog/ #\n"); 835 printf("# Please have a look at the website for latest versions and news #\n"); 836 printf("# Also register to the Frog mailing list if you are not a member yet #\n"); 837 printf("#######################################################################\n"); 838 printf("# HELP SCREEN #\n"); 839 printf("#######################################################################\n"); 840 printf("# Supported Commands are : #\n"); 841 printf("# filename.vis --> open the file : filename.vis #\n"); 842 printf("# filename.vis.gz --> open the file : filename.vis.gz #\n"); 843 printf("# -help --> Print this screen #\n"); 844 printf("# -v --> Print Version and Other Info #\n"); 845 printf("# -s --> ScreenSaver Mode #\n"); 846 printf("# -c <config.txt> --> Specify the Frog Configuration Card to use #\n"); 847 printf("# -shooter --> Scan events, make a screenshot and exit #\n"); 848 printf("#######################################################################\n"); 849 printf("\n"); 842 850 exit(0); 843 851 } … … 854 862 855 863 // Charge le logo en mémoire 856 LoadTexture((unsigned int*)&LogoTexture , "Resources/Frog_Logo.png");857 LoadTexture((unsigned int*)&LogoTxtTexture , "Resources/Frog_LogoTxt.png");864 LoadTexture((unsigned int*)&LogoTexture ,FROG_PATH::GetGlobalPath("Resources/Frog_Logo.png" ,AbsolutePath.c_str()).c_str()); 865 LoadTexture((unsigned int*)&LogoTxtTexture ,FROG_PATH::GetGlobalPath("Resources/Frog_LogoTxt.png",AbsolutePath.c_str()).c_str()); 858 866 859 867 // initialisation des fonctions callback appelées par glut … … 864 872 glutIdleFunc (Loading); 865 873 866 // here are the new entries867 glutKeyboardFunc (processNormalKeys);868 glutSpecialFunc (processSpecialKeys);869 870 glutMouseFunc(processMouse);871 glutMotionFunc(processMotion);872 if(SCREENSAVER){873 eventTime = 20;874 glutPassiveMotionFunc(processPassiveMotion);875 glutFullScreen();876 }877 874 878 875 // initialisation of GLEW (OpenGL Extension Wrangler Library) -
trunk/Utilities/FROG/main.h
r95 r100 7 7 #define _MAIN_H__ 8 8 9 #define FROG_VERSION 1.10 59 #define FROG_VERSION 1.106 10 10 #define FROG_AUTHORLIST "Loic.Quertenmont@cern.ch\nVincent.Roberfroid@cern.ch" 11 11 … … 89 89 GLuint LogoTxtTexture; 90 90 91 char ScreenShotName[1024] = {"screenshot"}; 92 std::string AbsolutePath; 93 std::string inputConfig = "config.txt"; 91 94 std::string inputVisFile; 92 95 std::string inputVisFileFromCard; 96 std::vector<string> inputVisFileFromCommand; 93 97 std::vector<std::string> inputGeom; 94 98 … … 151 155 void displayForScreenShot(); 152 156 void displaytext(); 157 void processNormalKeys(unsigned char key, int x, int y); 158 void processSpecialKeys(int key, int x, int y) ; 159 void processMouse(int button, int state, int x, int y); 160 void processMotion(int x, int y); 161 void processPassiveMotion(int x, int y); 153 162 154 163 void LoadCard(const char* inputCard ); … … 161 170 void updateEventsFile(); 162 171 163 164 172 #endif 165 173 -
trunk/Utilities/Fastjet/plugins/CDFCones/CDFJetCluPlugin.cc
r11 r100 1 1 //STARTHEADER 2 // $Id: CDFJetCluPlugin.cc,v 1. 1 2008-11-06 14:32:10ovyn Exp $2 // $Id: CDFJetCluPlugin.cc,v 1.2 2008-12-18 13:38:29 ovyn Exp $ 3 3 // 4 4 // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam … … 72 72 LorentzVector fourvect(particle.px(), particle.py(), 73 73 particle.pz(), particle.E()); 74 //std::cout<<"avant la reconstruction "<<particle.eta()<<std::endl; 75 //PhysicsTower tower(fourvect); 74 76 PhysicsTower tower(fourvect); 77 78 std::cout<<"apres la reconstruction "<<tower.eta()<<std::endl; 79 //std::cout<<"apres la reconstruction ieta "<<tower.iEta()<<std::endl; 80 81 75 82 // add tracking information for later 76 83 tower.fjindex = i; -
trunk/Utilities/Fastjet/plugins/CDFCones/interface/CalTower.hh
r42 r100 7 7 8 8 #include <cmath> 9 #include <iostream> 9 10 10 11 #ifndef M_PI … … 14 15 const double pi = acos(-1); 15 16 16 /* 17 // CDF data : 22 towers. step=2.7° at the beginning, and after, it changes 18 const unsigned int ntower = 22; 19 const double TOWER_THETA[ntower+1] = {3.000, 5.700, 8.400, 11.100, 13.800, 16.500, 19.200, 21.900, 24.600, 27.300, 30.000,// step=2.7° 20 33.524, 36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 }; 17 18 /* // CDF data : 22 towers. step=2.7° at the beginning, and after, it changes 19 const unsigned int ntower = 0; 20 const double TOWER_THETA[ntower+1] = {0},// step=2.7° 21 //const double TOWER_THETA[ntower+1] = {3.000, 5.700, 8.400, 11.100, 13.800, 16.500, 19.200, 21.900, 24.600, 27.300, 30.000,// step=2.7° 22 // 33.524, 36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 }; 21 23 const double tower_eta_edges[ntower+1] = { 22 24 0.0, 0.130817437415, 0.259479460739, 0.384075299436, 0.503273260393, 0.616250691646, 0.72264587494, 0.822472442947, … … 29 31 */ 30 32 33 31 34 // CMS data 32 35 const unsigned int ntower = 40; 36 //const double tower_eta_edges[ntower+1] = {0}; // list of the edges of each tower, in eta, for eta>0, assuming a symmetric detector in eta<0 33 37 const double tower_eta_edges[ntower+1] = { // list of the edges of each tower, in eta, for eta>0, assuming a symmetric detector in eta<0 34 38 0., // lower limit of the most central tower … … 39 43 5.000}; // higher limit of the most forward tower 40 44 45 //const double tower_dphi[ntower] = {}; // list of the tower size in phi (in degrees) 41 46 const double tower_dphi[ntower] = { // list of the tower size in phi (in degrees) 42 47 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, -
trunk/Utilities/Fastjet/plugins/CDFCones/src/JetCluAlgorithm.cc
r11 r100 1 #include "../interface/CalTower.hh" 1 2 #include "../interface/JetCluAlgorithm.hh" 2 3 #include "../interface/ClusterComparisons.hh" … … 4 5 #include <algorithm> 5 6 #include <cmath> 6 7 void JetCluAlgorithm::makeSeedTowers(std::vector<PhysicsTower>& towers, std::vector<Cluster>& seedTowers) 7 #include <iostream> 8 9 using namespace std; 10 /*void JetCluAlgorithm::makeSeedTowers(std::vector<PhysicsTower>& towers, std::vector<Cluster>& seedTowers) 8 11 { 9 12 for(int iEta = 4; iEta < 48; iEta++){ … … 22 25 } 23 26 sort(seedTowers.begin(),seedTowers.end(),ClusterCentroidEtGreater()); 24 } 27 }*/ 28 29 void JetCluAlgorithm::makeSeedTowers(std::vector<PhysicsTower>& towers, std::vector<Cluster>& seedTowers) 30 { 31 for(int iEta = 0; iEta < 2*ntower; iEta++){ 32 33 int myphiindex = (iEta<ntower) ? iEta : iEta-ntower; 34 int nphi = (int) 360/tower_dphi[myphiindex]; // number of phi segments for this eta 35 for(int iPhi = 0; iPhi < nphi; iPhi++){ 36 Cluster seed; 37 for(std::vector<PhysicsTower>::iterator towerIter = towers.begin(); towerIter != towers.end(); towerIter++) 38 if(towerIter->iEta() == iEta && towerIter->iPhi() == iPhi ) { 39 seed.addTower(*towerIter); 40 } 41 if(seed.centroid.Et > _seedThreshold) { 42 seedTowers.push_back(seed); 43 } 44 } 45 } 46 sort(seedTowers.begin(),seedTowers.end(),ClusterCentroidEtGreater()); 47 } 48 25 49 26 50 void JetCluAlgorithm::buildPreClusters(std::vector<Cluster>& seedTowers, std::vector<PhysicsTower>& towers, … … 40 64 int iEtaSeedTower = seedTowerIter->towerList.begin()->iEta(); 41 65 int iPhiSeedTower = seedTowerIter->towerList.begin()->iPhi(); 42 if(iEtaSeedTower >= 8 && iEtaSeedTower < 14 || iEtaSeedTower >= 38 && iEtaSeedTower < 44)43 iPhiSeedTower = iPhiSeedTower/2;66 // if(iEtaSeedTower >= 8 && iEtaSeedTower < 14 || iEtaSeedTower >= 38 && iEtaSeedTower < 44) 67 // iPhiSeedTower = iPhiSeedTower/2; 44 68 for(std::vector<PhysicsTower>::iterator preClusterTowerIter = preClusterIter->towerList.begin(); 45 69 preClusterTowerIter != preClusterIter->towerList.end() && !seedTowerAddedToPreCluster; … … 47 71 int iEtaPreClusterTower = preClusterTowerIter->iEta(); 48 72 int iPhiPreClusterTower = preClusterTowerIter->iPhi(); 49 if(iEtaPreClusterTower >= 8 && iEtaPreClusterTower < 14 || iEtaPreClusterTower >= 38 && iEtaPreClusterTower < 44)50 iPhiPreClusterTower = iPhiPreClusterTower/2;73 // if(iEtaPreClusterTower >= 8 && iEtaPreClusterTower < 14 || iEtaPreClusterTower >= 38 && iEtaPreClusterTower < 44) 74 // iPhiPreClusterTower = iPhiPreClusterTower/2; 51 75 int dIEta = abs(iEtaSeedTower - iEtaPreClusterTower); 52 76 int dIPhi = abs(iPhiSeedTower - iPhiPreClusterTower); 53 if(dIPhi > 12)54 dIPhi = 24 - dIPhi;77 // if(dIPhi > 12) 78 // dIPhi = 24 - dIPhi; 55 79 int adj = dIPhi*dIPhi + dIEta*dIEta; 56 80 if(adj <= _adjacencyCut){
Note:
See TracChangeset
for help on using the changeset viewer.