Changeset 2026 for trunk/MagicSoft
- Timestamp:
- 04/28/03 15:39:40 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2021 r2026 1 1 -*-*- END OF LINE -*-*- 2 2003/04/27: Thomas Bretz 3 4 * NEWS: 5 - updated 6 7 * manalysis/MBlindPixelCalc.cc: 8 - use Are of pixles while interpolating 9 10 * mbase/MEvtLoop.cc: 11 - output speed in Evts/s to fDisplay 12 13 * mbase/MGGroupFrame.h: 14 - fixed a typo 15 16 * mbase/MTask.[h,cc]: 17 - Added OverwritesProcess 18 19 * mbase/MTaskList.[h,cc]: 20 - removed CheckClassForProcess 21 - replaced by MTask::OverwritesProcess 22 23 * mhist/MFillH.cc: 24 - only draw something if the class overwrites the Draw function 25 26 * mhist/MH.[h,cc]: 27 - added OverwritesDraw 28 - added a higher maximum, lower minimum to Draw(TH1, TH1) 29 - changed default size 30 31 * mhist/MHMatrix.cc: 32 - mini change 33 34 * mimage/MHHillas.[h,cc]: 35 - removed fUsedPix 36 - removed fCorePix 37 38 * mimage/MHHillasExt.[h,cc]: 39 - removed fHConc 40 - removed fHConc1 41 - changed default name to MHillasExt 42 43 * mimage/MHNewImagePar.[h,cc]: 44 - added fHistConc 45 - added fHistConc1 46 - added fHistUsedPix 47 - added fHistCorePix 48 49 * mimage/MHillas.cc: 50 - removed fNumCorePixels 51 - removed fNumUsedPixels 52 - made fCosDelta writable 53 - made fSinDelta writable 54 - made GetSinDelta() public 55 - made GetCosDelta() public 56 57 * mimage/MHillasExt.[h,cc]: 58 - removed fConc 59 - removed fConc1 60 - changed default name to MHillasExt 61 - derives from MParContainer now instead of MHillas 62 63 * mimage/MNewImagePar.[h,cc]: 64 - added fNumCorePixels 65 - added fNumUsedPixels 66 - added fConc 67 - added fConc1 68 69 * mimage/MNewImageParCalc.[h,cc]: 70 - removed 71 72 * mimage/MHillasCalc.[h,cc]: 73 - changed so, that it can calc MHillas, MHillasExt and MNewImagePar 74 75 * mimage/MHillasSrc.cc: 76 - sqrt(tand*tand+1) replaced by 1/CosDelta 77 78 * mmain/MStatusDisplay.[h,cc]: 79 - added second argument to SetLogStream 80 81 * mhist/MHAlphaEnergyTheta.[h,cc], mhist/MHAlphaEnergyTime.[h,cc], 82 mhist/MHCerPhotEvt.[h,cc], mhist/MHEffOnTime.[h,cc], 83 mhist/MHEffOnTimeTheta.[h,cc], mhist/MHEffOnTimeTime.[h,cc], 84 mhist/MHEnergyTheta.[h,cc], mhist/MHEnergyTime.[h,cc], 85 mhist/MHFlux.[h,cc], mhist/MHMatrix.[h,cc], 86 mhist/MHSigmaTheta.[h,cc], mhistmc/MHMcCollectionArea.[h,cc], 87 mhistmc/MHMcDifRate.[h,cc], mhistmc/MHMcEfficiency.[h,cc], 88 mhistmc/MHMcEfficiencyEnergy.[h,cc], mhistmc/MHMcEfficiencyImpact.[h,cc], 89 mhistmc/MHMcEnergy.[h,cc], mhistmc/MHMcEnergyImpact.[h,cc], 90 mhistmc/MHMcEnergyMigration.[h,cc], mhistmc/MHMcRate.[h,cc]: 91 - removed DrawClone 92 - fixed Draw 93 94 * macros/MagicHillas.C, macros/star.C: 95 - removed MHillasExt (not necessary anymore) 96 - added MNewImagePar 97 98 * macros/readCT1.C, macros/readMagic.C, meventdisp/MGCamDisplay.cc, 99 mmain/MAnalysis.cc: 100 - added MHillasExt to be displayed 101 - added MNewImagePar to be displayed 102 2 103 3 104 -
trunk/MagicSoft/Mars/macros/MagicHillas.C
r1646 r2026 36 36 // 37 37 MParList plist; 38 39 38 40 39 MTaskList tlist; … … 112 111 MHillasSrcCalc csrc1; 113 112 114 //115 // To use MHillasExt instead of MHillas116 //117 MHillasExt hext;118 plist.AddToList(&hext);119 120 113 MFillH hfill1("MHHillas", "MHillas"); 121 114 MFillH hfill2("MHHillasExt"); … … 123 116 MFillH hfill4("HistExtSource [MHHillasExt]", "MHillasSrc"); 124 117 MFillH hfill5("HistSource [MHHillasSrc]", "MHillasSrc"); 118 MFillH hfill6("MHNewImagePar"); 125 119 126 120 MWriteRootFile write("hillas.root"); … … 130 124 write.AddContainer("HistSource"); 131 125 write.AddContainer("HistExtSource"); 126 write.AddContainer("MHNewImagePar"); 132 127 133 128 tlist.AddToList(&read); … … 146 141 tlist.AddToList(&hfill4); 147 142 tlist.AddToList(&hfill5); 143 tlist.AddToList(&hfill6); 148 144 tlist.AddToList(&write); 149 145 … … 172 168 plist.FindObject("HistSource")->DrawClone(); 173 169 plist.FindObject("HistExtSource")->DrawClone(); 170 plist.FindObject("MHNewImagePar")->DrawClone(); 174 171 } 175 172 -
trunk/MagicSoft/Mars/macros/readCT1.C
r1325 r2026 49 49 MParList plist; 50 50 51 MGeomCamCT1 geomcam; 52 MHillas hillas; 53 MTaskList tlist; 51 MGeomCamCT1 geomcam; 52 MHillas hillas; 53 MHillasExt hillasext; 54 MNewImagePar newimgpar; 55 MTaskList tlist; 54 56 55 57 plist.AddToList(&geomcam); 56 58 plist.AddToList(&hillas); 59 plist.AddToList(&hillasext); 60 plist.AddToList(&newimagepar); 57 61 plist.AddToList(&tlist); 58 62 … … 77 81 display.Draw(); 78 82 79 while ( tlist.Process())83 while ((rc=tlist.Process())) 80 84 { 81 85 cout << "Event #" << icount++ << endl; 82 86 83 87 MCerPhotEvt *evt = (MCerPhotEvt*)clone.GetClone(); 84 85 if (!evt) 88 if (!evt) // If skipped due to MInputStreamId 86 89 continue; 87 90 88 display.DrawPhotNum(evt); 91 display.FillPhotNum(*evt); 92 display.Update(); 89 93 90 94 if (!HandleInput()) 91 95 break; 92 96 97 hillas.Draw(); 93 98 hillas.Print(); 94 hillas.Draw(); 95 display.DrawPhotNum((MCerPhotEvt*)plist.FindObject("MCerPhotEvt")); 99 hillasext.Print(); 100 newimgpar.Print(); 101 102 display.FillPhotNum(*(MCerPhotEvt*)plist.FindObject("MCerPhotEvt")); 103 display.Update(); 96 104 97 105 if (!HandleInput()) -
trunk/MagicSoft/Mars/macros/readMagic.C
r1965 r2026 51 51 52 52 MGeomCamMagic geomcam; 53 MHillasExt hillas; 53 MHillas hillas; 54 MHillasExt hillasext; 55 MNewImagePar newimgpar; 54 56 MTaskList tlist; 55 57 56 58 plist.AddToList(&geomcam); 57 59 plist.AddToList(&hillas); 60 plist.AddToList(&hillasext); 61 plist.AddToList(&newimgpar); 58 62 plist.AddToList(&tlist); 59 63 … … 107 111 break; 108 112 113 hillas.Draw(); 109 114 hillas.Print(); 110 hillas.Draw(); 115 hillasext.Print(); 116 newimgpar.Print(); 111 117 112 118 display.FillPhotNum(*(MCerPhotEvt*)plist.FindObject("MCerPhotEvt")); -
trunk/MagicSoft/Mars/macros/star.C
r1847 r2026 52 52 53 53 // 54 // Uncomment this two line if you want to use MHillasExt instead55 // of MHillas56 //57 MHillasExt hext;58 plist.AddToList(&hext);59 60 //61 54 // The geometry container must be created by yourself to make sure 62 55 // that you don't choose a wrong geometry by mistake … … 73 66 74 67 // ------------- user change ----------------- 75 read.AddFile(" Pro*.root");68 read.AddFile("data/Gamma_z*.root"); 76 69 //read.AddFile("Gam*.root"); 77 70 … … 90 83 MWriteRootFile write("data/star_protons.root"); 91 84 write.AddContainer("MHillas", "Events"); 85 write.AddContainer("MHillasExt", "Events"); 86 write.AddContainer("MNewImagePar", "Events"); 92 87 write.AddContainer("MMcEvt", "Events"); 93 88 write.AddContainer("MHillasSrc", "Events"); -
trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc
r1966 r2026 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 10/2001 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz, 10/2001 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! … … 32 32 #include "MGTask.h" // MGTask::CreateGui 33 33 #include "MClone.h" // MClone 34 #include "MHillas Ext.h" // MHillasExt34 #include "MHillas.h" // MHillas 35 35 #include "MParList.h" // MParList::AddToList 36 36 #include "MEvtLoop.h" // MEvtLoop::GetParList … … 134 134 MGeomCamMagic *geom = new MGeomCamMagic; 135 135 MPedestalCam *pedest = new MPedestalCam; 136 MHillasExt *hext = new MHillasExt;137 136 138 137 plist->AddToList(geom); 139 138 plist->AddToList(pedest); 140 plist->AddToList(hext);141 139 142 140 return geom; … … 147 145 // Constructor. 148 146 // 149 MGCamDisplay::MGCamDisplay(const char *filename, 150 const TGWindow *p, /*const TGWindow *main,*/ 147 MGCamDisplay::MGCamDisplay(const char *filename, const TGWindow *p, 151 148 UInt_t w, UInt_t h) 152 : MGEvtDisplay(filename, "Events", p, /*main,*/w, h)149 : MGEvtDisplay(filename, "Events", p, w, h) 153 150 { 154 151 // … … 212 209 // 213 210 MHillas *hillas = (MHillas*)plist->FindObject("MHillas"); 211 212 plist->FindObject("MHillasExt")->Print(); 213 plist->FindObject("MNewImagePar")->Print(); 214 214 215 215 hillas->Print(); -
trunk/MagicSoft/Mars/mimage/ImageLinkDef.h
r1940 r2026 15 15 16 16 #pragma link C++ class MNewImagePar+; 17 #pragma link C++ class MNewImageParCalc+;18 17 19 18 #pragma link C++ class MHHillas+; -
trunk/MagicSoft/Mars/mimage/MHHillas.cc
r1992 r2026 70 70 fDistC = new TH1F("DistC", "Distance from center of camera", 100, 0, 445); 71 71 fDelta = new TH1F("Delta", "Angle (Main axis - x-axis)", 101, -90, 90); 72 fUsedPix = new TH1F("UsedPix", "Number of used pixels", 150, 0, 150);73 fCorePix = new TH1F("CorePix", "Number of core pixels", 150, 0, 150);74 72 75 73 fLength->SetLineColor(kBlue); 76 fCorePix->SetLineColor(kRed);77 fUsedPix->SetLineColor(kGreen);78 74 79 75 fLength->SetDirectory(NULL); … … 81 77 fDistC->SetDirectory(NULL); 82 78 fDelta->SetDirectory(NULL); 83 fUsedPix->SetDirectory(NULL);84 fCorePix->SetDirectory(NULL);85 79 86 80 fLength->SetXTitle("Length [mm]"); … … 88 82 fDistC->SetXTitle("Distance [mm]"); 89 83 fDelta->SetXTitle("Delta [\\circ]"); 90 fUsedPix->SetXTitle("Number of Pixels");91 fCorePix->SetXTitle("Number of Pixels");92 84 93 85 fLength->SetYTitle("Counts"); … … 95 87 fDistC->SetYTitle("Counts"); 96 88 fDelta->SetYTitle("Counts"); 97 fUsedPix->SetYTitle("Counts");98 fCorePix->SetYTitle("Counts");99 89 100 90 MBinning bins; … … 134 124 delete fSize; 135 125 delete fCenter; 136 137 delete fUsedPix;138 delete fCorePix;139 126 } 140 127 … … 165 152 ApplyBinning(*plist, "Delta", fDelta); 166 153 ApplyBinning(*plist, "Size", fSize); 167 ApplyBinning(*plist, "Pixels", fUsedPix);168 ApplyBinning(*plist, "Pixels", fCorePix);169 154 170 155 const MBinning *bins = (MBinning*)plist->FindObject("BinningCamera"); … … 262 247 const Double_t scale = fUseMmScale ? 1 : fMm2Deg; 263 248 264 fLength ->Fill(scale*h.GetLength()); 265 fWidth ->Fill(scale*h.GetWidth()); 266 fDistC ->Fill(scale*d); 267 fCenter ->Fill(scale*h.GetMeanX(), scale*h.GetMeanY()); 268 fDelta ->Fill(kRad2Deg*h.GetDelta()); 269 fSize ->Fill(h.GetSize()); 270 fUsedPix->Fill(h.GetNumUsedPixels()); 271 fCorePix->Fill(h.GetNumCorePixels()); 249 fLength ->Fill(scale*h.GetLength(), w); 250 fWidth ->Fill(scale*h.GetWidth(), w); 251 fDistC ->Fill(scale*d, w); 252 fCenter ->Fill(scale*h.GetMeanX(), scale*h.GetMeanY(), w); 253 fDelta ->Fill(kRad2Deg*h.GetDelta(), w); 254 fSize ->Fill(h.GetSize(), w); 272 255 273 256 return kTRUE; … … 289 272 // -------------------------------------------------------------------------- 290 273 // 291 // Draw clones of four histograms. So that the object can be deleted292 // and the histograms are still visible in the canvas.293 // The cloned object are deleted together with the canvas if the canvas is294 // destroyed. If you want to handle dostroying the canvas you can get a295 // pointer to it from this function296 //297 TObject *MHHillas::DrawClone(Option_t *opt) const298 {299 return MH::DrawClone(opt, 720, 810);300 }301 302 // --------------------------------------------------------------------------303 //304 274 // Creates a new canvas and draws the four histograms into it. 305 275 // Be careful: The histograms belongs to this object and won't get deleted … … 308 278 void MHHillas::Draw(Option_t *) 309 279 { 310 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this , 720, 810);280 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 311 281 pad->SetBorderMode(0); 312 282 … … 320 290 321 291 pad->cd(2); 292 gPad->SetBorderMode(0); 293 fDistC->Draw(); 294 295 pad->cd(3); 322 296 gPad->SetBorderMode(0); 323 297 gPad->SetLogx(); 324 298 fSize->Draw(); 325 299 326 pad->cd(3);327 gPad->SetBorderMode(0);328 MH::Draw(*fCorePix, *fUsedPix, "Number of core/used Pixels");329 330 300 pad->cd(4); 331 301 gPad->SetBorderMode(0); 332 fDelta->Draw(); 333 334 pad->cd(5); 335 gPad->SetBorderMode(0); 336 fDistC->Draw(); 337 338 pad->cd(6); 339 gPad->SetBorderMode(0); 302 gPad->SetPad(0.51, 0.01, 0.99, 0.65); 340 303 SetColors(); 341 304 fCenter->Draw("colz"); 305 306 pad->cd(5); 307 gPad->SetBorderMode(0); 308 fDelta->Draw(); 309 310 pad->cd(6); 311 delete gPad; 342 312 343 313 pad->Modified(); … … 353 323 if (name.Contains("Size", TString::kIgnoreCase)) 354 324 return fSize; 355 if (name.Contains("Core", TString::kIgnoreCase))356 return fCorePix;357 if (name.Contains("Used", TString::kIgnoreCase))358 return fUsedPix;359 325 if (name.Contains("Delta", TString::kIgnoreCase)) 360 326 return fDelta; -
trunk/MagicSoft/Mars/mimage/MHHillas.h
r1992 r2026 22 22 TH1F *fSize; //-> Sum of used pixels 23 23 TH2F *fCenter; //-> Center 24 25 TH1F *fUsedPix; //-> Number of used pixels26 TH1F *fCorePix; //-> Number of core pixels27 24 28 25 void SetColors() const; … … 55 52 56 53 void Draw(Option_t *opt=NULL); 57 TObject *DrawClone(Option_t *opt=NULL) const;58 54 59 55 //Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; } -
trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
r1992 r2026 57 57 // 58 58 MHHillasExt::MHHillasExt(const char *name, const char *title) 59 : fMm2Deg(1), fUseMmScale(kTRUE), fHilName("MHillas ")59 : fMm2Deg(1), fUseMmScale(kTRUE), fHilName("MHillasExt") 60 60 { 61 61 // … … 70 70 // connect all the histogram with the container fHist 71 71 // 72 fHConc1.SetLineColor(kBlue);73 fHConc.SetFillStyle(0);74 75 fHConc.SetDirectory(NULL);76 fHConc1.SetDirectory(NULL);77 72 fHAsym.SetDirectory(NULL); 78 73 fHM3Long.SetDirectory(NULL); 79 74 fHM3Trans.SetDirectory(NULL); 80 75 81 fHConc.SetName("Conc2");82 fHConc1.SetName("Conc1");83 76 fHAsym.SetName("Asymmetry"); 84 77 fHM3Long.SetName("3rd Mom Long"); 85 78 fHM3Trans.SetName("3rd Mom Trans"); 86 79 87 fHConc.SetTitle("Ratio: Conc");88 fHConc1.SetTitle("Ratio: Conc1");89 80 fHAsym.SetTitle("Asymmetry"); 90 81 fHM3Long.SetTitle("3^{rd} Moment Longitudinal"); 91 82 fHM3Trans.SetTitle("3^{rd} Moment Transverse"); 92 83 93 fHConc.SetXTitle("Ratio");94 fHConc1.SetXTitle("Ratio");95 84 fHAsym.SetXTitle("Asym [mm]"); 96 85 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]"); 97 86 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]"); 98 87 99 fHConc.SetYTitle("Counts");100 fHConc1.SetYTitle("Counts");101 88 fHAsym.SetYTitle("Counts"); 102 89 fHM3Long.SetYTitle("Counts"); 103 90 fHM3Trans.SetYTitle("Counts"); 104 91 105 fHConc.SetFillStyle(4000);106 fHConc1.SetFillStyle(4000);107 92 fHAsym.SetFillStyle(4000); 108 93 fHM3Long.SetFillStyle(4000); 109 94 fHM3Trans.SetFillStyle(4000); 110 95 96 fHM3Trans.SetLineColor(kBlue); 97 111 98 MBinning bins; 112 113 bins.SetEdges(100, 0, 1);114 bins.Apply(fHConc);115 bins.Apply(fHConc1);116 99 117 100 bins.SetEdges(101, -326, 326); … … 151 134 } 152 135 153 ApplyBinning(*plist, "Conc", &fHConc);154 ApplyBinning(*plist, "Conc1", &fHConc1);155 136 ApplyBinning(*plist, "Asym", &fHAsym); 156 137 ApplyBinning(*plist, "M3Long", &fHM3Long); … … 171 152 const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, (src ? src->GetCosDeltaAlpha() : 1)); 172 153 173 fHConc.Fill(fHillasExt->GetConc()); 174 fHConc1.Fill(fHillasExt->GetConc1()); 175 176 fHAsym.Fill(scale*fHillasExt->GetAsym()); 177 fHM3Long.Fill(scale*fHillasExt->GetM3Long()); 178 fHM3Trans.Fill(scale*fHillasExt->GetM3Trans()); 154 fHAsym.Fill(scale*fHillasExt->GetAsym(), w); 155 fHM3Long.Fill(scale*fHillasExt->GetM3Long(), w); 156 fHM3Trans.Fill(scale*fHillasExt->GetM3Trans(), w); 179 157 //fHAsymna.Fill(scale*ext.GetAsymna()); 180 158 //fHAsym0.Fill(scale*ext.GetAsym0()); … … 243 221 // -------------------------------------------------------------------------- 244 222 // 245 // Draw clones of all four histograms. So that the object can be deleted246 // and the histograms are still visible in the canvas.247 // The cloned object are deleted together with the canvas if the canvas is248 // destroyed. If you want to handle dostroying the canvas you can get a249 // pointer to it from this function250 //251 TObject *MHHillasExt::DrawClone(Option_t *opt) const252 {253 return MH::DrawClone(opt, 720, 540);254 }255 256 // --------------------------------------------------------------------------257 //258 223 // Creates a new canvas and draws the four histograms into it. 259 224 // Be careful: The histograms belongs to this object and won't get deleted … … 262 227 void MHHillasExt::Draw(Option_t *) 263 228 { 264 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this , 720, 540);229 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 265 230 pad->SetBorderMode(0); 266 231 267 232 AppendPad(""); 268 233 269 pad->Divide( 2, 2);234 pad->Divide(1, 2); 270 235 271 236 pad->cd(1); 272 237 gPad->SetBorderMode(0); 273 MH::Draw(fH Conc1, fHConc, "Concentrations");238 MH::Draw(fHM3Long, fHM3Trans, "3^{rd} Moments"); 274 239 275 240 pad->cd(2); … … 277 242 fHAsym.Draw(); 278 243 279 pad->cd(3);280 gPad->SetBorderMode(0);281 fHM3Long.Draw();282 283 pad->cd(4);284 gPad->SetBorderMode(0);285 fHM3Trans.Draw();286 287 244 pad->Modified(); 288 245 pad->Update(); … … 291 248 TH1 *MHHillasExt::GetHistByName(const TString name) 292 249 { 293 if (name.Contains("Conc", TString::kIgnoreCase))294 return &fHConc;295 if (name.Contains("Conc1", TString::kIgnoreCase))296 return &fHConc1;297 250 if (name.Contains("Asym", TString::kIgnoreCase)) 298 251 return &fHAsym; -
trunk/MagicSoft/Mars/mimage/MHHillasExt.h
r1992 r2026 16 16 MHillasExt *fHillasExt; //! Pointer to the MHillasExt container 17 17 18 TH1F fHConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize19 TH1F fHConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize20 18 TH1F fHAsym; // [mm] fDist minus dist: center of ellipse, highest pixel 21 19 TH1F fHM3Long; // [mm] 3rd moment (e-weighted) along major axis … … 41 39 42 40 void Draw(Option_t *opt=NULL); 43 TObject *DrawClone(Option_t *opt=NULL) const;44 41 45 42 ClassDef(MHHillasExt, 1) // Container which holds histograms for the extended hillas parameters -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r2004 r2026 132 132 const MHillasSrc &h = *(MHillasSrc*)par; 133 133 134 fAlpha->Fill(h.GetAlpha() );135 fDist ->Fill(fUseMmScale ? h.GetDist() : fMm2Deg*h.GetDist() );136 fCosDA->Fill(h.GetCosDeltaAlpha() );134 fAlpha->Fill(h.GetAlpha(), w); 135 fDist ->Fill(fUseMmScale ? h.GetDist() : fMm2Deg*h.GetDist(), w); 136 fCosDA->Fill(h.GetCosDeltaAlpha(), w); 137 137 138 138 return kTRUE; … … 186 186 // -------------------------------------------------------------------------- 187 187 // 188 // Draw clones of all two histograms. So that the object can be deleted189 // and the histograms are still visible in the canvas.190 // The cloned object are deleted together with the canvas if the canvas is191 // destroyed. If you want to handle dostroying the canvas you can get a192 // pointer to it from this function193 //194 TObject *MHHillasSrc::DrawClone(Option_t *opt) const195 {196 return MH::DrawClone(opt, 700, 500);197 }198 199 // --------------------------------------------------------------------------200 //201 188 // Creates a new canvas and draws the two histograms into it. 202 189 // Be careful: The histograms belongs to this object and won't get deleted … … 205 192 void MHHillasSrc::Draw(Option_t *) 206 193 { 207 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this , 700, 500);194 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 208 195 pad->SetBorderMode(0); 209 196 -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.h
r2004 r2026 36 36 37 37 void Draw(Option_t *opt=NULL); 38 TObject *DrawClone(Option_t *opt=NULL) const;39 38 40 39 ClassDef(MHHillasSrc, 1) // Container which holds histograms for the source dependant parameters -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r1992 r2026 16 16 ! 17 17 ! 18 ! Author(s): Wolfgang Wittek 03/2003 <mailto:wittek@mppmu.mpg.de> 18 ! Author(s): Wolfgang Wittek, 03/2003 <mailto:wittek@mppmu.mpg.de> 19 ! Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 20 ! 20 21 ! Copyright: MAGIC Software Development, 2000-2003 … … 23 24 \* ======================================================================== */ 24 25 25 /////////////////////////////////////////////////////////////////////// 26 ///////////////////////////////////////////////////////////////////////////// 26 27 // 27 28 // MHNewImagePar 28 29 // 29 // This class contains histograms for every Hillas parameter 30 // 31 /////////////////////////////////////////////////////////////////////// 30 //////////////////////////////////////////////////////////////////////////// 32 31 #include "MHNewImagePar.h" 33 32 … … 42 41 43 42 #include "MGeomCam.h" 44 43 #include "MBinning.h" 45 44 #include "MParList.h" 46 45 … … 59 58 fTitle = title ? title : "Histograms of new image parameters"; 60 59 61 fLeakage1 = new TH1F("Leakage1", "Leakage_{1}", 100, 0.0, 1.0); 62 fLeakage1->SetDirectory(NULL); 63 fLeakage1->SetXTitle("Leakage"); 64 fLeakage1->SetYTitle("Counts"); 65 66 fLeakage2 = new TH1F("Leakage2", "Leakage_{2}", 100, 0.0, 1.0); 67 fLeakage2->SetDirectory(NULL); 68 fLeakage2->SetXTitle("Leakage"); 69 fLeakage2->SetYTitle("Counts"); 70 fLeakage2->SetLineColor(kBlue); 71 } 72 73 // -------------------------------------------------------------------------- 74 // 75 // Delete the four histograms 76 // 77 MHNewImagePar::~MHNewImagePar() 78 { 79 delete fLeakage1; 80 delete fLeakage2; 81 } 60 fHistLeakage1.SetName("Leakage1"); 61 fHistLeakage1.SetTitle("Leakage_{1}"); 62 fHistLeakage1.SetXTitle("Leakage"); 63 fHistLeakage1.SetYTitle("Counts"); 64 fHistLeakage1.SetDirectory(NULL); 65 fHistLeakage1.SetFillStyle(4000); 66 67 fHistLeakage2.SetName("Leakage2"); 68 fHistLeakage2.SetTitle("Leakage_{2}"); 69 fHistLeakage2.SetXTitle("Leakage"); 70 fHistLeakage2.SetYTitle("Counts"); 71 fHistLeakage2.SetDirectory(NULL); 72 fHistLeakage2.SetLineColor(kBlue); 73 fHistLeakage2.SetFillStyle(4000); 74 75 fHistUsedPix.SetName("UsedPix"); 76 fHistUsedPix.SetTitle("Number of used pixels"); 77 fHistUsedPix.SetXTitle("Number of Pixels"); 78 fHistUsedPix.SetYTitle("Counts"); 79 fHistUsedPix.SetDirectory(NULL); 80 fHistUsedPix.SetLineColor(kGreen); 81 fHistUsedPix.SetFillStyle(4000); 82 83 fHistCorePix.SetName("CorePix"); 84 fHistCorePix.SetTitle("Number of core pixels"); 85 fHistCorePix.SetXTitle("Number of Pixels"); 86 fHistCorePix.SetYTitle("Counts"); 87 fHistCorePix.SetDirectory(NULL); 88 fHistCorePix.SetLineColor(kRed); 89 fHistCorePix.SetFillStyle(4000); 90 91 fHistConc.SetDirectory(NULL); 92 fHistConc1.SetDirectory(NULL); 93 fHistConc.SetName("Conc2"); 94 fHistConc1.SetName("Conc1"); 95 fHistConc.SetTitle("Ratio: Conc"); 96 fHistConc1.SetTitle("Ratio: Conc1"); 97 fHistConc.SetXTitle("Ratio"); 98 fHistConc1.SetXTitle("Ratio"); 99 fHistConc.SetYTitle("Counts"); 100 fHistConc1.SetYTitle("Counts"); 101 fHistConc.SetFillStyle(4000); 102 fHistConc1.SetFillStyle(4000); 103 fHistConc1.SetLineColor(kBlue); 104 fHistConc.SetFillStyle(0); 105 106 107 MBinning bins; 108 109 bins.SetEdges(100, 0, 1); 110 bins.Apply(fHistLeakage1); 111 bins.Apply(fHistLeakage2); 112 bins.Apply(fHistConc); 113 bins.Apply(fHistConc1); 114 115 bins.SetEdges(150, 0, 150); 116 bins.Apply(fHistUsedPix); 117 bins.Apply(fHistCorePix); 118 } 119 120 // -------------------------------------------------------------------------- 121 // 122 // Setup the Binning for the histograms automatically if the correct 123 // instances of MBinning 124 // 125 Bool_t MHNewImagePar::SetupFill(const MParList *plist) 126 { 127 ApplyBinning(*plist, "Leakage", &fHistLeakage1); 128 ApplyBinning(*plist, "Leakage", &fHistLeakage2); 129 130 ApplyBinning(*plist, "Pixels", &fHistUsedPix); 131 ApplyBinning(*plist, "Pixels", &fHistCorePix); 132 133 ApplyBinning(*plist, "Conc", &fHistConc); 134 ApplyBinning(*plist, "Conc1", &fHistConc1); 135 136 return kTRUE; 137 } 138 82 139 83 140 // -------------------------------------------------------------------------- … … 89 146 const MNewImagePar &h = *(MNewImagePar*)par; 90 147 91 fLeakage1->Fill(h.GetLeakage1()); 92 fLeakage2->Fill(h.GetLeakage2()); 148 fHistLeakage1.Fill(h.GetLeakage1(), w); 149 fHistLeakage2.Fill(h.GetLeakage2(), w); 150 151 fHistUsedPix.Fill(h.GetNumUsedPixels(), w); 152 fHistCorePix.Fill(h.GetNumCorePixels(), w); 153 154 fHistConc.Fill(h.GetConc(), w); 155 fHistConc1.Fill(h.GetConc1(), w); 93 156 94 157 return kTRUE; … … 108 171 AppendPad(""); 109 172 110 MH::Draw(*fLeakage1, *fLeakage2, "Leakage1 and Leakage2"); 173 pad->Divide(2,2); 174 175 pad->cd(1); 176 gPad->SetBorderMode(0); 177 TAxis &x = *fHistLeakage1.GetXaxis(); 178 x.SetRangeUser(0.01, x.GetXmax()); 179 MH::Draw(fHistLeakage1, fHistLeakage2, "Leakage1 and Leakage2"); 180 181 pad->cd(2); 182 gPad->SetBorderMode(0); 183 MH::Draw(fHistCorePix, fHistUsedPix, "Number of core/used Pixels"); 184 185 pad->cd(3); 186 gPad->SetBorderMode(0); 187 MH::Draw(fHistConc1, fHistConc, "Concentrations"); 188 189 pad->cd(4); 190 gPad->SetBorderMode(0); 111 191 112 192 pad->Modified(); … … 117 197 { 118 198 if (name.Contains("Leakage1", TString::kIgnoreCase)) 119 return fLeakage1; 120 199 return &fHistLeakage1; 121 200 if (name.Contains("Leakage2", TString::kIgnoreCase)) 122 return fLeakage2; 201 return &fHistLeakage2; 202 if (name.Contains("Conc", TString::kIgnoreCase)) 203 return &fHistConc; 204 if (name.Contains("Conc1", TString::kIgnoreCase)) 205 return &fHistConc1; 206 if (name.Contains("UsedPix", TString::kIgnoreCase)) 207 return &fHistUsedPix; 208 if (name.Contains("CorePix", TString::kIgnoreCase)) 209 return &fHistCorePix; 123 210 124 211 return NULL; -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.h
r1992 r2026 5 5 #include "MH.h" 6 6 #endif 7 #ifndef ROOT_TH1 8 #include <TH1.h> 9 #endif 7 10 8 class TH1F;9 11 class MHillas; 10 12 … … 12 14 { 13 15 private: 14 TH1F *fLeakage1; //-> 15 TH1F *fLeakage2; //-> 16 TH1F fHistLeakage1; // 17 TH1F fHistLeakage2; // 18 19 TH1F fHistUsedPix; // Number of used pixels 20 TH1F fHistCorePix; // Number of core pixels 21 22 TH1F fHistConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 23 TH1F fHistConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 16 24 17 25 public: 18 26 MHNewImagePar(const char *name=NULL, const char *title=NULL); 19 ~MHNewImagePar();20 27 28 Bool_t SetupFill(const MParList *plist); 21 29 Bool_t Fill(const MParContainer *par, Double_t w=1); 22 30 23 31 TH1 *GetHistByName(const TString name); 24 32 25 TH1F *GetHistLeakage1() { return fLeakage1; } 26 TH1F *GetHistLeakage2() { return fLeakage2; } 33 TH1F &GetHistLeakage1() { return fHistLeakage1; } 34 TH1F &GetHistLeakage2() { return fHistLeakage2; } 35 36 TH1F &GetHistUsedPix() { return fHistUsedPix; } 37 TH1F &GetHistCorePix() { return fHistCorePix; } 38 39 TH1F &GetHistConc() { return fHistConc; } 40 TH1F &GetHistConc1() { return fHistConc1; } 27 41 28 42 void Draw(Option_t *opt=NULL); -
trunk/MagicSoft/Mars/mimage/MHillas.cc
r1940 r2026 21 21 ! Author(s): Wolfgang Wittek 6/2002 <mailto:wittek@mppmu.mpg.de> 22 22 ! 23 ! Copyright: MAGIC Software Development, 2000-200 223 ! Copyright: MAGIC Software Development, 2000-2003 24 24 ! 25 25 ! … … 50 50 // fNumUsedPixels number of pixels which survived the cleaning 51 51 // 52 // Version 3: 53 // ---------- 54 // fNumCorePixels moved to MNewImagePar 55 // fNumUsedPixels moved to MNewImagePar 56 // fCosDelta added 57 // fSinDelte added 58 // 52 59 ///////////////////////////////////////////////////////////////////////////// 53 60 #include "MHillas.h" … … 106 113 fMeanX = -1; 107 114 fMeanY = -1; 108 109 fNumUsedPixels = -1;110 fNumCorePixels = -1;111 115 112 116 Clear(); … … 133 137 *fLog << " - Meany [mm] = " << fMeanY << endl; 134 138 *fLog << " - atg(y/x) [deg] = " << atg << endl; 135 *fLog << " - Used Pixels [#] = " << fNumUsedPixels << " Pixels" << endl; 136 *fLog << " - Core Pixels [#] = " << fNumCorePixels << " Pixels" << endl; 137 } 138 139 /* 140 // ----------------------------------------------------------- 141 // 142 // call the Paint function of the Ellipse if a TEllipse exists 143 // 144 void MHillas::Paint(Option_t *) 145 { 146 fEllipse->SetLineWidth(2); 147 fEllipse->PaintEllipse(fMeanX, fMeanY, fLength, fWidth, 148 0, 360, fDelta*kRad2Deg+180); 149 } 150 */ 151 152 // -------------------------------------------------------------------------- 153 // 154 // Instead of adding MHillas itself to the Pad 155 // (s. AppendPad in TObject) we create an ellipse, 156 // which is added to the Pad by its Draw function 157 // You can remove it by deleting the Ellipse Object 158 // (s. Clear() ) 139 } 140 141 // -------------------------------------------------------------------------- 142 // 143 // Instead of adding MHillas itself to the Pad (s. AppendPad in TObject) 144 // we create an ellipse, which is added to the Pad by its Draw function 145 // You can remove it by deleting the Ellipse Object (s. Clear()) 159 146 // 160 147 void MHillas::Draw(Option_t *opt) 161 148 { 162 163 149 Clear(); 164 150 … … 171 157 fEllipse->SetLineWidth(2); 172 158 fEllipse->Draw(); 173 174 /*175 fEllipse->SetPhimin();176 fEllipse->SetPhimax();177 fEllipse->SetR1(fLength);178 fEllipse->SetR2(fWidth);179 fEllipse->SetTheta(fDelta*kRad2Deg+180);180 fEllipse->SetX1(fMeanX);181 fEllipse->SetY1(fMeanY);182 183 fEllipse->SetLineWidth(2);184 fEllipse->PaintEllipse(fMeanX, fMeanY, fLength, fWidth,185 0, 360, fDelta*kRad2Deg+180);186 187 AppendPad(opt);188 189 // This is from TH1190 TString opt = option;191 opt.ToLower();192 if (gPad && !opt.Contains("same")) {193 //the following statement is necessary in case one attempts to draw194 //a temporary histogram already in the current pad195 if (TestBit(kCanDelete)) gPad->GetListOfPrimitives()->Remove(this);196 gPad->Clear();197 }198 */199 159 } 200 160 … … 235 195 // 236 196 if (npixevt < 3) 237 {238 //*fLog << warn << "MHillas::Calc: Event has less than three pixels... skipped." << endl;239 197 return 1; 240 }241 198 242 199 // … … 253 210 fSize = 0; 254 211 255 fNumUsedPixels = 0; 256 fNumCorePixels = 0; 212 Int_t numused = 0; 257 213 258 214 for (UInt_t i=0; i<npixevt; i++) … … 267 223 const Float_t nphot = pix.GetNumPhotons(); 268 224 269 //if (nphot==0)270 // *fLog << warn << GetDescriptor() << ": Pixel #" << pix.GetPixId() << " has no photons." << endl;271 272 225 fSize += nphot; // [counter] 273 226 fMeanX += nphot * gpix.GetX(); // [mm] 274 227 fMeanY += nphot * gpix.GetY(); // [mm] 275 228 276 if (pix.IsPixelCore()) 277 fNumCorePixels++; 278 279 fNumUsedPixels++; 229 numused++; 280 230 } 281 231 … … 284 234 // 285 235 if (fSize==0) 286 {287 //*fLog << inf << GetDescriptor() << ": Event has zero cerenkov photons... skipped." << endl;288 236 return 2; 289 }290 237 291 238 fMeanX /= fSize; // [mm] 292 239 fMeanY /= fSize; // [mm] 293 240 294 if (fNumUsedPixels<3) 295 { 296 //*fLog << inf << GetDescriptor() << ": Event has less than 3 used pixels... skipped." << endl; 241 if (numused<3) 297 242 return 3; 298 }299 243 300 244 // … … 339 283 // 340 284 if (corrxy==0) 341 {342 //*fLog << inf << GetDescriptor() << ": Event has CorrXY==0... skipped." << endl;343 285 return 4; 344 }345 286 346 287 // … … 352 293 // in the camera it has values between -pi/2 and pi/2 degrees 353 294 // 354 const Double_t d0 = corryy - corrxx; 355 const Double_t d1 = corrxy*2; 356 const Double_t d2 = d0 + sqrt(d0*d0 + d1*d1); 357 const Double_t tand = d2 / d1; 295 const Double_t d0 = corryy - corrxx; 296 const Double_t d1 = corrxy*2; 297 const Double_t d2 = d0 + sqrt(d0*d0 + d1*d1); 298 const Double_t tand = d2 / d1; 299 const Double_t tand2 = tand*tand; 358 300 359 301 fDelta = atan(tand); 360 302 361 const Double_t s2 = tand *tand+1;303 const Double_t s2 = tand2+1; 362 304 const Double_t s = sqrt(s2); 363 305 … … 365 307 fSinDelta = tand/s; // like MHillasExt 366 308 367 Double_t axis1 = (tand *tand*corryy + d2 + corrxx)/s2/fSize;368 Double_t axis2 = (tand *tand*corrxx - d2 + corryy)/s2/fSize;309 Double_t axis1 = (tand2*corryy + d2 + corrxx)/s2/fSize; 310 Double_t axis2 = (tand2*corrxx - d2 + corryy)/s2/fSize; 369 311 370 312 // … … 391 333 void MHillas::Set(const TArrayF &arr) 392 334 { 393 if (arr.GetSize() != 8)335 if (arr.GetSize() != 6) 394 336 return; 395 337 … … 400 342 fMeanX = arr.At(4); // [mm] x-coordinate of center of ellipse 401 343 fMeanY = arr.At(5); // [mm] y-coordinate of center of ellipse 402 403 fNumUsedPixels = (Short_t)arr.At(6); // Number of pixels which survived the image cleaning 404 fNumCorePixels = (Short_t)arr.At(7); // number of core pixels 405 } 406 407 408 // -------------------------------------------------------------------------- 409 // 410 /* 411 void MHillas::AsciiRead(ifstream &fin) 412 { 413 fin >> fLength; 414 fin >> fWidth; 415 fin >> fDelta; 416 fin >> fSize; 417 fin >> fMeanX; 418 fin >> fMeanY; 419 } 420 */ 421 // -------------------------------------------------------------------------- 422 /* 423 void MHillas::AsciiWrite(ofstream &fout) const 424 { 425 fout << fLength << " "; 426 fout << fWidth << " "; 427 fout << fDelta << " "; 428 fout << fSize << " "; 429 fout << fMeanX << " "; 430 fout << fMeanY; 431 } 432 */ 344 } -
trunk/MagicSoft/Mars/mimage/MHillas.h
r1940 r2026 23 23 Float_t fMeanY; // [mm] y-coordinate of center of ellipse 24 24 25 Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning 26 Short_t fNumCorePixels; // number of core pixels 27 28 Float_t fSinDelta; //! [1] sin of Delta (to be used in derived classes) 29 Float_t fCosDelta; //! [1] cos of Delta (to be used in derived classes) 25 Float_t fSinDelta; // [1] sin of Delta (to be used in derived classes) 26 Float_t fCosDelta; // [1] cos of Delta (to be used in derived classes) 30 27 31 28 TEllipse *fEllipse; //! Graphical Object to Display Ellipse 32 33 protected:34 //35 // This is only for calculations in derived classes because36 // we don't want to read/write this data members37 //38 Float_t GetCosDelta() const { return fCosDelta; }39 Float_t GetSinDelta() const { return fSinDelta; }40 29 41 30 public: … … 45 34 void Reset(); 46 35 47 virtualInt_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix);36 Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix); 48 37 49 virtual void Print(Option_t *opt=NULL) const; 50 virtual void Draw(Option_t *opt=NULL); 51 //virtual void Paint(Option_t *); 38 void Print(Option_t *opt=NULL) const; 39 void Draw(Option_t *opt=NULL); 52 40 53 v irtual void Clear(Option_t *opt=NULL);41 void Clear(Option_t *opt=NULL); 54 42 55 43 Float_t GetLength() const { return fLength; } … … 60 48 Float_t GetMeanY() const { return fMeanY; } 61 49 62 Int_t GetNumUsedPixels() const { return fNumUsedPixels; }63 Int_t GetNumCorePixels() const { return fNumCorePixels; }50 Float_t GetCosDelta() const { return fCosDelta; } 51 Float_t GetSinDelta() const { return fSinDelta; } 64 52 65 v irtual void Set(const TArrayF &arr);53 void Set(const TArrayF &arr); 66 54 67 //virtual void AsciiRead(ifstream &fin); 68 //virtual void AsciiWrite(ofstream &fout) const; 69 70 ClassDef(MHillas, 2) // Storage Container for Hillas Parameter 55 ClassDef(MHillas, 3) // Storage Container for Hillas Parameter 71 56 }; 72 57 -
trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
r1965 r2026 25 25 26 26 ///////////////////////////////////////////////////////////////////////////// 27 // //28 // MHillasCalc //29 // //30 // This is a task to calculate the Hillas parameters from each event //31 // //32 // Input Containers: //33 // MCerPhotEvt, MGeomCam //34 // //35 // Output Containers: //36 // MHillas //37 // //27 // 28 // MHillasCalc 29 // 30 // This is a task to calculate the Hillas parameters from each event 31 // 32 // Input Containers: 33 // MCerPhotEvt, MGeomCam 34 // 35 // Output Containers: 36 // MHillas, MHillasExt 37 // 38 38 ///////////////////////////////////////////////////////////////////////////// 39 39 … … 43 43 44 44 #include "MHillas.h" 45 #include "MHillasExt.h" 46 #include "MNewImagePar.h" 47 45 48 #include "MCerPhotEvt.h" 46 49 … … 54 57 // Default constructor. 55 58 // 56 MHillasCalc::MHillasCalc(const char * hil, const char *name, const char *title)59 MHillasCalc::MHillasCalc(const char *name, const char *title) 57 60 { 58 61 fName = name ? name : "MHillasCalc"; 59 62 fTitle = title ? title : "Calculate Hillas parameters"; 60 63 61 fHilName = hil; 64 fHilName = "MHillas"; 65 fHilExtName = "MHillasExt"; 66 fImgParName = "MNewImagePar"; 67 68 fFlags = 0xff; 62 69 } 63 70 … … 70 77 Bool_t MHillasCalc::PreProcess(MParList *pList) 71 78 { 79 // necessary 72 80 fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt"); 73 81 if (!fCerPhotEvt) 74 82 { 75 *fLog << dbginf<< "MCerPhotEvt not found... aborting." << endl;83 *fLog << err << "MCerPhotEvt not found... aborting." << endl; 76 84 return kFALSE; 77 85 } 78 86 87 // necessary 79 88 fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam"); 80 89 if (!fGeomCam) 81 90 { 82 *fLog << dbginf<< "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;91 *fLog << err << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl; 83 92 return kFALSE; 84 93 } 85 94 86 fHillas = (MHillas*)pList->FindCreateObj("MHillas",fHilName); 95 // sometimes necessary 96 if (TestFlag(kCalcHillas)) 97 fHillas = (MHillas*)pList->FindCreateObj("MHillas", fHilName); 98 else 99 { 100 fHillas = (MHillas*)pList->FindObject(fHilName, "MHillas"); 101 *fLog << err << fHilName << " [MHillas] not found... aborting." << endl; 102 } 87 103 if (!fHillas) 88 104 return kFALSE; 105 106 if (TestFlag(kCalcHillasExt)) 107 { 108 fHillasExt = (MHillasExt*)pList->FindCreateObj("MHillasExt", fHilExtName); 109 if (!fHillasExt) 110 return kFALSE; 111 } 112 113 if (TestFlag(kCalcNewImagePar)) 114 { 115 fNewImgPar = (MNewImagePar*)pList->FindCreateObj("MNewImagePar", fImgParName); 116 if (!fNewImgPar) 117 return kFALSE; 118 } 89 119 90 120 memset(fErrors, 0, sizeof(fErrors)); … … 102 132 Bool_t MHillasCalc::Process() 103 133 { 104 const Int_t rc = fHillas->Calc(*fGeomCam, *fCerPhotEvt); 105 if (rc<0 || rc>4) 134 if (TestFlag(kCalcHillas)) 106 135 { 107 *fLog << err << dbginf << "MHillas::Calc returned unknown error code!" << endl; 108 return kFALSE; 136 Int_t rc = fHillas->Calc(*fGeomCam, *fCerPhotEvt); 137 if (rc<0 || rc>4) 138 { 139 *fLog << err << dbginf << "MHillas::Calc returned unknown error code!" << endl; 140 return kFALSE; 141 } 142 fErrors[rc]++; 143 if (rc>0) 144 return kCONTINUE; 109 145 } 110 fErrors[rc]++;111 146 112 return rc==0 ? kTRUE : kCONTINUE; 147 if (TestFlag(kCalcHillasExt)) 148 fHillasExt->Calc(*fGeomCam, *fCerPhotEvt, *fHillas); 149 150 if (TestFlag(kCalcNewImagePar)) 151 fNewImgPar->Calc(*fGeomCam, *fCerPhotEvt, *fHillas); 152 153 return kTRUE; 113 154 } 114 155 -
trunk/MagicSoft/Mars/mimage/MHillasCalc.h
r1940 r2026 17 17 class MCerPhotEvt; 18 18 class MHillas; 19 class MHillasExt; 20 class MNewImagePar; 19 21 20 22 class MHillasCalc : public MTask … … 22 24 const MGeomCam *fGeomCam; // Camera Geometry used to calculate Hillas 23 25 const MCerPhotEvt *fCerPhotEvt; // Cerenkov Photon Event used for calculation 24 MHillas *fHillas; // ouput container to store result25 26 26 TString fHilName; 27 Int_t fErrors[5]; 27 MHillas *fHillas; // output container to store result 28 MHillasExt *fHillasExt; 29 MNewImagePar *fNewImgPar; 30 31 TString fHilName; 32 TString fHilExtName; 33 TString fImgParName; 34 35 Int_t fErrors[5]; 36 37 Int_t fFlags; 28 38 29 39 Bool_t PreProcess(MParList *pList); … … 31 41 Bool_t PostProcess(); 32 42 43 enum CalcCont_t { 44 kCalcHillas = BIT(0), 45 kCalcHillasExt = BIT(1), 46 //kCalcHillasSrc = BIT(2), 47 kCalcNewImagePar = BIT(3) 48 }; 49 33 50 public: 34 MHillasCalc(const char *hil="MHillas", const char *name=NULL, const char *title=NULL); 51 MHillasCalc(const char *name=NULL, const char *title=NULL); 52 53 void SetNameHillas(const char *name) { fHilName = name; } 54 void SetNameHillasExt(const char *name) { fHilExtName = name; } 55 void SetNameNewImgPar(const char *name) { fImgParName = name; } 56 57 void SetFlags(Int_t f) { fFlags = f; } 58 void Enable(Int_t f) { fFlags |= f; } 59 void Disable(Int_t f) { fFlags &= ~f; } 60 Bool_t TestFlag(CalcCont_t i) const { return fFlags&i; } 35 61 36 62 ClassDef(MHillasCalc, 0) // Task to calculate Hillas parameters -
trunk/MagicSoft/Mars/mimage/MHillasExt.cc
r1940 r2026 64 64 #include "MLogManip.h" 65 65 66 #include "MHillas.h" 67 66 68 ClassImp(MHillasExt); 67 69 … … 72 74 MHillasExt::MHillasExt(const char *name, const char *title) 73 75 { 74 fName = name ? name : "MHillas ";76 fName = name ? name : "MHillasExt"; 75 77 fTitle = title ? title : "Storage container for extended parameter set of one event"; 76 78 77 79 Reset(); 78 // FIXME: (intelligent) initialization of values missing79 80 } 80 81 … … 83 84 void MHillasExt::Reset() 84 85 { 85 MHillas::Reset();86 87 fConc = -1;88 fConc1 = -1;89 86 fAsym = 0; 90 87 fM3Long = 0; … … 96 93 void MHillasExt::Print(Option_t *) const 97 94 { 98 MHillas::Print();99 100 95 *fLog << "Extended Image Parameters (" << GetName() << ")" << endl; 101 *fLog << " - Conc = " << fConc << " (ratio)" << endl; 102 *fLog << " - Conc1 = " << fConc1 << " (ratio)" << endl; 103 *fLog << " - Asymmetry = " << fAsym << " mm" << endl; 96 *fLog << " - Asymmetry = " << fAsym << " mm" << endl; 104 97 *fLog << " - 3rd Moment Long = " << fM3Long << " mm" << endl; 105 98 *fLog << " - 3rd Moment Trans = " << fM3Trans << " mm" << endl; … … 108 101 // ------------------------------------------------------------------------- 109 102 // 110 // 103 // calculation of additional parameters based on the camera geometry 111 104 // and the cerenkov photon event 112 105 // 113 Int_t MHillasExt::Calc(const MGeomCam &geom, const MCerPhotEvt &evt) 114 { 115 const Int_t rc = MHillas::Calc(geom, evt); 116 if (rc>0) 117 return rc; 118 106 Int_t MHillasExt::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, const MHillas &hil) 107 { 119 108 // 120 109 // calculate the additional image parameters … … 129 118 Double_t m3y = 0; 130 119 131 Float_t maxpix1 = 0; // [#phot] 132 Float_t maxpix2 = 0; // [#phot] 120 const UInt_t npixevt = evt.GetNumPixels(); 133 121 134 122 Int_t maxpixid = 0; 135 136 const UInt_t npixevt = evt.GetNumPixels(); 137 138 const Float_t A0 = geom[0].GetA(); 123 Float_t maxpix = 0; 139 124 140 125 for (UInt_t i=0; i<npixevt; i++) … … 144 129 continue; 145 130 146 const MGeomPix &gpix = geom[pix.GetPixId()]; 147 const Double_t dx = gpix.GetX() - GetMeanX(); // [mm] 148 const Double_t dy = gpix.GetY() - GetMeanY(); // [mm] 149 150 Double_t nphot = pix.GetNumPhotons(); // [1] 151 152 const Double_t dzx = GetCosDelta()*dx + GetSinDelta()*dy; // [mm] 153 const Double_t dzy = -GetSinDelta()*dx + GetCosDelta()*dy; // [mm] 154 155 m3x += nphot * dzx*dzx*dzx; // [mm^3] 156 m3y += nphot * dzy*dzy*dzy; // [mm^3] 157 158 /* 159 // 160 // count number of photons in pixels at the edge of the camera 161 // 162 if (gpix.IsInOutermostRing()) 163 edgepix1 += nphot; 164 if (gpix.IsInOuterRing()) 165 edgepix2 += nphot; 166 */ 131 const Int_t pixid = pix.GetPixId(); 132 133 const MGeomPix &gpix = geom[pixid]; 134 const Double_t dx = gpix.GetX() - hil.GetMeanX(); // [mm] 135 const Double_t dy = gpix.GetY() - hil.GetMeanY(); // [mm] 136 137 Double_t nphot = pix.GetNumPhotons(); // [1] 138 139 const Double_t dzx = hil.GetCosDelta()*dx + hil.GetSinDelta()*dy; // [mm] 140 const Double_t dzy = -hil.GetSinDelta()*dx + hil.GetCosDelta()*dy; // [mm] 141 142 m3x += nphot * dzx*dzx*dzx; // [mm^3] 143 m3y += nphot * dzy*dzy*dzy; // [mm^3] 167 144 168 145 // … … 170 147 // must take pixel size into account 171 148 // 172 const Double_t r = A0/gpix.GetA(); 173 nphot *= r; 174 175 if (nphot>maxpix1) 149 nphot *= geom.GetPixRatio(pixid); 150 151 if (nphot>maxpix) 176 152 { 177 maxpix2 = maxpix1; 178 maxpix1 = nphot; // [1] 179 maxpixid = pix.GetPixId(); 180 continue; // [1] 153 maxpix = nphot; // [1] 154 maxpixid = pixid; 155 continue; // [1] 181 156 } 182 157 183 if (nphot>maxpix2)184 maxpix2 = nphot; // [1]185 186 158 /* 187 159 // 188 // power na for calculating fAsymna;189 // the value 1.5 was suggested by Thomas Schweizer160 // power na for calculating fAsymna; 161 // the value 1.5 was suggested by Thomas Schweizer 190 162 // 191 163 Double_t na = 1.5; … … 211 183 } 212 184 213 const MGeomPix &maxpix = geom[maxpixid]; 214 215 fAsym = (GetMeanX()-maxpix.GetX())*GetCosDelta() + 216 (GetMeanY()-maxpix.GetY())*GetSinDelta(); // [mm] 217 218 fConc = (maxpix1+maxpix2)/GetSize(); // [ratio] 219 fConc1 = maxpix1/GetSize(); // [ratio] 185 const MGeomPix &maxp = geom[maxpixid]; 186 187 fAsym = (hil.GetMeanX()-maxp.GetX())*hil.GetCosDelta() + 188 (hil.GetMeanY()-maxp.GetY())*hil.GetSinDelta(); // [mm] 220 189 221 190 /* 222 fLeakage1 = edgepix1 / GetSize();223 fLeakage2 = edgepix2 / GetSize();224 191 fAsym0 = fb / GetSize(); 225 226 192 fAsymna = na * (sna*xna1 - sna1*xna) / (sna*sna); 227 193 */ … … 230 196 // Third moments along axes get normalized 231 197 // 232 m3x /= GetSize();233 m3y /= GetSize();234 235 fM3Long = m3x<0 ? -pow(-m3x, 1./3) : pow(m3x, 1./3); 236 fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3); 198 m3x /= hil.GetSize(); 199 m3y /= hil.GetSize(); 200 201 fM3Long = m3x<0 ? -pow(-m3x, 1./3) : pow(m3x, 1./3); // [mm] 202 fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3); // [mm] 237 203 238 204 SetReadyToSave(); … … 248 214 void MHillasExt::Set(const TArrayF &arr) 249 215 { 250 if (arr.GetSize() != 13)216 if (arr.GetSize() != 3) 251 217 return; 252 218 253 fConc = arr.At(8); // [ratio] concentration ratio: sum of the two highest pixels / fSize 254 fConc1 = arr.At(9); // [ratio] concentration ratio: sum of the highest pixel / fSize 255 fAsym = arr.At(10); // [mm] fDist minus dist: center of ellipse, highest pixel 256 fM3Long = arr.At(11); // [mm] 3rd moment (e-weighted) along major axis 257 fM3Trans = arr.At(12); // [mm] 3rd moment (e-weighted) along minor axis 258 259 TArrayF n(arr); 260 n.Set(8); 261 MHillas::Set(n); 262 } 263 264 /* 265 // ------------------------------------------------------------------------- 266 // 267 void MHillasExt::AsciiRead(ifstream &fin) 268 { 269 MHillas::AsciiRead(fin); 270 271 fin >> fConc; 272 fin >> fConc1; 273 fin >> fAsym; 274 fin >> fM3Long; 275 fin >> fM3Trans; 276 } 277 */ 278 // ------------------------------------------------------------------------- 279 /* 280 void MHillasExt::AsciiWrite(ofstream &fout) const 281 { 282 MHillas::AsciiWrite(fout); 283 284 fout << " "; 285 fout << fConc << " "; 286 fout << fConc1 << " "; 287 fout << fAsym << " "; 288 fout << fM3Long << " "; 289 fout << fM3Trans; 290 } 291 */ 219 fAsym = arr.At(0); // [mm] fDist minus dist: center of ellipse, highest pixel 220 fM3Long = arr.At(1); // [mm] 3rd moment (e-weighted) along major axis 221 fM3Trans = arr.At(2); // [mm] 3rd moment (e-weighted) along minor axis 222 } -
trunk/MagicSoft/Mars/mimage/MHillasExt.h
r1940 r2026 2 2 #define MARS_MHillasExt 3 3 4 #ifndef MARS_M Hillas5 #include "M Hillas.h"4 #ifndef MARS_MParContainer 5 #include "MParContainer.h" 6 6 #endif 7 7 8 class TArrayF; 9 10 class MHillas; 8 11 class MGeomCam; 9 12 class MCerPhotEvt; 10 13 11 class MHillasExt : public M Hillas14 class MHillasExt : public MParContainer 12 15 { 13 16 private: 14 17 // for description see MExtHillas.cc 15 Float_t fConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 16 Float_t fConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 17 Float_t fAsym; // [mm] fDist minus dist: center of ellipse, highest pixel 18 Float_t fM3Long; // [mm] 3rd moment (e-weighted) along major axis 19 Float_t fM3Trans; // [mm] 3rd moment (e-weighted) along minor axis 18 Float_t fAsym; // [mm] fDist minus dist: center of ellipse, highest pixel 19 Float_t fM3Long; // [mm] 3rd moment (e-weighted) along major axis 20 Float_t fM3Trans; // [mm] 3rd moment (e-weighted) along minor axis 20 21 21 22 public: … … 24 25 void Reset(); 25 26 26 Float_t GetConc() const { return fConc; }27 Float_t GetConc1() const { return fConc1; }28 27 Float_t GetAsym() const { return fAsym; } 29 28 Float_t GetM3Long() const { return fM3Long; } 30 29 Float_t GetM3Trans() const { return fM3Trans; } 31 30 32 Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix );31 Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix, const MHillas &hil); 33 32 34 33 void Print(Option_t *opt=NULL) const; … … 36 35 void Set(const TArrayF &arr); 37 36 38 //void AsciiRead(ifstream &fin);39 //void AsciiWrite(ofstream &fout) const;40 41 37 ClassDef(MHillasExt, 1) // Storage Container for extended Hillas Parameter 42 38 }; -
trunk/MagicSoft/Mars/mimage/MHillasSrc.cc
r2004 r2026 34 34 // source-dependent image parameters 35 35 // 36 // 36 37 // Version 1: 37 38 // ---------- … … 39 40 // fDist distance from source to center of ellipse 40 41 // 42 // 41 43 // Version 2: 42 44 // ---------- 43 // fHeadTail 45 // fHeadTail added 46 // 44 47 // 45 48 // Version 3: … … 51 54 // defined with positive x-component 52 55 // 56 // 53 57 // Version 4: 54 58 // ---------- 55 59 // 56 60 // fHeadTail removed 57 //58 61 // 59 62 ///////////////////////////////////////////////////////////////////////////// … … 95 98 Bool_t MHillasSrc::Calc(const MHillas *hillas) 96 99 { 97 fHillas = hillas; 100 const Double_t mx = hillas->GetMeanX(); // [mm] 101 const Double_t my = hillas->GetMeanY(); // [mm] 98 102 99 const Double_t mx = GetMeanX();// [mm]100 const Double_t my = GetMeanY();// [mm]103 const Double_t sx = mx - fSrcPos->GetX(); // [mm] 104 const Double_t sy = my - fSrcPos->GetY(); // [mm] 101 105 102 const Double_t sx = mx - fSrcPos->GetX(); // [mm] 103 const Double_t sy = my - fSrcPos->GetY(); // [mm] 104 105 const Double_t sd = sin(GetDelta()); // [1] 106 const Double_t cd = cos(GetDelta()); // [1] 107 108 const Double_t tand = tan(GetDelta()); // [1] 109 110 const Double_t headtail = cd*sx + sd*sy; // [mm] 106 const Double_t sd = hillas->GetSinDelta(); // [1] 107 const Double_t cd = hillas->GetCosDelta(); // [1] 111 108 112 109 // … … 115 112 // The calculation has failed and returnes kFALSE. 116 113 // 117 Double_t dist = sqrt(sx*sx + sy*sy); // [mm] 118 114 const Double_t dist = sqrt(sx*sx + sy*sy); // [mm] 119 115 if (dist==0) 120 {121 //*fLog << warn << GetDescriptor() << ": Event has Dist==0... skipped." << endl;122 116 return kFALSE; 123 }124 117 125 118 // … … 128 121 // a head-tail information 129 122 // 130 const Double_t arg = (sy-tand*sx) / (dist*sqrt(tand*tand+1)); 123 // *OLD* const Double_t arg = (sy-tand*sx) / (dist*sqrt(tand*tand+1)); 124 // *OLD* fAlpha = asin(arg)*kRad2Deg; 131 125 132 fAlpha = asin(arg)*kRad2Deg; // [deg] 133 fCosDeltaAlpha = headtail/dist; // [1] 134 fDist = dist; // [mm] 126 const Double_t arg1 = cd*sy-sd*sx; // [mm] 127 const Double_t arg2 = cd*sx+sd*sy; // [mm] 128 129 fAlpha = asin(arg1/dist)*kRad2Deg; // [deg] 130 fCosDeltaAlpha = arg2/dist; // [1] 131 fDist = dist; // [mm] 135 132 136 133 SetReadyToSave(); … … 161 158 fCosDeltaAlpha = arr.At(2); // [1] cosine of angle between d and a 162 159 } 163 164 // -----------------------------------------------------------------------165 //166 // overloaded MParContainer to read MHillasSrc from an ascii file167 //168 /*169 void MHillasSrc::AsciiRead(ifstream &fin)170 {171 fin >> fAlpha;172 fin >> fDist;173 fin >> fHeadTail;174 }175 */176 // -----------------------------------------------------------------------177 //178 // overloaded MParContainer to write MHillasSrc to an ascii file179 /*180 void MHillasSrc::AsciiWrite(ofstream &fout) const181 {182 fout << fAlpha << " " << fDist;183 }184 */ -
trunk/MagicSoft/Mars/mimage/MHillasSrc.h
r2004 r2026 11 11 { 12 12 private: 13 const MHillas *fHillas; //! Input parameters14 13 const MSrcPosCam *fSrcPos; //! Source position in the camere 15 14 … … 26 25 void Reset(); 27 26 28 Float_t GetLength() const { return fHillas->GetLength(); }29 Float_t GetWidth() const { return fHillas->GetWidth(); }30 Float_t GetDelta() const { return fHillas->GetDelta(); }31 Float_t GetSize() const { return fHillas->GetSize(); }32 Float_t GetMeanX() const { return fHillas->GetMeanX(); }33 Float_t GetMeanY() const { return fHillas->GetMeanY(); }34 27 Float_t GetAlpha() const { return fAlpha; } 35 28 Float_t GetDist() const { return fDist; } … … 42 35 void Set(const TArrayF &arr); 43 36 44 //virtual void AsciiRead(ifstream &fin);45 //virtual void AsciiWrite(ofstream &fout) const;46 47 37 ClassDef(MHillasSrc, 4) // Container to hold source position dependant parameters 48 38 }; -
trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
r1966 r2026 33 33 34 34 #include <fstream.h> 35 #include <TArrayF.h>36 35 37 36 #include "MLog.h" 38 37 #include "MLogManip.h" 39 38 39 #include "MHillas.h" 40 40 41 #include "MGeomCam.h" 41 42 #include "MGeomPix.h" 43 42 44 #include "MCerPhotEvt.h" 43 45 #include "MCerPhotPix.h" 44 #include "MSrcPosCam.h" 46 45 47 46 48 ClassImp(MNewImagePar); … … 60 62 void MNewImagePar::Reset() 61 63 { 62 fLeakage1 = 0; 63 fLeakage2 = 0; 64 fLeakage1 = -1; 65 fLeakage2 = -1; 66 67 fConc = -1; 68 fConc1 = -1; 69 70 fNumUsedPixels = -1; 71 fNumCorePixels = -1; 64 72 } 65 73 … … 68 76 // Calculation of new image parameters 69 77 // 70 // 71 Bool_t MNewImagePar::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, 72 const MHillas *hillas) 78 void MNewImagePar::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, 79 const MHillas &hillas) 73 80 { 81 fNumUsedPixels = 0; 82 fNumCorePixels = 0; 83 74 84 const UInt_t npixevt = evt.GetNumPixels(); 75 85 76 86 Double_t edgepix1 = 0; 77 87 Double_t edgepix2 = 0; 88 89 Float_t maxpix1 = 0; // [#phot] 90 Float_t maxpix2 = 0; // [#phot] 91 92 Int_t maxpixid = 0; 93 78 94 79 95 for (UInt_t i=0; i<npixevt; i++) … … 83 99 continue; 84 100 85 const MGeomPix &gpix = geom[pix.GetPixId()];101 const Int_t pixid = pix.GetPixId(); 86 102 87 const Double_t nphot = pix.GetNumPhotons();103 const MGeomPix &gpix = geom[pixid]; 88 104 105 Double_t nphot = pix.GetNumPhotons(); 106 107 // 89 108 // count photons in outer rings of camera 109 // 90 110 if (gpix.IsInOutermostRing()) 91 111 edgepix1 += nphot; 92 112 if (gpix.IsInOuterRing()) 93 113 edgepix2 += nphot; 114 115 // 116 // count used and core pixels 117 // 118 if (pix.IsPixelCore()) 119 fNumCorePixels++; 120 121 fNumUsedPixels++; 122 123 // 124 // Now we are working on absolute values of nphot, which 125 // must take pixel size into account 126 // 127 nphot *= geom.GetPixRatio(pixid); 128 129 if (nphot>maxpix1) 130 { 131 maxpix2 = maxpix1; 132 maxpix1 = nphot; // [1] 133 maxpixid = pixid; 134 continue; // [1] 135 } 136 137 if (nphot>maxpix2) 138 maxpix2 = nphot; // [1] 94 139 } 95 140 96 fLeakage1 = edgepix1 / hillas->GetSize(); 97 fLeakage2 = edgepix2 / hillas->GetSize(); 141 fLeakage1 = edgepix1 / hillas.GetSize(); 142 fLeakage2 = edgepix2 / hillas.GetSize(); 143 144 fConc = (maxpix1+maxpix2)/hillas.GetSize(); // [ratio] 145 fConc1 = maxpix1/hillas.GetSize(); // [ratio] 98 146 99 147 SetReadyToSave(); 100 101 return kTRUE;102 148 } 103 149 … … 108 154 *fLog << all; 109 155 *fLog << "New Image Parameters (" << GetName() << ")" << endl; 110 *fLog << " - Leakage1 = " << fLeakage1 << endl; 111 *fLog << " - Leakage2 = " << fLeakage2 << endl; 156 *fLog << " - Leakage1 = " << fLeakage1 << endl; 157 *fLog << " - Leakage2 = " << fLeakage2 << endl; 158 *fLog << " - Conc = " << fConc << " (ratio)" << endl; 159 *fLog << " - Conc1 = " << fConc1 << " (ratio)" << endl; 160 *fLog << " - Used Pixels [#] = " << fNumUsedPixels << " Pixels" << endl; 161 *fLog << " - Core Pixels [#] = " << fNumCorePixels << " Pixels" << endl; 112 162 } -
trunk/MagicSoft/Mars/mimage/MNewImagePar.h
r1940 r2026 2 2 #define MARS_MNewImagePar 3 3 4 #ifndef MARS_M Hillas5 #include "M Hillas.h"4 #ifndef MARS_MParContainer 5 #include "MParContainer.h" 6 6 #endif 7 7 8 class MSrcPosCam; 8 class MHillas; 9 class MGeomCam; 10 class MCerPhotEvt; 9 11 10 12 class MNewImagePar : public MParContainer 11 13 { 12 14 private: 13 Float_t fLeakage1; // (photons in most outer ring of pixels) over fSize 14 Float_t fLeakage2; // (photons in the 2 outer rings of pixels) over fSize 15 Float_t fLeakage1; // (photons in most outer ring of pixels) over fSize 16 Float_t fLeakage2; // (photons in the 2 outer rings of pixels) over fSize 17 18 Float_t fConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 19 Float_t fConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 20 21 Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning 22 Short_t fNumCorePixels; // number of core pixels 15 23 16 24 public: 17 25 MNewImagePar(const char *name=NULL, const char *title=NULL); 18 26 19 // void SetSrcPos(MSrcPosCam *pos) { fSrcPos = pos; }20 // const MSrcPosCam *GetSrcPos() const { return fSrcPos; }21 22 27 void Reset(); 23 28 24 Float_t GetLeakage1() const { return fLeakage1; } 25 Float_t GetLeakage2() const { return fLeakage2; } 29 Float_t GetLeakage1() const { return fLeakage1; } 30 Float_t GetLeakage2() const { return fLeakage2; } 31 32 Float_t GetConc() const { return fConc; } 33 Float_t GetConc1() const { return fConc1; } 34 35 Int_t GetNumUsedPixels() const { return fNumUsedPixels; } 36 Int_t GetNumCorePixels() const { return fNumCorePixels; } 26 37 27 38 void Print(Option_t *opt=NULL) const; 28 39 29 virtual Bool_t Calc(const MGeomCam &geom, const MCerPhotEvt &evt, 30 const MHillas *hillas); 31 32 //virtual void AsciiRead(ifstream &fin); 33 //virtual void AsciiWrite(ofstream &fout) const; 40 void Calc(const MGeomCam &geom, const MCerPhotEvt &evt, 41 const MHillas &hillas); 34 42 35 43 ClassDef(MNewImagePar, 1) // Container to hold new image parameters -
trunk/MagicSoft/Mars/mimage/MNewImageParCalc.cc
r1940 r2026 65 65 fTitle = title ? title : gsDefTitle.Data(); 66 66 67 fSrcName = 68 fNewParName = 67 fSrcName = src; 68 fNewParName = newpar; 69 69 fHillasInput = "MHillas"; 70 70 } … … 102 102 } 103 103 104 105 104 fNewImagePar = (MNewImagePar*)pList->FindCreateObj("MNewImagePar", fNewParName); 106 105 if (!fNewImagePar) 107 106 return kFALSE; 108 107 109 fErrors = 0;108 //fErrors = 0; 110 109 111 110 return kTRUE; … … 117 116 { 118 117 119 if (!fNewImagePar->Calc(*fGeomCam, *fCerPhotEvt, fHillas))118 /*if (!*/fNewImagePar->Calc(*fGeomCam, *fCerPhotEvt, *fHillas);/*) 120 119 { 121 120 fErrors++; 122 121 return kCONTINUE; 123 122 124 } 123 }*/ 125 124 return kTRUE; 126 125 } … … 131 130 // is calculated with respect to the number of executions of this task. 132 131 // 132 /* 133 133 Bool_t MNewImageParCalc::PostProcess() 134 134 { … … 144 144 return kTRUE; 145 145 } 146 147 // -------------------------------------------------------------------------- 148 149 150 151 152 153 154 155 156 157 158 159 146 */ -
trunk/MagicSoft/Mars/mimage/MNewImageParCalc.h
r1940 r2026 22 22 MNewImagePar *fNewImagePar; //! Pointer to the output container for the new image parameters 23 23 24 TString 25 TString 26 TString 24 TString fSrcName; 25 TString fNewParName; 26 TString fHillasInput; 27 27 28 Int_t fErrors;28 //Int_t fErrors; 29 29 30 30 Bool_t PreProcess(MParList *plist); 31 31 Bool_t Process(); 32 Bool_t PostProcess();32 //Bool_t PostProcess(); 33 33 34 34 public: … … 38 38 void SetInput(TString hilname) { fHillasInput = hilname; } 39 39 40 ClassDef(MNewImageParCalc, 1) // task to calculate new image parameters40 ClassDef(MNewImageParCalc, 0) // task to calculate new image parameters 41 41 }; 42 42 -
trunk/MagicSoft/Mars/mimage/Makefile
r1947 r2026 36 36 MHillasSrcCalc.cc \ 37 37 MNewImagePar.cc \ 38 MNewImageParCalc.cc \39 38 MHHillas.cc \ 40 39 MHHillasSrc.cc \ -
trunk/MagicSoft/Mars/mmain/MAnalysis.cc
r1668 r2026 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 9/2001 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 218 ! Author(s): Thomas Bretz, 9/2001 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! 23 23 \* ======================================================================== */ 24 25 24 #include "MAnalysis.h" 26 25 … … 205 204 206 205 MFillH hfill("MHHillas", "MHillas"); 206 MFillH hfill2("MHHillasExt", "MHillasSrc"); 207 MFillH hfill2s("MHHillasSrc", "MHillasSrc"); 208 MFillH hfill3("MHNewImagePar"); 207 209 MFillH sfill("MHStarMap", "MHillas"); 208 MFillH hfill2s("MHHillasSrc", "MHillasSrc");209 210 /* 210 211 MFillH hfill2s("HistSource [MHHillasSrc]", "HillasSource"); … … 225 226 { 226 227 tlist.AddToList(&hfill); 228 tlist.AddToList(&hfill2); 227 229 tlist.AddToList(&hfill2s); 228 //tlist.AddToList(&hfill2a);230 tlist.AddToList(&hfill3); 229 231 } 230 232 … … 263 265 { 264 266 plist.FindObject("MHHillas")->DrawClone(); 267 plist.FindObject("MHHillasExt")->DrawClone(); 265 268 plist.FindObject("MHHillasSrc")->DrawClone(); 269 plist.FindObject("MHNewImagePar")->DrawClone(); 266 270 /* 267 271 plist.FindObject("HistSource")->DrawClone();
Note:
See TracChangeset
for help on using the changeset viewer.