- Timestamp:
- 05/04/06 15:10:54 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7689 r7690 32 32 at which the normalization is calculated instead of 33 33 the integral 34 35 * mpointing/MSrcPosRndm.[h,cc]: 36 - added new option which allows to create a random wobble 37 source position 34 38 35 39 -
trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.cc
r7565 r7690 36 36 #include "MSrcPosRndm.h" 37 37 38 #include <TRandom.h> 39 38 40 #include "MLog.h" 39 41 #include "MLogManip.h" … … 66 68 return kFALSE; 67 69 68 fHist = (MHSrcPosCam*)plist->FindObject("MHSrcPosCam"); 69 if (!fHist) 70 if (fDistOfSource<0) 70 71 { 71 *fLog << inf << "MHSrcPosCam not found... skipping." << endl; 72 return kSKIP; 72 fHist = (MHSrcPosCam*)plist->FindObject("MHSrcPosCam"); 73 if (!fHist) 74 { 75 *fLog << inf << "MHSrcPosCam not found... skipping." << endl; 76 return kSKIP; 77 } 78 79 *fLog << inf << "MHSrcPosCam found... taken to produce a random distribution." << endl; 73 80 } 74 75 *fLog << inf << "MHSrcPosCam found... taken to produce a random distribution." << endl;81 else 82 *fLog << inf << "Source position will be produced randomly in a distance of " << fDistOfSource << "° from the camera center!" << endl; 76 83 77 84 fConvMm2Deg = geom->GetConvMm2Deg(); … … 87 94 { 88 95 Axis_t x, y; 89 90 fHist->GetHist().GetRandom2(x, y); 96 if (fDistOfSource<0) 97 fHist->GetHist().GetRandom2(x, y); 98 else 99 { 100 const Double_t phi = gRandom->Uniform(TMath::TwoPi()); 101 x = TMath::Cos(phi)*fDistOfSource; 102 y = TMath::Sin(phi)*fDistOfSource; 103 } 91 104 92 105 fSrcPos->SetXY(x/fConvMm2Deg, y/fConvMm2Deg); 93 94 106 return kTRUE; 95 107 } -
trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.h
r7565 r7690 17 17 Double_t fConvMm2Deg; 18 18 19 Double_t fDistOfSource; // [deg] Distance of the source from the camera center 20 19 21 Int_t PreProcess(MParList *plist); 20 22 Int_t Process(); 21 23 22 24 public: 23 MSrcPosRndm() : fSrcPos(0), fHist(0) 25 MSrcPosRndm() : fSrcPos(0), fHist(0), fDistOfSource(-1) 24 26 { 25 27 fName = "MSrcPosRndm"; … … 27 29 } 28 30 31 void SetDistOfSource(Double_t dist=-1) { fDistOfSource=dist; } 32 29 33 ClassDef(MSrcPosRndm, 0) //Overwrite the source position with a random one from MHSrcPosCam 30 34 };
Note:
See TracChangeset
for help on using the changeset viewer.