Changeset 10090


Ignore:
Timestamp:
Jan 6, 2011, 4:53:13 PM (10 years ago)
Author:
tbretz
Message:
Implemented improved handling for the obscuration by the detector.
Location:
trunk/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/Changelog

    r10089 r10090  
    3737     - added GetL
    3838
     39   * mgeom/MGeomCamDwarf.cc:
     40     - use the HitFrame from the base class with a slightly
     41       increased radius (no change in behaviour)
     42
     43   * mgeom/MGeomCam.[h,cc]:
     44     - added HitFrame                                         
     45
     46   * msimreflector/MSimReflector.[h,cc]:
     47     - implemented the possibility to overwrite the absorbing
     48       size of the detector
     49     - added fDetectorFrame
     50
  • trunk/Mars/mgeom/MGeomCam.cc

    r9398 r10090  
    422422// --------------------------------------------------------------------------
    423423//
     424// Check if the photon which is flying along the trajectory u has passed
     425// (or will pass) the frame of the camera (and consequently get
     426// absorbed). The position p and direction u must be in the
     427// telescope coordinate frame, which is z parallel to the focal plane,
     428// x to the right and y upwards, looking from the mirror towards the camera.
     429//
     430// The units are cm.
     431//
     432Bool_t MGeomCam::HitFrame(MQuaternion p, const MQuaternion &u, Double_t margin) const
     433{
     434    if (margin<=0)
     435        return HitFrame(p, u);
     436
     437    // z is defined from the mirror (0) to the camera (z>0).
     438    // Thus we just propagate to the focal plane (z=fDist)
     439    p.PropagateZ(u, GetCameraDist()*100); // m->cm
     440    return p.R()<margin;
     441}
     442
     443// --------------------------------------------------------------------------
     444//
    424445// Check if the position given in the focal plane (so z can be ignored)
    425446// is a position which might hit the detector. It is meant to be a rough
     
    583604//  at the end.
    584605//
    585 // All pixel swith a center withing 1.75*GetT() are considered neiighbors,
     606// All pixels with a center withing 1.75*GetT() are considered neighbors,
    586607// Only six neighbors are allowed.
    587608//
  • trunk/Mars/mgeom/MGeomCam.h

    r9594 r10090  
    122122
    123123    virtual Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const { return kFALSE; }
     124            Bool_t HitFrame(MQuaternion p, const MQuaternion &u, Double_t margin) const;
    124125    virtual Bool_t HitDetector(const MQuaternion &p, Double_t offset=0) const;
    125126
  • trunk/Mars/mgeom/MGeomCamDwarf.cc

    r9863 r10090  
    101101Bool_t MGeomCamDwarf::HitFrame(MQuaternion p, const MQuaternion &u) const
    102102{
    103     // z is defined from the mirror (0) to the camera (z>0).
    104     // Thus we just propagate to the focal plane (z=fDist)
    105     //p -= 1700./u.Z()*u;
    106     p.PropagateZ(u, GetCameraDist()*100); // m->cm
    107 
    108103    // Add 10% to the max radius and convert from mm to cm
    109     return p.R()<GetMaxRadius()*0.11;//TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65;
     104    // FIXME: Why does the compiler complain without this cast?
     105    return static_cast<const MGeomCam*>(this)->HitFrame(p, u, GetMaxRadius()*0.11);
    110106}
    111107
  • trunk/Mars/msimreflector/MSimReflector.cc

    r9565 r10090  
    2727//  MSimReflector
    2828//
     29//  fDetectorFrame is a radius in centimeter, defining a disk in the focal
     30//  plane around the focal point, in which photons are absorbed. If
     31//  fDetectorFrame<=0 the virtual HitFrame function of the camera
     32//  geometry container is used instead.
     33//
    2934//  fDetectorMargin is a margin (in mm) which is given to the
    3035//  MGeomCam::HitDetector. It should define a margin around the area
     
    7681    fMirror4(0), /*fRunHeader(0),*/ fEvtHeader(0), fReflector(0),
    7782    fGeomCam(0), fPointing(0), fNameReflector("MReflector"),
    78     fDetectorMargin(0)
     83    fDetectorFrame(0), fDetectorMargin(0)
    7984{
    8085    fName  = name  ? name  : "MSimReflector";
     
    502507
    503508        // Check if the photon has hit the camera housing and holding
    504         if (fGeomCam->HitFrame(p, w))
     509        if (fGeomCam->HitFrame(p, w, fDetectorFrame))
    505510            continue;
    506511
     
    579584{
    580585    Bool_t rc = kFALSE;
     586    if (IsEnvDefined(env, prefix, "DetectorFrame", print))
     587    {
     588        rc = kTRUE;
     589        fDetectorFrame = GetEnvValue(env, prefix, "DetectorFrame", 0);
     590    }
    581591    if (IsEnvDefined(env, prefix, "DetectorMargin", print))
    582592    {
  • trunk/Mars/msimreflector/MSimReflector.h

    r9565 r10090  
    3333    TString fNameReflector;      // Name of the container storing the reflector geometry
    3434
     35    Double_t fDetectorFrame;     // A disk of radius DetectorFrame around the focal point absorbing photons
    3536    Double_t fDetectorMargin;    // A margin around the detector (MGeomCam::HitCamera) in which photons are also stored
    3637
     
    4950    void SetNameReflector(const char *name="MReflector") { fNameReflector = name; }
    5051
    51     void SetDetectorMargin(Double_t m=0) { fDetectorMargin = m; }
     52    void SetDetectorFrame(Double_t cm=0)  { fDetectorFrame  = cm; }
     53    void SetDetectorMargin(Double_t mm=0) { fDetectorMargin = mm; }
    5254
    5355    ClassDef(MSimReflector, 0) // Task to calculate reflection on a mirror
Note: See TracChangeset for help on using the changeset viewer.