Changeset 5143 for trunk/MagicSoft/Mars
- Timestamp:
- 09/28/04 12:25:50 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5141 r5143 20 20 -*-*- END OF LINE -*-*- 21 21 22 2004/09/28: Thomas Bretz 23 24 * mbase/MGMap.h: 25 - added Clear() function 26 27 * mfileio/MReadReports.[h,cc]: 28 - added GetReader member function 29 30 * mhbase/MBinning.h: 31 - set a default for a constructor argument 32 33 * mhbase/MH.cc: 34 - do not treat errors when enhancing histograms 35 if errors are not set 36 37 * mhflux/MHEffectiveOnTime.cc: 38 - changed conditions for fit: 39 + 5% - 95% ---> 60% - 99% 40 + start value 200Hz 41 + ok if chi2<3*NDF 42 - resturn chi2 as result of fit 43 - changed some text output in pads 44 45 * mhflux/MHFalseSource.cc: 46 - made work without MPointingPos 47 - fixed crash if star-display is used 48 - fixed dissapearing alpha plot 49 50 * mhist/MHCamEvent.[h,cc]: 51 - removed rms histogram 52 - enhanced display 53 - fixed handling of title 54 55 * mhist/MHCamera.[h,cc]: 56 - simplified projection functions a bit 57 - simplified profile functions a bit 58 - added default for binning 59 - added binning to Profiles 60 61 * mimage/MConcentration.c: 62 - fixed author list 63 64 * mimage/MHHillas.cc: 65 - display size as logy 66 67 * mimage/MHHillasExt.cc, mimage/MHHillasSrc.cc: 68 - fixed binnings 69 - removed obsolete pad->Update in Draw 70 71 * mimage/MHImagePar.cc: 72 - fixed setting of log-scale 73 74 * mjobs/MJCalibrateSignal.cc: 75 - fixed histogram titles and axis titles 76 77 * mjobs/MJStar.cc: 78 - added EventRate cut which cuts out events with extremely 79 changing rates 80 81 * mmain/MEventDisplay.cc: 82 - unlock event display 83 84 * msignal/MArrivalTime.cc: 85 - fixed GetPixelContent 86 87 88 22 89 2004/09/28: Raquel de los Reyes 23 90 … … 27 94 00035488 (2004_08_30) 28 95 96 97 29 98 2004/09/27: Abelardo Moralejo 30 99 … … 32 101 - Added. Macro to compare the piled-up signals for many pixels and 33 102 events together, intended to check the noise fluctuations. 103 104 34 105 35 106 2004/09/23: Markus Gaug … … 76 147 77 148 149 78 150 2004/09/23: Abelardo Moralejo 79 151 * mtemp/mpadova/macros/area.C, RanForestPD.C, gammarate.C 80 152 - Added 153 81 154 * macros/starmc.C 82 155 - Added some missing RunHeaders in the output 83 156 157 158 84 159 2004/09/19: Thomas Bretz 85 160 86 * mbadpixels/MBadP IxlesCam.[h,cc]:161 * mbadpixels/MBadPixlesCam.[h,cc]: 87 162 - added Reset-function. This makes sure, that the event-wise 88 163 bad pixels determined by MBadPIxelsCalc are deleted after … … 92 167 * mpointing/MPointingPos.cc, mreport/MReportDrive.cc: 93 168 - initialize the variables in the constructor 169 94 170 95 171 -
trunk/MagicSoft/Mars/mbase/MGMap.h
r4081 r5143 11 11 class TString; 12 12 class TGToolTip; 13 14 #include <iostream> 13 15 14 16 class MGMap : public TExMap … … 31 33 void Add(TObject *k, TString *v=0); 32 34 void Delete(Option_t *opt = ""); 35 void Clear(Option_t *o="") { TExMap::Delete(); } 33 36 34 37 // void SetNoToolTips(Bool_t b=kTRUE) { b ? SetBit(kNoToolTips) : ResetBit(kNoToolTips); } // *TOGGLE* *GETTER=HasNoToolTips -
trunk/MagicSoft/Mars/mfileio/MReadReports.cc
r4895 r5143 198 198 } 199 199 200 MReadTree *MReadReports::GetReader(const char *tree) const 201 { 202 return (MReadTree*)fTrees->FindObject(tree); 203 } 204 200 205 // -------------------------------------------------------------------------- 201 206 // -
trunk/MagicSoft/Mars/mfileio/MReadReports.h
r4895 r5143 13 13 class MTime; 14 14 class MTaskList; 15 class MReadTree; 15 16 16 17 class MReadReports : public MRead … … 55 56 void EnableAutoScheme(Bool_t e=kTRUE) { fEnableAutoScheme = e; } // Must be called BEFORE AddTree! 56 57 58 MReadTree *GetReader(const char *tree) const; 59 57 60 ClassDef(MReadReports, 0) // Reads events and reports from a root file ordered in time 58 61 }; -
trunk/MagicSoft/Mars/mhbase/MBinning.h
r4966 r5143 37 37 public: 38 38 MBinning(const char *name=NULL, const char *title=NULL); 39 MBinning(Int_t nbins, Axis_t lo, Axis_t hi, const char *name , const char *opt="", const char *title=NULL);39 MBinning(Int_t nbins, Axis_t lo, Axis_t hi, const char *name=0, const char *opt="", const char *title=NULL); 40 40 41 41 void SetEdges(const TArrayD &arr) -
trunk/MagicSoft/Mars/mhbase/MH.cc
r5060 r5143 483 483 return; 484 484 485 const Bool_t haserr = h.GetSumw2N()>0; 486 485 487 const Int_t n0 = h.GetNbinsX(); 486 488 if (n0<2) … … 488 490 489 491 TArrayD val(n0-1); 490 TArrayD err( n0-1);492 TArrayD err(haserr ? n0-1 : 0); 491 493 for (int i=1; i<n0; i++) 492 494 { 493 495 val[i-1] = h.GetBinContent(i+1); 494 err[i-1] = h.GetBinError(i+1); 496 if (haserr) 497 err[i-1] = h.GetBinError(i+1); 495 498 } 496 499 … … 505 508 { 506 509 h.SetBinContent(i, val[i-1]); 507 h.SetBinError(i, err[i-1]); 510 if (haserr) 511 h.SetBinError(i, err[i-1]); 508 512 } 509 513 } -
trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
r5012 r5143 304 304 // within the range (yq[0], yq[1]) there must be no empty bin; 305 305 // choose pedestrian approach as long as GetQuantiles is not available 306 Double_t xq[2] = { 0. 05, 0.95};306 Double_t xq[2] = { 0.6, 0.99 }; 307 307 Double_t yq[2]; 308 308 h->GetQuantiles(2, yq, xq); … … 321 321 //func.SetParNames("lambda", "N0", "del"); 322 322 323 func.SetParameter(0, 100); // Hz323 func.SetParameter(0, 200); // Hz 324 324 func.SetParameter(1, Nm); 325 325 func.FixParameter(2, Nmdel/Nm); … … 335 335 336 336 // was fit successful ? 337 const Bool_t ok = NDF>0 && chi2< 2.5*NDF;337 const Bool_t ok = NDF>0 && chi2<3*NDF; 338 338 339 339 if (paint) … … 343 343 func.Paint("same"); 344 344 } 345 346 if (!ok)347 return kFALSE;348 345 349 346 const Double_t lambda = func.GetParameter(0); … … 385 382 res[5] = NDF; 386 383 384 // Chi2 385 res[6] = chi2; 386 387 387 // Rdead (from fit) is the fraction from real time lost by the dead time 388 388 //fHRdead.SetBinContent(i, Rdead); 389 389 //fHRdead.SetBinError (i,dRdead); 390 390 391 return kTRUE;391 return ok; 392 392 } 393 393 … … 415 415 h = fH2DeltaT.ProjectionX(name, i, i, "E"); 416 416 417 Double_t res[ 6];417 Double_t res[7]; 418 418 if (!FitH(h, res)) 419 419 continue; … … 457 457 // Fit histogram 458 458 // 459 Double_t res[ 6];459 Double_t res[7]; 460 460 if (!FitH(&fH1DeltaT, res)) 461 461 return; … … 551 551 552 552 // 553 // If we reached the event number limit for the time-bins fit the histogram 554 // 555 if (fH1DeltaT.GetEntries()>=fNumEvents) 553 // If we reached the event number limit for the time-bins fit the 554 // histogram - if it fails try again when 1.6% more events available 555 // 556 const Int_t n = (Int_t)fH1DeltaT.GetEntries(); 557 if (n>=fNumEvents && n%(fNumEvents/60)==0) 556 558 FitTimeBin(); 557 559 … … 592 594 void MHEffectiveOnTime::PaintText(Double_t *res) const 593 595 { 594 TLatex text(0.2 5, 0.94, Form("T_{eff}=%.1fs\\pm%.1fs \\labda=%.1f\\pm%.1f p=%.1f%% NDF=%d",595 res[0], res[1], res[3], res[4], res[2], res[5]));596 TLatex text(0.27, 0.94, Form("T_{eff}=%.1fs\\pm%.1fs \\lambda=%.1f\\pm%.1fHz p=%.1f%% \\chi^{2}/%d=%.1f", 597 res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5])); 596 598 text.SetBit(TLatex::kTextNDC); 597 599 text.SetTextSize(0.04); … … 613 615 return; 614 616 615 TLatex text(0.4 5, 0.94, Form("\\bar{p} = %.1f%% (n=%d)", sum/n,n));617 TLatex text(0.47, 0.94, Form("\\bar{p} = %.1f%%", sum/n)); 616 618 text.SetBit(TLatex::kTextNDC); 617 619 text.SetTextSize(0.04); … … 692 694 if ((h = (TH1D*)gPad->FindObject(fNameProjDeltaT))) 693 695 { 694 Double_t res[ 6];696 Double_t res[7]; 695 697 FitH(h, res, kTRUE); 696 698 PaintText(res); -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r5100 r5143 290 290 // for the current pointing position and add a offset in the 291 291 // Fill function! 292 fRa = fPointPos ->GetRa();293 fDec = fPointPos ->GetDec();292 fRa = fPointPos ? fPointPos->GetRa() : 0; 293 fDec = fPointPos ? fPointPos->GetDec() : 90; 294 294 295 295 return kTRUE; … … 592 592 stars->ReadBSC("bsc5.dat"); 593 593 594 *fLog << err << "FIXME - The catalog will never be deleted, because this crashes!" << endl; 595 596 // stars->SetBit(kCanDelete); 597 594 stars->SetBit(kCanDelete); 598 595 return stars; 599 596 } … … 612 609 pad->Divide(1, 2, 0, 0.03); 613 610 614 *fLog << err << "FIXME - Plotting the catalog is broken!" << endl;615 616 611 TObject *catalog = GetCatalog(); 617 612 618 613 // Initialize upper part 619 614 pad->cd(1); 615 // Make sure that the catalog is deleted only once 616 gROOT->GetListOfCleanups()->Add(gPad); 620 617 gPad->SetBorderMode(0); 621 618 gPad->Divide(3, 1); … … 662 659 // Initialize lower part 663 660 pad->cd(2); 661 // Make sure that the catalog is deleted only once 662 gROOT->GetListOfCleanups()->Add(gPad); 664 663 gPad->SetBorderMode(0); 665 664 gPad->Divide(3, 1); … … 673 672 h1->SetXTitle(fHist.GetZaxis()->GetTitle()); 674 673 h1->SetYTitle("Counts"); 675 h1->Draw( opt);674 h1->Draw(); 676 675 h1->SetBit(kCanDelete); 677 676 … … 942 941 943 942 944 TF2 f2d("Gaus-2D", FcnGauss2d, -1.5, 1.5, -1.5, 1.5, 6); 943 const Double_t maxr = 0.9*TMath::Abs(fHist.GetBinCenter(1)); 944 TF2 f2d("Gaus-2D", FcnGauss2d, -maxr, maxr, -maxr, maxr, 6); 945 945 f2d.SetLineWidth(1); 946 946 f2d.SetParName(0, "Max sigma"); … … 950 950 f2d.SetParName(4, "Sigma_2 deg"); 951 951 f2d.SetParName(5, "Phi deg"); 952 f2d.SetParLimits(1, - 1, 1);// mu_1953 f2d.SetParLimits(3, - 1, 1);// mu_2954 f2d.SetParLimits(2, 0, 1);// sigma_1955 f2d.SetParLimits(4, 0, 1);// sigma_2956 f2d.SetParLimits(5, 0, 90);// phi957 f2d.SetParameter(0, maxs); // A958 f2d.SetParameter(1, 0);// mu_1959 f2d.SetParameter(2, 0. 5);// sigma_1960 f2d.SetParameter(3, 0);// mu_2961 f2d.SetParameter(4, 0. 5);// sigma_2962 f2d. SetParameter(5, 0);// phi963 hist->Fit(&f2d, "NI0 ");952 f2d.SetParLimits(1, -maxr/2, maxr/2); // mu_1 953 f2d.SetParLimits(3, -maxr/2, maxr/2); // mu_2 954 f2d.SetParLimits(2, 0, maxr); // sigma_1 955 f2d.SetParLimits(4, 0, maxr); // sigma_2 956 f2d.SetParLimits(5, 0, 45); // phi 957 f2d.SetParameter(0, maxs); // A 958 f2d.SetParameter(1, hist->GetXaxis()->GetBinCenter(maxx)); // mu_1 959 f2d.SetParameter(2, 0.1); // sigma_1 960 f2d.SetParameter(3, hist->GetYaxis()->GetBinCenter(maxy)); // mu_2 961 f2d.SetParameter(4, 0.1); // sigma_2 962 f2d.FixParameter(5, 0); // phi 963 hist->Fit(&f2d, "NI0R"); 964 964 f2d.DrawCopy("cont2same"); 965 965 -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r2893 r5143 30 30 // currents or enything else derived from MCamEvent 31 31 // 32 // To plot the variance instead of the rms use: 33 // MHCamEvent::SetBit(MHCamera::kVariance); 34 // 35 // Axis titles 36 // =========== 37 // 38 // 1) If no other title is given 'a.u.' is used. 39 // 2) If the title of MHCamEvent is different from the default, 40 // it is used as histogram title. You can use this to set the 41 // axis title, too. For more information see TH1::SetTitle, eg. 42 // SetTitle("MyHist;;y[cm];Counts"); 43 // Make sure to set an empty x-axis title. 44 // 45 // 46 // For example: 47 // MHCamEvent myhist("Titele;;y [cm]"); 48 // 49 // 32 50 ///////////////////////////////////////////////////////////////////////////// 33 51 #include "MHCamEvent.h" 34 52 35 53 #include <TCanvas.h> 54 #include <TPaveStats.h> 36 55 37 56 #include "MLog.h" … … 48 67 using namespace std; 49 68 50 // -------------------------------------------------------------------------- 51 // 52 // Initialize the name and title of the task. 53 // Resets the sum histogram 54 // 55 MHCamEvent::MHCamEvent(const char *name, const char *title) 56 : fSum(NULL), fRms(NULL), fEvt(NULL), fType(0) 69 const TString MHCamEvent::gsDefName = "MHCamEvent"; 70 const TString MHCamEvent::gsDefTitle = "Average of MCamEvents"; 71 72 // -------------------------------------------------------------------------- 73 // 74 // Initialize the name and title of the task 75 // 76 void MHCamEvent::Init(const char *name, const char *title) 57 77 { 58 78 // 59 79 // set the name and title of this object 60 80 // 61 fName = name ? name : "MHCamEvent"; 62 fTitle = title ? title : "Average of MCamEvents"; 81 fName = name ? name : gsDefName.Data(); 82 fTitle = title ? title : gsDefTitle.Data(); 83 } 84 85 // -------------------------------------------------------------------------- 86 // 87 // Initialize the name and title of the task. Set fType to 0 88 // 89 MHCamEvent::MHCamEvent(const char *name, const char *title) 90 : fSum(NULL), fEvt(NULL), fType(0) 91 { 92 Init(name, title); 93 } 94 95 // -------------------------------------------------------------------------- 96 // 97 // Initialize the name and title of the task. Set fType to type 98 // 99 MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title) 100 : fSum(NULL), fEvt(NULL), fType(type) 101 { 102 Init(name, title); 63 103 } 64 104 … … 71 111 if (fSum) 72 112 delete fSum; 73 if (fRms)74 delete fRms;75 113 } 76 114 … … 104 142 if (fSum) 105 143 delete (fSum); 106 if (fRms)107 delete (fRms);108 144 109 145 const TString name = fNameEvt.IsNull() ? fName : fNameEvt; 110 146 111 fSum = new MHCamera(*cam, name+";avg", fTitle); 112 fSum->SetYTitle("a.u."); 147 fSum = new MHCamera(*cam, name+";avg"); 148 if (fTitle!=gsDefTitle) 149 fSum->SetTitle(fTitle); 150 if (!fTitle.Contains(";")) 151 fSum->SetYTitle("a.u."); 113 152 fSum->SetBit(MHCamera::kProfile); 114 if(TestBit(MHCamera::kVariance)) 115 fSum->SetBit(MHCamera::kVariance); 116 117 fRms = new MHCamera(*cam, name+";rms", fTitle); 118 fRms->SetYTitle("a.u."); 153 if (TestBit(MHCamera::kVariance)) 154 fSum->SetBit(MHCamera::kVariance); 119 155 120 156 return kTRUE; … … 134 170 } 135 171 fSum->AddCamContent(*evt, fType); 136 fRms->SetCamContent(*fSum, 1);137 return kTRUE;138 }139 140 // --------------------------------------------------------------------------141 //142 // Scale the sum container with the number of entries143 //144 Bool_t MHCamEvent::Finalize()145 {146 //fRms->AddCamContent(*fSum, 1);147 172 return kTRUE; 148 173 } … … 176 201 TH1 *MHCamEvent::GetHistByName(const TString name) 177 202 { 178 // name.ToLower(); 179 180 if (name=="sum") 181 return fSum; 182 if (name=="rms") 183 return fRms; 184 185 return NULL; 203 return fSum; 204 } 205 206 void MHCamEvent::Paint(Option_t *) 207 { 208 TVirtualPad *pad = gPad; 209 210 pad->cd(2); 211 if (gPad->FindObject(Form("Proj_%p", this))) 212 { 213 TH1 *h=fSum->Projection(Form("Proj_%p", this)); 214 if (h->GetMaximum()>0) 215 gPad->SetLogy(); 216 } 217 218 pad->cd(5); 219 if (gPad->FindObject(Form("ProfR_%p", this))) 220 fSum->RadialProfile(Form("ProfR_%p", this)); 221 222 pad->cd(6); 223 if (gPad->FindObject(Form("ProfA_%p", this))) 224 fSum->AzimuthProfile(Form("ProfA_%p", this)); 225 226 pad->cd(4); 227 gPad->cd(1); 228 MHCamera *cam = (MHCamera*)gPad->FindObject(Form("Err_%p", this)); 229 if (cam) 230 cam->SetCamContent(*fSum, 1); 186 231 } 187 232 … … 191 236 pad->SetBorderMode(0); 192 237 193 pad->Divide(1,2); 238 AppendPad(); 239 240 TString name = Form("%s_5", pad->GetName()); 241 TPad *p = new TPad(name,name,6./8,0.25,0.99,0.5,pad->GetFillColor(),0,0); 242 p->SetNumber(5); 243 p->Draw(); 244 245 name = Form("%s_6", pad->GetName()); 246 p = new TPad(name,name,6./8,0.01,0.99,0.25,pad->GetFillColor(),0,0); 247 p->SetNumber(6); 248 p->Draw(); 249 250 pad->Divide(2,2); 194 251 195 252 pad->cd(1); 196 253 gPad->SetBorderMode(0); 254 gPad->SetPad(0.01, 0.5, 0.66, 0.99); 197 255 fSum->Draw("EPhist"); 198 256 199 257 pad->cd(2); 200 258 gPad->SetBorderMode(0); 201 gPad->Divide(2, 1); 202 pad = gPad; 203 204 pad->cd(1); 259 gPad->SetPad(0.66, 0.5, 0.99, 0.99); 260 TH1 *h = fSum->Projection(Form("Proj_%p", this), 50); 261 h->SetTitle("Projection"); 262 h->SetBit(kCanDelete); 263 h->Draw(); 264 265 pad->cd(3); 266 gPad->SetPad(0.01, 0.01, 3./8, 0.5); 205 267 gPad->SetBorderMode(0); 206 268 fSum->Draw(); 207 269 208 pad->cd(2); 209 gPad->SetBorderMode(0); 210 fRms->Draw(); 211 } 270 pad->cd(4); 271 gPad->SetPad(3./8, 0.01, 6./8, 0.5); 272 gPad->SetBorderMode(0); 273 274 MHCamera *cam = new MHCamera(*fSum->GetGeometry()); 275 cam->SetName(Form("Err_%p", this)); 276 cam->SetTitle(TestBit(MHCamera::kVariance)?"Variance":"Root Mean Squared (rms)"); 277 cam->SetYTitle(fSum->GetYaxis()->GetTitle()); 278 cam->SetCamContent(*fSum, 1); 279 cam->SetBit(kCanDelete); 280 cam->Draw(); 281 282 pad->cd(5); 283 h = (TH1*)fSum->RadialProfile(Form("ProfR_%p", this), 20); 284 h->SetTitle("Radial Profile"); 285 h->SetBit(kCanDelete|TH1::kNoStats); 286 h->Draw(); 287 288 pad->cd(6); 289 h = (TH1*)fSum->AzimuthProfile(Form("ProfA_%p", this), 30); 290 h->SetTitle("Azimuth Profile"); 291 h->SetBit(kCanDelete|TH1::kNoStats); 292 h->Draw(); 293 } -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r2550 r5143 12 12 { 13 13 private: 14 static const TString gsDefName; 15 static const TString gsDefTitle; 16 14 17 MHCamera *fSum; // storing the sum 15 MHCamera *fRms; // storing the rms16 18 MCamEvent *fEvt; //! the current event 17 19 … … 20 22 Int_t fType; 21 23 24 void Init(const char *name, const char *title); 25 22 26 Bool_t SetupFill(const MParList *pList); 23 27 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 24 Bool_t Finalize();25 28 26 29 public: 27 30 MHCamEvent(const char *name=NULL, const char *title=NULL); 31 MHCamEvent(Int_t type, const char *name=NULL, const char *title=NULL); 28 32 ~MHCamEvent(); 29 33 … … 33 37 TH1 *GetHistByName(const TString name=""); 34 38 39 void Paint(Option_t *o=""); 35 40 void Draw(Option_t *o=""); 36 41 -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r4915 r5143 75 75 76 76 #include "MH.h" 77 #include "MBinning.h" 77 78 #include "MHexagon.h" 78 79 … … 576 577 if (!h1) 577 578 { 578 Double_t min = GetMinimumSectors(sector, aidx); 579 Double_t max = GetMaximumSectors(sector, aidx); 580 581 Int_t newbins=0; 582 583 THLimitsFinder::OptimizeLimits(nbins, newbins, min, max, kFALSE); 584 585 h1 = new TH1D(pname, GetTitle(), nbins, min, max); 586 h1->SetDirectory(pname.IsNull() ? NULL : gROOT); 579 h1 = new TH1D; 580 h1->UseCurrentStyle(); 581 h1->SetName(pname); 582 h1->SetTitle(GetTitle()); 583 h1->SetDirectory(0); 587 584 h1->SetXTitle(GetYaxis()->GetTitle()); 588 585 h1->SetYTitle("Counts"); 589 586 //h1->Sumw2(); 590 587 } 588 589 Double_t min = GetMinimumSectors(sector, aidx); 590 Double_t max = GetMaximumSectors(sector, aidx); 591 592 if (min==max && max>0) 593 min=0; 594 if (min==max && min<0) 595 max=0; 596 597 Int_t newbins=0; 598 THLimitsFinder::OptimizeLimits(nbins, newbins, min, max, kFALSE); 599 600 MBinning bins(nbins, min, max); 601 bins.Apply(*h1); 591 602 592 603 // Fill the projected histogram … … 630 641 TProfile *MHCamera::RadialProfileS(const TArrayI §or, const TArrayI &aidx, const char *name, const Int_t nbins) const 631 642 { 643 // Create the projection histogram 644 TString pname(name); 645 if (name=="_rad") 646 { 647 pname.Prepend(GetName()); 648 if (sector.GetSize()>0) 649 { 650 pname += ";"; 651 for (int i=0; i<sector.GetSize(); i++) 652 pname += sector[i]; 653 } 654 if (aidx.GetSize()>0) 655 { 656 pname += ";"; 657 for (int i=0; i<aidx.GetSize(); i++) 658 pname += aidx[i]; 659 } 660 } 661 662 TProfile *h1=0; 663 664 //check if histogram with identical name exist 665 TObject *h1obj = gROOT->FindObject(pname); 666 if (h1obj && h1obj->InheritsFrom("TProfile")) { 667 h1 = (TProfile*)h1obj; 668 h1->Reset(); 669 } 670 671 if (!h1) 672 { 673 h1 = new TProfile; 674 h1->UseCurrentStyle(); 675 h1->SetName(pname); 676 h1->SetTitle(GetTitle()); 677 h1->SetDirectory(0); 678 h1->SetXTitle("Radius from camera center [mm]"); 679 h1->SetYTitle(GetYaxis()->GetTitle()); 680 } 681 682 Double_t min = 0.; 683 Double_t max = fGeomCam->GetMaxRadius(); 684 685 Int_t newbins=0; 686 687 THLimitsFinder::OptimizeLimits(nbins, newbins, min, max, kFALSE); 688 689 MBinning bins(nbins, min, max); 690 bins.Apply(*h1); 632 691 633 // Create the projection histogram 634 TString pname(name); 635 if (name=="_rad") 636 { 637 pname.Prepend(GetName()); 638 if (sector.GetSize()>0) 639 { 640 pname += ";"; 641 for (int i=0; i<sector.GetSize(); i++) 642 pname += sector[i]; 643 } 644 if (aidx.GetSize()>0) 645 { 646 pname += ";"; 647 for (int i=0; i<aidx.GetSize(); i++) 648 pname += aidx[i]; 649 } 650 } 651 652 TProfile *h1=0; 653 654 //check if histogram with identical name exist 655 TObject *h1obj = gROOT->FindObject(pname); 656 if (h1obj && h1obj->InheritsFrom("TProfile")) { 657 h1 = (TProfile*)h1obj; 658 h1->Reset(); 659 } 660 661 if (!h1) 662 { 663 664 Double_t min = 0.; 665 Double_t max = fGeomCam->GetMaxRadius(); 666 667 Int_t newbins=0; 668 669 THLimitsFinder::OptimizeLimits(nbins, newbins, min, max, kFALSE); 670 671 h1 = new TProfile(pname, GetTitle(), nbins, min, max); 672 h1->SetDirectory(pname.IsNull() ? NULL : gROOT); 673 h1->SetXTitle("Radius from camera center [mm]"); 674 h1->SetYTitle(GetYaxis()->GetTitle()); 675 } 676 677 // Fill the projected histogram 678 for (Int_t idx=0; idx<fNcells-2; idx++) 679 if (IsUsed(idx) && MatchSector(idx, sector, aidx)) 680 h1->Fill(TMath::Hypot((*fGeomCam)[idx].GetX(),(*fGeomCam)[idx].GetY()), 681 GetBinContent(idx+1)); 682 return h1; 692 // Fill the projected histogram 693 for (Int_t idx=0; idx<fNcells-2; idx++) 694 if (IsUsed(idx) && MatchSector(idx, sector, aidx)) 695 h1->Fill(TMath::Hypot((*fGeomCam)[idx].GetX(),(*fGeomCam)[idx].GetY()), 696 GetBinContent(idx+1)); 697 return h1; 683 698 } 684 699 … … 710 725 TProfile *MHCamera::AzimuthProfileA(const TArrayI &aidx, const char *name, const Int_t nbins) const 711 726 { 712 713 // Create the projection histogram 714 TString pname(name); 715 if (name=="_azi") 716 { 717 pname.Prepend(GetName()); 718 if (aidx.GetSize()>0) 727 // Create the projection histogram 728 TString pname(name); 729 if (name=="_azi") 730 { 731 pname.Prepend(GetName()); 732 if (aidx.GetSize()>0) 719 733 { 720 pname += ";";721 for (int i=0; i<aidx.GetSize(); i++)722 pname += aidx[i];734 pname += ";"; 735 for (int i=0; i<aidx.GetSize(); i++) 736 pname += aidx[i]; 723 737 } 724 738 } 725 726 TProfile *h1=0; 727 728 //check if histogram with identical name exist 729 TObject *h1obj = gROOT->FindObject(pname); 730 if (h1obj && h1obj->InheritsFrom("TProfile")) { 731 h1 = (TProfile*)h1obj; 732 h1->Reset(); 733 } 734 735 if (!h1) 736 { 737 738 Double_t min = -0.5; 739 Double_t max = 359.5; 740 741 Int_t newbins=0; 742 743 THLimitsFinder::OptimizeLimits(nbins, newbins, min, max, kFALSE); 744 745 h1 = new TProfile(pname, GetTitle(), nbins, min, max); 746 h1->SetDirectory(pname.IsNull() ? NULL : gROOT); 747 h1->SetXTitle("Azimuth in camera [deg]"); 748 h1->SetYTitle(GetYaxis()->GetTitle()); 749 } 750 751 // Fill the projected histogram 752 for (Int_t idx=0; idx<fNcells-2; idx++) 753 { 754 if (IsUsed(idx) && MatchSector(idx, TArrayI(), aidx)) 755 h1->Fill(TMath::ATan2((*fGeomCam)[idx].GetY(),(*fGeomCam)[idx].GetX())*180./TMath::Pi()+180., 756 GetPixContent(idx)); 757 758 } 759 760 return h1; 739 740 TProfile *h1=0; 741 742 //check if histogram with identical name exist 743 TObject *h1obj = gROOT->FindObject(pname); 744 if (h1obj && h1obj->InheritsFrom("TProfile")) { 745 h1 = (TProfile*)h1obj; 746 h1->Reset(); 747 } 748 749 if (!h1) 750 { 751 752 h1 = new TProfile; 753 h1->UseCurrentStyle(); 754 h1->SetName(pname); 755 h1->SetTitle(GetTitle()); 756 h1->SetDirectory(0); 757 h1->SetXTitle("Azimuth in camera [deg]"); 758 h1->SetYTitle(GetYaxis()->GetTitle()); 759 } 760 761 Double_t min = 0; 762 Double_t max = 360; 763 764 Int_t newbins=0; 765 THLimitsFinder::OptimizeLimits(nbins, newbins, min, max, kFALSE); 766 767 MBinning bins(nbins, min, max); 768 bins.Apply(*h1); 769 770 // Fill the projected histogram 771 for (Int_t idx=0; idx<fNcells-2; idx++) 772 { 773 if (IsUsed(idx) && MatchSector(idx, TArrayI(), aidx)) 774 h1->Fill(TMath::ATan2((*fGeomCam)[idx].GetY(),(*fGeomCam)[idx].GetX())*TMath::RadToDeg()+180, 775 GetPixContent(idx)); 776 777 } 778 779 return h1; 761 780 } 762 781 … … 1599 1618 return TObject::GetObjectInfo(px, py); 1600 1619 1601 sprintf(info, "Software Pixel Index: %d (Hardware Id=%d)", idx, idx+1); 1620 sprintf(info, "Software Pixel Idx: %d (Hardware Id=%d) c=%.1f <%s>", 1621 idx, idx+1, GetBinContent(idx+1), IsUsed(idx)?"on":"off"); 1602 1622 return info; 1603 1623 } -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r4883 r5143 262 262 TH1D *ProjectionS(const TArrayI §or, const TArrayI &aidx, const char *name="_py", const Int_t nbins=50) const; 263 263 264 TProfile *RadialProfile(const char *name="_rad" ) const { return RadialProfileS(TArrayI(), TArrayI(), name);}264 TProfile *RadialProfile(const char *name="_rad", Int_t nbins=25) const { return RadialProfileS(TArrayI(), TArrayI(), name, nbins);} 265 265 TProfile *RadialProfileS(Int_t sector, Int_t aidx, const char *name="_rad", const Int_t nbins=25) const 266 266 { … … 269 269 TProfile *RadialProfileS(const TArrayI §or, const TArrayI &aidx, const char *name="_rad", const Int_t nbins=25) const; 270 270 271 TProfile *AzimuthProfile(const char *name="_azi" ) const { return AzimuthProfileA(TArrayI(), name); }271 TProfile *AzimuthProfile(const char *name="_azi", Int_t nbins=25) const { return AzimuthProfileA(TArrayI(), name, nbins); } 272 272 TProfile *AzimuthProfile(Int_t aidx, const char *name="_rad", const Int_t nbins=25) const 273 273 { -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r5035 r5143 306 306 MBadPixelsTreat treat; 307 307 308 MHCamEvent evt0("PedestalFLG"); 309 MHCamEvent evt1("Extra'd"); 310 MHCamEvent evt2("PedPhot"); 311 MHCamEvent evt3("Interp'd"); 312 MHCamEvent evt4("Unsuitable"); 313 MHCamEvent evt5("Times"); 314 evt0.SetType(0); 315 evt1.SetType(0); 316 evt2.SetType(0); 317 evt3.SetType(0); 318 evt4.SetType(2); 319 evt5.SetType(0); 308 MHCamEvent evt0(0, "PedestalFLG", "Pedestal from Lo Gain;;P [fadc/sl]"); 309 MHCamEvent evt1(0, "Extra'd", "Extracted Signal;;S [fadc/sl]"); 310 MHCamEvent evt2(0, "PedPhot", "Calibrated Pedestal;;P [\\gamma]"); 311 MHCamEvent evt3(1, "PedRMS", "Calibrated Pedestal RMS;;\\sigma_{p} [\\gamma]"); 312 MHCamEvent evt4(0, "Interp'd", "Interpolated Signal;;S [\\gamma]"); 313 MHCamEvent evt5(2, "Unsuitable", "Unsuitable event ratio;;%"); 314 MHCamEvent evt6(0, "Times", "Arrival Time;;T [slice]"); 315 320 316 MFillH fill0(&evt0, "MPedestalCam", "FillPedestalFLG"); 321 317 MFillH fill1(&evt1, "MExtractedSignalCam", "FillExtracted"); 322 318 MFillH fill2(&evt2, "MPedPhotCam", "FillPedPhot"); 323 MFillH fill3(&evt3, "MCerPhotEvt", "FillInterpolated"); 324 MFillH fill4(&evt4, "MBadPixelsCam", "FillUnsuitable"); 325 MFillH fill5(&evt5, "MArrivalTime", "FillTimes"); 319 MFillH fill3(&evt3, "MPedPhotCam", "FillPedRMS"); 320 MFillH fill4(&evt4, "MCerPhotEvt", "FillInterpolated"); 321 MFillH fill5(&evt5, "MBadPixelsCam", "FillUnsuitable"); 322 MFillH fill6(&evt6, "MArrivalTime", "FillTimes"); 326 323 327 324 MWriteRootFile write(2, Form("%s{s/_D_/_Y_}", fPathOut.Data()), fOverwrite); … … 386 383 tlist2.AddToList(&fill4); 387 384 tlist2.AddToList(&fill5); 385 tlist2.AddToList(&fill6); 388 386 389 387 // Setup List for Drive-tree -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r5067 r5143 169 169 MGeomApply apply; // Only necessary to craete geometry 170 170 MEventRateCalc rate; 171 MEventRateCalc rate1; // 5min 172 rate.SetNumEvents(1200); 173 rate1.SetNumEvents(60000); 174 rate1.SetNameEventRate("MEventRate2"); 175 rate1.SetNameTimeRate("MTimeRate2"); 171 176 /* 172 177 MEventRateCalc rate10000; … … 179 184 180 185 // ------------------ Setup histograms and fill tasks ---------------- 181 MHCamEvent evt0("Cleaned" );186 MHCamEvent evt0("Cleaned", "Signal after Cleaning;;S [\\gamma]"); 182 187 evt0.SetType(0); 183 188 184 189 MH3 h1("MEventRate.fRate"); 185 190 h1.SetName("MHEventRate"); 191 h1.SetTitle("Event Rate distribution;R [Hz];Counts"); 186 192 h1.SetLogy(); 187 193 /* … … 194 200 plist.AddToList(&b1); 195 201 196 MFillH fill0(&evt0, "MCerPhotEvt", "FillCerPhotEvt"); 202 MHVsTime hvs("MEventRate.fRate"); 203 hvs.SetTitle("Rate per 500 events;R [Hz];Counts"); 204 hvs.SetNumEvents(500); 205 206 MContinue cont1("MEventRate2.fRate/MEventRate.fRate>1.1"); 207 MContinue cont2("MEventRate.fRate/MEventRate2.fRate>1.1"); 208 209 MFillH fillvs(&hvs, "MTime", "FillEventRate10s"); 210 211 MFillH fill0(&evt0, "MCerPhotEvt", "FillCerPhotEvt"); 197 212 MFillH fill1("MHHillas", "MHillas", "FillHillas"); 198 213 MFillH fill2("MHHillasExt", "", "FillHillasExt"); … … 257 272 tlist2.AddToList(&cont); 258 273 tlist2.AddToList(&rate); 259 //tlist2.AddToList(&rate10000); 274 tlist2.AddToList(&rate1); 275 tlist2.AddToList(&fillvs); 276 tlist2.AddToList(&cont1); 277 tlist2.AddToList(&cont2); 260 278 tlist2.AddToList(&fill8); 261 279 tlist2.AddToList(&fill9); -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r5114 r5143 602 602 return; 603 603 604 UnLock(); 605 604 606 // 605 607 // Get parlist -
trunk/MagicSoft/Mars/msignal/MArrivalTime.cc
r4828 r5143 63 63 void MArrivalTime::Reset() 64 64 { 65 fData.Reset(-1);66 fDataErr.Reset(-1);65 fData.Reset(-1); 66 fDataErr.Reset(-1); 67 67 } 68 68 69 69 void MArrivalTime::InitSize(const UInt_t i) 70 70 { 71 fData.Set(i);72 fDataErr.Set(i);71 fData.Set(i); 72 fDataErr.Set(i); 73 73 } 74 74 … … 112 112 { 113 113 case 0: 114 case 1:115 114 val = fData[idx]; 116 115 break; 116 default: 117 return kFALSE; 117 118 } 118 119 119 return kTRUE;120 return val>=0; 120 121 } 121 122
Note:
See TracChangeset
for help on using the changeset viewer.