Changeset 1465
- Timestamp:
- 08/01/02 09:31:18 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1463 r1465 1 1 -*-*- END -*-*- 2 3 2002/08/01: Thomas Bretz 4 5 * manalysis/MHillas.[h,cc]: 6 - don't draw ellipse if values are invalid 7 - add used and core pixels to Print-output 8 9 * manalysis/MHillasExt.cc: 10 - reordered some comments 11 12 * mdata/MDataChain.[h,cc]: 13 - fixed a bug causing usage of '-' sometime not to work 14 - added handling of '+' sign 15 16 * mfileio/MReadTree.h: 17 - changed some comments 18 19 * mhist/MBinning.[h,cc]: 20 - added Apply 21 22 * mhist/MHHillas.[h,cc], mhist/MHHillasSrc.[h,cc], 23 mhist/MHHillasExt.[h,cc]: 24 - added default binning (usefull for the Magic Camera) 25 - some changes to the layout 26 - added support for the sign in MHHillasExt 27 28 2 29 3 30 2002/07/31: Thomas Bretz -
trunk/MagicSoft/Mars/manalysis/MHillas.cc
r1434 r1465 126 126 *fLog << all; 127 127 *fLog << "Basic Image Parameters (" << GetName() << ")" << endl; 128 *fLog << " - Length [mm] = " << fLength << endl; 129 *fLog << " - Width [mm] = " << fWidth << endl; 130 *fLog << " - Delta [deg] = " << fDelta*kRad2Deg << endl; 131 *fLog << " - Size [1] = " << fSize << " #CherPhot" << endl; 132 *fLog << " - Meanx [mm] = " << fMeanX << endl; 133 *fLog << " - Meany [mm] = " << fMeanY << endl; 134 *fLog << " - atg(y/x) [deg] = " << atg << endl; 128 *fLog << " - Length [mm] = " << fLength << endl; 129 *fLog << " - Width [mm] = " << fWidth << endl; 130 *fLog << " - Delta [deg] = " << fDelta*kRad2Deg << endl; 131 *fLog << " - Size [1] = " << fSize << " #CherPhot" << endl; 132 *fLog << " - Meanx [mm] = " << fMeanX << endl; 133 *fLog << " - Meany [mm] = " << fMeanY << endl; 134 *fLog << " - atg(y/x) [deg] = " << atg << endl; 135 *fLog << " - Used Pixels [#] = " << fNumUsedPixels << " Pixels" << endl; 136 *fLog << " - Core Pixels [#] = " << fNumCorePixels << " Pixels" << endl; 135 137 } 136 138 … … 160 162 161 163 Clear(); 164 165 if (fLength<0 || fWidth<0) 166 return; 162 167 163 168 fEllipse = new TEllipse(fMeanX, fMeanY, fLength, fWidth, -
trunk/MagicSoft/Mars/manalysis/MHillas.h
r1434 r1465 22 22 Float_t fMeanY; // [mm] y-coordinate of center of ellipse 23 23 24 Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning 25 Short_t fNumCorePixels; // number of core pixels 26 24 27 Float_t fSinDelta; //! [1] sin of Delta (to be used in derived classes) 25 28 Float_t fCosDelta; //! [1] cos of Delta (to be used in derived classes) 26 27 Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning28 Short_t fNumCorePixels; // number of core pixels29 29 30 30 TEllipse *fEllipse; //! Graphical Object to Display Ellipse -
trunk/MagicSoft/Mars/manalysis/MHillasExt.cc
r1460 r1465 18 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de> 19 19 ! Author(s): Rudolf Bock 10/2001 <mailto:Rudolf.Bock@cern.ch> 20 ! Author(s): Wolfgang Wittek 06/2002 <mailto:wittek@mppmu.mpg.de> 20 21 ! 21 22 ! Copyright: MAGIC Software Development, 2000-2002 … … 36 37 // fM3Long third moment along major axis 37 38 // fM3Trans third moment along minor axis 39 // fLeakage1 ratio : (photons in most outer ring of pixels) over fSize 40 // fLeakage2 ratio : (photons in the 2 outer rings of pixels) over fSize 41 // 42 // WARNING: Before you can use fAsym, fM3Long and fM3Trans you must 43 // multiply by the sign of MHillasSrc::fCosAlphaDelta 38 44 // 39 45 //////////////////////////////////////////////////////////////////////////// 46 /* 47 // fAsymna d/(d na) of ( sum(x*q^na)/sum(q^na), sum(y*q^na)/sum(q^na) ) 48 // projected onto the major axis 49 // fAsym0 (F-B)/(F+B) along the major axis 50 */ 40 51 #include "MHillasExt.h" 41 52 … … 172 183 /* 173 184 // 185 // power na for calculating fAsymna; 186 // the value 1.5 was suggested by Thomas Schweizer 187 // 188 Double_t na = 1.5; 189 190 // 174 191 // get sums for calculating fAsymna 175 192 // the outer pixels are 4 times as big (in area) … … 201 218 202 219 /* 203 204 //205 // power na for calculating fAsymna;206 // the value 1.5 was suggested by Thomas Schweizer207 //208 Double_t na = 1.5;209 210 220 fLeakage1 = edgepix1 / GetSize(); 211 221 fLeakage2 = edgepix2 / GetSize(); -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1353 r1465 162 162 { 163 163 int l = txt.Length(); 164 for (int i = 0; i<l; i++) 165 if (!isalnum(txt[i]) && txt[i]!='.' && txt[i]!='-') 164 for (int i=0; i<l; i++) 165 { 166 if (!isalnum(txt[i]) && txt[i]!='.' && 167 ((txt[i]!='-' && txt[i]!='+') || i!=0)) 166 168 return i; 169 } 167 170 168 171 return l; … … 210 213 if (txt=="sgn") return kESgn; 211 214 if (txt[0]=='-') return kENegative; 215 if (txt[0]=='+') return kEPositive; 212 216 213 217 return kENoop; … … 324 328 case '8': 325 329 case '9': 326 if ( txt[0]!='-'|| isdigit(txt[1]) || txt[1]=='.')330 if ((txt[0]!='-' && txt[0]!='+') || isdigit(txt[1]) || txt[1]=='.') 327 331 { 328 332 char *end; … … 360 364 txt = txt.Strip(TString::kBoth); 361 365 362 if ( txt.IsNull() || txt[0]!='(')366 if ((txt.IsNull() || txt[0]!='(') && text[0]!='-' && text[0]!='+') 363 367 { 364 368 newmember = new MDataMember(text.Data()); … … 376 380 377 381 Int_t first = GetBracket(txt); 378 TString sub = op==kENegative ? text.Remove(0,1) + txt : txt(1, first-1);382 TString sub = op==kENegative || op==kEPositive ? text.Remove(0,1) + txt : txt(1, first-1); 379 383 txt.Remove(0, first+1); 380 384 … … 435 439 case kESgn: return val<0 ? -1 : 1; 436 440 case kENegative: return -val; 441 case kEPositive: return val; 437 442 case kENoop: return val; 438 443 } … … 466 471 case kESgn: *fLog << "sgn" << flush; break; 467 472 case kENegative: *fLog << "-" << flush; break; 473 case kEPositive: *fLog << "+" << flush; break; 468 474 case kENoop: 469 475 break; -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1353 r1465 37 37 kEExp, 38 38 kESgn, 39 kEPositive, 39 40 kENegative 40 41 } OperatorType_t; -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r1381 r1465 89 89 // This is the code from TChain::LoadTree but skips the 90 90 // notification in LoadTree. If LoadTree raises the notification 91 // a flag is set and the notification is done by hand. If it 92 // has not been successfull -15 is returned. 91 // a flag is set and the notification is done by hand. This 92 // is done to be able to catch the return value from Notify. If 93 // it has not been successfull -15 is returned. 93 94 // This is to support return values from Notify()/Reinit() 94 95 // -
trunk/MagicSoft/Mars/mhist/MBinning.cc
r1368 r1465 31 31 #include "MBinning.h" 32 32 33 #include "MH.h" 34 33 35 ClassImp(MBinning); 34 36 … … 49 51 } 50 52 53 54 void MBinning::Apply(TH1 &h) 55 { 56 MH::SetBinning(&h, this); 57 } -
trunk/MagicSoft/Mars/mhist/MBinning.h
r1215 r1465 10 10 #endif 11 11 12 class TH1; 13 12 14 class MBinning : public MParContainer 13 15 { … … 20 22 void SetEdges(const TArrayD &arr) 21 23 { 22 fEdges = arr;/* 23 const Int_t nbins = arr.GetSize(); 24 fEdges.Set(nbins); 25 for (int i=0; i<nbins; i++) 26 fEdges[i] = (*(TArrayD*)(&arr))[i];*/ 24 fEdges = arr; 27 25 } 28 26 … … 54 52 Double_t *GetEdges() const { return fEdges.GetArray(); } 55 53 54 void Apply(TH1 &); 55 56 56 ClassDef(MBinning, 1) //Container to store the binning of a histogram 57 57 }; -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r1463 r1465 99 99 fSize->GetXaxis()->SetLabelOffset(-0.015); 100 100 101 MH::SetBinning(fSize, &bins);101 bins.Apply(*fSize); 102 102 103 103 fCenter = new TH2F("Center", "Center of Ellipse", 51, -445, 445, 51, -445, 445); … … 138 138 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 139 139 if (!geom) 140 *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl;140 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 141 141 else 142 142 { -
trunk/MagicSoft/Mars/mhist/MHHillasExt.cc
r1283 r1465 43 43 44 44 #include "MGeomCam.h" 45 45 46 #include "MParList.h" 47 48 #include "MBinning.h" 46 49 #include "MHillasExt.h" 50 #include "MHillasSrc.h" 47 51 48 52 ClassImp(MHHillasExt); … … 88 92 fHM3Long.SetYTitle("Counts"); 89 93 fHM3Trans.SetYTitle("Counts"); 94 95 96 MBinning bins; 97 98 bins.SetEdges(100, 0, 1); 99 bins.Apply(fHConc); 100 bins.Apply(fHConc1); 101 102 bins.SetEdges(101, -326, 326); 103 bins.Apply(fHM3Long); 104 bins.Apply(fHM3Trans); 105 106 bins.SetEdges(89, -297, 593); 107 bins.Apply(fHAsym); 90 108 } 91 109 … … 110 128 Bool_t MHHillasExt::SetupFill(const MParList *plist) 111 129 { 112 const MBinning* binsc = (MBinning*)plist->FindObject("BinningConc");113 const MBinning* binsc1 = (MBinning*)plist->FindObject("BinningConc1");114 const MBinning* binsa = (MBinning*)plist->FindObject("BinningAsym");115 const MBinning* binsl = (MBinning*)plist->FindObject("BinningM3Long");116 const MBinning* binst = (MBinning*)plist->FindObject("BinningM3Trans");117 if (!binsc || !binsc1 || !binsa || !binsl || !binst)118 {119 *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;120 return kFALSE;121 }122 123 SetBinning(&fHConc, binsc);124 SetBinning(&fHConc1, binsc1);125 SetBinning(&fHAsym, binsa);126 SetBinning(&fHM3Long, binsl);127 SetBinning(&fHM3Trans, binst);128 129 130 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 130 131 if (!geom) 131 { 132 *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl; 133 return kTRUE; 134 } 135 136 fHAsym.SetXTitle("Asym [\\circ]"); 137 fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]"); 138 fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]"); 132 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 133 else 134 { 135 fMm2Deg = geom->GetConvMm2Deg(); 136 SetMmScale(kFALSE); 137 } 138 139 ApplyBinning(*plist, "Conc", &fHConc); 140 ApplyBinning(*plist, "Conc1", &fHConc1); 141 ApplyBinning(*plist, "Asym", &fHAsym); 142 ApplyBinning(*plist, "M3Long", &fHM3Long); 143 ApplyBinning(*plist, "M3Trans", &fHM3Trans); 144 145 fHillasSrc = (MHillasSrc*)plist->FindObject("HillasSource"); 146 if (!fHillasSrc) 147 *fLog << warn << dbginf << "Sorry 'HillasSource' [MHillasSrc] not found. Histograms will be source independant." << endl; 139 148 140 149 return MHHillas::SetupFill(plist); … … 148 157 Bool_t MHHillasExt::Fill(const MParContainer *par) 149 158 { 150 const MHillasExt &h = *(MHillasExt*)par; 151 152 fHConc.Fill(h.GetConc()); 153 fHConc1.Fill(h.GetConc1()); 154 155 if (fUseMmScale) 156 { 157 fHAsym.Fill(h.GetAsym()); 158 fHM3Long.Fill(h.GetM3Long()); 159 fHM3Trans.Fill(h.GetM3Trans()); 160 } 161 else 162 { 163 fHAsym.Fill(fMm2Deg*h.GetAsym()); 164 fHM3Long.Fill(fMm2Deg*h.GetM3Long()); 165 fHM3Trans.Fill(fMm2Deg*h.GetM3Trans()); 166 } 159 const MHillasExt &ext = *(MHillasExt*)par; 160 161 const Double_t scale = fHillasSrc ? TMath::Sign(fUseMmScale?1:fMm2Deg, fHillasSrc->GetCosDeltaAlpha()) : 1; 162 163 fHConc.Fill(ext.GetConc()); 164 fHConc1.Fill(ext.GetConc1()); 165 166 fHAsym.Fill(scale*ext.GetAsym()); 167 fHM3Long.Fill(scale*ext.GetM3Long()); 168 fHM3Trans.Fill(scale*ext.GetM3Trans()); 169 //fHAsymna.Fill(scale*ext.GetAsymna()); 170 //fHAsym0.Fill(scale*ext.GetAsym0()); 167 171 168 172 return MHHillas::Fill(par); … … 185 189 } 186 190 187 if (fUseMmScale) 191 const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg; 192 MH::ScaleAxis(&fHAsym, scale); 193 MH::ScaleAxis(&fHM3Long, scale); 194 MH::ScaleAxis(&fHM3Trans, scale); 195 196 if (mmscale) 188 197 { 189 198 fHAsym.SetXTitle("Asym [mm]"); 190 199 fHM3Long.SetXTitle("3^{rd} M_{l}[mm]"); 191 200 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]"); 192 193 fHAsym.Scale(1./fMm2Deg);194 fHM3Long.Scale(1./fMm2Deg);195 fHM3Trans.Scale(1./fMm2Deg);196 201 } 197 202 else … … 200 205 fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]"); 201 206 fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]"); 202 203 fHAsym.Scale(fMm2Deg);204 fHM3Long.Scale(fMm2Deg);205 fHM3Trans.Scale(fMm2Deg);206 207 } 207 208 … … 220 221 { 221 222 TCanvas &c = *MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 222 3*350, 2*250);223 c.Divide( 3, 2);223 720, 810); 224 c.Divide(2, 3); 224 225 225 226 gROOT->SetSelectedPad(NULL); … … 231 232 ((TH1F&)fHConc).DrawCopy(); 232 233 233 c.cd( 4);234 c.cd(2); 234 235 ((TH1F&)fHConc1).DrawCopy(); 235 236 236 c.cd( 2);237 c.cd(5); 237 238 ((TH1F&)fHAsym).DrawCopy(); 238 239 … … 240 241 ((TH1F&)fHM3Long).DrawCopy(); 241 242 242 c.cd( 6);243 c.cd(4); 243 244 ((TH1F&)fHM3Trans).DrawCopy(); 244 245 … … 260 261 { 261 262 if (!gPad) 262 MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 3*250); 263 264 gPad->Divide(3, 2); 263 MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 264 720, 810); 265 266 gPad->Divide(2, 3); 265 267 266 268 gPad->cd(1); 267 269 fHConc.DrawCopy(); 268 270 269 gPad->cd( 4);271 gPad->cd(2); 270 272 fHConc1.DrawCopy(); 271 273 272 gPad->cd( 2);274 gPad->cd(5); 273 275 fHAsym.DrawCopy(); 274 276 … … 276 278 fHM3Long.DrawCopy(); 277 279 278 gPad->cd( 6);280 gPad->cd(4); 279 281 fHM3Trans.DrawCopy(); 280 282 -
trunk/MagicSoft/Mars/mhist/MHHillasExt.h
r1283 r1465 9 9 #endif 10 10 11 class MHillasSrc; 12 11 13 class MHHillasExt : public MHHillas 12 14 { 13 15 private: 16 MHillasSrc *fHillasSrc; //! Pointer to an MHillasSrc to be able to add sign to Asym, M3Long and M3Trans 17 14 18 TH1F fHConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 15 19 TH1F fHConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize -
trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc
r1463 r1465 179 179 if (fMm2Deg<0) 180 180 { 181 *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;181 *fLog << warn << GetDescriptor() << ": Warning - Sorry, no conversion factor for conversion available." << endl; 182 182 return; 183 183 }
Note:
See TracChangeset
for help on using the changeset viewer.