Changeset 5331
- Timestamp:
- 11/01/04 22:28:46 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5330 r5331 20 20 21 21 -*-*- END OF LINE -*-*- 22 23 2004/11/01: Markus Meyer and Keiichi Mase 24 25 * mmuon/MMuonCalibParCalc.[h,cc], 26 - changed according to Thomas Bretz's suggestion. 27 The main part of the calculation is moved from MMuonCalibPar to 28 MMuonCalibParCalc. 29 30 - changed. The function of the UseCleanForWidth is removed since we found 31 that we should get the Arc Width with uncleaned images. 32 33 * mmuon/MMuonSearchPar.[h,cc] 34 - changed according to Thomas Bretz's suggestion. 35 The pointer of the funciotn is changed to the reference. 36 37 * mmuon/MMuonCalibPar.[h,cc], 38 - changed according to Thomas Bretz's suggestion as written above. 39 40 22 41 23 42 2004/11/01: Abelardo Moralejo -
trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.h
r5210 r5331 10 10 #endif 11 11 12 class MGeomCam;13 12 class MCerPhotEvt; 14 13 class MMuonSearchPar; … … 29 28 Float_t fArcPhiThres; // The threshold value to define arc phi 30 29 Float_t fArcWidthThres; // The threshold value to define arc width 31 Int_t fArcPhiBinNum; // The bin number for the histogram of arc phi. You may change this value. However, if you change this, YOU ALSO HAVE TO CHANGE THE THRESHOLD VALUE TO GET ARC LENGTH. 30 31 public: 32 MMuonCalibPar(const char *name=NULL, const char *title=NULL); 33 ~MMuonCalibPar(); 34 35 Int_t fArcPhiBinNum; // The bin number for the histogram of arc phi. You may change this value. However, if you change this, YOU ALSO HAVE TO CHANGE THE THRESHOLD VALUE TO GET ARC LENGTH. 32 36 Int_t fArcWidthBinNum; // The bin number for the histogram of arc wid 33 37 Float_t fArcPhiHistStartVal; // The starting value for the histogram of arc phi … … 35 39 Float_t fArcWidthHistStartVal; // The starting value for the histogram of arc width 36 40 Float_t fArcWidthHistEndVal; // The end value for the histogram of arc width 37 Bool_t fEnableImpactCalc; // If true, the impact calculation will be done, which will consume a lot of time.38 Bool_t fDisablePreCuts; // If true, the pre cuts to select muons for the calibration will be disabled.39 Bool_t fUseCleanForWidth; // If true, the only signal after image cleaningwill be used for the histogram of arc width40 41 41 TH1F *fHistPhi; // Histogram of photon distribution along the arc. 42 TH1F *fHistWidth; // Histogram of radial photon distribution of the arc. 43 44 public: 45 MMuonCalibPar(const char *name=NULL, const char *title=NULL); 46 ~MMuonCalibPar(); 42 TH1F *fHistPhi; // Histogram of photon distribution along the arc. 43 TH1F *fHistWidth; // Histogram of radial photon distribution of the arc. 47 44 48 45 void Reset(); … … 65 62 TH1F *GetHistWidth() { return fHistWidth; } 66 63 64 void SetArcLength(Float_t len) { fArcLength = len; } 65 void SetArcPhi(Float_t phi) { fArcPhi = phi; } 66 void SetArcWidth(Float_t wid) { fArcWidth = wid; } 67 void SetChiArcPhi(Float_t chi) { fChiArcPhi = chi; } 68 void SetChiArcWidth(Float_t chi) { fChiArcWidth = chi; } 67 69 void SetMargin(Float_t margin) { fMargin = margin; } 70 void SetMuonSize(Float_t size) { fMuonSize = size; } 71 void SetEstImpact(Float_t impact) { fEstImpact = impact; } 72 void SetUseUnmap() { fUseUnmap = kTRUE; } 73 void SetPeakPhi(Float_t phi) { fPeakPhi = phi; } 68 74 void SetArcPhiThres(Float_t thres) { fArcPhiThres = thres; } 69 75 void SetArcWidthThres(Float_t thres) { fArcWidthThres = thres; } … … 71 77 void SetArcWidthBinNum(Int_t num) { fArcWidthBinNum = num; } 72 78 73 void EnableImpactCalc() { fEnableImpactCalc = kTRUE; }74 Bool_t IsEnableImpactCalc() { return fEnableImpactCalc; }75 void DisablePreCuts() { fDisablePreCuts = kTRUE; }76 Bool_t IsDisablePreCuts() { return fDisablePreCuts; }77 void UseCleanForWidth() { fUseCleanForWidth = kTRUE; }78 Bool_t IsUseCleanForWidth() { return fUseCleanForWidth; }79 80 79 void Print(Option_t *opt=NULL) const; 81 80 82 void FillHist(const MGeomCam &geom, const MCerPhotEvt &evt,83 const MMuonSearchPar &musearch);84 void CalcPhi(const MGeomCam &geom, const MCerPhotEvt &evt,85 const MMuonSearchPar &musearch);86 void CalcImpact(const MGeomCam &geom, const MMuonSearchPar &musearch,87 Int_t effbinnum, Float_t startfitval, Float_t endfitval);88 Float_t CalcWidth(const MGeomCam &geom, const MCerPhotEvt &evt,89 const MMuonSearchPar &musearch);90 Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &evt,91 MMuonSearchPar &musearch, const Float_t *cuts);92 93 81 ClassDef(MMuonCalibPar, 1) // Container to hold muon calibration parameters 94 82 }; -
trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc
r5210 r5331 30 30 // Storage Container for muon 31 31 // 32 // This class is the container for muon parameters. Actually, in this class,33 // muons are searched by fitting the image with a circle. (This function will34 // be called by using the class of MMuonSearchParCalc.) This container35 // especially holds the information of the results of the search (fit of36 // a image by a circle).32 // This class is the container for muon parameters. Actually, the calculation 33 // is done here. Muons are searched by fitting the image with a circle. 34 // (This function will be called by using the class of MMuonSearchParCalc.) 35 // This container especially holds the information of the results of the 36 // search (fit of a image by a circle). 37 37 // 38 38 // In order to use further information of muons such as the width of arcs, … … 85 85 #include "MCerPhotEvt.h" 86 86 #include "MCerPhotPix.h" 87 #include "MBinning.h"88 87 89 88 using namespace std; … … 118 117 // 119 118 void MMuonSearchPar::CalcTempCenter(const MHillas &hillas, 120 Float_t *xtmp1, Float_t *ytmp1, Float_t *xtmp2, Float_t *ytmp2)119 Float_t &xtmp1, Float_t &ytmp1, Float_t &xtmp2, Float_t &ytmp2) 121 120 { 122 121 Float_t a,dx,dy; … … 128 127 dy = -tmp_r/TMath::Sqrt(1+a*a)/3.; 129 128 130 *xtmp1 = hillas.GetMeanX() + dx;131 *ytmp1 = hillas.GetMeanY() + dy;132 *xtmp2 = hillas.GetMeanX() - dx;133 *ytmp2 = hillas.GetMeanY() - dy;129 xtmp1 = hillas.GetMeanX() + dx; 130 ytmp1 = hillas.GetMeanY() + dy; 131 xtmp2 = hillas.GetMeanX() - dx; 132 ytmp2 = hillas.GetMeanY() - dy; 134 133 } 135 134 … … 140 139 // 141 140 Bool_t MMuonSearchPar::CalcRadius(const MGeomCam &geom, const MCerPhotEvt &evt, 142 Float_t x, Float_t y, Float_t *r, Float_t *sigma)141 Float_t x, Float_t y, Float_t &r, Float_t &sigma) 143 142 { 144 143 Float_t mean_r=0., dev_r=0., sums=0., tmp=0.; … … 165 164 return kFALSE; 166 165 167 *r = mean_r/sums;168 169 if(dev_r/sums-( *r)*(*r)<1.E-10)166 r = mean_r/sums; 167 168 if(dev_r/sums-(r)*(r)<1.E-10) 170 169 return kFALSE; 171 170 172 *sigma = TMath::Sqrt(dev_r/sums-(*r)*(*r));171 sigma = TMath::Sqrt(dev_r/sums-(r)*(r)); 173 172 174 173 return kTRUE; … … 182 181 void MMuonSearchPar::CalcMinimumDeviation 183 182 ( const MGeomCam &geom, const MCerPhotEvt &evt, Float_t x, Float_t y, 184 Float_t xcog, Float_t ycog, Float_t sigma, Float_t *opt_rad,185 Float_t *new_sigma, Float_t *newx, Float_t *newy )183 Float_t xcog, Float_t ycog, Float_t sigma, Float_t &opt_rad, 184 Float_t &new_sigma, Float_t &newx, Float_t &newy ) 186 185 { 187 186 Float_t delta = 3.; // 3 mm (1/10 of an inner pixel size) Step to move. … … 195 194 if(r2 > 360000.) 196 195 { 197 *new_sigma=sigma; 198 *opt_rad=rad_tmp; 199 *newx=x; *newy=y; 196 new_sigma=sigma; 197 opt_rad=rad_tmp; 198 newx=x; 199 newy=y; 200 200 fNoMuon = kTRUE; 201 201 break; 202 202 } 203 if(CalcRadius(geom,evt,x,y+delta, &rad_tmp,&sig_tmp))203 if(CalcRadius(geom,evt,x,y+delta,rad_tmp,sig_tmp)) 204 204 { 205 205 if(sig_tmp<sigma) 206 206 { 207 sigma=sig_tmp; *opt_rad=rad_tmp; 207 sigma=sig_tmp; 208 opt_rad=rad_tmp; 208 209 y=y+delta; 209 210 continue; 210 211 } 211 212 } 212 if(CalcRadius(geom,evt,x-delta,y, &rad_tmp,&sig_tmp))213 if(CalcRadius(geom,evt,x-delta,y,rad_tmp,sig_tmp)) 213 214 { 214 215 if(sig_tmp<sigma) 215 216 { 216 sigma=sig_tmp; *opt_rad=rad_tmp; 217 sigma=sig_tmp; 218 opt_rad=rad_tmp; 217 219 x=x-delta; 218 220 continue; 219 221 } 220 222 } 221 if(CalcRadius(geom,evt,x+delta,y, &rad_tmp,&sig_tmp))223 if(CalcRadius(geom,evt,x+delta,y,rad_tmp,sig_tmp)) 222 224 { 223 225 if(sig_tmp<sigma) 224 226 { 225 sigma=sig_tmp; *opt_rad=rad_tmp; 227 sigma=sig_tmp; 228 opt_rad=rad_tmp; 226 229 x=x+delta; 227 230 continue; 228 231 } 229 232 } 230 if(CalcRadius(geom,evt,x,y-delta, &rad_tmp,&sig_tmp))233 if(CalcRadius(geom,evt,x,y-delta,rad_tmp,sig_tmp)) 231 234 { 232 235 if(sig_tmp<sigma) 233 236 { 234 sigma=sig_tmp; *opt_rad=rad_tmp; 237 sigma=sig_tmp; 238 opt_rad=rad_tmp; 235 239 y=y-delta; 236 240 continue; 237 241 } 238 242 } 239 *new_sigma=sigma; 240 *newx=x; *newy=y; 243 new_sigma=sigma; 244 newx=x; 245 newy=y; 241 246 break; 242 247 } … … 257 262 258 263 // gets temporaly center 259 CalcTempCenter(hillas, &xtmp1,&ytmp1,&xtmp2,&ytmp2);264 CalcTempCenter(hillas,xtmp1,ytmp1,xtmp2,ytmp2); 260 265 261 266 // determine which position will be the true position. Here mainly 262 267 // the curvature of a muon arc is relied on. 263 CalcRadius(geom, evt, xtmp1,ytmp1, &rad,&dev);264 CalcRadius(geom, evt, xtmp2,ytmp2, &rad2,&dev2);268 CalcRadius(geom, evt, xtmp1,ytmp1,rad,dev); 269 CalcRadius(geom, evt, xtmp2,ytmp2,rad2,dev2); 265 270 if(dev2<dev){ 266 271 xtmp1=xtmp2; ytmp1=ytmp2; dev=dev2; rad=rad2; … … 268 273 269 274 // find the best fit. 270 CalcMinimumDeviation(geom, evt, xtmp1,ytmp1,hillas.GetMeanX(),hillas.GetMeanY(), 271 dev, &opt_rad, &new_sigma, &newx, &newy); 275 CalcMinimumDeviation(geom, evt, xtmp1,ytmp1,hillas.GetMeanX(), 276 hillas.GetMeanY(), dev, opt_rad, new_sigma, 277 newx, newy); 272 278 273 279 fRadius = opt_rad; -
trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.h
r5210 r5331 4 4 #ifndef MARS_MParContainer 5 5 #include "MParContainer.h" 6 #endif7 8 #ifndef ROOT_TH19 #include <TH1.h>10 #endif11 12 #ifndef ROOT_TArrayI13 #include <TArrayI.h>14 6 #endif 15 7 … … 39 31 void SetNoMuon() { fNoMuon = kTRUE; } 40 32 33 void CalcTempCenter(const MHillas &hillas, Float_t &xtmp1, 34 Float_t &ytmp1, Float_t &xtmp2, Float_t &ytmp2); 35 Bool_t CalcRadius(const MGeomCam &geom, const MCerPhotEvt &evt, Float_t x, 36 Float_t y, Float_t &r, Float_t &sigma); 37 void CalcMinimumDeviation(const MGeomCam &geom, const MCerPhotEvt &evt, 38 Float_t x, Float_t y, Float_t xcog, 39 Float_t ycog, Float_t sigma, Float_t &opt_rad, 40 Float_t &new_sigma, Float_t &newx, Float_t &newy); 41 void Calc(const MGeomCam &geom, const MCerPhotEvt &evt, 42 const MHillas &hillas); 43 41 44 void Print(Option_t *opt=NULL) const; 42 45 void Print(const MGeomCam &geom, Option_t *opt=NULL) const; 43 void CalcTempCenter(const MHillas &hillas, Float_t *xtmp1,44 Float_t *ytmp1, Float_t *xtmp2, Float_t *ytmp2);45 Bool_t CalcRadius(const MGeomCam &geom, const MCerPhotEvt &evt, Float_t x,46 Float_t y, Float_t *r, Float_t *sigma);47 void CalcMinimumDeviation(const MGeomCam &geom, const MCerPhotEvt &evt,48 Float_t x, Float_t y, Float_t xcog,49 Float_t ycog, Float_t sigma, Float_t *opt_rad,50 Float_t *new_sigma, Float_t *newx, Float_t *newy);51 void Calc(const MGeomCam &geom, const MCerPhotEvt &evt,52 const MHillas &hillas);53 46 54 47 ClassDef(MMuonSearchPar, 1) // Container to hold muon search parameters
Note:
See TracChangeset
for help on using the changeset viewer.