Changeset 1965 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 04/19/03 18:39:05 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MHHillas.cc
r1940 r1965 31 31 // 32 32 ///////////////////////////////////////////////////////////////////////////// 33 34 33 #include "MHHillas.h" 35 34 … … 110 109 fSize->GetXaxis()->SetTitleOffset(1.2); 111 110 fSize->GetXaxis()->SetLabelOffset(-0.015); 111 fSize->SetFillStyle(4000); 112 112 113 113 bins.Apply(*fSize); … … 280 280 void MHHillas::SetColors() const 281 281 { 282 // FIXME: This must be redone each time the canvas is repainted....283 282 gStyle->SetPalette(51, NULL); 284 283 Int_t c[50]; … … 298 297 TObject *MHHillas::DrawClone(Option_t *opt) const 299 298 { 300 TCanvas *c = MakeDefCanvas(this, 720, 810); 301 c->Divide(2,3); 302 303 gROOT->SetSelectedPad(NULL); 304 305 c->cd(1); 306 DrawCopy(*fWidth, *fLength, "Width / Length"); 307 308 c->cd(2); 309 gPad->SetLogx(); 310 fSize->DrawCopy(); 311 312 c->cd(3); 313 DrawCopy(*fCorePix, *fUsedPix, "Number of core/used Pixels"); 314 315 c->cd(4); 316 fDelta->DrawCopy(); 317 318 c->cd(5); 319 fDistC->DrawCopy(); 320 321 c->cd(6); 322 SetColors(); 323 fCenter->DrawCopy("colz"); 324 325 c->Modified(); 326 c->Update(); 327 328 return c; 299 return MH::DrawClone(opt, 720, 810); 329 300 } 330 301 … … 337 308 void MHHillas::Draw(Option_t *) 338 309 { 339 if (!gPad) 340 MakeDefCanvas(this, 720, 810); 341 342 gPad->Divide(2,3); 343 344 gPad->cd(1); 345 MH::Draw(*fWidth, *fLength, "Width / Length"); 346 347 gPad->cd(2); 310 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 720, 810); 311 pad->SetBorderMode(0); 312 313 AppendPad(""); 314 315 pad->Divide(2,3); 316 317 pad->cd(1); 318 MH::Draw(*fWidth, *fLength, "Width'n'Length"); 319 320 pad->cd(2); 321 gPad->SetBorderMode(0); 348 322 gPad->SetLogx(); 349 323 fSize->Draw(); 350 324 351 gPad->cd(3); 325 pad->cd(3); 326 gPad->SetBorderMode(0); 352 327 MH::Draw(*fCorePix, *fUsedPix, "Number of core/used Pixels"); 353 328 354 gPad->cd(4); 329 pad->cd(4); 330 gPad->SetBorderMode(0); 355 331 fDelta->Draw(); 356 332 357 gPad->cd(5); 333 pad->cd(5); 334 gPad->SetBorderMode(0); 358 335 fDistC->Draw(); 359 336 360 gPad->cd(6); 337 pad->cd(6); 338 gPad->SetBorderMode(0); 361 339 SetColors(); 362 340 fCenter->Draw("colz"); 363 341 364 gPad->Modified();365 gPad->Update();342 pad->Modified(); 343 pad->Update(); 366 344 } 367 345 … … 387 365 return NULL; 388 366 } 367 368 void MHHillas::Paint(Option_t *opt="") 369 { 370 SetColors(); 371 MH::Paint(); 372 } -
trunk/MagicSoft/Mars/mimage/MHHillas.h
r1940 r1965 14 14 private: 15 15 16 TH1F *fLength; //->17 TH1F *fWidth; //->16 TH1F *fLength; //-> Length 17 TH1F *fWidth; //-> Width 18 18 19 TH1F *fDistC; //->20 TH1F *fDelta; //->19 TH1F *fDistC; //-> Distance to Camera Center 20 TH1F *fDelta; //-> Angle between Length axis and x-axis 21 21 22 TH1F *fSize; //->23 TH2F *fCenter; //->22 TH1F *fSize; //-> Sum of used pixels 23 TH2F *fCenter; //-> Center 24 24 25 TH1F *fUsedPix; //-> 26 TH1F *fCorePix; //-> 25 TH1F *fUsedPix; //-> Number of used pixels 26 TH1F *fCorePix; //-> Number of core pixels 27 27 28 28 void SetColors() const; … … 30 30 Float_t fMm2Deg; 31 31 Bool_t fUseMmScale; 32 33 void Paint(Option_t *opt=""); 32 34 33 35 public: … … 55 57 TObject *DrawClone(Option_t *opt=NULL) const; 56 58 59 //Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; } 60 57 61 ClassDef(MHHillas, 1) // Container which holds histograms for the source independent image parameters 58 62 }; -
trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
r1945 r1965 30 30 // 31 31 ///////////////////////////////////////////////////////////////////////////// 32 33 32 #include "MHHillasExt.h" 34 33 … … 57 56 // Setup four histograms for Width, Length 58 57 // 59 MHHillasExt::MHHillasExt(const char *name, const char *title, 60 const char *hil) 61 : fMm2Deg(1), fUseMmScale(kTRUE) 58 MHHillasExt::MHHillasExt(const char *name, const char *title) 59 : fMm2Deg(1), fUseMmScale(kTRUE), fHilName("MHillas") 62 60 { 63 61 // … … 66 64 fName = name ? name : "MHHillasExt"; 67 65 fTitle = title ? title : "Container for extended Hillas histograms"; 68 69 fHilName = hil;70 //*fLog << "MHHillasExt : fHilName = " << fHilName << endl;71 66 72 67 // … … 108 103 fHM3Trans.SetYTitle("Counts"); 109 104 105 fHConc.SetFillStyle(4000); 106 fHConc1.SetFillStyle(4000); 107 fHAsym.SetFillStyle(4000); 108 fHM3Long.SetFillStyle(4000); 109 fHM3Trans.SetFillStyle(4000); 110 110 111 111 MBinning bins; … … 121 121 bins.SetEdges(101, -593, 593); 122 122 bins.Apply(fHAsym); 123 }124 125 // --------------------------------------------------------------------------126 //127 // Delete the four histograms128 //129 MHHillasExt::~MHHillasExt()130 {131 123 } 132 124 … … 143 135 Bool_t MHHillasExt::SetupFill(const MParList *plist) 144 136 { 145 TObject *obj = plist->FindObject(fHilName, "MHillas"); 146 if (!obj) 147 { 148 *fLog << err << dbginf << "Sorry '" << fHilName 149 << "' not found in parameter list... aborting." << endl; 137 fHillasExt = (MHillasExt*)plist->FindObject(fHilName, "MHillasExt"); 138 if (!fHillasExt) 139 { 140 *fLog << err << fHilName << "[MHillasExt] not found in parameter list... aborting." << endl; 150 141 return kFALSE; 151 142 } 152 if (!obj->InheritsFrom(MHillasExt::Class()))153 {154 *fLog << err << dbginf << "Sorry 'MHillas' doesn't inherit from MHillasExt... aborting." << endl;155 return kFALSE;156 }157 fHillasExt = (MHillasExt*)obj;158 143 159 144 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); … … 184 169 const MHillasSrc *src = (MHillasSrc*)par; 185 170 186 const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, src ? src->GetCosDeltaAlpha() : 1);171 const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, (src ? src->GetCosDeltaAlpha() : 1)); 187 172 188 173 fHConc.Fill(fHillasExt->GetConc()); … … 266 251 TObject *MHHillasExt::DrawClone(Option_t *opt) const 267 252 { 268 TCanvas &c = *MakeDefCanvas(this, 720, 540); 269 c.Divide(2, 2); 270 271 gROOT->SetSelectedPad(NULL); 272 273 c.cd(1); 274 DrawCopy(fHConc1, fHConc, "Concentrations"); 275 276 c.cd(2); 277 ((TH1&)fHAsym).DrawCopy(); 278 279 c.cd(3); 280 ((TH1&)fHM3Long).DrawCopy(); 281 282 c.cd(4); 283 ((TH1&)fHM3Trans).DrawCopy(); 284 285 c.Modified(); 286 c.Update(); 287 288 return &c; 253 return MH::DrawClone(opt, 720, 540); 289 254 } 290 255 … … 297 262 void MHHillasExt::Draw(Option_t *) 298 263 { 299 if (!gPad) 300 MakeDefCanvas(this, 720, 540); 301 302 gPad->Divide(2, 2); 303 304 gPad->cd(1); 264 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 720, 540); 265 pad->SetBorderMode(0); 266 267 AppendPad(""); 268 269 pad->Divide(2, 2); 270 271 pad->cd(1); 272 gPad->SetBorderMode(0); 305 273 MH::Draw(fHConc1, fHConc, "Concentrations"); 306 274 307 gPad->cd(2); 275 pad->cd(2); 276 gPad->SetBorderMode(0); 308 277 fHAsym.Draw(); 309 278 310 gPad->cd(3); 279 pad->cd(3); 280 gPad->SetBorderMode(0); 311 281 fHM3Long.Draw(); 312 282 313 gPad->cd(4); 283 pad->cd(4); 284 gPad->SetBorderMode(0); 314 285 fHM3Trans.Draw(); 315 286 316 gPad->Modified();317 gPad->Update();287 pad->Modified(); 288 pad->Update(); 318 289 } 319 290 -
trunk/MagicSoft/Mars/mimage/MHHillasExt.h
r1940 r1965 28 28 29 29 public: 30 //MHHillasExt(const char *name=NULL, const char *title=NULL); 31 MHHillasExt(const char *name=NULL, const char *title=NULL, 32 const char *hil="MHillas"); 30 MHHillasExt(const char *name=NULL, const char *title=NULL); 33 31 34 ~MHHillasExt();32 void SetHillasName(const char *name) { fHilName = name; } 35 33 36 34 void SetMmScale(Bool_t mmscale=kTRUE); -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r1940 r1965 211 211 TObject *MHHillasSrc::DrawClone(Option_t *opt) const 212 212 { 213 TCanvas *c = MakeDefCanvas(this, 700, 500); 214 c->Divide(2, 2); 215 216 // FIXME: Display Source position 217 218 gROOT->SetSelectedPad(NULL); 219 220 // 221 // This is necessary to get the expected bahviour of DrawClone 222 // 223 c->cd(1); 224 fAlpha->DrawCopy(); 225 226 c->cd(2); 227 fDist->DrawCopy(); 228 229 c->cd(3); 230 fHeadTail->DrawCopy(); 231 232 c->cd(4); 233 gPad->SetLogy(); 234 fCosDA->DrawCopy(); 235 236 c->Modified(); 237 c->Update(); 238 239 return c; 213 return MH::DrawClone(opt, 700, 500); 240 214 } 241 215 … … 248 222 void MHHillasSrc::Draw(Option_t *) 249 223 { 250 if (!gPad) 251 MakeDefCanvas(this, 700, 500); 224 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 700, 500); 225 pad->SetBorderMode(0); 226 227 AppendPad(""); 252 228 253 229 // FIXME: Display Source position 254 230 255 gPad->Divide(2, 2); 256 257 gPad->cd(1); 231 pad->Divide(2, 2); 232 233 pad->cd(1); 234 gPad->SetBorderMode(0); 258 235 fAlpha->Draw(); 259 236 260 gPad->cd(2); 237 pad->cd(2); 238 gPad->SetBorderMode(0); 261 239 fDist->Draw(); 262 240 263 gPad->cd(1); 241 pad->cd(3); 242 gPad->SetBorderMode(0); 264 243 fHeadTail->Draw(); 265 244 266 gPad->cd(2); 245 pad->cd(4); 246 gPad->SetBorderMode(0); 267 247 gPad->SetLogy(); 268 248 fCosDA->Draw(); 269 249 270 gPad->Modified();271 gPad->Update();250 pad->Modified(); 251 pad->Update(); 272 252 } 273 253 -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r1940 r1965 188 188 TObject *MHNewImagePar::DrawClone(Option_t *opt) const 189 189 { 190 TCanvas *c = MakeDefCanvas(this, 300, 600); 191 c->Divide(1, 2); 192 193 gROOT->SetSelectedPad(NULL); 194 195 c->cd(1); 196 fLeakage1->DrawCopy(); 197 198 c->cd(2); 199 fLeakage2->DrawCopy(); 200 201 c->Modified(); 202 c->Update(); 203 204 return c; 190 return MH::DrawClone(opt, 300, 600); 205 191 } 206 192 … … 213 199 void MHNewImagePar::Draw(Option_t *) 214 200 { 215 if (!gPad) 216 MakeDefCanvas(this, 300, 600); 217 218 gPad->Divide(2, 2); 219 220 gPad->cd(1); 201 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 300, 600); 202 pad->SetBorderMode(0); 203 204 AppendPad(""); 205 206 pad->Divide(1, 2); 207 208 pad->cd(1); 209 pad->SetBorderMode(0); 221 210 fLeakage1->Draw(); 222 211 223 gPad->cd(2); 212 pad->cd(2); 213 pad->SetBorderMode(0); 224 214 fLeakage2->Draw(); 225 215 226 gPad->Modified();227 gPad->Update();216 pad->Modified(); 217 pad->Update(); 228 218 } 229 219 -
trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
r1940 r1965 57 57 { 58 58 fName = name ? name : "MHillasCalc"; 59 fTitle = title ? title : " Task to calculate Hillas parameters";59 fTitle = title ? title : "Calculate Hillas parameters"; 60 60 61 61 fHilName = hil; -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r1940 r1965 69 69 70 70 static const TString gsDefName = "MImgCleanStd"; 71 static const TString gsDefTitle = " Task to perform astandard image cleaning";71 static const TString gsDefTitle = "Perform standard image cleaning"; 72 72 73 73 // --------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.