Changeset 7109
- Timestamp:
- 05/30/05 18:12:10 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc
r7094 r7109 136 136 Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsPix::UnsuitableType_t type) const 137 137 { 138 if (!fGeomCam || !fPedPhotCam || !fBadPixels) 139 { 140 *fLog << err << "MBadPixelsCalc::CheckPedestalRms: ERROR - One of the necessary container are not initialized..." << endl; 141 return kFALSE; 142 } 143 138 144 if (fPedestalLevel<=0 && fPedestalLevelVariance<=0) 139 145 return kTRUE; … … 247 253 // Check if the number of pixels to blind is > 60% of total number of pixels 248 254 // 249 // if (bads>0.6*entries)250 //{251 // fErrors[2]++;252 //return kFALSE;253 //}255 if (bads>0.5*entries) 256 { 257 *fLog << err << "ERROR - More than 50% unsuitable pixels... something must be wrong!" << endl; 258 return kFALSE; 259 } 254 260 255 261 return kTRUE; 262 } 263 264 Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsCam &cam, const MPedPhotCam &ped, MBadPixelsPix::UnsuitableType_t t) 265 { 266 MBadPixelsCam *store1 = fBadPixels; 267 const MPedPhotCam *store2 = fPedPhotCam; 268 269 fBadPixels = &cam; 270 fPedPhotCam = &ped; 271 272 const Bool_t rc = CheckPedestalRms(t); 273 274 fBadPixels = store1; 275 fPedPhotCam = store2; 276 277 return rc; 278 } 279 280 Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsCam &cam, const MPedestalCam &ped, MBadPixelsPix::UnsuitableType_t t) 281 { 282 return CheckPedestalRms(cam, MPedPhotCam(ped), t); 256 283 } 257 284 -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h
r7094 r7109 12 12 class MGeomCam; 13 13 class MPedPhotCam; 14 class MPedestalCam; 14 15 15 16 class MBadPixelsCalc : public MTask 16 17 { 17 18 private: 18 MGeomCam *fGeomCam; //! Input container storing the pixel sizes19 MPedPhotCam *fPedPhotCam; //! Input container storing the pedestal and pedestal rms of all pixels20 MBadPixelsCam *fBadPixels; //! Output container holding the bad pixels19 const MGeomCam *fGeomCam; //! Input container storing the pixel sizes 20 const MPedPhotCam *fPedPhotCam; //! Input container storing the pedestal and pedestal rms of all pixels 21 MBadPixelsCam *fBadPixels; //! Output container holding the bad pixels 21 22 22 23 Float_t fPedestalLevel; … … 27 28 Bool_t fCheckInProcess; 28 29 Bool_t fCheckInPostProcess; 29 30 // MBadPixelsCalc31 Bool_t CheckPedestalRms(MBadPixelsPix::UnsuitableType_t t) const;32 30 33 31 // MTask … … 47 45 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 48 46 47 void SetGeomCam(const MGeomCam *geom) { fGeomCam = geom; } 48 49 49 void EnableCheckInProcess(Bool_t b=kTRUE) { fCheckInProcess = b; } 50 50 void EnableCheckInPostProcess(Bool_t b=kTRUE) { fCheckInPostProcess = b; } 51 52 // MBadPixelsCalc 53 Bool_t CheckPedestalRms(MBadPixelsPix::UnsuitableType_t t) const; 54 Bool_t CheckPedestalRms(MBadPixelsCam &cam, const MPedPhotCam &ped, MBadPixelsPix::UnsuitableType_t t=MBadPixelsPix::kUnsuitableRun); 55 Bool_t CheckPedestalRms(MBadPixelsCam &cam, const MPedestalCam &ped, MBadPixelsPix::UnsuitableType_t t=MBadPixelsPix::kUnsuitableRun); 51 56 52 57 ClassDef(MBadPixelsCalc, 1) // Task to find bad pixels (star, broken pixels, etc) -
trunk/MagicSoft/Mars/mhflux/FluxLinkDef.h
r7038 r7109 7 7 #pragma link C++ class MAlphaFitter+; 8 8 9 #pragma link C++ class MHDisp+; 9 10 #pragma link C++ class MHAlpha+; 10 11 #pragma link C++ class MHThetaSq+; … … 13 14 #pragma link C++ class MHEffectiveOnTime+; 14 15 #pragma link C++ class MHCollectionArea+; 16 #pragma link C++ class MMcSpectrumWeight+; 17 18 //#pragma link C++ class MMatrixHist+; 19 //#pragma link C++ class MMatrixUnfold+; 20 //#pragma link C++ class MUnfoldBert+; 15 21 16 22 #endif -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r6892 r7109 246 246 fMm2Deg = geom->GetConvMm2Deg(); 247 247 248 if (fName!=(TString)"MHFalseSourceOff" && fHistOff==NULL) 249 { 250 MHFalseSource *hoff = (MHFalseSource*)plist->FindObject("MHFalseSourceOff", "MHFalseSource"); 248 const TString off(Form("%sOff", fName.Data())); 249 if (fName!=off && fHistOff==NULL) 250 { 251 const TString desc(Form("%s [%s] found... using ", off.Data(), ClassName())); 252 MHFalseSource *hoff = (MHFalseSource*)plist->FindObject(off, ClassName()); 251 253 if (!hoff) 252 *fLog << inf << "No MHFalseSourceOff [MHFalseSource] found... usingcurrent data only!" << endl;254 *fLog << inf << "No " << desc << "current data only!" << endl; 253 255 else 254 256 { 255 *fLog << inf << "MHFalseSource [MHFalseSource] found... usingon-off mode!" << endl;257 *fLog << inf << desc << "on-off mode!" << endl; 256 258 SetOffData(*hoff); 257 259 } … … 294 296 *fLog << warn << "MObservatory not found... no derotation." << endl; 295 297 298 MPointingPos *point = (MPointingPos*)plist->FindObject("MSourcePos", "MPointingPos"); 299 if (!point) 300 point = fPointPos; 301 296 302 // FIXME: Because the pointing position could change we must check 297 303 // for the current pointing position and add a offset in the 298 304 // Fill function! 299 fRa = fPointPos ? fPointPos->GetRa() : 0;300 fDec = fPointPos ? fPointPos->GetDec() : 90;305 fRa = point ? point->GetRa() : 0; 306 fDec = point ? point->GetDec() : 90; 301 307 302 308 return kTRUE; … … 615 621 const Int_t l = h0->GetXaxis()->FindFixBin(fAlphaCut*3)+f-1; 616 622 h0->Scale(h1->Integral(f, l)/h0->Integral(f, l)); 623 624 617 625 //h0->Scale(h1->GetEntries()/h0->GetEntries()); 618 626 … … 854 862 } 855 863 856 Double_t FcnGauss2d(Double_t *x, Double_t *par)864 static Double_t FcnGauss2d(Double_t *x, Double_t *par) 857 865 { 858 866 TVector2 v = TVector2(x[0], x[1]).Rotate(par[5]*TMath::DegToRad()); -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.h
r6978 r7109 20 20 class MHFalseSource : public MH 21 21 { 22 pr ivate:22 protected: 23 23 MTime *fTime; //! container to take the event time from 24 24 MPointingPos *fPointPos; //! container to take pointing position from … … 28 28 Float_t fMm2Deg; // conversion factor for display in degrees 29 29 30 private: 30 31 Float_t fAlphaCut; // Alpha cut 31 32 Float_t fBgMean; // Background mean … … 37 38 Float_t fMaxDW; // Maximum distance in percent of dist 38 39 40 protected: 39 41 TH3D fHist; // Alpha vs. x and y 40 42 … … 44 46 Double_t fDec; 45 47 48 private: 46 49 Int_t DistancetoPrimitive(Int_t px, Int_t py); 47 50 void Modified(); -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r7075 r7109 304 304 305 305 SetNameHist(GetEnv("NameHist", fNameHist)); 306 SetNameHistFS(GetEnv("NameHistFS", fNameHistFS)); 306 307 307 308 return kTRUE; … … 366 367 } 367 368 368 const TString objname(Form(" %s%s", "Hist"/*fNameHist.Data()*/, name));369 const TString objname(Form("Hist%s", name)); 369 370 MHAlpha *h = (MHAlpha*)plist.FindCreateObj(fNameHist, objname); 370 371 if (!h) … … 374 375 375 376 return h; 377 } 378 379 // -------------------------------------------------------------------------- 380 // 381 // Create a new instance of an object with name name of class 382 // type fNameHistFS in parlist. It must derive from MHFalseSource 383 // If something fails NULL is returned. 384 // 385 MH *MJCut::CreateNewHistFS(MParList &plist, const char *name) const 386 { 387 const TString cname(fNameHistFS.IsNull()?"MHFalseSource":fNameHistFS); 388 389 TClass *cls = gROOT->GetClass(cname); 390 if (!cls) 391 { 392 *fLog << err << "Class " << cname << " not found in dictionary... abort." << endl; 393 return NULL; 394 } 395 if (!cls->InheritsFrom("MHFalseSource")) 396 { 397 *fLog << err << "Class " << cname << " doesn't inherit from MHFalseSource... abort." << endl; 398 return NULL; 399 } 400 401 const TString objname(Form("FS%s", name)); 402 return (MH*)plist.FindCreateObj(cname, objname); 376 403 } 377 404 … … 452 479 MHAlpha *halphaoff = CreateNewHist(plist, "Off"); 453 480 MFillH falpha(halphaoff, "", "FillHist"); 454 MFillH ffs("MHFalseSourceOff [MHFalseSource]", "MHillas", "FillFS"); 481 MH *hfsoff = CreateNewHistFS(plist, "Off"); 482 MFillH ffs(hfsoff, "MHillas", "FillFS"); 455 483 456 484 // FIXME: If fPathIn read cuts and energy estimator from file! … … 531 559 tlist2.AddToList(&scalc); 532 560 tlist2.AddToList(&hcalc); 533 if (fIsWobble)561 //if (fIsWobble) 534 562 tlist2.AddToList(&hcalc2); 535 563 //tlist2.AddToList(&taskenv1); … … 541 569 tlist2.AddToList(&fill1a); 542 570 tlist2.AddToList(&cont1); 543 if (!fWriteOnly && !fIsWobble)571 if (!fWriteOnly && (!fIsWobble || !fNameHistFS.IsNull())) 544 572 tlist2.AddToList(&ffs); 545 573 tlist2.AddToList(&cont2); … … 679 707 MHAlpha *halphaon=CreateNewHist(plist); 680 708 MFillH falpha2(halphaon, "", "FillHist"); 681 MFillH ffs2("MHFalseSource", "MHillas", "FillFS"); 709 MH *hfs=CreateNewHistFS(plist); 710 MFillH ffs2(hfs, "MHillas", "FillFS"); 682 711 683 712 tlist.Replace(&readon); … … 702 731 } 703 732 tlist2.Replace(&falpha2); 704 if (!fIsWobble )733 if (!fIsWobble/* || !fNameHist.IsNull()*/) 705 734 tlist2.Replace(&ffs2); 735 if (fIsWobble && !fNameHist.IsNull()) 736 tlist2.RemoveFromList(&ffs); 706 737 707 738 if (!fIsMonteCarlo) -
trunk/MagicSoft/Mars/mjobs/MJCut.h
r6988 r7109 10 10 class MParList; 11 11 class MHAlpha; 12 class MH; 12 13 class MWriteRootFile; 13 14 … … 28 29 29 30 TString fNameHist; 31 TString fNameHistFS; 30 32 31 33 //MTask *fEstimateEnergy; … … 38 40 Bool_t WriteResult(const MParList &plist, UInt_t num) const; 39 41 MHAlpha *CreateNewHist(MParList &plist, const char *name="") const; 42 MH *CreateNewHistFS(MParList &plist, const char *name="") const; 40 43 41 44 Bool_t CanStoreSummary() const { return !fPathOut.IsNull() && fStoreSummary; } … … 61 64 62 65 void SetNameHist(const char *name) { fNameHist=name; } 66 void SetNameHistFS(const char *name) { fNameHistFS=name; } 63 67 64 68 //void SetEnergyEstimator(const MTask *task=0); -
trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc
r5807 r7109 55 55 #include "MBadPixelsPix.h" 56 56 57 #include "MPedestalCam.h" 58 #include "MPedestalPix.h" 59 57 60 ClassImp(MPedPhotCam); 58 61 … … 61 64 // -------------------------------------------------------------------------- 62 65 // 63 // Default constructor. Creates a MPedPhotPix object for each pixel 64 // 65 MPedPhotCam::MPedPhotCam(const char *name, const char *title) 66 // Contains the default constructor. Creates a MPedPhotPix object 67 // for each pixel 68 // 69 void MPedPhotCam::InitArrays(const char *name, const char *title) 66 70 { 67 71 fName = name ? name : "MPedPhotCam"; … … 71 75 fAreas = new TClonesArray("MPedPhotPix", 1); 72 76 fSectors = new TClonesArray("MPedPhotPix", 1); 77 } 78 79 // -------------------------------------------------------------------------- 80 // 81 // Default constructor. Creates a MPedPhotPix object for each pixel 82 // 83 MPedPhotCam::MPedPhotCam(const char *name, const char *title) 84 { 85 InitArrays(name, title); 86 } 87 88 // -------------------------------------------------------------------------- 89 // 90 // Initialize the mean, rms and number of events with the values from 91 // the MPedestalCam converted 1:1 92 // 93 MPedPhotCam::MPedPhotCam(const MPedestalCam &p) 94 { 95 const Int_t n = p.GetSize(); 96 97 InitArrays(); 98 InitSize(n); 99 100 for (int i=0; i<n; i++) 101 (*this)[i].Set(p[i].GetPedestal(), p[i].GetPedestalRms(), p[i].GetNumEvents()); 73 102 } 74 103 -
trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.h
r4609 r7109 14 14 class MPedPhotPix; 15 15 class MBadPixelsCam; 16 class MPedestalCam; 16 17 17 18 class MPedPhotCam : public MParContainer, public MCamEvent … … 22 23 TClonesArray *fSectors; //-> Array of MPedPhotPix, one per camera sector 23 24 25 void InitArrays(const char *name=NULL, const char *title=NULL); 26 24 27 // void InitSize(const UInt_t i); 25 28 void InitAreas(const UInt_t i); … … 28 31 public: 29 32 MPedPhotCam(const char *name=NULL, const char *title=NULL); 33 MPedPhotCam(const MPedestalCam &pcam); 30 34 ~MPedPhotCam(); 31 35 -
trunk/MagicSoft/Mars/mpointing/MSrcPosCam.cc
r3568 r7109 56 56 fName = name ? name : gsDefName.Data(); 57 57 fTitle = title ? title : gsDefTitle.Data(); 58 } 59 60 // -------------------------------------------------------------------------- 61 // 62 // Copy constructor, set default name and title 63 // 64 MSrcPosCam::MSrcPosCam(const MSrcPosCam &p) : fX(p.fX), fY(p,fY) 65 { 66 fName = gsDefName.Data(); 67 fTitle = gsDefTitle.Data(); 58 68 } 59 69 -
trunk/MagicSoft/Mars/mpointing/MSrcPosCam.h
r4710 r7109 16 16 public: 17 17 MSrcPosCam(const char *name=NULL, const char *title=NULL); 18 MSrcPosCam(const MSrcPosCam &p); 18 19 19 20 void Clear(Option_t *) { fX = 0; fY = 0; }
Note:
See TracChangeset
for help on using the changeset viewer.