ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FastOpenGlDisplayer/src/SimEvent.cpp
(Generate patch)

Comparing UserCode/FastOpenGlDisplayer/src/SimEvent.cpp (file contents):
Revision 1.11 by roberfro, Mon Apr 28 11:47:49 2008 UTC vs.
Revision 1.14 by querten, Sun Jun 8 06:42:32 2008 UTC

# Line 98 | Line 98 | void MySimEvent::LoadEvent(FILE* pFile,
98                          while(CurrentChunk->read<CurrentChunk->size){
99                                  MyRecoHit* temp_RecoHit = new MyRecoHit;
100                                  CurrentChunk->read += fread(temp_RecoHit,sizeof(MyRecoHit),1,pFile) * sizeof(MyRecoHit);
101 <                                MyRecoTrackCollection[MyRecoTrackCollection.size()-1]->Hits.push_back(temp_RecoHit);
101 >                                MyRecoTrackCollection[MyRecoTrackCollection.size()-1]->Hits.push_back(temp_RecoHit);                            
102                          }
103                          }break;
104  
105 <                case C_RECO_ECALHIT:{   // RecHits              
105 >                case C_RECO_TRACKINFO:{ // TrackInfo                                    
106 >                                MyRecoTrackInfo* temp_Info = new MyRecoTrackInfo;
107 >                                CurrentChunk->read += fread(temp_Info,sizeof(MyRecoTrackInfo),1,pFile) * sizeof(MyRecoTrackInfo);
108 >                                MyRecoTrackCollection[MyRecoTrackCollection.size()-1]->Info = temp_Info;
109 >                        }break;
110 >
111 >                case C_RECO_ECALHIT:{   // ECAL Hits            
112                          while(CurrentChunk->read<CurrentChunk->size){
113                                  MyCaloHit* temp_EcalHit = new MyCaloHit;
114                                  CurrentChunk->read += fread(temp_EcalHit,sizeof(MyCaloHit),1,pFile) * sizeof(MyCaloHit);                        
# Line 110 | Line 116 | void MySimEvent::LoadEvent(FILE* pFile,
116                          }
117                          }break;
118  
119 <                case C_RECO_HCALHIT:{   // RecHits      
119 >                case C_RECO_HCALHIT:{   // HCAL Hits    
120                          while(CurrentChunk->read<CurrentChunk->size){
121                                  MyCaloHit* temp_HcalHit = new MyCaloHit;
122                                  CurrentChunk->read += fread(temp_HcalHit,sizeof(MyCaloHit),1,pFile) * sizeof(MyCaloHit);                        
# Line 308 | Line 314 | void MySimEvent::SaveEvent(stChunkToSave
314                                          data_buffer = (void*)((unsigned long)data_buffer + sizeof(MyRecoHit));                                  
315                                  }      
316                                  ParentChunk->daughters.push_back(CurrentChunk);
317 +
318 +                                if(((MyRecoTrack*)ParentChunk->buffer)->Info!=NULL){
319 +                                        CurrentChunk       = new stChunkToSave;
320 +                                        CurrentChunk->type = C_RECO_TRACKINFO;
321 +                                        CurrentChunk->size = 6 + sizeof(MyRecoTrackInfo);
322 +                                        data_buffer        = new void*[CurrentChunk->size-6];                                          
323 +                                        CurrentChunk->data = data_buffer;
324 +                                        memcpy( data_buffer, ((MyRecoTrack*)ParentChunk->buffer)->Info, sizeof(MyRecoTrackInfo) );                              
325 +                                        ParentChunk->daughters.push_back(CurrentChunk);
326 +                                }
327                          }              
328                          break;
329  
# Line 404 | Line 420 | void MySimEvents::Load(const char* path)
420          FILE* f = fopen(path,"rb" );    
421          if(f==NULL){
422                  printf("The file %s can not be open !\n",path);
423 <                return;
423 >                exit(0);
424          }
425  
426          stChunk* PrimaryChunk = new stChunk;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines