Changeset 1490 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 08/08/02 14:01:38 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHHillas.h
r1489 r1490 28 28 void SetColors() const; 29 29 30 protected:31 30 Float_t fMm2Deg; 32 33 Bool_t fUseMmScale; 31 Bool_t fUseMmScale; 34 32 35 33 public: -
trunk/MagicSoft/Mars/mhist/MHHillasExt.cc
r1489 r1490 57 57 // 58 58 MHHillasExt::MHHillasExt(const char *name, const char *title) 59 : fMm2Deg(1), fUseMmScale(kTRUE) 59 60 { 60 61 // … … 107 108 bins.Apply(fHM3Trans); 108 109 109 bins.SetEdges( 89, -297, 593);110 bins.SetEdges(101, -593, 593); 110 111 bins.Apply(fHAsym); 111 112 } … … 131 132 Bool_t MHHillasExt::SetupFill(const MParList *plist) 132 133 { 134 TObject *obj = plist->FindObject("MHillas"); 135 if (!obj) 136 { 137 *fLog << err << dbginf << "Sorry 'MHillas' not found in parameter list... aborting." << endl; 138 return kFALSE; 139 } 140 if (!obj->InheritsFrom(MHillasExt::Class())) 141 { 142 *fLog << err << dbginf << "Sorry 'MHillas' doesn't inherit from MHillasExt... aborting." << endl; 143 return kFALSE; 144 } 145 fHillasExt = (MHillasExt*)obj; 146 133 147 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 134 148 if (!geom) … … 146 160 ApplyBinning(*plist, "M3Trans", &fHM3Trans); 147 161 148 fHillasSrc = (MHillasSrc*)plist->FindObject("HillasSource"); 149 if (!fHillasSrc) 150 *fLog << warn << dbginf << "Sorry 'HillasSource' [MHillasSrc] not found. Histograms will be source independant." << endl; 151 152 return MHHillas::SetupFill(plist); 162 return kTRUE; 153 163 } 154 164 … … 160 170 Bool_t MHHillasExt::Fill(const MParContainer *par) 161 171 { 162 const MHillas Ext &ext = *(MHillasExt*)par;163 164 const Double_t scale = fHillasSrc ? TMath::Sign(fUseMmScale?1:fMm2Deg, fHillasSrc->GetCosDeltaAlpha()) : 1;165 166 fHConc.Fill( ext.GetConc());167 fHConc1.Fill( ext.GetConc1());168 169 fHAsym.Fill(scale* ext.GetAsym());170 fHM3Long.Fill(scale* ext.GetM3Long());171 fHM3Trans.Fill(scale* ext.GetM3Trans());172 const MHillasSrc *src = (MHillasSrc*)par; 173 174 const Double_t scale = src ? TMath::Sign(fUseMmScale?1:fMm2Deg, src->GetCosDeltaAlpha()) : 1; 175 176 fHConc.Fill(fHillasExt->GetConc()); 177 fHConc1.Fill(fHillasExt->GetConc1()); 178 179 fHAsym.Fill(scale*fHillasExt->GetAsym()); 180 fHM3Long.Fill(scale*fHillasExt->GetM3Long()); 181 fHM3Trans.Fill(scale*fHillasExt->GetM3Trans()); 172 182 //fHAsymna.Fill(scale*ext.GetAsymna()); 173 183 //fHAsym0.Fill(scale*ext.GetAsym0()); 174 184 175 return MHHillas::Fill(par);185 return kTRUE; 176 186 } 177 187 … … 200 210 { 201 211 fHAsym.SetXTitle("Asym [mm]"); 202 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");212 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]"); 203 213 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]"); 204 214 } … … 210 220 } 211 221 212 MHHillas::SetMmScale(mmscale); 222 fUseMmScale = mmscale; 223 } 224 225 // -------------------------------------------------------------------------- 226 // 227 // Use this function to setup your own conversion factor between degrees 228 // and millimeters. The conversion factor should be the one calculated in 229 // MGeomCam. Use this function with Caution: You could create wrong values 230 // by setting up your own scale factor. 231 // 232 void MHHillasExt::SetMm2Deg(Float_t mmdeg) 233 { 234 if (mmdeg<0) 235 { 236 *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl; 237 return; 238 } 239 240 if (fMm2Deg>=0) 241 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl; 242 243 fMm2Deg = mmdeg; 213 244 } 214 245 … … 245 276 c.Update(); 246 277 247 MHHillas::DrawClone();248 249 278 return &c; 250 279 } … … 279 308 gPad->Modified(); 280 309 gPad->Update(); 281 282 MHHillas::DrawClone(); 283 } 310 } -
trunk/MagicSoft/Mars/mhist/MHHillasExt.h
r1465 r1490 5 5 #include <TH1.h> 6 6 #endif 7 #ifndef MARS_MH Hillas8 #include "MH Hillas.h"7 #ifndef MARS_MH 8 #include "MH.h" 9 9 #endif 10 10 11 class MHillas Src;11 class MHillasExt; 12 12 13 class MHHillasExt : public MH Hillas13 class MHHillasExt : public MH 14 14 { 15 15 private: 16 MHillas Src *fHillasSrc; //! Pointer to an MHillasSrc to be able to add sign to Asym, M3Long and M3Trans16 MHillasExt *fHillasExt; //! Pointer to the MHillasExt container 17 17 18 18 TH1F fHConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize … … 22 22 TH1F fHM3Trans; // [mm] 3rd moment (e-weighted) along minor axis 23 23 24 Float_t fMm2Deg; 25 Bool_t fUseMmScale; 26 24 27 public: 25 28 MHHillasExt(const char *name=NULL, const char *title=NULL); … … 27 30 28 31 void SetMmScale(Bool_t mmscale=kTRUE); 32 virtual void SetMm2Deg(Float_t mmdeg); 29 33 30 34 Bool_t SetupFill(const MParList *pList); … … 34 38 TObject *DrawClone(Option_t *opt=NULL) const; 35 39 36 ClassDef(MHHillasExt, 1) // Container which holds histograms for length and width40 ClassDef(MHHillasExt, 1) // Container which holds histograms for the extended hillas parameters 37 41 }; 38 42
Note:
See TracChangeset
for help on using the changeset viewer.