Changeset 5431 for trunk/MagicSoft
- Timestamp:
- 11/18/04 15:55:40 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r5000 r5431 51 51 #pragma link C++ class MPad+; 52 52 #pragma link C++ class MMcCalibrationUpdate+; 53 #pragma link C++ class MMakePadHistograms+; 53 54 54 55 #endif -
trunk/MagicSoft/Mars/manalysis/Makefile
r5000 r5431 23 23 -I../mhistmc -I../mfileio -I../mmain -I../mhcalib -I../mcalib \ 24 24 -I../msignal -I../mpointing -I../mtools -I../mfbase \ 25 -I../mbadpixels -I../mastro -I../mpedestal 25 -I../mbadpixels -I../mastro -I../mpedestal -I../mtemp/mucm/classes 26 26 # mcalib: MGeomApply (MCalibrationCam) 27 27 … … 55 55 MFiltercutsCalc.cc \ 56 56 MPad.cc \ 57 MMcCalibrationUpdate.cc 57 MMcCalibrationUpdate.cc \ 58 MMakePadHistograms.cc 58 59 59 60 ############################################################ … … 66 67 67 68 mrproper: clean rmbak 69 -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc
r4635 r5431 106 106 if (!fPedPhotCam) 107 107 { 108 *fLog << err << "MPedPhotCamnot found... aborting." << endl;108 *fLog << err << fNamePedPhotContainer << "[MPedPhotCam] not found... aborting." << endl; 109 109 return kFALSE; 110 110 } … … 117 117 } 118 118 } 119 120 *fLog << inf << "Name of MPedPhotCam container : " << fNamePedPhotContainer 121 << endl; 122 119 123 return kTRUE; 120 124 } … … 257 261 fPedPhotCam->ReCalc(*fGeomCam, fBadPixels); 258 262 } 263 259 264 return kTRUE; 260 265 } -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h
r5117 r5431 37 37 38 38 #endif 39 40 41 42 -
trunk/MagicSoft/Mars/mbadpixels/MHBadPixels.cc
r4887 r5431 35 35 #include "MBadPixelsCam.h" 36 36 #include "MGeomCam.h" 37 #include "MPedPhotCam.h" 37 38 #include "MParList.h" 38 39 #include "MBinning.h" … … 47 48 // ------------------------------------------------------------------------- 48 49 // 49 // DefaultConstructor.50 // Constructor. 50 51 // 51 52 MHBadPixels::MHBadPixels(const char *name, const char *title) 52 : fNamePedPhotCam("MPedPhotCam")53 53 { 54 54 fName = name ? name : "MHBadPixels"; 55 55 fTitle = title ? title : "Histogram for Bad Pixels vs. Theta"; 56 56 57 fBadId.SetName("2D-IdBadPixels"); 58 fBadId.SetTitle("2D-IdBadPixels"); 59 fBadId.SetDirectory(NULL); 60 fBadId.SetXTitle("\\Theta [\\circ]"); 61 fBadId.SetYTitle("pixel Id"); 62 63 fBadN.SetName("2D-NBadPixels"); 64 fBadN.SetTitle("2D-NBadPixels"); 65 fBadN.SetDirectory(NULL); 66 fBadN.SetXTitle("\\Theta [\\circ]"); 67 fBadN.SetYTitle("number of bad pixels"); 68 57 fBadId = new TH2D; 58 fBadId->SetName("2D-IdBadPixels"); 59 fBadId->SetTitle("2D-IdBadPixels"); 60 fBadId->SetDirectory(NULL); 61 fBadId->UseCurrentStyle(); 62 fBadId->SetXTitle("\\Theta [\\circ]"); 63 fBadId->SetYTitle("pixel Id"); 64 fBadId->SetTitleOffset(1.2, "Y"); 65 66 fBadN = new TH2D; 67 fBadN->SetName("2D-NBadPixels"); 68 fBadN->SetTitle("2D-NBadPixels"); 69 fBadN->SetDirectory(NULL); 70 fBadN->UseCurrentStyle(); 71 fBadN->SetXTitle("\\Theta [\\circ]"); 72 fBadN->SetYTitle("number of bad pixels"); 73 fBadN->SetTitleOffset(1.2, "Y"); 74 75 // define default binnings 76 fBinsTheta = new MBinning; 77 fBinsTheta->SetEdgesCos(10, 0.0, 90.0); // theta 78 79 fBinsPix = new MBinning; 80 fBinsPix->SetEdges(578, -0.5, 577.5); // pixel id 81 82 SetBinning(fBadId, fBinsTheta, fBinsPix); 83 SetBinning(fBadN, fBinsTheta, fBinsPix); 84 85 //----------------------------------------- 86 fNamePedPhotCam = "MPedPhotCamFromData"; 87 } 88 89 90 // ------------------------------------------------------------------------- 91 // 92 // Destructor. 93 // 94 MHBadPixels::~MHBadPixels() 95 { 96 delete fBadId; 97 delete fBadN; 98 99 delete fBinsTheta; 100 delete fBinsPix; 69 101 } 70 102 … … 75 107 Bool_t MHBadPixels::SetupFill(const MParList *plist) 76 108 { 77 MGeomCam *fCam = (MGeomCam*)plist->FindObject(AddSerialNumber("MGeomCam"));109 fCam = (MGeomCam*)plist->FindObject(AddSerialNumber("MGeomCam")); 78 110 if (!fCam) 79 111 { 80 *fLog << err << "MGeomCam not found... aborting." << endl; 81 return kFALSE; 82 } 112 *fLog << err << "MHBadPixels::SetupFill; MGeomCam not found... aborting." << endl; 113 return kFALSE; 114 } 115 *fLog << "MHBadPixels::SetupFill; fCam = " << fCam << endl; 116 83 117 fPointPos = (MPointingPos*)plist->FindObject("MPointingPos"); 84 118 if (!fPointPos) … … 87 121 return kFALSE; 88 122 } 123 124 fPedPhot = (MPedPhotCam*)plist->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam"); 125 if (!fPedPhot) 126 { 127 *fLog << err << AddSerialNumber(fNamePedPhotCam) 128 << "[MPedPhotCam] not found... aborting." << endl; 129 return kFALSE; 130 } 131 fPedPhot->InitSize(fCam->GetNumPixels()); 132 89 133 90 134 //---------------------------------------------------- 135 *fLog << inf << "Name of MPedPhotCam container : " << fNamePedPhotCam 136 << endl; 137 138 139 //---------------------------------------------------- 140 // redefine the binnings 141 91 142 // Get Theta Binning 92 MBinning* binstheta = (MBinning*)plist->FindObject("BinningTheta", "MBinning");143 const MBinning* binstheta = (MBinning*)plist->FindObject("BinningTheta", "MBinning"); 93 144 if (!binstheta) 94 145 { 95 *fLog << err << " BinningTheta [MBinning] not found... aborting" << endl;96 return kFALSE;97 } 98 99 // Getbinning for pixel number100 const UInt_t npix1 = f Cam->GetNumPixels()+1;101 146 *fLog << err << "Object 'BinningTheta' [MBinning] not found... use default binning." << endl; 147 binstheta = fBinsTheta; 148 } 149 150 // Define binning for pixel number 151 const UInt_t npix1 = fPedPhot->GetSize()+1; 152 //*fLog << "MHBadPixels::SetupFill(); npix1 = " << npix1 << endl; 102 153 MBinning binspix("BinningPixel"); 103 154 binspix.SetEdges(npix1, -0.5, npix1-0.5); 104 155 105 156 // Set binnings in histograms 106 SetBinning(&fBadId, binstheta, &binspix); 107 SetBinning(&fBadN, binstheta, &binspix); 157 SetBinning(fBadId, binstheta, &binspix); 158 SetBinning(fBadN, binstheta, &binspix); 159 160 *fLog << "MHBadPixels::SetupFill(); binnings were set" << endl; 161 162 108 163 109 164 return kTRUE; … … 122 177 Double_t theta = fPointPos->GetZd(); 123 178 124 const MBadPixelsCam *badpixels = (MBadPixelsCam*)par; 125 126 const UInt_t entries = badpixels->GetSize(); 127 179 const MBadPixelsCam *fBadPixels = (MBadPixelsCam*)par; 180 181 const UInt_t entries = fPedPhot->GetSize(); 128 182 UInt_t nb = 0; 129 183 for (UInt_t i=0; i<entries; i++) 130 184 { 131 if ( (*badpixels)[i].IsUnsuitable() ) 132 { 133 fBadId.Fill(theta, i, w); 134 nb++; 135 } 136 } 137 fBadN.Fill(theta, nb, w); 185 //*fLog << "MHBadPixels::Fill; i = " << i << endl; 186 187 if ( (*fBadPixels)[i].IsUnsuitable() ) 188 { 189 //*fLog << "MHBadPixels::Fill; (UnSuitable) " << endl; 190 191 fBadId->Fill(theta, i, w); 192 nb++; 193 } 194 } 195 fBadN->Fill(theta, nb, w); 138 196 139 197 return kTRUE; … … 154 212 155 213 pad->cd(1); 156 fBadId .Draw(option);214 fBadId->Draw(option); 157 215 158 216 pad->cd(2); 159 fBadN .Draw(option);217 fBadN->Draw(option); 160 218 161 219 pad->cd(3); 162 220 gPad->SetBorderMode(0); 163 h = ((TH2*) &fBadId)->ProjectionY("ProjY-pixId", -1, 9999, "");221 h = ((TH2*)fBadId)->ProjectionY("ProjY-pixId", -1, 9999, ""); 164 222 h->SetDirectory(NULL); 165 223 h->SetTitle("Distribution of bad pixel Id"); 166 224 h->SetXTitle("Id of bad pixel"); 167 225 h->SetYTitle("No. of events"); 226 h->SetTitleOffset(1.2, "Y"); 168 227 h->Draw(option); 169 228 h->SetBit(kCanDelete); … … 171 230 pad->cd(4); 172 231 gPad->SetBorderMode(0); 173 h = ((TH2*) &fBadN)->ProjectionY("ProjY-pixN", -1, 9999, "");232 h = ((TH2*)fBadN)->ProjectionY("ProjY-pixN", -1, 9999, ""); 174 233 h->SetDirectory(NULL); 175 234 h->SetTitle("Distribution of no.of bad pixels"); 176 235 h->SetXTitle("No. of bad pixels"); 177 236 h->SetYTitle("No. of events"); 237 h->SetTitleOffset(1.2, "Y"); 178 238 h->Draw(option); 179 239 h->SetBit(kCanDelete); … … 182 242 pad->Update(); 183 243 } 244 //========================================================================== 245 246 247 248 249 250 251 252 253 254 255 -
trunk/MagicSoft/Mars/mbadpixels/MHBadPixels.h
r4887 r5431 18 18 private: 19 19 MGeomCam *fCam; //! 20 MPedPhotCam *fPedPhot; //! 20 21 MPointingPos *fPointPos; //! 21 22 22 23 TString fNamePedPhotCam; //! name of the 'MPedPhotCam' container 24 MBinning *fBinsTheta; //! 25 MBinning *fBinsPix; //! 23 26 24 TH2D fBadId; // 2D-histogram : pixel Id vs. Theta25 TH2D fBadN; // 2D-histogram : no.of bad pixels vs. Theta27 TH2D *fBadId; // 2D-histogram : pixel Id vs. Theta 28 TH2D *fBadN; // 2D-histogram : no.of bad pixels vs. Theta 26 29 27 30 public: 28 31 MHBadPixels(const char *name=NULL, const char *title=NULL); 32 ~MHBadPixels(); 29 33 30 34 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 31 35 32 const TH2D *GetBadId() { return &fBadId; }33 const TH2D *GetBadId() const { return &fBadId; }36 const TH2D *GetBadId() { return fBadId; } 37 const TH2D *GetBadId() const { return fBadId; } 34 38 35 const TH2D *GetBadN() { return &fBadN; } 36 const TH2D *GetBadN() const { return &fBadN; } 39 const TH2D *GetBadN() { return fBadN; } 40 const TH2D *GetBadN() const { return fBadN; } 41 42 TH2 *GetBadIdByName(const TString name) { return fBadId; } 43 TH2 *GetBadNByName(const TString name) { return fBadN; } 37 44 38 45 void Draw(Option_t* option = ""); -
trunk/MagicSoft/Mars/mfilter/MFSelBasic.cc
r4584 r5431 86 86 fThetaMax = thetamax; 87 87 88 } 89 90 // -------------------------------------------------------------------------- 91 // 92 // Set the pointers 93 // 94 // 95 Int_t MFSelBasic::PreProcess(MParList *pList) 96 { 97 fRawRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 98 if (!fRawRun) 99 { 100 *fLog << dbginf << "MRawRunHeader not found... aborting." << endl; 101 return kFALSE; 102 } 103 104 fPointPos = (MPointingPos*)pList->FindObject("MPointingPos"); 105 if (!fPointPos) 106 { 107 *fLog << dbginf << "MPointingPos not found... aborting." << endl; 108 return kFALSE; 109 } 110 111 fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt"); 112 if (!fEvt) 113 { 114 *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl; 115 return kFALSE; 116 } 117 118 fCam = (MGeomCam*)pList->FindObject("MGeomCam"); 119 if (!fCam) 120 { 121 *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl; 122 return kFALSE; 123 } 124 125 memset(fCut, 0, sizeof(fCut)); 126 127 //------------------------- 88 128 *fLog << inf << "MFSelBasic cut values : fMinPhotons, fThetaMin, fThetaMax = "; 89 129 *fLog << fMinPhotons <<", " << fThetaMin << ", " << fThetaMax << endl; 90 } 91 92 // -------------------------------------------------------------------------- 93 // 94 // Set the pointers 95 // 96 // 97 Int_t MFSelBasic::PreProcess(MParList *pList) 98 { 99 fRawRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 100 if (!fRawRun) 101 { 102 *fLog << dbginf << "MRawRunHeader not found... aborting." << endl; 103 return kFALSE; 104 } 105 106 fPointPos = (MPointingPos*)pList->FindObject("MPointingPos"); 107 if (!fPointPos) 108 { 109 *fLog << dbginf << "MPointingPos not found... aborting." << endl; 110 return kFALSE; 111 } 112 113 fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt"); 114 if (!fEvt) 115 { 116 *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl; 117 return kFALSE; 118 } 119 120 fCam = (MGeomCam*)pList->FindObject("MGeomCam"); 121 if (!fCam) 122 { 123 *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl; 124 return kFALSE; 125 } 126 127 memset(fCut, 0, sizeof(fCut)); 130 //------------------------- 128 131 129 132 return kTRUE; -
trunk/MagicSoft/Mars/mfilter/MFSelFinal.cc
r2663 r5431 86 86 fDistMax = distmax; 87 87 88 *fLog << inf << "MFSelFinal cut values : fHadronnessMax, fAlphaMax, fDistMax = ";89 *fLog << fHadronnessMax << ", " << fAlphaMax << ", " << fDistMax << endl;90 88 } 91 89 … … 120 118 121 119 memset(fCut, 0, sizeof(fCut)); 120 121 //---------------------- 122 *fLog << inf << "MFSelFinal cut values : fHadronnessMax, fAlphaMax, fDistMax = "; 123 *fLog << fHadronnessMax << ", " << fAlphaMax << ", " << fDistMax << endl; 124 //---------------------- 122 125 123 126 return kTRUE; -
trunk/MagicSoft/Mars/mfilter/MFSelStandard.cc
r3398 r5431 92 92 fWidthMin = widthmin; 93 93 94 } 95 96 // -------------------------------------------------------------------------- 97 // 98 // MISSING 99 // 100 Int_t MFSelStandard::PreProcess(MParList *pList) 101 { 102 fHil = (MHillas*)pList->FindObject(fHilName, "MHillas"); 103 if (!fHil) 104 { 105 *fLog << err << fHilName << " [MHillas] not found... aborting." << endl; 106 return kFALSE; 107 } 108 109 fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc"); 110 if (!fHilSrc) 111 { 112 *fLog << err << fHilSrcName << " [MHillasSrc] not found... aborting." << endl; 113 return kFALSE; 114 } 115 116 fNewImgPar = (MNewImagePar*)pList->FindObject(fImgParName, "MNewImagePar"); 117 if (!fNewImgPar) 118 { 119 *fLog << err << fImgParName << " [MNewImagePar] not found... aborting." << endl; 120 return kFALSE; 121 } 122 123 MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam"); 124 if (!cam) 125 { 126 *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl; 127 return kFALSE; 128 } 129 130 fMm2Deg = cam->GetConvMm2Deg(); 131 132 memset(fCut, 0, sizeof(fCut)); 133 134 //-------------------- 94 135 *fLog << inf << "MFSelStandard cut values : fUsedPixelsMax, fCorePixelsMin = "; 95 136 *fLog << fUsedPixelsMax << ", " << fCorePixelsMin << endl; … … 98 139 *fLog << inf << " fLengthMin, fWidthMin = " << fLengthMin ; 99 140 *fLog << ", " << fWidthMin << endl; 100 } 101 102 // -------------------------------------------------------------------------- 103 // 104 // MISSING 105 // 106 Int_t MFSelStandard::PreProcess(MParList *pList) 107 { 108 fHil = (MHillas*)pList->FindObject(fHilName, "MHillas"); 109 if (!fHil) 110 { 111 *fLog << err << fHilName << " [MHillas] not found... aborting." << endl; 112 return kFALSE; 113 } 114 115 fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc"); 116 if (!fHilSrc) 117 { 118 *fLog << err << fHilSrcName << " [MHillasSrc] not found... aborting." << endl; 119 return kFALSE; 120 } 121 122 fNewImgPar = (MNewImagePar*)pList->FindObject(fImgParName, "MNewImagePar"); 123 if (!fNewImgPar) 124 { 125 *fLog << err << fImgParName << " [MNewImagePar] not found... aborting." << endl; 126 return kFALSE; 127 } 128 129 MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam"); 130 if (!cam) 131 { 132 *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl; 133 return kFALSE; 134 } 135 136 fMm2Deg = cam->GetConvMm2Deg(); 137 138 memset(fCut, 0, sizeof(fCut)); 141 //-------------------- 139 142 140 143 return kTRUE; -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
r4841 r5431 32 32 // - the 3D-histogram sigma, pixel no., Theta // 33 33 // - the 3D-histogram (sigma^2-sigmabar^2), pixel no., Theta // 34 // - the 2D-histogram Theta vs. Phi // 34 35 // // 35 36 ////////////////////////////////////////////////////////////////////////////// … … 64 65 // -------------------------------------------------------------------------- 65 66 // 66 // Default Constructor. It sets name and title of the histogram.67 // Constructor. 67 68 // 68 69 MHSigmaTheta::MHSigmaTheta(const char *name, const char *title) … … 71 72 fTitle = title ? title : "2D histogram sigmabar vs. Theta"; 72 73 73 fSigmaTheta.SetDirectory(NULL); 74 fSigmaTheta.SetName("2D-ThetaSigmabar(Inner)"); 75 fSigmaTheta.SetTitle("2D: \\bar{\\sigma}, \\Theta"); 76 fSigmaTheta.SetXTitle("\\Theta [\\circ]"); 77 fSigmaTheta.SetYTitle("Sigmabar(Inner) / SQRT(Area)"); 78 79 fSigmaThetaOuter.SetDirectory(NULL); 80 fSigmaThetaOuter.SetName("2D-ThetaSigmabar(Outer)"); 81 fSigmaThetaOuter.SetTitle("2D: \\bar{\\sigma}, \\Theta"); 82 fSigmaThetaOuter.SetXTitle("\\Theta [\\circ]"); 83 fSigmaThetaOuter.SetYTitle("Sigmabar(Outer) / SQRT(Area)"); 84 85 fSigmaPixTheta.SetDirectory(NULL); 86 fSigmaPixTheta.SetName("3D-ThetaPixSigma"); 87 fSigmaPixTheta.SetTitle("3D: \\Theta, Pixel Id, \\sigma"); 88 fSigmaPixTheta.SetXTitle("\\Theta [\\circ]"); 89 fSigmaPixTheta.SetYTitle("Pixel Id"); 90 fSigmaPixTheta.SetZTitle("Sigma"); 91 92 fDiffPixTheta.SetDirectory(NULL); 93 fDiffPixTheta.SetName("3D-ThetaPixDiff"); 94 fDiffPixTheta.SetTitle("3D: \\Theta, Pixel Id, {\\sigma}^{2}-\\bar{\\sigma}^{2}"); 95 fDiffPixTheta.SetXTitle("\\Theta [\\circ]"); 96 fDiffPixTheta.SetYTitle("Pixel Id"); 97 fDiffPixTheta.SetZTitle("(Sigma2 - Sigmabar2)/Area"); 98 99 // Set default binning 100 // FIXME: Maybe ist's necessary to adapt the value to the 101 // Magic default values 102 MBinning binsb; 103 MBinning binst; 104 MBinning binsd; 105 binsd.SetEdges(100, -10, 20); 106 binsb.SetEdges(100, 0, 10); 107 binst.SetEdgesCos(10, 0, 90); 108 109 MBinning binspix("BinningPixel"); 110 binspix.SetEdges(578, -0.5, 577.5); 111 112 SetBinning(&fSigmaTheta, &binst, &binsb); 113 SetBinning(&fSigmaThetaOuter, &binst, &binsb); 114 SetBinning(&fSigmaPixTheta, &binst, &binspix, &binsb); 115 SetBinning(&fDiffPixTheta, &binst, &binspix, &binsd); 116 74 fThetaPhi = new TH2D; 75 fThetaPhi->SetDirectory(NULL); 76 fThetaPhi->UseCurrentStyle(); 77 fThetaPhi->SetName("2D-ThetaPhi"); 78 fThetaPhi->SetTitle("2D: \\Theta vs. \\Phi"); 79 fThetaPhi->SetXTitle("\\phi [\\circ]"); 80 fThetaPhi->SetYTitle("\\Theta [\\circ]"); 81 fThetaPhi->SetTitleOffset(1.2,"Y"); 82 83 fSigmaTheta = new TH2D; 84 fSigmaTheta->SetDirectory(NULL); 85 fSigmaTheta->UseCurrentStyle(); 86 fSigmaTheta->SetName("2D-ThetaSigmabar(Inner)"); 87 fSigmaTheta->SetTitle("2D: \\bar{\\sigma}, \\Theta"); 88 fSigmaTheta->SetXTitle("\\Theta [\\circ]"); 89 fSigmaTheta->SetYTitle("Sigmabar(Inner)"); 90 fSigmaTheta->SetTitleOffset(1.2,"Y"); 91 92 fSigmaThetaOuter = new TH2D; 93 fSigmaThetaOuter->SetDirectory(NULL); 94 fSigmaThetaOuter->UseCurrentStyle(); 95 fSigmaThetaOuter->SetName("2D-ThetaSigmabar(Outer)"); 96 fSigmaThetaOuter->SetTitle("2D: \\bar{\\sigma}, \\Theta"); 97 fSigmaThetaOuter->SetXTitle("\\Theta [\\circ]"); 98 fSigmaThetaOuter->SetYTitle("Sigmabar(Outer)"); 99 fSigmaThetaOuter->SetTitleOffset(1.2,"Y"); 100 101 fSigmaPixTheta = new TH3D; 102 fSigmaPixTheta->SetDirectory(NULL); 103 fSigmaPixTheta->UseCurrentStyle(); 104 fSigmaPixTheta->SetName("3D-ThetaPixSigma"); 105 fSigmaPixTheta->SetTitle("3D: \\Theta, Pixel Id, \\sigma"); 106 fSigmaPixTheta->SetXTitle("\\Theta [\\circ]"); 107 fSigmaPixTheta->SetYTitle("Pixel Id"); 108 fSigmaPixTheta->SetZTitle("Sigma"); 109 110 fDiffPixTheta = new TH3D; 111 fDiffPixTheta->SetDirectory(NULL); 112 fDiffPixTheta->UseCurrentStyle(); 113 fDiffPixTheta->SetName("3D-ThetaPixDiff"); 114 //fDiffPixTheta->SetTitle("3D: \\Theta, Pixel Id, {\\sigma}^{2}-\\bar{\\sigma}^{2}"); 115 fDiffPixTheta->SetTitle("3D: \\Theta, Pixel Id, (Sigma2-Sigmabar2)/Area"); 116 fDiffPixTheta->SetXTitle("\\Theta [\\circ]"); 117 fDiffPixTheta->SetYTitle("Pixel Id"); 118 fDiffPixTheta->SetZTitle("(Sigma2 - Sigmabar2)/Area"); 119 120 // Define default binning 121 fBinsPhi = new MBinning; 122 fBinsPhi->SetEdges( 20, 0.0, 360.0); 123 124 Double_t fThetaLo = 0.0; 125 Double_t fThetaHi = 90.0; 126 fBinsTheta = new MBinning; 127 fBinsTheta->SetEdgesCos( 10, fThetaLo, fThetaHi); // theta 128 //fBinsTheta->SetEdges( 1, fThetaLo, fThetaHi); // theta 129 130 fBinsSigma = new MBinning; 131 fBinsSigma->SetEdges( 100, 0.0, 120.0); // sigma 132 133 fBinsSigmabarIn = new MBinning; 134 fBinsSigmabarOut = new MBinning;; 135 fBinsSigmabarIn->SetEdges(100, 0.0, 40.0); // sigmabar (inner) 136 fBinsSigmabarOut->SetEdges(100, 0.0, 80.0); // sigmabar (outer) 137 138 fBinsPix = new MBinning; 139 fBinsPix->SetEdges(578, -0.5, 577.5); 140 141 fBinsDiff = new MBinning; 142 fBinsDiff->SetEdges( 100, -500.0, 1500.0); // (sigma2-sigmabar2)/area 143 144 SetBinning(fThetaPhi, fBinsPhi, fBinsTheta); 145 SetBinning(fSigmaTheta, fBinsTheta, fBinsSigmabarIn); 146 SetBinning(fSigmaThetaOuter, fBinsTheta, fBinsSigmabarOut); 147 SetBinning(fSigmaPixTheta, fBinsTheta, fBinsPix, fBinsSigma); 148 SetBinning(fDiffPixTheta, fBinsTheta, fBinsPix, fBinsDiff); 149 150 //-------------------------------------------- 117 151 fNamePedPhotCam = "MPedPhotCamFromData"; 152 } 153 154 155 // -------------------------------------------------------------------------- 156 // 157 // Destructor. 158 // 159 MHSigmaTheta::~MHSigmaTheta() 160 { 161 delete fThetaPhi; 162 delete fSigmaTheta; 163 delete fSigmaThetaOuter; 164 delete fSigmaPixTheta; 165 delete fDiffPixTheta; 166 167 delete fBinsPhi; 168 delete fBinsTheta; 169 delete fBinsSigma; 170 delete fBinsSigmabarIn; 171 delete fBinsSigmabarOut; 172 delete fBinsPix; 173 delete fBinsDiff; 118 174 } 119 175 … … 133 189 fPointPos = (MPointingPos*)plist->FindObject("MPointingPos"); 134 190 if (!fPointPos) 135 *fLog << warn << "MPointingPos not found... aborting." << endl; 136 137 191 { 192 *fLog << err << "MPointingPos not found... aborting." << endl; 193 return kFALSE; 194 } 138 195 139 196 fPed = (MPedPhotCam*)plist->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam"); … … 144 201 return kFALSE; 145 202 } 146 //fPed->InitSize(fCam->GetNumPixels());203 fPed->InitSize(fCam->GetNumPixels()); 147 204 148 205 … … 162 219 163 220 221 //--------------------------------------------------------------- 222 *fLog << inf << "Name of MPedPhotCam container : " 223 << fNamePedPhotCam << endl; 224 225 226 //--------------------------------------------------------------- 227 228 // Get Phi Binning 229 MBinning* binsphi = (MBinning*)plist->FindObject("BinningPhi", "MBinning"); 230 if (!binsphi) 231 { 232 *fLog << warn << "Object 'BinningPhi' [MBinning] not found... use default binning." << endl; 233 binsphi = fBinsPhi; 234 } 235 164 236 // Get Theta Binning 165 237 MBinning* binstheta = (MBinning*)plist->FindObject("BinningTheta", "MBinning"); 166 238 if (!binstheta) 167 239 { 168 *fLog << warn << "Object 'BinningTheta' [MBinning] not found... no binning applied." << endl; 169 return kTRUE; 170 } 171 172 // Get Sigmabar binning 173 MBinning* binssigma = (MBinning*)plist->FindObject("BinningSigmabar", "MBinning"); 174 if (!binssigma) 175 *fLog << warn << "Object 'BinningSigmabar' [MBinning] not found... no binning applied." << endl; 240 *fLog << warn << "Object 'BinningTheta' [MBinning] not found... use default binning." << endl; 241 binstheta = fBinsTheta; 242 } 243 244 // Get Sigma binning 245 MBinning* binssig = (MBinning*)plist->FindObject("BinningSigma", "MBinning"); 246 if (!binssig) 247 { 248 *fLog << warn << "Object 'BinningSigma' [MBinning] not found... use default binning." << endl; 249 binssig = fBinsSigma; 250 } 251 252 // Get SigmabarIn binning 253 MBinning* binssigmain = (MBinning*)plist->FindObject("BinningSigmabarIn", "MBinning"); 254 if (!binssigmain) 255 { 256 *fLog << warn << "Object 'BinningSigmabarIn' [MBinning] not found... use default binning." << endl; 257 binssigmain = fBinsSigmabarIn; 258 } 259 260 // Get SigmabarOut binning 261 MBinning* binssigmaout = (MBinning*)plist->FindObject("BinningSigmabarOut", "MBinning"); 262 if (!binssigmaout) 263 { 264 *fLog << warn << "Object 'BinningSigmabarOut' [MBinning] not found... use default binning." << endl; 265 binssigmaout = fBinsSigmabarOut; 266 } 176 267 177 268 // Get binning for (sigma^2-sigmabar^2) 178 269 MBinning* binsdiff = (MBinning*)plist->FindObject("BinningDiffsigma2", "MBinning"); 179 270 if (!binsdiff) 180 *fLog << warn << "Object 'BinningDiffsigma2' [MBinning] not found... no binning applied." << endl; 181 182 //FIXME: Missing: Apply new binning to only one axis! 271 { 272 *fLog << warn << "Object 'BinningDiffsigma2' [MBinning] not found... use default binning." << endl; 273 binsdiff = fBinsDiff; 274 } 275 276 277 //--------------------------------------------------------------- 183 278 184 279 // Get binning for pixel number 185 280 const UInt_t npix1 = fPed->GetSize()+1; 186 *fLog << "npix1 = " << npix1 << endl;281 //*fLog << "MHSigmaTheata::SetupFill(); npix1 = " << npix1 << endl; 187 282 MBinning binspix("BinningPixel"); 188 283 binspix.SetEdges(npix1, -0.5, npix1-0.5); 189 284 190 285 // Set binnings in histograms 191 if (binssigma) 192 { 193 SetBinning(&fSigmaTheta, binstheta, binssigma); 194 SetBinning(&fSigmaThetaOuter, binstheta, binssigma); 195 SetBinning(&fSigmaPixTheta, binstheta, &binspix, binssigma); 196 } 197 198 if (binsdiff) 199 SetBinning(&fDiffPixTheta, binstheta, &binspix, binsdiff); 286 SetBinning(fThetaPhi, binsphi, binstheta); 287 SetBinning(fSigmaTheta, binstheta, binssigmain); 288 SetBinning(fSigmaThetaOuter, binstheta, binssigmaout); 289 SetBinning(fSigmaPixTheta, binstheta, &binspix, binssig); 290 SetBinning(fDiffPixTheta, binstheta, &binspix, binsdiff); 291 292 *fLog << "MHSigmaTheta::SetupFill(); binnings were set" << endl; 200 293 201 294 return kTRUE; … … 211 304 { 212 305 Double_t theta = fPointPos->GetZd(); 306 Double_t phi = fPointPos->GetAz(); 307 308 fPed->ReCalc(*fCam, fBad); 213 309 214 310 Double_t mysig = (fPed->GetArea(0)).GetRms(); 215 311 Double_t mysigouter = (fPed->GetArea(1)).GetRms(); 216 312 217 *fLog << "theta, mysig, mysigouter = " << theta << ", " << mysig218 << ", " << mysigouter << endl;219 220 f SigmaTheta.Fill(theta, mysig);221 fSigmaTheta Outer.Fill(theta, mysigouter);222 223 const UInt_t npix = fEvt->GetNumPixels(); 224 225 for (UInt_t i=0; i<npix; i++)226 {227 MCerPhotPix &cerpix = (*fEvt)[i];228 const Int_t id = cerpix .GetPixId();229 230 if (!cerpix .IsPixelUsed())313 //*fLog << "theta, mysig, mysigouter = " << theta << ", " << mysig 314 // << ", " << mysigouter << endl; 315 316 fThetaPhi->Fill(phi, theta); 317 fSigmaTheta->Fill(theta, mysig); 318 fSigmaThetaOuter->Fill(theta, mysigouter); 319 320 MCerPhotPix *cerpix = 0; 321 TIter Next(*fEvt); 322 while ( (cerpix=(MCerPhotPix*)Next()) ) 323 { 324 const Int_t id = cerpix->GetPixId(); 325 326 if (!cerpix->IsPixelUsed()) 231 327 { 232 328 //*fLog << all << "MHSigmaTheta::Fill; unused pixel found, id = " … … 237 333 const MPedPhotPix &pix = (*fPed)[id]; 238 334 239 if ( fBad != NULL && ((*fBad)[id]).IsUnsuitable() )240 {241 // this should never occur, because bad pixels should have242 // been set unused243 *fLog << all << "MHSigmaTheta::Fill; bad pixel found which is used, id = "244 << id << "... go to next pixel." << endl;245 continue;246 }247 248 335 // ratio is the area of pixel 0 249 336 // divided by the area of the current pixel … … 251 338 const Double_t sigma = pix.GetRms(); 252 339 253 fSigmaPixTheta .Fill(theta, (Double_t)id, sigma*sqrt(ratio));340 fSigmaPixTheta->Fill(theta, (Double_t)id, sigma); 254 341 255 342 Double_t diff; … … 258 345 { 259 346 // inner pixel 260 diff = sigma*sigma*ratio - mysig*mysig;347 diff = (sigma*sigma - mysig*mysig) * ratio; 261 348 } 262 349 else 263 350 { 264 351 // outer pixel 265 diff = sigma*sigma*ratio - mysigouter*mysigouter;352 diff = (sigma*sigma - mysigouter*mysigouter) * ratio; 266 353 } 267 354 268 fDiffPixTheta .Fill(theta, (Double_t)id, diff);355 fDiffPixTheta->Fill(theta, (Double_t)id, diff); 269 356 } 270 357 … … 285 372 if ((h = (TH1D*)gPad->FindObject("ProjX-Theta"))) 286 373 { 287 ProjectionX(*h, fSigmaTheta);374 ProjectionX(*h, *fSigmaTheta); 288 375 if (h->GetEntries()!=0) 289 376 gPad->SetLogy(); … … 292 379 padsave->cd(4); 293 380 if ((h = (TH1D*)gPad->FindObject("ProjY-sigma"))) 294 ProjectionY(*h, fSigmaTheta);381 ProjectionY(*h, *fSigmaTheta); 295 382 296 383 gPad = padsave; … … 305 392 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 306 393 pad->SetBorderMode(0); 307 308 394 AppendPad(""); 309 395 … … 315 401 pad->cd(1); 316 402 gPad->SetBorderMode(0); 317 h = fSigmaTheta .ProjectionX("ProjX-Theta", -1, 9999, "E");403 h = fSigmaTheta->ProjectionX("ProjX-Theta", -1, 9999, "E"); 318 404 h->SetDirectory(NULL); 405 h->UseCurrentStyle(); 319 406 h->SetTitle("Distribution of \\Theta"); 320 407 h->SetXTitle("\\Theta [\\circ]"); 321 408 h->SetYTitle("No.of events"); 409 h->SetTitleOffset(1.2,"Y"); 322 410 h->Draw(opt); 323 411 h->SetBit(kCanDelete); … … 325 413 pad->cd(2); 326 414 gPad->SetBorderMode(0); 327 h = fDiffPixTheta .Project3D("zx");415 h = fDiffPixTheta->Project3D("zx"); 328 416 h->SetDirectory(NULL); 329 h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. \\Theta (all pixels)"); 417 h->UseCurrentStyle(); 418 //h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. \\Theta (all pixels)"); 419 h->SetTitle("(Sigma2-Sigmabar2)/Area vs. \\Theta (all pixels)"); 330 420 h->SetXTitle("\\Theta [\\circ]"); 331 421 h->SetYTitle("(Sigma2 - Sigmabar2) / Area"); 422 h->SetTitleOffset(1.2,"Y"); 332 423 h->Draw("box"); 333 424 h->SetBit(kCanDelete); … … 335 426 pad->cd(3); 336 427 gPad->SetBorderMode(0); 337 h = fSigmaPixTheta .Project3D("zx");428 h = fSigmaPixTheta->Project3D("zx"); 338 429 h->SetDirectory(NULL); 430 h->UseCurrentStyle(); 339 431 h->SetTitle("\\sigma_{ped} vs. \\Theta (all pixels)"); 340 432 h->SetXTitle("\\Theta [\\circ]"); 341 433 h->SetYTitle("Sigma"); 434 h->SetTitleOffset(1.2,"Y"); 342 435 h->Draw("box"); 343 436 h->SetBit(kCanDelete); … … 345 438 //pad->cd(7); 346 439 //gPad->SetBorderMode(0); 347 //h = fSigmaTheta .ProjectionY("ProjY-sigma", -1, 9999, "E");440 //h = fSigmaTheta->ProjectionY("ProjY-sigma", -1, 9999, "E"); 348 441 //h->SetDirectory(NULL); 442 //h->UseCurrentStyle(); 349 443 //h->SetTitle("Distribution of \\bar{\\sigma}_{ped}"); 350 444 //h->SetXTitle("\\bar{\\sigma}_{ped}"); 351 445 //h->SetYTitle("No.of events"); 446 //h->SetTitleOffset(1.2,"Y"); 352 447 //h->Draw(opt); 353 448 //h->SetBit(kCanDelete); … … 355 450 pad->cd(5); 356 451 gPad->SetBorderMode(0); 357 h = fDiffPixTheta .Project3D("zy");452 h = fDiffPixTheta->Project3D("zy"); 358 453 h->SetDirectory(NULL); 359 h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. pixel Id (all \\Theta)"); 454 h->UseCurrentStyle(); 455 //h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. pixel Id (all \\Theta)"); 456 h->SetTitle("(Sigma2-Sigmabar2)/Area vs. pixel Id (all \\Theta)"); 360 457 h->SetXTitle("Pixel Id"); 361 h->SetYTitle("Sigma2 - sigmabar2) / Area"); 458 h->SetYTitle("(Sigma2 - sigmabar2) / Area"); 459 h->SetTitleOffset(1.2,"Y"); 362 460 h->Draw("box"); 363 461 h->SetBit(kCanDelete); … … 365 463 pad->cd(6); 366 464 gPad->SetBorderMode(0); 367 h = fSigmaPixTheta .Project3D("zy");465 h = fSigmaPixTheta->Project3D("zy"); 368 466 h->SetDirectory(NULL); 467 h->UseCurrentStyle(); 369 468 h->SetTitle("\\sigma_{ped} vs. pixel Id (all \\Theta)"); 370 469 h->SetXTitle("Pixel Id"); 371 470 h->SetYTitle("Sigma"); 471 h->SetTitleOffset(1.2,"Y"); 372 472 h->Draw("box"); 373 473 h->SetBit(kCanDelete); 374 474 375 475 pad->cd(4); 376 fSigmaTheta.Draw(opt); 476 gPad->SetBorderMode(0); 477 fSigmaTheta->Draw(); 377 478 378 479 pad->cd(7); 379 fSigmaThetaOuter.Draw(opt); 380 381 //pad->cd(8); 382 //fDiffPixTheta.Draw(opt); 383 384 //pad->cd(9); 385 //fSigmaPixTheta.Draw(opt); 480 gPad->SetBorderMode(0); 481 fSigmaThetaOuter->Draw(); 482 483 pad->cd(8); 484 gPad->SetBorderMode(0); 485 fThetaPhi->Draw(); 486 487 pad->cd(9); 488 gPad->SetBorderMode(0); 489 h = fThetaPhi->ProjectionX("ProjX-Phi", -1, 9999, "E"); 490 h->SetDirectory(NULL); 491 h->UseCurrentStyle(); 492 h->SetTitle("Distribution of \\Phi"); 493 h->SetXTitle("\\phi [\\circ]"); 494 h->SetYTitle("No. of events"); 495 h->SetTitleOffset(1.2,"Y"); 496 h->Draw(opt); 497 h->SetBit(kCanDelete); 386 498 } 387 499 -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h
r4841 r5431 35 35 36 36 // sigmabar is the average pedestal sigma 37 TH2D fSigmaTheta; // 2D-distribution sigmabar versus Theta (Inner)38 TH2D fSigmaThetaOuter; // 2D-distribution sigmabar versus Theta (Outer)37 TH2D *fSigmaTheta; // 2D-distribution sigmabar versus Theta (Inner) 38 TH2D *fSigmaThetaOuter; // 2D-distribution sigmabar versus Theta (Outer) 39 39 40 TH3D fSigmaPixTheta; // 3D-distr.:Theta, pixel, pedestal sigma 41 TH3D fDiffPixTheta; // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2 40 TH3D *fSigmaPixTheta; // 3D-distr.:Theta, pixel, pedestal sigma 41 TH3D *fDiffPixTheta; // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2 42 43 TH2D *fThetaPhi; // 2D-distribution Theta versus Phi 44 45 MBinning *fBinsPhi; //! 46 MBinning *fBinsTheta; //! 47 MBinning *fBinsSigma; //! 48 MBinning *fBinsSigmabarIn; //! 49 MBinning *fBinsSigmabarOut; //! 50 MBinning *fBinsPix; //! 51 MBinning *fBinsDiff; //! 42 52 43 53 void Paint(Option_t *opt=""); … … 45 55 public: 46 56 MHSigmaTheta(const char *name=NULL, const char *title=NULL); 57 ~MHSigmaTheta(); 47 58 48 59 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } … … 51 62 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 52 63 53 const TH2D *Get SigmaTheta() { return &fSigmaTheta; }54 const TH2D *Get SigmaTheta() const { return &fSigmaTheta; }64 const TH2D *GetThetaPhi() { return fThetaPhi; } 65 const TH2D *GetThetaPhi() const { return fThetaPhi; } 55 66 56 const TH2D *GetSigmaTheta Outer() { return &fSigmaThetaOuter; }57 const TH2D *GetSigmaTheta Outer() const { return &fSigmaThetaOuter; }67 const TH2D *GetSigmaTheta() { return fSigmaTheta; } 68 const TH2D *GetSigmaTheta() const { return fSigmaTheta; } 58 69 59 const TH 3D *GetSigmaPixTheta() { return &fSigmaPixTheta; }60 const TH 3D *GetSigmaPixTheta() const { return &fSigmaPixTheta; }70 const TH2D *GetSigmaThetaOuter() { return fSigmaThetaOuter; } 71 const TH2D *GetSigmaThetaOuter() const { return fSigmaThetaOuter; } 61 72 62 const TH3D *GetDiffPixTheta() { return &fDiffPixTheta; } 63 const TH3D *GetDiffPixTheta() const { return &fDiffPixTheta; } 73 const TH3D *GetSigmaPixTheta() { return fSigmaPixTheta; } 74 const TH3D *GetSigmaPixTheta() const { return fSigmaPixTheta; } 75 76 const TH3D *GetDiffPixTheta() { return fDiffPixTheta; } 77 const TH3D *GetDiffPixTheta() const { return fDiffPixTheta; } 64 78 65 79 void Draw(Option_t *option=""); -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r4844 r5431 560 560 return kFALSE; 561 561 } 562 *fLog << all << "Name of MPedPhotCam container = " << fNamePedPhotCam 563 << endl; 562 564 563 565 fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));
Note:
See TracChangeset
for help on using the changeset viewer.