Changeset 9349 for trunk/MagicSoft/Mars/msimreflector
- Timestamp:
- 02/19/09 16:27:33 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc
r9336 r9349 429 429 TClonesArray &arr = fEvt->GetArray(); 430 430 431 TClonesArray &cpy0 = fMirror0->GetArray(); 432 //TClonesArray &cpy1 = fMirror1->GetArray(); 433 TClonesArray &cpy2 = fMirror2->GetArray(); 434 TClonesArray &cpy3 = fMirror3->GetArray(); 435 TClonesArray &cpy4 = fMirror4->GetArray(); 436 cpy0.ExpandCreateFast(arr.GetEntriesFast()); 437 //cpy1.ExpandCreateFast(arr.GetEntriesFast()); 438 cpy2.ExpandCreateFast(arr.GetEntriesFast()); 439 cpy3.ExpandCreateFast(arr.GetEntriesFast()); 440 cpy4.ExpandCreateFast(arr.GetEntriesFast()); 431 // Because we knwo in advance what the maximum storage space could 432 // be we allocated it in advance (or shrink it if it was extremely 433 // huge before) 434 // Note, that the drawback is that an extremly large event 435 // will take about five times its storage space 436 // for a moment even if a lot from it is unused. 437 // It will be freed in the next step. 438 fMirror0->Resize(arr.GetEntriesFast()); // Free memory of allocated MPhotonData 439 fMirror2->Resize(arr.GetEntriesFast()); // Free memory of allocated MPhotonData 440 fMirror3->Resize(arr.GetEntriesFast()); // Free memory of allocated MPhotonData 441 fMirror4->Resize(arr.GetEntriesFast()); // Free memory of allocated MPhotonData 441 442 442 443 // Initialize mirror properties … … 448 449 449 450 // Rotation matrix to derotate sky 451 // For the new coordinate system see the Wiki 450 452 TRotation rot; // The signs are positive because we align the incident point on ground to the telescope axis 451 453 rot.RotateZ( az); // Rotate point on ground to align it with the telescope axis 452 454 rot.RotateX(-zd); // tilt the point from ground to make it parallel to the mirror plane 453 455 454 // Now: viewed from the backside of the mirror 455 // x is pointing downwards 456 // y is pointing left 457 458 // Rotate around z counterclockwise 459 // rot.RotateZ(TMath::Pi()/2); // Rotate x to point right / y downwards / z from mirror to camera 460 // rot.RotateX(TMath::Pi()); // Flip -y and y (also flips Z :( ) 461 462 // Now: viewed from the backside of the mirror 463 // x is pointing upwards 464 // y is pointing right 465 456 // Now get the impact point from Corsikas output 466 457 const TVector3 impact(fEvtHeader->GetX(), fEvtHeader->GetY(), 0); 467 458 … … 500 491 dat->SetDirection(w); 501 492 502 *static_cast<MPhotonData*>(cpy0.UncheckedAt(cnt[0]++)) = *dat; 493 (*fMirror0)[cnt[0]++] = *dat; 494 //*static_cast<MPhotonData*>(cpy0.UncheckedAt(cnt[0]++)) = *dat; 503 495 504 496 // Check if the photon has hit the camera housing and holding … … 507 499 508 500 // FIXME: Do we really need this one?? 501 //(*fMirror1)[cnt[1]++] = *dat; 509 502 //*static_cast<MPhotonData*>(cpy1.UncheckedAt(cnt[1]++)) = *dat; 510 503 … … 513 506 continue; 514 507 515 *static_cast<MPhotonData*>(cpy2.UncheckedAt(cnt[2]++)) = *dat; 508 (*fMirror2)[cnt[2]++] = *dat; 509 //*static_cast<MPhotonData*>(cpy2.UncheckedAt(cnt[2]++)) = *dat; 516 510 517 511 // Now execute the reflection of the photon on the mirrors' surfaces … … 526 520 dat->SetDirection(w); 527 521 528 *static_cast<MPhotonData*>(cpy3.UncheckedAt(cnt[3]++)) = *dat; 522 (*fMirror3)[cnt[3]++] = *dat; 523 //*static_cast<MPhotonData*>(cpy3.UncheckedAt(cnt[3]++)) = *dat; 529 524 530 525 // Propagate the photon along its trajectory to the focal plane z=F … … 534 529 dat->SetPosition(p); 535 530 536 *static_cast<MPhotonData*>(cpy4.UncheckedAt(cnt[4]++)) = *dat; 531 (*fMirror4)[cnt[4]++] = *dat; 532 //*static_cast<MPhotonData*>(cpy4.UncheckedAt(cnt[4]++)) = *dat; 537 533 538 534 // FIXME: It make make sense to move this out of this class
Note:
See TracChangeset
for help on using the changeset viewer.