Changeset 1559 for trunk/MagicSoft
- Timestamp:
- 10/29/02 17:15:27 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r1550 r1559 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.4 4$23 // $Revision: 1.45 $ 24 24 // $Author: blanch $ 25 // $Date: 2002-10- 18 16:53:03$25 // $Date: 2002-10-29 17:15:27 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 409 409 char flag[SIZE_OF_FLAGS + 1]; //@< flags in the .rfl file 410 410 411 int reflector_file_version; //@< vrsion of he reflector file 412 411 413 FILE *inputfile; //@< stream for the input file 412 414 ofstream datafile; //@< stream for the data file 413 415 414 416 MCEventHeader mcevth; //@< Event Header class (MC) 417 MCEventHeader_2 mcevth_2; //@< Event Header class (MC) for reflector > 0.6 415 418 MCCphoton cphoton; //@< Cherenkov Photon class (MC) 416 419 … … 1174 1177 // get signature, and check it 1175 1178 1176 if( check_reflector_file( inputfile)==FALSE){1179 if((reflector_file_version=check_reflector_file( inputfile ))==FALSE){ 1177 1180 exit(1); 1178 1181 } … … 1241 1244 1242 1245 // get MCEventHeader 1243 fread( (char*)&mcevth, mcevth.mysize(), 1, inputfile ); 1246 if (reflector_file_version<6) 1247 fread( (char*)&mcevth, mcevth.mysize(), 1, inputfile ); 1248 else 1249 fread( (char*)&mcevth_2, mcevth_2.mysize(), 1, inputfile ); 1250 1244 1251 1245 1252 // calculate impact parameter (shortest distance betwee the original … … 1273 1280 // read the direction of the incoming shower 1274 1281 1275 thetashw = mcevth.get_theta(); 1276 phishw = mcevth.get_phi(); 1282 if (reflector_file_version<6){ 1283 thetashw = mcevth.get_theta(); 1284 phishw = mcevth.get_phi(); 1285 } 1286 else{ 1287 thetashw = mcevth_2.get_theta(); 1288 phishw = mcevth_2.get_phi(); 1289 } 1277 1290 1278 1291 // calculate vector for shower … … 1284 1297 // read the deviation of the telescope with respect to the shower 1285 1298 1286 mcevth.get_deviations ( &thetaCT, &phiCT ); 1299 if (reflector_file_version<6) 1300 mcevth.get_deviations ( &thetaCT, &phiCT ); 1301 else 1302 mcevth_2.get_deviations ( &thetaCT, &phiCT ); 1287 1303 1288 1304 if ( (thetaCT == 0.) && (phiCT == 0.) ) { … … 1292 1308 // between the CT axis and the core position 1293 1309 1294 mcevth.get_core(&coreX, &coreY); 1295 1310 if (reflector_file_version<6) 1311 mcevth.get_core(&coreX, &coreY); 1312 else 1313 mcevth_2.get_core(&coreX, &coreY); 1314 1296 1315 impactD = dist_r_P( 0., 0., 0., l1, m1, n1, coreX, coreY, 0. ); 1297 1316 … … 1324 1343 1325 1344 if ( Select_Energy ) { 1326 if (( mcevth.get_energy() < Select_Energy_le ) || 1327 ( mcevth.get_energy() > Select_Energy_ue )) { 1328 log(SIGNATURE, "select_energy: shower rejected.\n"); 1329 continue; 1330 } 1345 if (reflector_file_version<6) 1346 if (( mcevth.get_energy() < Select_Energy_le ) || 1347 ( mcevth.get_energy() > Select_Energy_ue )) { 1348 log(SIGNATURE, "select_energy: shower rejected.\n"); 1349 continue; 1350 } 1351 else 1352 if (( mcevth_2.get_energy() < Select_Energy_le ) || 1353 ( mcevth_2.get_energy() > Select_Energy_ue )) { 1354 log(SIGNATURE, "select_energy: shower rejected.\n"); 1355 continue; 1356 } 1331 1357 } 1332 1358 1333 1359 // Read first and last time and put inumphe to 0 1334 1360 1335 mcevth.get_times(&arrtmin_ns,&arrtmax_ns); 1361 if (reflector_file_version<6) 1362 mcevth.get_times(&arrtmin_ns,&arrtmax_ns); 1363 else 1364 mcevth_2.get_times(&arrtmin_ns,&arrtmax_ns); 1365 1336 1366 inumphe=0; 1337 1367 … … 1657 1687 // 1658 1688 1659 EvtHeader[0]->FillHeader ( (U Short_t) (ntshow + nshow) , 20 ) ;1689 EvtHeader[0]->FillHeader ( (UInt_t) (ntshow + nshow) , 20 ) ; 1660 1690 1661 1691 // fill pixel information … … 1780 1810 // get signature of the next part and check it. 1781 1811 1782 if( check_reflector_file( inputfile)==FALSE){1812 if((reflector_file_version=check_reflector_file( inputfile ))==FALSE){ 1783 1813 exit(1); 1784 1814 } … … 3340 3370 static MCEventHeader evth; // the event header 3341 3371 static float nphe[iMAXNUMPIX]; // the number of photoelectrons in each pixel 3372 int reflector_file_version; 3342 3373 int itnphe; // total number of produced photoelectrons 3343 3374 int itotnphe; // total number of produced photoelectrons after averaging … … 3366 3397 // get signature, and check it 3367 3398 3368 if( check_reflector_file(infile)==FALSE){3399 if((reflector_file_version=check_reflector_file( infile ))==FALSE){ 3369 3400 exit(1); 3370 3401 } … … 3606 3637 // 3607 3638 // $Log: not supported by cvs2svn $ 3639 // Revision 1.44 2002/10/18 16:53:03 blanch 3640 // Modification to read several reflector files. 3641 // 3608 3642 // Revision 1.43 2002/09/13 10:53:39 blanch 3609 3643 // Minor change to remove some undisired comments. … … 3739 3773 // 3740 3774 // $Log: not supported by cvs2svn $ 3775 // Revision 1.44 2002/10/18 16:53:03 blanch 3776 // Modification to read several reflector files. 3777 // 3741 3778 // Revision 1.43 2002/09/13 10:53:39 blanch 3742 3779 // Minor change to remove some undisired comments.
Note:
See TracChangeset
for help on using the changeset viewer.