Changeset 9234
- Timestamp:
- 01/21/09 14:26:15 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r9229 r9234 29 29 30 30 #pragma link C++ class MSpline3+; 31 #pragma link C++ class MQuaternion+; 31 32 32 33 #pragma link C++ class MString+; -
trunk/MagicSoft/Mars/mbase/MArrayI.cc
r5088 r9234 36 36 #include "MArrayI.h" 37 37 38 #include "MMath.h" 39 38 40 ClassImp(MArrayI); 39 41 42 void MArrayI::ReSort(Bool_t down) 43 { 44 MMath::ReSort(fN, fArray, down); 45 } -
trunk/MagicSoft/Mars/mbase/MArrayI.h
r9211 r9234 73 73 // Add char c at position i. Check for out of bounds. 74 74 fArray[i] = c; 75 } 76 77 void Add(Int_t c) 78 { 79 Set(fN+1); 80 fArray[fN-1] = c; 81 } 82 83 Int_t Find(Int_t c) const 84 { 85 for (Int_t *ptr=fArray; ptr<fArray+fN; ptr++) 86 if (*ptr==c) 87 return ptr-fArray; 88 89 return -1; 90 } 91 92 void AddUniq(Int_t c) 93 { 94 if (Find(c)<0) 95 Add(c); 75 96 } 76 97 … … 157 178 } 158 179 180 void ReSort(Bool_t down=kFALSE); 181 159 182 ClassDef(MArrayI, 1) //Array of Int_t 160 183 }; -
trunk/MagicSoft/Mars/mbase/MMath.cc
r9226 r9234 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.4 4 2009-01-17 14:52:37tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.45 2009-01-21 14:22:39 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 347 347 *ptr = cpy[*idx++]; 348 348 349 delete cpy;350 delete pos;349 delete [] cpy; 350 delete [] pos; 351 351 } 352 352 -
trunk/MagicSoft/Mars/mbase/Makefile
r9229 r9234 24 24 MMath.cc \ 25 25 MSpline3.cc \ 26 MQuaternion.cc \ 26 27 MEnv.cc \ 27 28 MLog.cc \ -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r8921 r9234 13 13 #ifndef ROOT_TArrayS 14 14 #include <TArrayS.h> 15 #endif 16 #ifndef MARS_MQuaternion 17 #include "MQuaternion.h" 15 18 #endif 16 19 … … 109 112 Int_t GetNeighbor(UInt_t idx, Int_t dir) const; 110 113 114 virtual Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const { return kFALSE; } 115 virtual Bool_t HitDetector(const MQuaternion &p) const { return kFALSE; } 116 111 117 void Print(Option_t *opt=NULL) const; 112 118 -
trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.cc
r8910 r9234 112 112 // -------------------------------------------------------------------------- 113 113 // 114 // Check if the photon which is flying along the trajectory u has passed 115 // (or will pass) the frame of the camera (and consequently get 116 // absorbed). The position p and direction u must be in the 117 // telescope coordinate frame, which is z parallel to the focal plane, 118 // x to the right and y upwards, looking from the mirror towards the camera. 119 // 120 // The units are cm. 121 // 122 Bool_t MGeomCamDwarf::HitFrame(MQuaternion p, const MQuaternion &u) const 123 { 124 // z is defined from the mirror (0) to the camera (z>0). 125 // Thus we just propagate to the focal plane (z=fDist) 126 //p -= 1700./u.Z()*u; 127 p.PropagateZ(u, GetCameraDist()*100); // m->cm 128 129 // Add 10% to the max radius and convert from mm to cm 130 return p.R()<GetMaxRadius()*0.11;//TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65; 131 } 132 133 // -------------------------------------------------------------------------- 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 rough 137 // and fast estimate not a precise calculation. All positions dicarded 138 // must not hit the detector. All positions accepted might still miss 139 // the detector. 140 // 141 // The units are cm. 142 // 143 Bool_t MGeomCamDwarf::HitDetector(const MQuaternion &v) const 144 { 145 // Add 10% to the max radius and convert from mm to cm 146 return v.R()<GetMaxRadius()*0.11;//60.2; 147 } 148 149 // -------------------------------------------------------------------------- 150 // 114 151 // Calculate in the direction 0-5 (kind of sector) in the ring-th ring 115 152 // the x and y coordinate of the i-th pixel. The unitx are unity, -
trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.h
r9219 r9234 28 28 TObject *Clone(const char *newname) const; 29 29 30 ClassDef(MGeomCamDwarf, 1) // Geometry class for the Dwarf camera 30 Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const; 31 Bool_t HitDetector(const MQuaternion &p) const; 32 33 ClassDef(MGeomCamDwarf, 1) // Geometry class for the Dwarf camera 31 34 }; 32 35 33 36 #endif 34 -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
r3392 r9234 49 49 CreateNN(); 50 50 InitGeometry(); 51 } 52 53 // -------------------------------------------------------------------------- 54 // 55 // Check if the photon which is flying along the trajectory u has passed 56 // (or will pass) the frame of the camera (and consequently get 57 // absorbed). The position p and direction u must be in the 58 // telescope coordinate frame, which is z parallel to the focal plane, 59 // x to the right and y upwards, looking from the mirror towards the camera. 60 // 61 Bool_t MGeomCamMagic::HitFrame(MQuaternion p, const MQuaternion &u) const 62 { 63 // z is defined from the mirror (0) to the camera (z>0). 64 // Thus we just propagate to the focal plane (z=fDist) 65 //p -= 1700./u.Z()*u; 66 p.PropagateZ(u, GetCameraDist()*100); 67 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 rough 75 // and fast estimate not a precise calculation. All positions dicarded 76 // must not hit the detector. All positions accepted might still miss 77 // the detector. 78 // 79 Bool_t MGeomCamMagic::HitDetector(const MQuaternion &v) const 80 { 81 return v.R()<60.2; 51 82 } 52 83 -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h
r1458 r9234 15 15 MGeomCamMagic(const char *name=NULL); 16 16 17 Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const; 18 Bool_t HitDetector(const MQuaternion &p) const; 19 17 20 ClassDef(MGeomCamMagic, 1) // Geometry class for the Magic camera 18 21 }; -
trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc
r9232 r9234 44 44 // 45 45 // Type 3: 46 // The maximum in x and y is determined from M Camera->GetMaxR();46 // The maximum in x and y is determined from MGeomCam->GetMaxR(); 47 47 // 48 48 // Type 4: 49 49 // As type 3 but divided by 10. 50 50 // 51 // Type 5:52 // The maximum in x and y is determined from MGeomCam->GetMaxR();53 //54 // Type 6:55 // As type 5 but divided by 10.56 //57 51 // The binning is optimized using MH::FindGoodLimits. The number of bins 58 // in 100 in the default case and 50 for type 3- 6.52 // in 100 in the default case and 50 for type 3-4. 59 53 // 60 54 // Fill expects a MPhotonEvent (the second argumnet in MFillH). … … 78 72 #include "MCorsikaRunHeader.h" 79 73 80 #include " ../msimreflector/MSimReflector.h" // MCamera, MReflector74 #include "MReflector.h" 81 75 82 76 ClassImp(MHPhotonEvent); … … 198 192 case 4: 199 193 { 200 MCamera *c = (MCamera*)pList->FindObject("MCamera");201 if (!c)202 {203 *fLog << err << "MCamera not found... aborting." << endl;204 return kFALSE;205 }206 xmax = fType==3 ? c->GetMaxR() : c->GetMaxR()/10;207 num = 50;208 209 break;210 }211 case 5:212 case 6:213 {214 194 MGeomCam *c = (MGeomCam*)pList->FindObject("MGeomCam"); 215 195 if (!c) … … 218 198 return kFALSE; 219 199 } 220 xmax = fType== 5 ? c->GetMaxRadius() : c->GetMaxRadius()/10;200 xmax = fType==3 ? c->GetMaxRadius()/10 : c->GetMaxRadius()/100; 221 201 num = 50; 222 202
Note:
See TracChangeset
for help on using the changeset viewer.