- Timestamp:
- 02/10/09 20:00:10 (16 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9311 r9312 18 18 19 19 -*-*- END OF LINE -*-*- 20 2009/02/10 Thomas Bretz 21 22 * manalysis/MMcTriggerLvl2Calc.cc: 23 - removed obsolete include of MmcRunHeader 24 25 * mbase/MSpline3.[h,cc]: 26 - improved the available constructors 27 - added some comments for future use 28 - added default constructor 29 - added GetHistogram() 30 31 * mcorsika/MCorsikaRunHeader.[h,cc]: 32 - added fImpactMax 33 - added some Getters 34 35 * melectronics/MPulseShape.[h,cc]: 36 - set class version to 1 to make it storable 37 - set a title for the splines 38 - implemented Paint function 39 40 * mhbase/MH.[h,cc]: 41 - added SetPadRange 42 43 * mhist/MHCamEvent.[h,cc]: 44 - Init the geometry in ReInit thus it can work with a geometry stored in a file 45 - Make sure that histogranms already drawn properly to a pad are found in Paint 46 - added RecursiveRemove for sanity 47 48 * mmc/MMcCorsikaRunHeader.h: 49 - added SetSpectrum 50 51 * mmc/MMcEvt.hxx: 52 - added SetEvtNumber 53 - added SetPhotElfromShower 54 55 * mmc/MMcEvtBasic.[h,cc]: 56 - added operator= 57 58 * mmc/MMcRunHeader.[hxx, cxx]: 59 - set default for the versions to UShort_t(-1) 60 - added some comments 61 - added SetNumSimulatedShowers 62 - added SetImpactMax 63 64 * mraw/MRawRunHeader.cc: 65 - suppress some information in header if not valid 66 67 * msignal/MSignalCalc.cc: 68 - if (!fPedestal) we should return kTRUE not kFALSE 69 70 * msimreflector/MMirror.[h,cc], msimreflector/MMirrorDisk.[h,cc], 71 msimreflector/MMirrorHex.[h,cc], msimreflector/MMirrorSquare.[h,cc], 72 msimreflector/MReflector.[h,cc], 73 - added Print 74 - some cosmetics in header 75 - set class version to 1 to make it storable 76 77 * mtools/MagicJam.cc: 78 - updated 79 80 20 81 21 82 2009/02/10 Daniela Dorner -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc
r7188 r9312 45 45 #include "MMcTrig.hxx" 46 46 #include "MRawRunHeader.h" 47 #include "MMcRunHeader.hxx"48 47 49 48 #include "MGeomCam.h" -
trunk/MagicSoft/Mars/mbase/MSpline3.cc
r9229 r9312 38 38 #include <TF1.h> 39 39 40 #include "MArrayD.h" 41 40 42 ClassImp(MSpline3); 41 43 … … 48 50 MSpline3::MSpline3(const TF1 &f, const char *opt, Double_t valbeg, Double_t valend) 49 51 : TSpline3("MSpline3", f.GetXmin(), f.GetXmax(), &f, f.GetNpx(), opt, valbeg, valend) 52 { 53 } 54 55 MSpline3::MSpline3(const TF1 &f, Double_t freq, const char *opt,Double_t valbeg, Double_t valend) 56 : TSpline3("MSpline3", f.GetXmin()*freq, f.GetXmax()*freq, ConvertFunc(f, freq).GetArray(), f.GetNpx(), opt, valbeg, valend) 50 57 { 51 58 } … … 105 112 // a discrete binning is done similar to the constructor of TSpline 106 113 // 107 TGraph *MSpline3::ConvertFunc(const TF1 &f, Float_t freq) const114 MArrayD &MSpline3::ConvertFunc(const TF1 &f, Float_t freq) const 108 115 { 109 116 const UInt_t npx = f.GetNpx(); … … 111 118 // WARNING: This is a stupid workaround because the TSpline3- 112 119 // constructor takes a pointer as input! It is not thread-safe! 113 static TGraphg;120 static MArrayD g; 114 121 g.Set(npx); 115 122 … … 119 126 { 120 127 const Double_t x = f.GetXmin() + i*step; 121 g .SetPoint(i, x*freq, f.Eval(x));128 g[i] = f.Eval(x); 122 129 } 123 130 124 return &g;131 return g; 125 132 } 133 134 // FIXME: As soon as TSpline3 allows access to fPoly we can implement 135 // a much faster evaluation of the spline, especially in 136 // special conditions like in MAnalogSignal::AddPulse 137 // This will be the case for root > 5.22/00 138 139 /* 140 Double_t MSpline3::EvalFast(Double_t x) const 141 { 142 // Eval this spline at x 143 const Int_t klow=FindFast(x); 144 return fPoly[klow].Eval(x); 145 } 146 147 Int_t MSpline3::FindFast(Double_t x) const 148 { 149 // 150 // If out of boundaries, extrapolate 151 // It may be badly wrong 152 153 // if (x<=fXmin) 154 // return 0; 155 // 156 // if (x>=fXmax) 157 // return fNp-1; 158 159 // 160 // Equidistant knots, use histogramming 161 if (fKstep) 162 return TMath::Min(Int_t((x-fXmin)/fDelta),fNp-1); 163 164 // 165 // Non equidistant knots, binary search 166 Int_t klow = 0; 167 Int_t khig = fNp-1; 168 169 Int_t khalf; 170 while (khig-klow>1) 171 if(x>fPoly[khalf=(klow+khig)/2].X()) 172 klow=khalf; 173 else 174 khig=khalf; 175 176 // This could be removed, sanity check 177 //if(!(fPoly[klow].X()<=x && x<=fPoly[klow+1].X())) 178 // Error("Eval", 179 // "Binary search failed x(%d) = %f < %f < x(%d) = %f\n", 180 // klow,fPoly[klow].X(),x,fPoly[klow+1].X()); 181 182 return klow; 183 } 184 */ -
trunk/MagicSoft/Mars/mbase/MSpline3.h
r9229 r9312 6 6 #endif 7 7 8 class MArrayD; 9 8 10 class MSpline3 : public TSpline3 9 11 { 10 12 private: 11 TGraph *ConvertSpline(const TSpline &s, Float_t freq) const;12 TGraph *ConvertGraph(const TGraph &s, Float_t freq) const;13 TGraph *ConvertFunc(const TF1 &f, Float_t freq) const;13 TGraph *ConvertSpline(const TSpline &s, Float_t freq) const; 14 TGraph *ConvertGraph(const TGraph &s, Float_t freq) const; 15 MArrayD &ConvertFunc(const TF1 &f, Float_t freq) const; 14 16 15 17 public: 16 MSpline3(const TGraph &g, 17 const char *opt=0, Double_t valbeg=0, Double_t valend=0) 18 : TSpline3("MSpline3", &g, opt, valbeg, valend) 19 { 20 } 18 MSpline3() { } 21 19 22 MSpline3(const TGraph &g, Double_t freq, 23 const char *opt=0, Double_t valbeg=0, Double_t valend=0) 24 : TSpline3("MSpline3", ConvertGraph(g, freq), opt, valbeg, valend) 25 { 26 } 20 // None equidistant binning (evaluation a bit slower in case of many bins) 21 MSpline3(const TGraph &g, 22 const char *opt=0, Double_t valbeg=0, Double_t valend=0) 23 : TSpline3("MSpline3", &g, opt, valbeg, valend) 24 { 25 } 27 26 28 MSpline3(const TSpline &s, Double_t freq, 29 const char *opt=0, Double_t valbeg=0, Double_t valend=0) 30 : TSpline3("MSpline3", ConvertSpline(s, freq), opt, valbeg, valend) 31 { 32 } 33 /* 34 MSpline3(Double_t xmin, Double_t xmax, 35 const TF1 *func, Int_t n, const char *opt=0, 36 Double_t valbeg=0, Double_t valend=0) 37 : TSpline3("MSpline3", xmin, xmax, func, n, opt, valbeg, valend) 38 { 39 }*/ 40 MSpline3(const TF1 &f, const char *opt=0,Double_t valbeg=0, Double_t valend=0); 27 MSpline3(const TGraph &g, Double_t freq, 28 const char *opt=0, Double_t valbeg=0, Double_t valend=0) 29 : TSpline3("MSpline3", ConvertGraph(g, freq), opt, valbeg, valend) 30 { 31 } 41 32 42 MSpline3(const TF1 &f, Double_t freq,43 const char *opt=0,Double_t valbeg=0, Double_t valend=0)44 : TSpline3("MSpline3", ConvertFunc(f, freq), opt, valbeg, valend)45 {46 }33 MSpline3(const TSpline &s, Double_t freq, 34 const char *opt=0, Double_t valbeg=0, Double_t valend=0) 35 : TSpline3("MSpline3", ConvertSpline(s, freq), opt, valbeg, valend) 36 { 37 } 47 38 48 MSpline3(const Double_t x[], const Double_t y[], Int_t n, const char *opt=0, 49 Double_t valbeg=0, Double_t valend=0) 50 : TSpline3("MSpline3", const_cast<Double_t*>(x), const_cast<Double_t*>(y), n, opt, valbeg, valend) 51 { 52 } 39 MSpline3(const Double_t x[], const Double_t y[], Int_t n, const char *opt=0, 40 Double_t valbeg=0, Double_t valend=0) 41 : TSpline3("MSpline3", const_cast<Double_t*>(x), const_cast<Double_t*>(y), n, opt, valbeg, valend) 42 { 43 } 44 45 // Equidistant binning (evaluation a bit faster in case of many bins) 46 47 // FIXME: In principle TF1 can be evaluated histogram like which should be faster 48 MSpline3(const TF1 &f, const char *opt=0,Double_t valbeg=0, Double_t valend=0); 49 MSpline3(const TF1 &f, Double_t freq, const char *opt=0,Double_t valbeg=0, Double_t valend=0); 53 50 54 51 Double_t GetXmin() const { return fXmin; } // Minimum value of abscissa … … 57 54 Int_t GetNp() const { return fNp; } 58 55 56 TH1 *GetHistogram() const { return fHistogram; } 57 59 58 ClassDef(MSpline3, 1) // An extension of the TSpline3 60 59 }; -
trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.cc
r9308 r9312 33 33 // ---------------- 34 34 // + UInt_t fParticleID 35 // + Float_t fImpactMax 35 36 // 36 37 //////////////////////////////////////////////////////////////////////////// … … 148 149 fParticleID = TMath::Nint(g[1]); 149 150 150 //fImpactMax = g[86];151 fImpactMax = g[86]; 151 152 152 153 fZdMin = g[79]; // lower edge of theta in ° -
trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h
r9308 r9312 16 16 17 17 private: 18 UInt_t fRunNumber;// Run number19 UInt_t fParticleID;// Particle ID (see MMcEvtBasic or CORSIKA manual)20 UInt_t fNumEvents;// Number of events21 MTime fRunStart;// Date of begin (yymmdd)22 Float_t fProgramVersion;// Version of program18 UInt_t fRunNumber; // Run number 19 UInt_t fParticleID; // Particle ID (see MMcEvtBasic or CORSIKA manual) 20 UInt_t fNumEvents; // Number of events 21 MTime fRunStart; // Date of begin (yymmdd) 22 Float_t fProgramVersion; // Version of program 23 23 24 Byte_t fNumObsLevel;// Number of observation levels25 Float_t fObsLevel[10];// Observation levels [cm]24 Byte_t fNumObsLevel; // Number of observation levels 25 Float_t fObsLevel[10]; // Observation levels [cm] 26 26 27 Float_t fSlopeSpectrum; // Slope of energy spectrum 28 Float_t fEnergyMin; // Lower limit of energy range 29 Float_t fEnergyMax; // Upper limit of energy range 27 Float_t fImpactMax; // [cm] Maximum simulated impact 30 28 31 Float_t fZdMin; // [rad] Zenith distance 32 Float_t fZdMax; // [rad] Zenith distance 33 Float_t fAzMin; // [rad] Azimuth (north=0; west=90) 34 Float_t fAzMax; // [rad] Azimuth (north=0; west=90) 29 Float_t fSlopeSpectrum; // Slope of energy spectrum 30 Float_t fEnergyMin; // Lower limit of energy range 31 Float_t fEnergyMax; // Upper limit of energy range 35 32 36 Float_t fWavelengthMin; // [nm] Wavelength bandwidth lo edge 37 Float_t fWavelengthMax; // [nm] Wavelength bandwidth up edge 33 Float_t fZdMin; // [rad] Zenith distance 34 Float_t fZdMax; // [rad] Zenith distance 35 Float_t fAzMin; // [rad] Azimuth (north=0; west=90) 36 Float_t fAzMax; // [rad] Azimuth (north=0; west=90) 38 37 39 //Float_t fImpactMax; // [cm] Maximum simulated impact 38 Float_t fWavelengthMin; // [nm] Wavelength bandwidth lo edge 39 Float_t fWavelengthMax; // [nm] Wavelength bandwidth up edge 40 40 41 41 Float_t fViewConeInnerAngle; // [deg] … … 48 48 Bool_t HasViewCone() const { return fViewConeOuterAngle>0; } 49 49 50 UInt_t GetParticleID() const { return fParticleID; } 51 50 52 Float_t GetZdMin() const { return fZdMin; } 51 53 Float_t GetZdMax() const { return fZdMax; } … … 57 59 Float_t GetWavelengthMax() const { return fWavelengthMax; } 58 60 59 UInt_t GetParticleID() const { return fParticleID; } 61 Float_t GetSlopeSpectrum() const { return fSlopeSpectrum; } 62 Float_t GetEnergyMin() const { return fEnergyMin; } 63 Float_t GetEnergyMax() const { return fEnergyMax; } 60 64 61 //Float_t GetImpactMax() const { return fImpactMax; }65 Float_t GetImpactMax() const { return fImpactMax; } 62 66 63 67 Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; } -
trunk/MagicSoft/Mars/melectronics/MPulseShape.cc
r9280 r9312 127 127 Clear(); 128 128 fSpline = new MSpline3(g);//, fRunHeader->GetFreqSampling()/1000.); 129 fSpline->SetTitle("MPulseShape"); 129 130 130 131 // FIXME: Make a boundary condition e1b1,0,0 (First der, at Xmin and Xmax==0) … … 146 147 Clear(); 147 148 fSpline = new MSpline3(f);//, fRunHeader->GetFreqSampling()/1000.); 149 fSpline->SetTitle("MPulseShape"); 148 150 149 151 // FIXME: Make a boundary condition e1b1,0,0 (First der, at Xmin and Xmax==0) … … 200 202 return rc; 201 203 } 204 205 void MPulseShape::Paint(Option_t *) 206 { 207 fSpline->SetMarkerStyle(kFullDotMedium); 208 209 if (!fSpline->GetHistogram()) 210 fSpline->Paint(); 211 212 TH1 *h = fSpline->GetHistogram(); 213 if (!h) 214 return; 215 216 h->SetXTitle("t [ns]"); 217 h->SetYTitle("a.u."); 218 219 fSpline->Paint("PC"); 220 } -
trunk/MagicSoft/Mars/melectronics/MPulseShape.h
r9274 r9312 36 36 37 37 void Clear(Option_t *o=""); 38 void Paint(Option_t *o=""); 38 39 39 40 MSpline3 *GetSpline() const { return fSpline; } … … 43 44 Float_t GetXmax() const; 44 45 45 ClassDef(MPulseShape, 0) // Parameter container to hold the setup for a pulse shape46 ClassDef(MPulseShape, 1) // Parameter container to hold the setup for a pulse shape 46 47 }; 47 48 -
trunk/MagicSoft/Mars/mhbase/MH.cc
r9302 r9312 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.4 3 2009-02-07 20:40:12tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.44 2009-02-10 20:00:09 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 1813 1813 return "MH::GetObjectInfo: unknown class."; 1814 1814 } 1815 1816 // -------------------------------------------------------------------------- 1817 // 1818 // Set the pad-range such that at the smallest width it is still 1819 // two times max and that the displayed "pixels" (i.e. its coordinate 1820 // system) have the width to height ratio of aspect. 1821 // 1822 void MH::SetPadRange(Float_t max, Float_t aspect) 1823 { 1824 if (!gPad) 1825 return; 1826 1827 const Float_t w = gPad->GetWw(); 1828 const Float_t h = gPad->GetWh(); 1829 1830 if (w>aspect*h) 1831 { 1832 const Double_t dx = ((w/h-aspect)/2+1)*max; 1833 gPad->Range(-dx, -max, dx, max); 1834 } 1835 else 1836 { 1837 const Double_t dy = ((h/w-1./aspect)/2+1)*max; 1838 gPad->Range(-max, -dy, max, dy); 1839 } 1840 } 1841 1842 // -------------------------------------------------------------------------- 1843 // 1844 // Set the range of a pad in a way that the coordinates fit into the pad 1845 // without abberation. 1846 // 1847 void MH::SetPadRange(Float_t x0, Float_t y0, Float_t x1, Float_t y1) 1848 { 1849 if (!gPad) 1850 return; 1851 1852 const Float_t w = x1-x0; // Width in user coordinates 1853 const Float_t h = y1-y0; // Hieght in user coordinates 1854 1855 const Float_t ww = gPad->GetWw()*gPad->GetAbsWNDC(); // Width of pad in pixels 1856 const Float_t hh = gPad->GetWh()*gPad->GetAbsHNDC(); // Height of pad in pixels 1857 1858 if (ww/hh > w/h) 1859 { 1860 const Double_t dx = (ww/hh-w/h)/2*h; 1861 1862 gPad->Range(x0-dx, y0, x1+dx, y1); 1863 } 1864 else 1865 { 1866 const Double_t dy = (hh/ww-h/w)/2*w; 1867 1868 gPad->Range(x0, y0-dy, x1, y1+dy); 1869 } 1870 } -
trunk/MagicSoft/Mars/mhbase/MH.h
r9205 r9312 130 130 131 131 static void SetPalette(TString paletteName="pretty", Int_t ncol=50); 132 static void SetPadRange(Float_t max, Float_t aspect=1); 133 static void SetPadRange(Float_t x0, Float_t y0, Float_t x1, Float_t y1); 132 134 133 135 static char *GetObjectInfoH(Int_t px, Int_t py, const TH1 &h); -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r9308 r9312 91 91 // 92 92 MHCamEvent::MHCamEvent(const char *name, const char *title) 93 : fSum(NULL), fE vt(NULL), fType(0), fErrorSpread(kTRUE), fErrorRelative(kFALSE),93 : fSum(NULL), fErr(NULL), fEvt(NULL), fType(0), fErrorSpread(kTRUE), fErrorRelative(kFALSE), 94 94 fThreshold(0), fUseThreshold(0) 95 95 { … … 104 104 // 105 105 MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title) 106 : fSum(NULL), fE vt(NULL), fType(type), fErrorSpread(kTRUE), fErrorRelative(kFALSE),106 : fSum(NULL), fErr(NULL), fEvt(NULL), fType(type), fErrorSpread(kTRUE), fErrorRelative(kFALSE), 107 107 fThreshold(0), fUseThreshold(0) 108 108 { … … 120 120 if (fSum) 121 121 delete fSum; 122 } 123 124 Bool_t MHCamEvent::InitGeom(const MParList &plist) 125 { 126 MGeomCam *cam = (MGeomCam*)plist.FindObject(fNameGeom, "MGeomCam"); 127 if (!cam) 128 { 129 *fLog << err << fNameGeom << " [MGeomCam] not found... abort." << endl; 130 return kFALSE; 131 } 132 133 // combine name 134 const TString name = fNameEvt.IsNull() ? fName : fNameEvt; 135 136 fSum->SetGeometry(*cam, name+";avg"); 137 if (fTitle!=gsDefTitle) 138 fSum->SetTitle(fTitle); 139 if (!fTitle.Contains(";")) 140 fSum->SetYTitle("a.u."); 141 142 if (fErr) 143 fErr->SetGeometry(*fSum->GetGeometry(), fErr->GetName(), fErr->GetTitle()); 144 145 return kTRUE; 122 146 } 123 147 … … 142 166 } 143 167 144 MGeomCam *cam = (MGeomCam*)plist->FindObject(fNameGeom, "MGeomCam"); 145 if (!cam) 146 { 147 *fLog << err << fNameGeom << " [MGeomCam] not found... abort." << endl; 168 fSum->Reset(); 169 170 fNumReInit = 0; 171 172 if (!InitGeom(*plist)) 148 173 return kFALSE; 149 } 150 151 // combine name 152 const TString name = fNameEvt.IsNull() ? fName : fNameEvt; 153 154 fSum->Reset(); 155 fSum->SetGeometry(*cam, name+";avg"); 156 157 if (fTitle!=gsDefTitle) 158 fSum->SetTitle(fTitle); 159 if (!fTitle.Contains(";")) 160 fSum->SetYTitle("a.u."); 174 161 175 if (fUseThreshold!=kCollectMin && fUseThreshold!=kCollectMax) 162 176 fSum->SetBit(MHCamera::kProfile); … … 169 183 // -------------------------------------------------------------------------- 170 184 // 185 // The geometry read from the RunHeaders might have changed. This does not 186 // effect anything in PreProcess. So we set a new geometry. We don't move 187 // this away from PreProcess to support also loops without calling ReInit. 188 // 189 Bool_t MHCamEvent::ReInit(MParList *plist) 190 { 191 return fNumReInit++==0 ? InitGeom(*plist) : kTRUE; 192 } 193 194 195 // -------------------------------------------------------------------------- 196 // 171 197 // Fill the histograms with data from a MCamEvent-Container. 172 198 // … … 250 276 } 251 277 278 TString MHCamEvent::Format(const char *ext) const 279 { 280 TString n = fSum->GetName(); 281 282 const Ssiz_t pos = n.Last(';'); 283 if (pos<0) 284 return ""; 285 286 n = n(0, pos); 287 n += ";"; 288 n += ext; 289 return n; 290 } 291 252 292 void MHCamEvent::Paint(Option_t *) 253 293 { … … 255 295 256 296 pad->cd(2); 257 if (gPad->FindObject( MString::Format("%s;proj", fName.Data())))258 { 259 TH1 *h=fSum->Projection( MString::Format("%s;proj", fName.Data()));297 if (gPad->FindObject(Format("proj"))) 298 { 299 TH1 *h=fSum->Projection(Format("proj")); 260 300 if (h->GetMaximum()>0) 261 301 gPad->SetLogy(); … … 263 303 264 304 pad->cd(5); 265 if (gPad->FindObject( MString::Format("%s;rad", fName.Data())))266 fSum->RadialProfile( MString::Format("%s;rad", fName.Data()));305 if (gPad->FindObject(Format("rad"))) 306 fSum->RadialProfile(Format("rad")); 267 307 268 308 pad->cd(6); 269 if (gPad->FindObject( MString::Format("%s;az", fName.Data())))270 fSum->AzimuthProfile( MString::Format("%s;az", fName.Data()));309 if (gPad->FindObject(Format("az"))) 310 fSum->AzimuthProfile(Format("az")); 271 311 272 312 pad->cd(4); 273 313 gPad->cd(1); 274 MHCamera *cam = (MHCamera*)gPad->FindObject( MString::Format("%s;err", fName.Data()));314 MHCamera *cam = (MHCamera*)gPad->FindObject(Format("err")); 275 315 if (cam) 276 316 cam->SetCamContent(*fSum, fErrorRelative ? 1 : 2); … … 300 340 p->Draw(); 301 341 p->cd(); 302 TH1 *h = fSum->Projection( MString::Format("%s;proj", fName.Data()), 50);342 TH1 *h = fSum->Projection(Format("proj"), 50); 303 343 h->SetTitle("Projection"); 304 344 h->SetBit(kCanDelete); … … 328 368 e += "/v_{i}"; 329 369 330 MHCamera *cam = new MHCamera(*fSum->GetGeometry()); 331 cam->SetName(MString::Format("%s;err", fName.Data())); 332 cam->SetTitle(e); 333 cam->SetYTitle(fSum->GetYaxis()->GetTitle()); 334 cam->SetCamContent(*fSum, fErrorRelative ? 1 : 2); 335 cam->SetBit(kCanDelete); 336 cam->Draw(); 370 fErr = new MHCamera(*fSum->GetGeometry()); 371 fErr->SetName(Format("err")); 372 fErr->SetTitle(e); 373 fErr->SetYTitle(fSum->GetYaxis()->GetTitle()); 374 fErr->SetCamContent(*fSum, fErrorRelative ? 1 : 2); 375 fErr->SetBit(kMustCleanup); 376 fErr->SetBit(kCanDelete); 377 fErr->Draw(); 337 378 338 379 pad->cd(); … … 343 384 p->Draw(); 344 385 p->cd(); 345 h = (TH1*)fSum->RadialProfile( MString::Format("%s;rad", fName.Data()), 20);386 h = (TH1*)fSum->RadialProfile(Format("rad"), 20); 346 387 h->SetTitle("Radial Profile"); 347 388 h->SetBit(kCanDelete|TH1::kNoStats); … … 355 396 p->Draw(); 356 397 p->cd(); 357 h = (TH1*)fSum->AzimuthProfile( MString::Format("%s;az", fName.Data()), 30);398 h = (TH1*)fSum->AzimuthProfile(Format("az"), 30); 358 399 h->SetTitle("Azimuth Profile"); 359 400 h->SetBit(kCanDelete|TH1::kNoStats); … … 361 402 } 362 403 404 405 void MHCamEvent::RecursiveRemove(TObject *obj) 406 { 407 if (obj==fErr) 408 fErr = 0; 409 } -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r9308 r9312 17 17 protected: 18 18 MHCamera *fSum; // storing the sum 19 MHCamera *fErr; //! storing the err 19 20 MCamEvent *fEvt; //! the current event 20 21 … … 29 30 Char_t fUseThreshold; // Use a threshold? Which direction has it? 30 31 31 void Init(const char *name, const char *title); 32 Int_t fNumReInit; //! 33 34 TString Format(const char *ext) const; 35 36 void Init(const char *name, const char *title); 37 Bool_t InitGeom(const MParList &plist); 32 38 33 39 Bool_t SetupFill(const MParList *pList); 40 Bool_t ReInit(MParList *plist); 34 41 Int_t Fill(const MParContainer *par, const Stat_t w=1); 35 42 … … 62 69 void SetErrorRelative(Bool_t b=kTRUE) { fErrorRelative = b; } 63 70 71 void RecursiveRemove(TObject *obj); 72 64 73 ClassDef(MHCamEvent, 2) // Histogram to sum camera events 65 74 }; -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r9309 r9312 964 964 if (fFormatVersion>6) 965 965 *fLog << "Sampling: " << fSamplingFrequency << "MHz with " << (int)fFadcResolution << " significant bits" << endl; 966 *fLog << "Samples: " << fNumSamplesHiGain << "/" << fNumSamplesLoGain << " (hi/lo) * " << fNumBytesPerSample << "B/sample = " << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate * fNumBytesPerSample/1000 << "kB/Evt" << endl; 966 *fLog << "Samples: " << fNumSamplesHiGain << "/" << fNumSamplesLoGain << " (hi/lo) * " << fNumBytesPerSample << "B/sample = "; 967 if (fNumCrates>0) 968 *fLog << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate * fNumBytesPerSample/1000 << "kB/Evt" << endl; 969 else 970 *fLog << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumBytesPerSample << "B/pix" << endl; 967 971 *fLog << "Evt Counter: " << fNumEvents; 968 972 if (fFormatVersion>8) -
trunk/MagicSoft/Mars/msignal/MSignalCalc.cc
r9261 r9312 128 128 { 129 129 if (!fPedestals) 130 return k FALSE;130 return kTRUE; 131 131 132 132 const Int_t npix = fRawEvt->GetNumPixels(); -
trunk/MagicSoft/Mars/msimreflector/MMirror.cc
r9243 r9312 78 78 #include <TRandom.h> 79 79 80 #include "MLog.h" 81 80 82 #include "MQuaternion.h" 81 83 … … 133 135 return dn; // Return the vector to be added to the normal vector 134 136 } 137 138 void MMirror::Print(Option_t *o) const 139 { 140 gLog << fPos.X() << " " << fPos.Y() << " " << fPos.Z() << " "; 141 gLog << fNorm.X() << " " << fNorm.Y() << " " << fNorm.Z() << " "; 142 gLog << fFocalLength << " "; 143 144 const TString n = ClassName(); 145 146 gLog << n(7, n.Length()); 147 } -
trunk/MagicSoft/Mars/msimreflector/MMirror.h
r9236 r9312 70 70 // ----- Mirror specialized functions ----- 71 71 72 // This should fit with Paint()73 72 virtual Bool_t HasHit(const MQuaternion &p) const=0; 74 // This should fit with HasHit()75 //void Paint(Option_t *)=0;76 73 virtual Bool_t CanHit(const MQuaternion &p) const=0; 77 74 78 75 virtual Int_t ReadM(const TObjArray &tok)=0; 76 77 // TObject 78 void Print(Option_t *o) const; 79 79 80 80 /* … … 86 86 } 87 87 */ 88 ClassDef(MMirror, 0) // Base class to describe a mirror88 ClassDef(MMirror, 1) // Base class to describe a mirror 89 89 }; 90 90 -
trunk/MagicSoft/Mars/msimreflector/MMirrorDisk.cc
r9252 r9312 38 38 #include <TEllipse.h> 39 39 #include <TVirtualPad.h> 40 41 #include "MLog.h" 40 42 41 43 #include "MQuaternion.h" … … 99 101 // ------------------------------------------------------------------------ 100 102 // 103 // Print the contents of the mirror 104 // 105 void MMirrorDisk::Print(Option_t *o) const 106 { 107 MMirror::Print(o); 108 gLog << " " << fR << endl; 109 } 110 111 // ------------------------------------------------------------------------ 112 // 101 113 // Paint the mirror in x/y. 102 114 // -
trunk/MagicSoft/Mars/msimreflector/MMirrorDisk.h
r9236 r9312 9 9 { 10 10 private: 11 Double_t fR; 11 Double_t fR; // Radius of the disk 12 12 13 13 public: 14 14 MMirrorDisk() : fR(24.75) { } 15 15 16 // MMirror 16 17 Double_t GetMaxR() const { return fR; } 17 18 18 // This should fit with Paint()19 Bool_t CanHit(const MQuaternion &p) const; 19 20 Bool_t HasHit(const MQuaternion &p) const; 20 // This should fit with HasHit() 21 void Paint(Option_t *); 22 Bool_t CanHit(const MQuaternion &p) const; 21 23 22 Int_t ReadM(const TObjArray &tok); 24 23 25 ClassDef(MMirrorDisk, 0) // A spherical disk type mirror 24 //TObject 25 void Paint(Option_t *); 26 void Print(Option_t *) const; 27 28 ClassDef(MMirrorDisk, 1) // A spherical disk type mirror 26 29 }; 27 30 -
trunk/MagicSoft/Mars/msimreflector/MMirrorHex.cc
r9252 r9312 39 39 #include <TEllipse.h> 40 40 #include <TVirtualPad.h> 41 42 #include "MLog.h" 41 43 42 44 #include "MHexagon.h" … … 142 144 // ------------------------------------------------------------------------ 143 145 // 146 // Print the contents of the mirror 147 // 148 void MMirrorHex::Print(Option_t *o) const 149 { 150 MMirror::Print(o); 151 gLog << " " << fD*2 << endl; 152 } 153 154 // ------------------------------------------------------------------------ 155 // 144 156 // Read the mirror's setup from a file. The first eight tokens should be 145 157 // ignored. (This could be fixed!) -
trunk/MagicSoft/Mars/msimreflector/MMirrorHex.h
r9236 r9312 21 21 MMirrorHex() { SetD(24.75); } 22 22 23 // MMirror 23 24 Double_t GetMaxR() const { return fMaxR; } 24 25 25 // This should fit with Paint()26 Bool_t CanHit(const MQuaternion &p) const; 26 27 Bool_t HasHit(const MQuaternion &p) const; 27 // This should fit with HasHit() 28 void Paint(Option_t *); 29 Bool_t CanHit(const MQuaternion &p) const; 28 30 29 Int_t ReadM(const TObjArray &tok); 31 30 32 ClassDef(MMirrorHex, 0) // A spherical hexagon type mirror 31 // TObject 32 void Paint(Option_t *); 33 void Print(Option_t *) const; 34 35 ClassDef(MMirrorHex, 1) // A spherical hexagon type mirror 33 36 }; 34 37 -
trunk/MagicSoft/Mars/msimreflector/MMirrorSquare.cc
r9252 r9312 40 40 #include <TEllipse.h> 41 41 #include <TVirtualPad.h> 42 43 #include "MLog.h" 42 44 43 45 #include "MQuaternion.h" … … 139 141 // ------------------------------------------------------------------------ 140 142 // 143 // Print the contents of the mirror 144 // 145 void MMirrorSquare::Print(Option_t *o) const 146 { 147 MMirror::Print(o); 148 gLog << " " << fSideLength << endl; 149 } 150 151 // ------------------------------------------------------------------------ 152 // 141 153 // Read the mirror's setup from a file. The first eight tokens should be 142 154 // ignored. (This could be fixed!) -
trunk/MagicSoft/Mars/msimreflector/MMirrorSquare.h
r9252 r9312 10 10 private: 11 11 Double_t fSideLength; // HALF of the side length! 12 12 13 public: 13 14 MMirrorSquare() : fSideLength(24.75) { } 14 15 16 // MMirror 15 17 Double_t GetMaxR() const; 16 18 17 // This should fit with Paint()18 19 Bool_t HasHit(const MQuaternion &p) const; 19 // This should fit with HasHit()20 void Paint(Option_t *);21 20 Bool_t CanHit(const MQuaternion &p) const; 21 22 22 Int_t ReadM(const TObjArray &tok); 23 23 24 ClassDef(MMirrorSquare, 0) // A spherical square type mirror 24 // TObject 25 void Paint(Option_t *); 26 void Print(Option_t *) const; 27 28 ClassDef(MMirrorSquare, 1) // A spherical square type mirror 25 29 }; 26 30 -
trunk/MagicSoft/Mars/msimreflector/MReflector.h
r9262 r9312 28 28 void InitMaxR(); 29 29 30 // MParContainer 30 31 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 31 32 … … 46 47 Int_t ExecuteReflector(MQuaternion &p, MQuaternion &u) const; 47 48 49 // TObject 48 50 void Paint(Option_t *o); 51 void Print(Option_t *o) const; 49 52 50 ClassDef(MReflector, 0) // Parameter container storing a collection of several mirrors (reflector)53 ClassDef(MReflector, 1) // Parameter container storing a collection of several mirrors (reflector) 51 54 }; 52 55 -
trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc
r9307 r9312 559 559 fEvt->Sort(kTRUE); 560 560 561 // FIXME FIXME FIXME: Set maxindex, first and last time. 562 // SetMaxIndex(fReflector->GetNumMirrors()-1) 563 // if (fEvt->GetNumPhotons()) 564 // { 565 // SetTime(fEvt->GetFirst()->GetTime(), fEvt->GetLast()->GetTime()); 566 // } 567 561 568 return kTRUE; 562 569 } -
trunk/MagicSoft/Mars/mtools/MagicJam.cc
r9235 r9312 77 77 #include <TGFileDialog.h> 78 78 79 #include "MH.h" 79 80 #include "MHexagon.h" 80 81 #include "MGeomCam.h" … … 365 366 if (fImage) 366 367 { 367 SetRange(); 368 const Float_t r = fGeomCam->GetMaxRadius(); 369 370 MH::SetPadRange(-r*1.02, -r*1.02, TestBit(kNoLegend) ? r : 1.15*r, r*1.2); 368 371 369 372 Double_t x1, y1, x2, y2; … … 732 735 cam[i].SetNeighbors(nn[0], nn[1], nn[2], nn[3], nn[4], nn[5]); 733 736 } 737 738 cam.InitGeometry(); 734 739 735 740 SetGeometry(cam); … … 856 861 o->Draw(); 857 862 gPad->SetBit(kCannotPick); 858 gPad->GetPad(1)->SetBit(kCannotPick);859 863 } 860 864 -
trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.h
r8758 r9312 109 109 Int_t CTnum); 110 110 111 void SetSpectrum(Float_t slope, Float_t emin, Float_t emax) 112 { 113 fSlopeSpec=slope; fELowLim=emin; fEUppLim=emax; 114 } 115 111 116 MGeomCorsikaCT &operator[](Int_t i) const; 112 117 -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
r8438 r9312 109 109 void SetCoreY(Float_t CoreY) { fCoreY=CoreY; } //Set Core y pos 110 110 111 void SetEvtNumber(UInt_t n) { fEvtNumber=n; } 112 void SetPhotElfromShower(UInt_t n) { fPhotElfromShower=n; } 113 111 114 void Fill( UInt_t, ParticleId_t, Float_t, Float_t, Float_t, 112 115 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc
r7094 r9312 89 89 // -------------------------------------------------------------------------- 90 90 // 91 // Copy operator. Copy all data members 92 // 93 void MMcEvtBasic::operator=(const MMcEvtBasic &evt) 94 { 95 fPartId = evt.fPartId; 96 fEnergy = evt.fEnergy; 97 fImpact = evt.fImpact; 98 fTelescopePhi = evt.fTelescopePhi; 99 fTelescopeTheta = evt.fTelescopeTheta; 100 } 101 102 // -------------------------------------------------------------------------- 103 // 91 104 // Reset all values: Fill(kUNDEFINED, -1, -1, 0, 0) 92 105 // -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
r9272 r9312 5 5 #include "MParContainer.h" 6 6 #endif 7 8 7 9 8 class MMcEvtBasic : public MParContainer … … 41 40 MMcEvtBasic(); 42 41 MMcEvtBasic(ParticleId_t, Float_t, Float_t, Float_t, Float_t); 42 void operator=(const MMcEvtBasic &evt); 43 43 44 44 // Getter -
trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx
r8066 r9312 138 138 fSlopeSpec = 0.0; 139 139 140 fCorsikaVersion = 0; 141 fReflVersion = 0; 142 fCamVersion = 0; 140 fCorsikaVersion = UShort_t(-1); 141 fReflVersion = UShort_t(-1); 142 fCamVersion = UShort_t(-1); 143 143 144 fOpticLinksNoise= 0; 144 145 -
trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.hxx
r7880 r9312 6 6 #endif 7 7 8 // ------------------------------------------------------------- 9 // 10 // The following data member are in use: 11 // 12 // fCorsikaVersion MHCollectionArea 13 // fReflVersion MSrcPosCalc 14 // fCamVersion MMcCalibrationUpdate, MReadMarsFile, 15 // MMcPedestalCopy, MMcPedestalNSBAdd 16 // fStarField* MMcBadPixelSet 17 // fImpactMax MHCollectionArea 18 // fNumSimulatedShowers MHCollectionArea 19 // [fAllEvtsTriggered] MHCollectionArea 20 // fNumPheFromDNSB MMcPedestalNSBAdd 21 // 22 // ------------------------------------------------------------- 8 23 9 24 class MMcRunHeader : public MParContainer … … 146 161 Float_t GetImpactMax() const {return fImpactMax;} 147 162 163 void SetNumSimulatedShowers(UInt_t n) { fNumSimulatedShowers=n; } 164 void SetImpactMax(Float_t im) { fImpactMax=im; } 165 148 166 ClassDef(MMcRunHeader, 7) // storage container for general run info 149 167 };
Note:
See TracChangeset
for help on using the changeset viewer.