Changeset 2237
- Timestamp:
- 06/26/03 17:00:06 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2236 r2237 35 35 - added GetNumMaxLoGainSample 36 36 37 * manalysis/MCT1PadSchweizer.cc, manalysis/MMcPedestalNSBAdd.cc, 38 manalysis/MSigmabar.cc: 39 - adapted to new function names in MPedestalPix 40 41 * manalysis/MCerPhotAnal.cc: 42 - adapted to new function names in MPedestalPix 43 - fixed to work with real data and monte carlo data 44 - preliminarily removed error of pedestal and pedestalrms 45 46 * manalysis/MCerPhotCalc.[h,cc]: 47 - adapted to new function names in MPedestalPix 48 - fixed to work with real data and monte carlo data 49 50 * manalysis/MMcPedestalCopy.cc, manalysis/MPedCalcPedRun.[h,cc]: 51 - adapted to new function names in MPedestalPix 52 - preliminarily removed error of pedestal and pedestalrms 53 54 * manalysis/MPedestalCam.[h,cc]: 55 - adapted to new function names in MPedestalPix 56 - preliminarily removed error of pedestal and pedestalrms 57 - fixed GetPixelContent (do not return Pedestal*PixRatio) 58 59 * manalysis/MPedestalPix.[h,cc]: 60 - removed old variables 61 - introduced Pedestal for pedestal 62 - introduced pedestalRMS for the rms of the pedestal 63 - error of both values still missing 64 65 * meventdisp/MGCamDisplay.cc: 66 - fixed display, displays now: 67 + Number Of Photons 68 + Pedestal 69 + PedestalRMS 70 + Number of Photons/PedestalRMS 71 72 * mimage/MImgCleanStd.[h,cc]: 73 - fixed image cleaning in the sense that erronously the error 74 of the number of photons was used instead of the error of 75 the PMT offset (pedestal) 76 - introduced some debugging option 77 78 * mmontecarlo/MMcCollectionAreaCalc.cc: 79 - minor change 80 81 82 37 83 38 84 -
trunk/MagicSoft/Mars/manalysis/MCT1PadSchweizer.cc
r2206 r2237 293 293 continue; 294 294 295 fEvt->AddPixel(i, 0.0, (*fPed)[i].Get MeanRms());295 fEvt->AddPixel(i, 0.0, (*fPed)[i].GetPedestalRms()); 296 296 } 297 297 … … 543 543 544 544 MPedestalPix &ppix = (*fPed)[j]; 545 Double_t oldsigma = ppix.Get MeanRms();545 Double_t oldsigma = ppix.GetPedestalRms(); 546 546 Double_t oldsigma2 = oldsigma*oldsigma; 547 547 … … 691 691 Double_t oldphotons = pix.GetNumPhotons(); 692 692 Double_t newphotons = oldphotons + NSB; 693 pix.SetNumPhotons( newphotons);693 pix.SetNumPhotons(newphotons); 694 694 695 695 … … 700 700 // error: add sigma of padded noise quadratically 701 701 Double_t olderror = pix.GetErrorPhot(); 702 Double_t newerror = sqrt( olderror*olderror + addSig2);703 pix.SetErrorPhot( newerror);704 705 706 Double_t newsigma = sqrt( oldsigma2 + addSig2 );707 ppix.Set MeanRms( newsigma);708 709 fHSigmaPedestal->Fill( oldsigma, newsigma);702 Double_t newerror = sqrt(olderror*olderror + addSig2); 703 pix.SetErrorPhot(newerror); 704 705 706 Double_t newsigma = sqrt(oldsigma2 + addSig2); 707 ppix.SetPedestalRms(newsigma); 708 709 fHSigmaPedestal->Fill(oldsigma, newsigma); 710 710 } 711 711 //---------- end of loop over pixels --------------------------------- -
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc
r2211 r2237 99 99 } 100 100 101 fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");102 if (!fPedestals)103 {104 *fLog << dbginf << "MPedestalCam not found... aborting." << endl;105 return kFALSE;106 }107 108 101 fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt"); 109 102 if (!fCerPhotEvt) 103 return kFALSE; 104 105 const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 106 if (!runheader) 107 *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl; 108 else 109 if (runheader->GetRunType() == kRTMonteCarlo) 110 { 111 fPedestals=NULL; 112 return kTRUE; 113 } 114 115 fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 116 if (runheader && !fPedestals) 110 117 return kFALSE; 111 118 … … 184 191 const UInt_t pixid = pixel.GetPixelId(); 185 192 186 MPedestalPix &ped = (*fPedestals)[pixid];187 188 193 // 189 194 // sanity check (old MC files sometimes have pixids>577) 190 195 // 191 if ( !fPedestals->CheckBounds(pixid))196 if (fPedestals && !fPedestals->CheckBounds(pixid)) 192 197 { 193 198 *fLog << inf << "Pixel ID larger than camera... skipping event." << endl; … … 196 201 197 202 fCerPhotEvt->AddPixel(pixid, nphot, sigmaped/2.236); 198 ped.SetPedestal(pedes, sigmaped); 199 ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5.), 200 sigmaped/sqrt(2.*(fRawEvt->GetNumHiGainSamples()-5))); 201 203 204 if (fPedestals) 205 (*fPedestals)[pixid].Set(pedes, sigmaped); 206 207 /* 208 ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5.), 209 sigmaped/sqrt(2.*(fRawEvt->GetNumHiGainSamples()-5))); 210 */ 202 211 // FIXME! Handling of Lo Gains is missing! 203 212 } … … 206 215 fCerPhotEvt->SetReadyToSave(); 207 216 217 if (fPedestals) 218 fPedestals->SetReadyToSave(); 219 208 220 return kTRUE; 209 221 } -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r2213 r2237 107 107 fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 108 108 if (!fPedestals) 109 return kFALSE; 109 { 110 *fLog << dbginf << "MPedestalCam not found... aborting." << endl; 111 return kFALSE; 112 } 110 113 111 114 fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt"); … … 148 151 } 149 152 150 if (runheader->GetRunType() != kRTMonteCarlo) 153 Bool_t fIsMcFile = runheader->GetRunType() == kRTMonteCarlo; 154 if (!fIsMcFile) 151 155 return kTRUE; 156 157 ScalePedestals(); 152 158 153 159 MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader"); … … 165 171 } 166 172 173 void MCerPhotCalc::ScalePedestals() 174 { 175 Int_t n = 577; //FIXME: fPedestals->GetNumPixel(); 176 177 for (int idx=0; idx<n; idx++) 178 { 179 MPedestalPix &ped = (*fPedestals)[idx]; 180 181 const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal(); 182 ped.Set(offset*fSumWeights, ped.GetPedestalRms()*fSumQuadWeights); 183 } 184 185 fPedestals->SetReadyToSave(); 186 } 187 167 188 // -------------------------------------------------------------------------- 168 189 // … … 174 195 //fCerPhotEvt->InitSize(fRawEvt->GetNumPixels()); 175 196 197 if (fIsMcFile) 198 ScalePedestals(); 199 176 200 MRawEvtPixelIter pixel(fRawEvt); 177 201 178 202 while (pixel.Next()) 179 203 { 180 const UInt_t pixid= pixel.GetPixelId();181 const MPedestalPix &ped = (*fPedestals)[pixid];204 const UInt_t idx = pixel.GetPixelId(); 205 MPedestalPix &ped = (*fPedestals)[idx]; 182 206 183 207 // 184 208 // sanity check (old MC files sometimes have pixids>577) 185 209 // 186 if (!fPedestals->CheckBounds( pixid))210 if (!fPedestals->CheckBounds(idx)) 187 211 { 188 *fLog << inf << "Pixel I Dlarger than camera... skipping event." << endl;212 *fLog << inf << "Pixel Index larger than camera... skipping event." << endl; 189 213 return kCONTINUE; 190 214 } 191 192 //193 // Mean pedestal:194 //195 const Double_t mean = fEnableFix ? ped.GetMean()-0.5 : ped.GetMean();196 215 197 216 // … … 204 223 nphot += ptr[i]*fWeight[i]; 205 224 206 nphot -= mean*fSumWeights; 207 208 const Float_t nphoterr = ped.GetSigma()* fSumQuadWeights; 209 210 fCerPhotEvt->AddPixel(pixid, nphot, nphoterr); 225 nphot -= ped.GetPedestal(); 226 227 fCerPhotEvt->AddPixel(idx, nphot, 0); 211 228 212 229 // FIXME! Handling of Lo Gains is missing! -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h
r2213 r2237 31 31 32 32 Bool_t fEnableFix; // fix for a bug in files from older camera versions (<=40) 33 Bool_t fIsMcFile; 33 34 34 35 TArrayF fWeight; // Weights for adding up the ADC slices … … 42 43 43 44 Bool_t ReInit(MParList *pList); 45 void ScalePedestals(); 44 46 45 47 public: -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r2206 r2237 138 138 139 139 const Float_t pedest = fMcPed->GetPedestal(i); 140 const Float_t pedrms = pedest/sqrt((float)num);140 //const Float_t pedrms = pedest/sqrt((float)num); 141 141 142 142 const Float_t sigma = fMcPed->GetPedestalRms(i); 143 const Float_t sigrms = sigma/sqrt(num*2.);143 //const Float_t sigrms = sigma/sqrt(num*2.); 144 144 145 pix.SetPedestal(pedest, sigma);146 pix.Set PedestalRms(pedrms, sigrms);145 //pix.SetPedestalRms(pedrms, sigrms); 146 pix.Set(pedest, sigma); 147 147 } 148 148 -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
r2206 r2237 215 215 MPedestalPix &pix = (*fPedCam)[i]; 216 216 217 const Float_t pedrms = pix.Get Sigma();217 const Float_t pedrms = pix.GetPedestalRms(); 218 218 const Float_t ratio = fGeom->GetPixRatio(i); 219 219 const Float_t ampl = fFadc->GetAmplitud(); 220 220 221 pix.Set Sigma(sqrt(pedrms*pedrms + dnsbpix*ampl*ampl/ratio));221 pix.SetPedestalRms(sqrt(pedrms*pedrms + dnsbpix*ampl*ampl/ratio)); 222 222 } 223 223 -
trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc
r2206 r2237 95 95 const Float_t higainrms = CalcHiGainRms(ptr, end, higainped); 96 96 97 const Float_t higainpederr = CalcHiGainMeanErr(higainrms);98 const Float_t higainrmserr = CalcHiGainRmsErr(higainrms);97 //const Float_t higainpederr = CalcHiGainMeanErr(higainrms); 98 //const Float_t higainrmserr = CalcHiGainRmsErr(higainrms); 99 99 100 100 const UInt_t pixid = pixel.GetPixelId(); 101 101 MPedestalPix &pix = (*fPedestals)[pixid]; 102 102 103 pix.Set Pedestal(higainped, higainrms);104 pix.SetPedestalRms(higainpederr, higainrmserr);103 pix.Set(higainped, higainrms); 104 //pix.SetPedestalRms(higainpederr, higainrmserr); 105 105 } 106 106 … … 132 132 } while (++ptr != end); 133 133 134 return sqrt(rms/ (fNumHiGainSamples-1));134 return sqrt(rms/fNumHiGainSamples); 135 135 } 136 136 /* 137 137 Float_t MPedCalcPedRun::CalcHiGainMeanErr(Float_t higainrms) const 138 138 { … … 144 144 return higainrms/sqrt(2.*fNumHiGainSamples); 145 145 } 146 146 */ -
trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.h
r2206 r2237 26 26 Float_t CalcHiGainMean(Byte_t *ptr, const Byte_t *end) const; 27 27 Float_t CalcHiGainRms(Byte_t *ptr, const Byte_t *end, Float_t higainped) const; 28 Float_t CalcHiGainMeanErr(Float_t higainrms) const;29 Float_t CalcHiGainRmsErr(Float_t higainrms) const;28 //Float_t CalcHiGainMeanErr(Float_t higainrms) const; 29 //Float_t CalcHiGainRmsErr(Float_t higainrms) const; 30 30 31 31 Int_t PreProcess(MParList *pList); -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r2206 r2237 133 133 134 134 *fLog << id-1 << ": "; 135 *fLog << pix->GetMean() << " " << pix->GetSigma() << " "; 136 *fLog << pix->GetMeanRms() << " " << pix->GetSigmaRms() << endl; 135 *fLog << pix->GetPedestal() << " " << pix->GetPedestalRms() << endl; 137 136 } 138 137 } 139 138 140 Float_t MPedestalCam::Get MeanMin(const MGeomCam *geom) const139 Float_t MPedestalCam::GetPedestalMin(const MGeomCam *geom) const 141 140 { 142 141 if (fArray->GetEntries() <= 0) 143 142 return 50.; 144 143 145 Float_t minval = (*this)[0].Get Mean();144 Float_t minval = (*this)[0].GetPedestalRms(); 146 145 147 146 for (Int_t i=1; i<fArray->GetEntries(); i++) … … 149 148 const MPedestalPix &pix = (*this)[i]; 150 149 151 Float_t testval = pix.Get Mean();150 Float_t testval = pix.GetPedestalRms(); 152 151 153 152 if (geom) … … 160 159 } 161 160 162 Float_t MPedestalCam::Get MeanMax(const MGeomCam *geom) const161 Float_t MPedestalCam::GetPedestalMax(const MGeomCam *geom) const 163 162 { 164 163 if (fArray->GetEntries() <= 0) 165 164 return 50.; 166 165 167 Float_t maxval = (*this)[0].Get Mean();166 Float_t maxval = (*this)[0].GetPedestalRms(); 168 167 169 168 for (Int_t i=1; i<fArray->GetEntries(); i++) … … 171 170 const MPedestalPix &pix = (*this)[i]; 172 171 173 Float_t testval = pix.Get Mean();172 Float_t testval = pix.GetPedestalRms(); 174 173 175 174 if (geom) … … 184 183 Bool_t MPedestalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 185 184 { 186 val = (*this)[idx].GetMean()*cam.GetPixRatio(idx); 185 switch (type) 186 { 187 case 0: 188 val = (*this)[idx].GetPedestal(); 189 break; 190 case 1: 191 val = (*this)[idx].GetPedestalRms(); 192 break; 193 } 187 194 return kTRUE; 188 195 } -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
r2206 r2237 28 28 MPedestalPix &operator[](Int_t i) const; 29 29 30 Float_t Get MeanMin(const MGeomCam *cam) const;31 Float_t Get MeanMax(const MGeomCam *cam) const;30 Float_t GetPedestalMin(const MGeomCam *cam) const; 31 Float_t GetPedestalMax(const MGeomCam *cam) const; 32 32 33 33 Bool_t CheckBounds(Int_t i); -
trunk/MagicSoft/Mars/manalysis/MPedestalPix.cc
r1540 r2237 48 48 void MPedestalPix::Clear(Option_t *o) 49 49 { 50 fMean = -1; 51 fSigma = -1; 52 fMeanRms = -1; 53 fSigmaRms = -1; 50 fPedestal = -1; 51 fPedestalRms = -1; 54 52 } 55 53 -
trunk/MagicSoft/Mars/manalysis/MPedestalPix.h
r1540 r2237 9 9 { 10 10 private: 11 Float_t fMean; // mean value of pedestal (PMT offset) 12 Float_t fSigma; // sigma (standard deviation) of pedestal 13 Float_t fMeanRms; // root mean square of pedestal 14 Float_t fSigmaRms; // root mean sqare of sigma of the pedestal 11 Float_t fPedestal; // mean value of pedestal (PMT offset) 12 Float_t fPedestalRms; // root mean square / sigma / standard deviation of pedestal 15 13 16 14 public: … … 19 17 void Clear(Option_t *o=""); 20 18 21 Float_t GetMean() const { return fMean; } 22 Float_t GetSigma() const { return fSigma; } 23 Float_t GetMeanRms() const { return fMeanRms; } 24 Float_t GetSigmaRms() const { return fSigmaRms; } 25 19 Float_t GetPedestal() const { return fPedestal; } 20 Float_t GetPedestalRms() const { return fPedestalRms; } 21 /* 26 22 void SetMean(Float_t f) { fMean = f; } 27 23 void SetSigma(Float_t f) { fSigma = f; } 28 24 void SetMeanRms(Float_t f) { fMeanRms = f; } 29 25 void SetSigmaRms(Float_t f) { fSigmaRms = f; } 26 */ 30 27 31 void SetPedestal(Float_t m, Float_t s) { fMean = m; fSigma = s; } 32 void SetPedestalRms(Float_t m, Float_t s) { fMeanRms = m; fSigmaRms = s; } 28 void SetPedestal(Float_t f) { fPedestal = f; } 29 void SetPedestalRms(Float_t f) { fPedestalRms = f; } 30 void Set(Float_t m, Float_t r) { fPedestal = m; fPedestalRms = r; } 33 31 34 Bool_t IsValid() const { return f Mean>=0||fSigma>=0||fMeanRms>=0||fSigmaRms>=0; }32 Bool_t IsValid() const { return fPedestal>=0||fPedestalRms>=0; } 35 33 36 34 ClassDef(MPedestalPix, 1) // Storage Container for Pedestal information of one pixel -
trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
r2209 r2237 135 135 */ 136 136 137 const Int_t id = cerpix.GetPixId();138 const Double_t area = geom.GetPixRatio(id );139 140 if (id == 0)137 const Int_t idx = cerpix.GetPixId(); 138 const Double_t area = geom.GetPixRatio(idx); 139 140 if (idx == 0) 141 141 { 142 142 //*fLog << "MSigmabar : id = 0; pixel '0' is used, ignore it" … … 145 145 } 146 146 147 const MGeomPix &gpix = geom[id ];147 const MGeomPix &gpix = geom[idx]; 148 148 149 149 Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 / (TMath::Pi()*2)); … … 152 152 153 153 // count only those pixels which have a sigma != 0.0 154 const Float_t sigma = ped[id ].GetMeanRms();154 const Float_t sigma = ped[idx].GetPedestalRms(); 155 155 156 156 if ( sigma <= 0 ) -
trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc
r2230 r2237 39 39 #include "MHillasCalc.h" // MHillasCalc 40 40 #include "MHillasSrcCalc.h" // MHillasSrcCalc 41 #include "MPedestalPix.h" // MPedestalPix 41 42 #include "MPedestalCam.h" // MPedestalCam 42 #include "MCerPhotCalc.h" // MCerPhotCalc 43 #include "MCerPhotEvt.h" // MCerPhotEvt::GetPixById 44 #include "MCerPhotCalc.h" // MCerPhotCalc 43 45 #include "MMcPedestalCopy.h" // MMcPedestalCopy 44 46 #include "MMcPedestalNSBAdd.h" // MMcPedestalNSBAdd … … 166 168 167 169 fCanvas2[0] = fCanvas; 168 fCanvas2[1] = AddTab(" Errors");169 fCanvas2[2] = AddTab("Phot/ Err");170 fCanvas2[1] = AddTab("PedRMS"); 171 fCanvas2[2] = AddTab("Phot/PedRMS"); 170 172 fCanvas2[3] = AddTab("Levels"); 171 173 fCanvas2[4] = AddTab("Pedestals"); … … 184 186 } 185 187 186 fDisplay[0]->SetNameTitle("photons", "Number of Photons");187 fDisplay[1]->SetNameTitle(" errors", "Error of Photons");188 fDisplay[2]->SetNameTitle("phot err", "Number of Photons / Error");189 fDisplay[3]->SetNameTitle("levels", "Cleaning Levels");190 fDisplay[4]->SetNameTitle("pedestals", "Pedestals");188 fDisplay[0]->SetNameTitle("photons", "Number of Photons"); 189 fDisplay[1]->SetNameTitle("pedrms", "Pedestal RMS"); 190 fDisplay[2]->SetNameTitle("photpedrms", "Number of Photons / Pedestal RMS"); 191 fDisplay[3]->SetNameTitle("levels", "Cleaning Levels"); 192 fDisplay[4]->SetNameTitle("pedestals", "Pedestals"); 191 193 192 194 ReadFirstEvent(); … … 247 249 const MPedestalCam *ped = (MPedestalCam*)plist->FindObject("MPedestalCam"); 248 250 249 fDisplay[0]->SetCamContent((MCamEvent&)*evt, 0); 250 fDisplay[1]->SetCamContent((MCamEvent&)*evt, 1); 251 fDisplay[2]->SetCamContent((MCamEvent&)*evt, 2); 251 // FIXME: Make this publicly available 252 TArrayD val(577); 253 TArrayC use(577); 254 for (int i=0; i<577;i++) 255 { 256 // FIXME: photon event first! 257 MCerPhotPix *pix = evt->GetPixById(i); 258 if (!pix) 259 continue; 260 MPedestalPix &ppix = (*ped)[i]; 261 if (ppix.GetPedestalRms()<0) 262 continue; 263 val[i] = pix->GetNumPhotons()/ppix.GetPedestalRms(); 264 use[i] = 1; 265 } 266 267 fDisplay[0]->SetCamContent(*evt, 0); 268 fDisplay[1]->SetCamContent(*ped, 1); 269 fDisplay[2]->SetCamContent(val, &use); 252 270 fDisplay[3]->FillLevels(*evt, *clean); 253 fDisplay[4]->SetCamContent( (MCamEvent&)*ped);271 fDisplay[4]->SetCamContent(*ped, 0); 254 272 255 273 if (fDisplayHillas) -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r2233 r2237 263 263 264 264 #include "MParList.h" 265 #include "MSigmabar.h" 266 265 267 #include "MGeomPix.h" 266 268 #include "MGeomCam.h" 269 267 270 #include "MCerPhotPix.h" 268 271 #include "MCerPhotEvt.h" 269 #include "MSigmabar.h" 272 273 #include "MPedestalPix.h" 274 #include "MPedestalCam.h" 270 275 271 276 #include "MGGroupFrame.h" // MGGroupFrame … … 328 333 MCerPhotPix &pix = (*fEvt)[i]; 329 334 330 const Int_t id = pix.GetPixId();331 332 const Float_t 333 const Float_t noise = pix.GetErrorPhot();334 335 335 const Int_t idx = pix.GetPixId(); 336 337 const Float_t entry = pix.GetNumPhotons(); 338 const Float_t noise = (*fPed)[idx].GetSigma(); 339 340 // 336 341 // We calculate a correction factor which accounts for the 337 342 // fact that pixels have different size (see TDAS 02-14). 338 343 // 339 const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(id ));344 const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(idx)); 340 345 341 346 // COBB: '<=' to skip entry=noise=0 … … 485 490 // get pixel id of this entry 486 491 // 487 const Int_t id = pix.GetPixId();492 const Int_t idx = pix.GetPixId(); 488 493 489 494 // 490 495 // check the num of photons against the noise level 491 496 // 492 const Float_t 493 const Float_t noise = pix.GetErrorPhot();497 const Float_t entry = pix.GetNumPhotons(); 498 const Float_t noise = (*fPed)[idx].GetSigma(); 494 499 495 500 // … … 497 502 // fact that pixels have different size (see TDAS 02-14). 498 503 // 499 const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(id ));504 const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(idx)); 500 505 501 506 return (entry * factor <= fCleanLvl2 * noise); … … 653 658 } 654 659 655 if (fCleaningMethod != kDemocratic) 656 return kTRUE; 657 658 fSgb = (MSigmabar*)pList->FindObject("MSigmabar"); 659 if (!fSgb) 660 { 661 *fLog << dbginf << "MSigmabar not found... aborting." << endl; 662 return kFALSE; 660 if (fCleaningMethod == kDemocratic) 661 { 662 fSgb = (MSigmabar*)pList->FindObject("MSigmabar"); 663 if (!fSgb) 664 { 665 *fLog << dbginf << "MSigmabar not found... aborting." << endl; 666 return kFALSE; 667 } 668 } 669 else 670 { 671 fPed = (MPedestalCam*)pList->FindObject("MPedestalCam"); 672 if (!fPed) 673 { 674 *fLog << dbginf << "MPedestalCam not found... aborting." << endl; 675 return kFALSE; 676 } 663 677 } 664 678 … … 674 688 if (fSgb) 675 689 fInnerNoise = fSgb->GetSigmabarInner(); 676 690 #ifdef DEBUG 691 *fLog << all << "CleanStep 1" << endl; 692 #endif 677 693 CleanStep1(); 694 #ifdef DEBUG 695 *fLog << all << "CleanStep 2" << endl; 696 #endif 678 697 CleanStep2(); 698 #ifdef DEBUG 699 *fLog << all << "CleanStep 3" << endl; 700 #endif 679 701 CleanStep3(); 702 #ifdef DEBUG 703 *fLog << all << "Done." << endl; 704 #endif 680 705 681 706 return kTRUE; -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r2209 r2237 10 10 class MCerPhotPix; 11 11 class MCerPhotEvt; 12 class MPedestalCam; 12 13 13 14 class MGGroupFrame; … … 22 23 23 24 private: 24 const MGeomCam *fCam; //! 25 MCerPhotEvt *fEvt; //! 26 MSigmabar *fSgb; //! 25 const MGeomCam *fCam; //! 26 MCerPhotEvt *fEvt; //! 27 MSigmabar *fSgb; //! 28 MPedestalCam *fPed; //! 27 29 28 30 CleaningMethod_t fCleaningMethod; -
trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc
r2207 r2237 84 84 fEmax = -1; 85 85 fSlope = 0; 86 fTotalNumSimulatedShowers = 0;87 fCorsikaVersion = 0;86 fTotalNumSimulatedShowers = 0; 87 fCorsikaVersion = 0; 88 88 fAllEvtsTriggered = kFALSE; 89 89
Note:
See TracChangeset
for help on using the changeset viewer.