Changeset 1543 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 10/16/02 10:45:18 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/macros
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/CT1Hillas.C
r1490 r1543 159 159 // Execute your analysis 160 160 // 161 MProgressBar bar; 162 evtloop.SetProgressBar(&bar); 161 163 if (!evtloop.Eventloop()) 162 164 return; -
trunk/MagicSoft/Mars/macros/MagicHillas.C
r1490 r1543 107 107 // 108 108 109 MCameraSmooth smooth;110 109 MImgCleanStd clean; 111 110 MBlindPixelCalc blind; … … 121 120 122 121 // 123 // Uncomment this two line if you want to use MHillasExt instead 124 // of MHillas 122 // To use MHillasExt instead of MHillas 125 123 // 126 //MHillasExt hext;127 //plist.AddToList(&hext);124 MHillasExt hext; 125 plist.AddToList(&hext); 128 126 129 127 MFillH hfill1("MHHillas", "MHillas"); … … 131 129 MFillH hfill3("MHStarMap", "MHillas"); 132 130 MFillH hfill4("HistExtSource [MHHillasExt]", "HillasSource"); 133 MFillH hfill5("HistExtAntiS ource [MHHillasExt]", "HillasAntiSource");131 MFillH hfill5("HistExtAntiSrc [MHHillasExt]", "HillasAntiSrc"); 134 132 MFillH hfill6("HistSource [MHHillasSrc]", "HillasSource"); 135 133 MFillH hfill7("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc"); … … 141 139 write.AddContainer("MMcEvt","Hillas"); 142 140 write.AddContainer("Source","RunHeaders"); 143 write.AddContainer("AntiS ource","RunHeaders");141 write.AddContainer("AntiSrc","RunHeaders"); 144 142 145 143 tlist.AddToList(&read); … … 172 170 // Execute your analysis 173 171 // 172 MProgressBar bar; 173 evtloop.SetProgressBar(&bar); 174 174 if (!evtloop.Eventloop()) 175 175 return; … … 184 184 plist.FindObject("MHStarMap")->DrawClone(); 185 185 plist.FindObject("HistSource")->DrawClone(); 186 plist.FindObject("HistAntiS ource")->DrawClone();186 plist.FindObject("HistAntiSrc")->DrawClone(); 187 187 plist.FindObject("HistExtSource")->DrawClone(); 188 plist.FindObject("HistExtAntiS ource")->DrawClone();188 plist.FindObject("HistExtAntiSrc")->DrawClone(); 189 189 } 190 190 -
trunk/MagicSoft/Mars/macros/collarea.C
r1301 r1543 53 53 // Start to loop over all events 54 54 // 55 MProgressBar bar; 56 magic.SetProgressBar(&bar); 55 57 if (!magic.Eventloop()) 56 58 return; -
trunk/MagicSoft/Mars/macros/flux.C
r1417 r1543 420 420 // and for different intervals in Theta 421 421 422 char *varnametime; 423 varnametime = "Time"; 424 char *unittime; 425 unittime = "[ s]"; 426 MHEffOnTime effontime(varnametime, unittime); 427 428 char *varnametheta; 429 varnametheta = "Theta"; 430 char *unittheta; 431 unittheta = "[ \\circ]"; 432 MHEffOnTime effontheta(varnametheta, unittheta); 422 MHEffOnTime effontime ("Time", "[s]"); 423 MHEffOnTime effontheta("Theta", "[\\circ]"); 433 424 434 425 effontime.SetupFill(&parlist); … … 438 429 // Draw == 0 don't draw the individual distributions of time differences 439 430 // != 0 draw them 440 Bool_t Draw=kFALSE;441 effontime.Calc (dtimetime->GetHist(), Draw);442 effontheta.Calc(dtimetheta->GetHist(), Draw);431 Bool_t draw=kFALSE; 432 effontime.Calc (dtimetime->GetHist(), draw); 433 effontheta.Calc(dtimetheta->GetHist(),draw); 443 434 444 435 … … 487 478 MHGamma gamma; 488 479 489 Bool_t Draw = kFALSE;490 480 TH3D *hsubtime = gamma.Subtract( evtsptime->GetHist(), 491 481 evtasptime->GetHist(), 492 "Al-En-time", "3D-plot of Alpha,E-est,time", Draw);482 "Al-En-time", "3D-plot of Alpha,E-est,time", draw); 493 483 494 484 TH3D *hsubtheta = gamma.Subtract( evtsptheta->GetHist(), 495 485 evtasptheta->GetHist(), 496 "Al-En-time", "3D-plot of Alpha,E-est,Theta", Draw);486 "Al-En-time", "3D-plot of Alpha,E-est,Theta", draw); 497 487 498 488 … … 504 494 Axis_t lo = 0; // [deg] 505 495 Axis_t up = 10; // [deg] 506 Bool_t Draw = kFALSE;507 496 const TH2D &evttime = *(gamma.GetAlphaProjection(hsubtime, 508 lo, up, Draw));497 lo, up, draw)); 509 498 510 499 const TH2D &evttheta = *(gamma.GetAlphaProjection(hsubtheta, 511 lo, up, Draw));500 lo, up, draw)); 512 501 513 502 … … 547 536 // Draw == kTRUE draw the no.of photons vs. E-est 548 537 // for the individual bins of the variable Var 549 Bool_t Draw=kTRUE;550 MHFlux fluxtime(evttime, Draw, "Time", " [s]");551 fluxtime.Unfold( Draw);538 draw=kTRUE; 539 MHFlux fluxtime(evttime, draw, "Time", "[s]"); 540 fluxtime.Unfold(draw); 552 541 fluxtime.CalcFlux(effontime.GetHist(), bartime.GetHist(), 553 &aeff, Draw);542 &aeff, draw); 554 543 555 544 fluxtime.DrawClone(); … … 559 548 //.............................................. 560 549 // get flux spectrum for different bins in Theta 561 Bool_t Draw=kTRUE; 562 MHFlux fluxtheta(evttheta, Draw, "Theta", " [ \\circ]"); 563 fluxtheta.Unfold(Draw); 550 MHFlux fluxtheta(evttheta, draw, "Theta", "[\\circ]"); 551 fluxtheta.Unfold(draw); 564 552 fluxtheta.CalcFlux(effontheta.GetHist(), bartheta.GetHist(), 565 &aeff, Draw);553 &aeff, draw); 566 554 567 555 fluxtheta.DrawClone(); -
trunk/MagicSoft/Mars/macros/plot.C
r1410 r1543 99 99 // Execute your analysis 100 100 // 101 MProgressBar bar; 102 evtloop.SetProgressBar(&bar); 101 103 if (!evtloop.Eventloop()) 102 104 return; -
trunk/MagicSoft/Mars/macros/plot2.C
r1410 r1543 104 104 // Execute your analysis 105 105 // 106 MProgressBar bar; 107 evtloop.SetProgressBar(&bar); 106 108 if (!evtloop.Eventloop()) 107 109 return; -
trunk/MagicSoft/Mars/macros/star.C
r1491 r1543 119 119 // Create and setup the eventloop 120 120 // 121 MProgressBar bar; 122 121 123 MEvtLoop evtloop; 124 evtloop.SetProgressBar(&bar); 122 125 evtloop.SetParList(&plist); 123 126 -
trunk/MagicSoft/Mars/macros/starplot.C
r1490 r1543 105 105 // Execute your analysis 106 106 // 107 MProgressBar bar; 108 evtloop.SetProgressBar(&bar); 107 109 if (!evtloop.Eventloop()) 108 110 return; -
trunk/MagicSoft/Mars/macros/threshold.C
r1008 r1543 90 90 // don't try to draw the results 91 91 // 92 MProgressBar bar; 93 evtloop.SetProgressBar(&bar); 92 94 if (!evtloop.Eventloop()) 93 95 return; -
trunk/MagicSoft/Mars/macros/trigrate.C
r1380 r1543 29 29 ! 30 30 \* ======================================================================== */ 31 32 Int_t GetNSBEvents(TString name, Float_t *BgR) 33 { 34 Int_t numnsbevents; 35 36 TChain events("Events"); 37 events.Add(name); 38 39 TH1F h("h","",5,.5,5.5); 40 41 for (Int_t i = from; i <= to; i++) 42 { 43 TString plot = "MMcTrig;"; 44 plot+=i; 45 plot+=".fNumFirstLevel>>h"; 46 47 if (i == 0) 48 plot = "MMcTrig.fNumFirstLevel>>h"; 49 50 events.Draw(plot,"", "goff"); 51 52 // Get total number of L1 triggers from histogram: 53 BgR[dim>0? i-1: 0] = h.Integral()*h.GetMean(); 54 55 numnsbevents = (Float_t) h.GetEntries(); 56 } 57 58 return numnsbevents; 59 } 60 31 61 32 62 void trigrate(int dim=0, char *filename = "data/camera.root", … … 97 127 tasklist.AddToList(&reader); 98 128 99 100 129 // Now we have to build the BgR array, containing the number 101 130 // of triggers (may be more than 1 trigger/event!) from the … … 103 132 // If no nsbfile is supplied, we assume no triggers from NSB 104 133 134 Float_t* BgR = new Float_t[num]; 135 memset(BgR, 0, num*sizeof(Float_t)); 136 105 137 Float_t numnsbevents = 5.e4; // some default value. 106 107 Float_t* BgR = new float[num];108 for(Int_t i = 0; i < num; i++)109 BgR[i] = 0.;110 111 138 if (nsbfile) 112 { 113 TChain nsb_events("Events"); 114 nsb_events.Add(nsbfile); 115 116 TH1F h("h","",5,.5,5.5); 117 118 for (Int_t i = from; i <= to; i++) 119 { 120 TString plot = "MMcTrig;"; 121 plot+=i; 122 plot+=".fNumFirstLevel>>h"; 123 124 if (i == 0) 125 plot = "MMcTrig.fNumFirstLevel>>h"; 126 127 nsb_events.Draw(plot,"", "goff"); 128 // Get total number of L1 triggers from histogram: 129 BgR[dim>0? i-1: 0] = h.Integral()*h.GetMean(); 130 131 numnsbevents = (Float_t) h.GetEntries(); 132 } 133 } 139 numnsbevents = GetNSBEvents(nsbfile, BgR); 134 140 135 141 cout << "Number of Trigger conditions: " << num << endl; … … 147 153 // Start to loop over all events 148 154 // 155 MProgressBar bar; 156 magic.SetProgressBar(&bar); 149 157 if (!magic.Eventloop()) 150 158 return; 151 159 160 delete BgR; 161 152 162 hists.Print(); 153 163 }
Note:
See TracChangeset
for help on using the changeset viewer.