- Timestamp:
- 01/25/09 13:41:19 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mgeom
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r9219 r9259 244 244 const UInt_t s = pix.GetAidx(); 245 245 246 const Float_t d = pix.Get D();246 const Float_t d = pix.GetT(); 247 247 const Float_t r = pix.GetDist(); 248 248 … … 340 340 // -------------------------------------------------------------------------- 341 341 // 342 // The maximum possible distance from the origin. 343 // 344 Float_t MGeomCam::GetMaxRadius() const 345 { 346 return fMaxRadius[0]; 347 } 348 349 // -------------------------------------------------------------------------- 350 // 351 // The minimum possible distance from the origin. 352 // 353 Float_t MGeomCam::GetMinRadius() const 354 { 355 return fMinRadius[0]; 356 } 357 358 // -------------------------------------------------------------------------- 359 // 342 360 // Have to call the radii of the subcameras starting to count from 1 343 361 // 344 362 Float_t MGeomCam::GetMaxRadius(const Int_t i) const 345 363 { 346 return i< -1|| i>=(Int_t)GetNumAreas() ? -1 : fMaxRadius[i+1];364 return i<0 || i>=(Int_t)GetNumAreas() ? -1 : fMaxRadius[i+1]; 347 365 } 348 366 … … 353 371 Float_t MGeomCam::GetMinRadius(const Int_t i) const 354 372 { 355 return i< -1|| i>=(Int_t)GetNumAreas() ? -1 : fMinRadius[i+1];373 return i<0 || i>=(Int_t)GetNumAreas() ? -1 : fMinRadius[i+1]; 356 374 } 357 375 … … 379 397 // The const_cast is necessary to support older root version 380 398 return i<fNumPixels ? const_cast<TArrayF&>(fPixRatioSqrt)[i] : 0; 399 } 400 401 // -------------------------------------------------------------------------- 402 // 403 // Check if the position given in the focal plane (so z can be ignored) 404 // is a position which might hit the detector. It is meant to be a rough 405 // and fast estimate not a precise calculation. All positions dicarded 406 // must not hit the detector. All positions accepted might still miss 407 // the detector. 408 // 409 Bool_t MGeomCam::HitDetector(const MQuaternion &v, Double_t offset) const 410 { 411 const Double_t max = fMaxRadius[0]/10+offset; // cm --> mm 412 return v.R2()<max*max; 381 413 } 382 414 -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r9234 r9259 78 78 UInt_t GetNumPixels() const { return fNumPixels; } 79 79 80 Float_t GetMaxRadius(const Int_t i=-1) const; 81 Float_t GetMinRadius(const Int_t i=-1) const; 80 Float_t GetMaxRadius() const; 81 Float_t GetMinRadius() const; 82 Float_t GetMaxRadius(const Int_t i) const; 83 Float_t GetMinRadius(const Int_t i) const; 82 84 83 85 Float_t GetDist(UShort_t i, UShort_t j=0) const; … … 113 115 114 116 virtual Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const { return kFALSE; } 115 virtual Bool_t HitDetector(const MQuaternion &p ) const { return kFALSE; }117 virtual Bool_t HitDetector(const MQuaternion &p, Double_t offset=0) const; 116 118 117 119 void Print(Option_t *opt=NULL) const; -
trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.cc
r9234 r9259 133 133 // -------------------------------------------------------------------------- 134 134 // 135 // Check if the position given in the focal plane (so z can be ignored)136 // is a position which might hit the detector. It is meant to be a rough137 // and fast estimate not a precise calculation. All positions dicarded138 // must not hit the detector. All positions accepted might still miss139 // the detector.140 //141 // The units are cm.142 //143 Bool_t MGeomCamDwarf::HitDetector(const MQuaternion &v) const144 {145 // Add 10% to the max radius and convert from mm to cm146 return v.R()<GetMaxRadius()*0.11;//60.2;147 }148 149 // --------------------------------------------------------------------------150 //151 135 // Calculate in the direction 0-5 (kind of sector) in the ring-th ring 152 136 // the x and y coordinate of the i-th pixel. The unitx are unity, -
trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.h
r9234 r9259 29 29 30 30 Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const; 31 Bool_t HitDetector(const MQuaternion &p) const;32 31 33 32 ClassDef(MGeomCamDwarf, 1) // Geometry class for the Dwarf camera -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
r9234 r9259 67 67 68 68 return TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65; 69 }70 71 // --------------------------------------------------------------------------72 //73 // Check if the position given in the focal plane (so z can be ignored)74 // is a position which might hit the detector. It is meant to be a rough75 // and fast estimate not a precise calculation. All positions dicarded76 // must not hit the detector. All positions accepted might still miss77 // the detector.78 //79 Bool_t MGeomCamMagic::HitDetector(const MQuaternion &v) const80 {81 return v.R()<60.2;82 69 } 83 70 -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h
r9234 r9259 16 16 17 17 Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const; 18 Bool_t HitDetector(const MQuaternion &p) const;19 18 20 19 ClassDef(MGeomCamMagic, 1) // Geometry class for the Magic camera -
trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
r9235 r9259 66 66 using namespace std; 67 67 68 const Float_t MGeomPix::gsTan30 = tan(30/kRad2Deg);69 const Float_t MGeomPix::gsTan60 = tan(60/kRad2Deg);68 const Float_t MGeomPix::gsTan30 = TMath::Tan(30/kRad2Deg); // sqrt(3)/3 69 const Float_t MGeomPix::gsTan60 = TMath::Tan(60/kRad2Deg); // sqrt(3) 70 70 71 71 // -------------------------------------------------------------------------- … … 73 73 // Initializes one pixel 74 74 // 75 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s, UInt_t a) 75 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s, UInt_t a) : fUserBits(0) 76 76 { 77 77 // default constructor -
trunk/MagicSoft/Mars/mgeom/MGeomPix.h
r9235 r9259 9 9 class TVector2; 10 10 class TOrdCollection; 11 11 12 12 13 class MGeomPix : public MParContainer … … 75 76 Float_t GetX() const { return fX; } 76 77 Float_t GetY() const { return fY; } 77 Float_t GetD() const { return fD; } 78 Float_t GetD() const { return fD; } // Distance between two parellel sides 78 79 Float_t GetL() const { return fD*gsTan30; } // Length of one of the parallel sides 80 Float_t GetT() const { return fD/gsTan60; } // Distance between two opposite edges (traverse) 79 81 UInt_t GetSector() const { return fSector; } 80 82 … … 101 103 //Double_t CalcOverlapArea(const MGeomPix &cam) const; 102 104 105 //TObject *GetGraphics() { return new MHexagon(*this); } 106 103 107 ClassDef(MGeomPix, 4) // Geometry class describing the geometry of one pixel 104 108 };
Note:
See TracChangeset
for help on using the changeset viewer.