Changeset 6855 for trunk/MagicSoft
- Timestamp:
- 03/18/05 17:21:58 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 deleted
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Makefile
r6604 r6855 20 20 # 21 21 #PROGRAMS = readraw merpp mars test mona status 22 PROGRAMS = readdaq merpp readraw sinope callisto star ganymed showlog showplot mars mona22 PROGRAMS = readdaq merpp readraw sinope callisto star ganymed showlog showplot mars 23 23 SOLIB = libmars.so 24 24 CINT = M -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r6848 r6855 4 4 #pragma link off all classes; 5 5 #pragma link off all functions; 6 7 #pragma link C++ class MCerPhotPix+;8 #pragma link C++ class MCerPhotEvt+;9 #pragma link C++ class MCerPhotEvtIter+;10 #pragma link C++ class MCerPhotAnal+;11 #pragma link C++ class MCerPhotAnal2+;12 #pragma link C++ class MCerPhotCalc+;13 6 14 7 #pragma link C++ class MCameraData+; … … 27 20 28 21 #pragma link C++ class MMatrixLoop+; 29 /* 30 #pragma link C++ class MSigmabar+; 31 #pragma link C++ class MSigmabarCalc+; 32 #pragma link C++ class MSigmabarParam+; 33 */ 22 34 23 #pragma link C++ class MEventRate+; 35 24 #pragma link C++ class MEventRateCalc+; … … 38 27 #pragma link C++ class MParameterD+; 39 28 #pragma link C++ class MParameterDerr+; 40 //#pragma link C++ class MParameters+;41 29 42 30 #pragma link C++ class MMcTriggerLvl2+; … … 49 37 #pragma link C++ class MFiltercutsCalc+; 50 38 51 //#pragma link C++ class MPad+;52 39 #pragma link C++ class MMcCalibrationUpdate+; 53 //#pragma link C++ class MMakePadHistograms+;54 40 55 41 #endif -
trunk/MagicSoft/Mars/manalysis/MCameraData.cc
r6569 r6855 45 45 #include "MPedPhotPix.h" 46 46 47 #include "M CerPhotEvt.h"48 #include "M CerPhotPix.h"47 #include "MSignalCam.h" 48 #include "MSignalPix.h" 49 49 50 50 #include "MSigmabar.h" 51 #include "MArrivalTime.h"52 51 53 52 ClassImp(MCameraData); … … 57 56 // -------------------------------------------------------------------------- 58 57 // 59 // Creates a M CerPhotPix object for each pixel in the event58 // Creates a MSignalPix object for each pixel in the event 60 59 // 61 60 MCameraData::MCameraData(const char *name, const char *title) … … 99 98 // FIXME: Should the check noise<=0 be replaced by MBadPixels? 100 99 // 101 void MCameraData::CalcCleaningLevel(const M CerPhotEvt&evt, const MPedPhotCam &cam,100 void MCameraData::CalcCleaningLevel(const MSignalCam &evt, const MPedPhotCam &cam, 102 101 const MGeomCam &geom) 103 102 { … … 114 113 115 114 // calculate cleaning levels 116 for (Int_t i=0; i<entries; i++) 117 { 118 const MCerPhotPix &pix = evt[i]; 119 120 const Int_t idx = pix.GetPixId(); 115 for (Int_t idx=0; idx<entries; idx++) 116 { 117 const MSignalPix &pix = evt[idx]; 118 121 119 const Float_t noise = cam[idx].GetRms(); 122 120 … … 145 143 // FIXME: Should the check noise<=0 be replaced by MBadPixels? 146 144 // 147 void MCameraData::CalcCleaningLevel2(const M CerPhotEvt&evt, const MPedPhotCam &cam,145 void MCameraData::CalcCleaningLevel2(const MSignalCam &evt, const MPedPhotCam &cam, 148 146 const MGeomCam &geom) 149 147 { … … 164 162 // calculate cleaning levels 165 163 const Int_t entries = evt.GetNumPixels(); 166 for (Int_t i=0; i<entries; i++) 167 { 168 const MCerPhotPix &pix = evt[i]; 169 170 const Int_t idx = pix.GetPixId(); 164 for (Int_t idx=0; idx<entries; idx++) 165 { 166 const MSignalPix &pix = evt[idx]; 167 171 168 const Float_t noise = cam[idx].GetRms(); 172 169 … … 189 186 190 187 191 void MCameraData::CalcCleaningLevel(const M CerPhotEvt&evt, const MSigmabar &sgb,188 void MCameraData::CalcCleaningLevel(const MSignalCam &evt, const MSigmabar &sgb, 192 189 const MGeomCam &geom) 193 190 { … … 195 192 } 196 193 197 void MCameraData::CalcCleaningLevel(const M CerPhotEvt&evt, Double_t noise,194 void MCameraData::CalcCleaningLevel(const MSignalCam &evt, Double_t noise, 198 195 const MGeomCam &geom) 199 196 { … … 213 210 // calculate cleaning levels 214 211 const Int_t entries = evt.GetNumPixels(); 215 for (Int_t i=0; i<entries; i++) 216 { 217 const MCerPhotPix &pix = evt[i]; 218 219 const Int_t idx = pix.GetPixId(); 212 for (Int_t idx=0; idx<entries; idx++) 213 { 214 const MSignalPix &pix = evt[idx]; 220 215 221 216 // … … 237 232 // FIXME: Should the check noise<=0 be replaced by MBadPixels? 238 233 // 239 void MCameraData::CalcCleaningLevelDemocratic(const M CerPhotEvt&evt, const MPedPhotCam &cam,234 void MCameraData::CalcCleaningLevelDemocratic(const MSignalCam &evt, const MPedPhotCam &cam, 240 235 const MGeomCam &geom) 241 236 { … … 256 251 // calculate cleaning levels 257 252 const Int_t entries = evt.GetNumPixels(); 258 for (Int_t i=0; i<entries; i++) 259 { 260 const MCerPhotPix &pix = evt[i]; 261 262 const Int_t idx = pix.GetPixId(); 253 for (Int_t idx=0; idx<entries; idx++) 254 { 255 const MSignalPix &pix = evt[idx]; 256 263 257 const Float_t noise = cam[idx].GetRms(); 264 258 … … 286 280 // FIXME: Should the check noise<=0 be replaced by MBadPixels? 287 281 // 288 void MCameraData::CalcCleaningProbability(const M CerPhotEvt&evt, const MPedPhotCam &pcam,289 const MGeomCam &geom , const MArrivalTime *tcam)282 void MCameraData::CalcCleaningProbability(const MSignalCam &evt, const MPedPhotCam &pcam, 283 const MGeomCam &geom) 290 284 { 291 285 const Int_t n = geom.GetNumPixels(); … … 307 301 // Find pixel with max signal 308 302 Int_t maxidx = 0; 309 if (tcam) 310 { 311 // Find pixel enty with maximum signal 312 for (Int_t i=0; i<entries; i++) 313 { 314 const Double_t s0 = evt[i].GetNumPhotons() * geom.GetPixRatio(i); 315 const Double_t s1 = evt[maxidx].GetNumPhotons() * geom.GetPixRatio(maxidx); 316 if (s0>s1) 317 maxidx = i; 318 } 319 320 // Get software index of pixel 321 maxidx = evt[maxidx].GetPixId(); 322 } 323 324 const Double_t timemean = tcam ? (*tcam)[maxidx] : 0; 303 304 // Find pixel entry with maximum signal 305 for (Int_t i=0; i<entries; i++) 306 { 307 const Double_t s0 = evt[i].GetNumPhotons() * geom.GetPixRatio(i); 308 const Double_t s1 = evt[maxidx].GetNumPhotons() * geom.GetPixRatio(maxidx); 309 if (s0>s1) 310 maxidx = i; 311 } 312 313 const Double_t timemean = evt[maxidx].GetArrivalTime(); 325 314 const Double_t timerms = 0.75; //[slices] rms time spread around highest pixel 326 315 327 316 // calculate cleaning levels 328 for (Int_t i=0; i<entries; i++) 329 { 330 const MCerPhotPix &spix = evt[i]; 331 332 const Int_t idx = spix.GetPixId(); 317 for (Int_t idx=0; idx<entries; idx++) 318 { 319 const MSignalPix &spix = evt[idx]; 320 333 321 const Float_t rms = pcam[idx].GetRms(); 334 322 if (rms<=0) // fData[idx]=0, fValidity[idx]=0 … … 342 330 343 331 const Double_t signal = spix.GetNumPhotons() * geom.GetPixRatio(idx) * ratio / rms; 344 const Double_t time = tcam ? (*tcam)[idx] : 1;332 const Double_t time = evt[idx].GetArrivalTime(); 345 333 346 334 // if signal<0 the probability is equal 0 … … 377 365 // The level is the absolute number of photons times the area-ratio. 378 366 // 379 void MCameraData::CalcCleaningAbsolute(const M CerPhotEvt&evt, const MGeomCam &geom)367 void MCameraData::CalcCleaningAbsolute(const MSignalCam &evt, const MGeomCam &geom) 380 368 { 381 369 const Int_t n = geom.GetNumPixels(); … … 391 379 392 380 // calculate cleaning levels 393 for (Int_t i=0; i<entries; i++) 394 { 395 const MCerPhotPix &spix = evt[i]; 396 397 const Int_t idx = spix.GetPixId(); 381 for (Int_t idx=0; idx<entries; idx++) 382 { 383 const MSignalPix &spix = evt[idx]; 398 384 399 385 // Set probability -
trunk/MagicSoft/Mars/manalysis/MCameraData.h
r6569 r6855 17 17 class MGeomCam; 18 18 class MSigmabar; 19 class M CerPhotEvt;19 class MSignalCam; 20 20 class MPedPhotCam; 21 class MArrivalTime;22 21 23 22 class MCameraData : public MParContainer, public MCamEvent … … 33 32 UInt_t GetNumPixels() const { return fData.GetSize(); } 34 33 35 void CalcCleaningLevel(const M CerPhotEvt&evt, const MPedPhotCam &fCam,34 void CalcCleaningLevel(const MSignalCam &evt, const MPedPhotCam &fCam, 36 35 const MGeomCam &geom); 37 void CalcCleaningLevel(const M CerPhotEvt&evt, const MSigmabar &sgb,36 void CalcCleaningLevel(const MSignalCam &evt, const MSigmabar &sgb, 38 37 const MGeomCam &geom); 39 void CalcCleaningLevel(const M CerPhotEvt&evt, Double_t noise,38 void CalcCleaningLevel(const MSignalCam &evt, Double_t noise, 40 39 const MGeomCam &geom); 41 void CalcCleaningLevel2(const M CerPhotEvt&evt, const MPedPhotCam &fCam,40 void CalcCleaningLevel2(const MSignalCam &evt, const MPedPhotCam &fCam, 42 41 const MGeomCam &geom); 43 void CalcCleaningLevelDemocratic(const M CerPhotEvt&evt, const MPedPhotCam &cam,42 void CalcCleaningLevelDemocratic(const MSignalCam &evt, const MPedPhotCam &cam, 44 43 const MGeomCam &geom); 45 void CalcCleaningProbability(const M CerPhotEvt&evt, const MPedPhotCam &pcam,46 const MGeomCam &geom , const MArrivalTime *tcam);47 void CalcCleaningAbsolute(const M CerPhotEvt&evt, const MGeomCam &geom);44 void CalcCleaningProbability(const MSignalCam &evt, const MPedPhotCam &pcam, 45 const MGeomCam &geom); 46 void CalcCleaningAbsolute(const MSignalCam &evt, const MGeomCam &geom); 48 47 49 48 const TArrayD &GetData() const { return fData; } -
trunk/MagicSoft/Mars/manalysis/MSupercutsCalc.cc
r3140 r6855 24 24 25 25 ///////////////////////////////////////////////////////////////////////////// 26 // // 27 // MSupercutsCalc // 28 // // 29 // this class calculates the hadronness for the supercuts // 30 // the parameters of the supercuts are taken // 31 // from the container MSupercuts // 32 // // 33 // // 26 // 27 // MSupercutsCalc 28 // 29 // this class calculates the hadronness for the supercuts 30 // the parameters of the supercuts are taken 31 // from the container MSupercuts 32 // 34 33 ///////////////////////////////////////////////////////////////////////////// 35 34 #include "MSupercutsCalc.h" … … 46 45 #include "MNewImagePar.h" 47 46 #include "MMcEvt.hxx" 48 #include "MCerPhotEvt.h"49 47 #include "MGeomCam.h" 50 48 #include "MHadronness.h" -
trunk/MagicSoft/Mars/manalysis/Makefile
r6848 r6855 36 36 MCompProbCalc.cc \ 37 37 MMultiDimDistCalc.cc \ 38 MCerPhotPix.cc \39 MCerPhotEvt.cc \40 MCerPhotAnal.cc \41 MCerPhotAnal2.cc \42 MCerPhotCalc.cc \43 38 MEventRate.cc \ 44 39 MEventRateCalc.cc \ -
trunk/MagicSoft/Mars/mars.cc
r2531 r6855 6 6 #include "MLogManip.h" 7 7 8 #include "M Mars.h"8 #include "MCameraDisplay.h" 9 9 #include "MArgs.h" 10 10 #include "MArray.h" … … 133 133 // start the main window 134 134 // 135 new M Mars;135 new MCameraDisplay; 136 136 137 137 // -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r6845 r6855 34 34 // This task takes the integrated charge from MExtractedSignal and applies 35 35 // the calibration constants from MCalibrationCam to convert the summed FADC 36 // slices into photons. The number of photons obtained is stored in M CerPhotEvt.36 // slices into photons. The number of photons obtained is stored in MSignalCam. 37 37 // Optionally, the calibration of pedestals from an MPedestalCam container into 38 38 // an MPedPhotCam container can be chosen with the member functions … … 89 89 // Output Containers: 90 90 // [MPedPhotCam] 91 // [M CerPhotEvt]91 // [MSignalCam] 92 92 // 93 93 // See also: MJCalibration, MJPedestal, MJExtractSignal, MJExtractCalibTest … … 129 129 #include "MBadPixelsPix.h" 130 130 131 #include "M CerPhotEvt.h"131 #include "MSignalCam.h" 132 132 133 133 ClassImp(MCalibrateData); … … 194 194 // 195 195 // - MPedPhotCam 196 // - M CerPhotEvt196 // - MSignalCam 197 197 // 198 198 Int_t MCalibrateData::PreProcess(MParList *pList) … … 218 218 } 219 219 220 fCerPhotEvt = (M CerPhotEvt*)pList->FindCreateObj(AddSerialNumber("MCerPhotEvt"));220 fCerPhotEvt = (MSignalCam*)pList->FindCreateObj(AddSerialNumber("MSignalCam")); 221 221 if (!fCerPhotEvt) 222 222 return kFALSE; … … 657 657 const Float_t sqrtslices = TMath::Sqrt(slices); 658 658 659 Int_t numsatlo=0; 660 Int_t numsathi=0; 661 659 662 for (UInt_t pixidx=0; pixidx<npix; pixidx++) 660 663 { … … 699 702 const Float_t nphotErr = TMath::Sqrt(TMath::Abs(nphot)) * fCalibFFactors[pixidx]; 700 703 701 MCerPhotPix *cpix =fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr);704 fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr); 702 705 703 706 if (sig.GetNumHiGainSaturated() > 0) 704 cpix->SetPixelHGSaturated();707 numsathi++; 705 708 706 709 if (sig.GetNumLoGainSaturated() > 0) 707 cpix->SetPixelSaturated();710 numsatlo++; 708 711 } /* if (data) */ 709 712 … … 735 738 if (data) 736 739 { 737 fCerPhotEvt-> FixSize();740 fCerPhotEvt->SetNumPixelsSaturated(numsathi, numsatlo); 738 741 fCerPhotEvt->SetReadyToSave(); 739 742 } -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
r6330 r6855 2 2 #define MARS_MCalibrateData 3 3 4 /////////////////////////////////////////////////////////////////////////////5 // //6 // MCalibrateData //7 // //8 // Integrates the desired ADC time slices of one pixel and apply //9 // calibration constants //10 // //11 // Differences between MCalibrateData and MCalibrate : //12 // in MCalibrateData //13 // - in ReInit the MPedPhot container is filled using //14 // - the pedstals/slice from MPedestalCam //15 // - the number of used FADC slices from MExtractedSignalCam //16 // - the photon/ADC conversion factor from MCalibrationCam //17 // //18 /////////////////////////////////////////////////////////////////////////////19 4 #ifndef MARS_MTask 20 5 #include "MTask.h" … … 33 18 34 19 class MPedPhotCam; 35 class M CerPhotEvt;20 class MSignalCam; 36 21 class MCalibConstCam; 22 37 23 class MCalibrateData : public MTask 38 24 { … … 50 36 MCalibrationQECam *fQEs; //! Quantum efficiencies 51 37 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts 52 M CerPhotEvt*fCerPhotEvt; //! Cerenkov Photon Event used for calculation38 MSignalCam *fCerPhotEvt; //! Cerenkov Photon Event used for calculation 53 39 MCalibConstCam *fCalibConstCam; //! Temporary calib consts storage 54 40 -
trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc
r6038 r6855 29 29 // This task takes the extracted arrival times from MArrivalTimeCam for each 30 30 // pixel and applies the offset calibrated in MCalibrationRelTimeCam 31 // The calibrated arrival time and its error gets stored in M CerPhotEvt.31 // The calibrated arrival time and its error gets stored in MSignalCam. 32 32 // 33 33 // Input Containers: … … 36 36 // 37 37 // Output Containers: 38 // M ArrivalTime38 // MSignalCam 39 39 // 40 40 ////////////////////////////////////////////////////////////////////////////// … … 58 58 #include "MBadPixelsPix.h" 59 59 60 #include "MArrivalTime.h" 60 #include "MSignalCam.h" 61 #include "MSignalPix.h" 61 62 62 63 ClassImp(MCalibrateRelTimes); … … 112 113 113 114 114 fArrivalTime = (M ArrivalTime*)pList->FindCreateObj(AddSerialNumber("MArrivalTime"));115 fArrivalTime = (MSignalCam*)pList->FindCreateObj(AddSerialNumber("MSignalCam")); 115 116 if (!fArrivalTime) 116 {117 *fLog << err << AddSerialNumber("MArrivalTime") << ": Cannot create ... aborting." << endl;118 117 return kFALSE; 119 }120 118 121 119 return kTRUE; 122 120 } 123 121 124 // --------------------------------------------------------------------------125 //126 // Check for validity of the selected calibration method, switch to a127 // different one in case of need128 //129 Bool_t MCalibrateRelTimes::ReInit(MParList *pList)130 {131 return kTRUE;132 }133 122 // -------------------------------------------------------------------------- 134 123 // … … 142 131 { 143 132 // FIXME: MArrivalTime must be of variable size - 144 // like M CerPhotEvt- because we must be able133 // like MSignalCam - because we must be able 145 134 // to reduce size by zero supression 146 135 // For the moment this check could be done in ReInit... … … 172 161 const Float_t time = signal - offset; 173 162 174 fArrivalTime->SetTime(pixidx,time);163 (*fArrivalTime)[pixidx].SetArrivalTime(time); 175 164 176 165 } /* for (UInt_t pixidx=0; pixidx<npix; pixidx++) */ -
trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.h
r3752 r6855 18 18 class MCalibrationRelTimeCam; 19 19 class MArrivalTimeCam; 20 class MArrivalTime; 20 class MSignalCam; 21 21 22 class MCalibrateRelTimes : public MTask 22 23 { … … 26 27 MBadPixelsCam *fBadPixels; // Bad Pixels information 27 28 MArrivalTimeCam *fSignals; // Extracted Arrival Time 28 M ArrivalTime*fArrivalTime; // Calibrated arrival times29 MSignalCam *fArrivalTime; // Calibrated arrival times 29 30 30 31 Int_t PreProcess(MParList *pList); 31 Bool_t ReInit(MParList *pList);32 32 Int_t Process(); 33 33 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r6828 r6855 489 489 fBlindCam = (MCalibrationBlindCam*)pList->FindObject(AddSerialNumber("MCalibrationBlindCam")); 490 490 if (!fBlindCam) 491 { 492 *fLog << endl; 493 *fLog << warn << GetDescriptor() 494 << ": No MCalibrationBlindCam found... no Blind Pixel method! " << endl; 495 } 491 *fLog << warn << GetDescriptor() 492 << ": No MCalibrationBlindCam found... no Blind Pixel method! " << endl; 496 493 } 497 494 498 495 fHBlindCam = (MHCalibrationChargeBlindCam*)pList->FindObject(AddSerialNumber("MHCalibrationChargeBlindCam")); 499 496 if (!fHBlindCam) 500 { 501 *fLog << endl; 502 *fLog << warn << GetDescriptor() 503 << ": No MHCalibrationChargeBlindCam found... no Blind Pixel method! " << endl; 504 } 497 *fLog << warn << GetDescriptor() 498 << ": No MHCalibrationChargeBlindCam found... no Blind Pixel method! " << endl; 505 499 506 500 fIntensBad = (MBadPixelsIntensityCam*)pList->FindObject(AddSerialNumber("MBadPixelsIntensityCam")); … … 522 516 fPINDiode = (MCalibrationChargePINDiode*)pList->FindObject("MCalibrationChargePINDiode"); 523 517 if (!fPINDiode) 524 { 525 *fLog << endl; 526 *fLog << warn << GetDescriptor() 527 << ": MCalibrationChargePINDiode not found... no PIN Diode method! " << endl; 528 } 518 *fLog << warn << GetDescriptor() 519 << ": No MCalibrationChargePINDiode found... no PIN Diode method! " << endl; 529 520 530 521 MCalibrationQECam *qecam = fIntensQE … … 1865 1856 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam; 1866 1857 1858 if (!blindcam) 1859 return; 1860 1867 1861 // 1868 1862 // Set the results in the MCalibrationChargeCam … … 1956 1950 MBadPixelsCam *badcam = fIntensBad 1957 1951 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 1952 1953 if (!fPINDiode) 1954 return; 1955 1958 1956 // 1959 1957 // With the knowledge of the overall photon flux, calculate the -
trunk/MagicSoft/Mars/mhft/MGeomCamMagicEnhance.cc
r5691 r6855 163 163 164 164 // Copy result into output MCerPhotEvt 165 fEvtOut-> Reset();165 fEvtOut->InitSize(res.GetSize()); 166 166 167 167 for (UInt_t i=0; i<res.GetSize(); i++) 168 168 fEvtOut->AddPixel(i, res[i], 0); 169 169 170 fEvtOut->FixSize();170 //fEvtOut->FixSize(); 171 171 fEvtOut->SetReadyToSave(); 172 172 -
trunk/MagicSoft/Mars/mhft/MHexagonalFTCalc.cc
r5691 r6855 172 172 fOffset.Reset(); 173 173 174 fMap.Set(lim);175 for (int i=0; i<lim; i++)176 fMap[i]=-1;174 //fMap.Set(lim); 175 //for (int i=0; i<lim; i++) 176 // fMap[i]=-1; 177 177 178 178 const Double_t dx = (*geom)[2].GetX(); // -(*geom)[0].GetX() … … 190 190 if ((*geom)[idx].GetAidx()==0) 191 191 { 192 fMap[idx] = i;192 //fMap[idx] = i; 193 193 fOffset[i] = 1; 194 194 } … … 254 254 MArrayD re(lim); 255 255 256 MCerPhotPix *pix=0; 257 258 MCerPhotEvtIter Next(fEvtIn, kFALSE); 259 256 // MCerPhotPix *pix=0; 257 // MCerPhotEvtIter Next(fEvtIn, kFALSE); 258 // while ((pix = (MCerPhotPix*)Next())) 260 259 // Copy data from MCerPhotEvt into array 261 while ((pix = (MCerPhotPix*)Next())) 262 { 263 const Int_t idx = pix->GetPixId(); 264 if (fMap[idx]>=0) 265 re[fMap[idx]] = pix->GetNumPhotons(); 260 const UInt_t npix = fEvtIn->GetNumPixels(); 261 for (UInt_t idx=0; idx<npix; idx++) 262 { 263 //const Int_t idx = pix->GetPixId(); 264 //if (fMap[idx]>=0) 265 re[idx] = (*fEvtIn)[idx].GetNumPhotons(); 266 266 } 267 267 … … 307 307 return kTRUE; 308 308 309 fEvtOut-> Reset();309 fEvtOut->InitSize(lim); // necessary? 310 310 for (int i=0; i<lim; i++) 311 311 { 312 const Int_t map = fMap[i];313 if (map>=0)314 fEvtOut->AddPixel(i, out[map]);315 } 316 fEvtOut->FixSize();312 //const Int_t map = fMap[i]; 313 //if (map>=0) 314 fEvtOut->AddPixel(i, out[i]); 315 } 316 //fEvtOut->FixSize(); 317 317 fEvtOut->SetReadyToSave(); 318 318 -
trunk/MagicSoft/Mars/mhist/HistLinkDef.h
r5068 r6855 18 18 #pragma link C++ class MHAlphaEnergyTheta+; 19 19 #pragma link C++ class MHGamma+; 20 #pragma link C++ class MHSigmaTheta;20 //#pragma link C++ class MHSigmaTheta; 21 21 #pragma link C++ class MHThetabarTime+; 22 22 #pragma link C++ class MHThetabarTheta+; -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r6513 r6855 33 33 // ===== 34 34 // 35 // To plot sqrt(variance) instead of the rms use:36 // MHCamEvent::SetBit(MHCamera::kSqrtVariance);37 // or38 // MHCamEvent::EnableSqrtVariance()39 //40 35 // To count how often a certain pixel is above or below a threshold do: 41 36 // MHCamEvent::SetThreshold(5.5); // Default=LowerBound … … 121 116 if (fSum) 122 117 delete fSum; 123 }124 125 // --------------------------------------------------------------------------126 //127 // use this to display the variance instead of the rms.128 //129 void MHCamEvent::EnableSqrtVariance(Bool_t b)130 {131 b ? SetBit(MHCamera::kSqrtVariance) : ResetBit(MHCamera::kSqrtVariance);132 118 } 133 119 … … 173 159 fSum->SetYTitle("a.u."); 174 160 fSum->SetBit(MHCamera::kProfile); 175 if (TestBit(MHCamera::kSqrtVariance))176 fSum->SetBit(MHCamera::kSqrtVariance);177 161 178 162 fSum->SetXTitle("Pixel Idx"); … … 261 245 { 262 246 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 247 const Int_t col = pad->GetFillColor(); 263 248 pad->SetBorderMode(0); 264 249 265 250 AppendPad(); 266 251 267 TString name = Form("%s_5", pad->GetName()); 268 TPad *p = new TPad(name,name,6./8,0.25,0.99,0.5,pad->GetFillColor(),0,0); 269 p->SetNumber(5); 270 p->Draw(); 271 272 name = Form("%s_6", pad->GetName()); 273 p = new TPad(name,name,6./8,0.01,0.99,0.25,pad->GetFillColor(),0,0); 274 p->SetNumber(6); 275 p->Draw(); 276 277 pad->Divide(2,2); 278 279 pad->cd(1); 280 gPad->SetBorderMode(0); 281 gPad->SetPad(0.01, 0.5, 0.66, 0.99); 252 TString name = Form("%s_1", pad->GetName()); 253 TPad *p = new TPad(name,name,0.005, 0.5, 0.66, 0.995,col,0,0); 254 p->SetNumber(1); 255 p->Draw(); 256 p->cd(); 282 257 fSum->Draw("EPhist"); 283 258 284 pad->cd(2); 285 gPad->SetBorderMode(0); 286 gPad->SetPad(0.66, 0.5, 0.99, 0.99); 259 pad->cd(); 260 name = Form("%s_2", pad->GetName()); 261 p = new TPad(name,name,0.66, 0.5, 0.995, 0.995,col,0,0); 262 p->SetNumber(2); 263 p->Draw(); 264 p->cd(); 287 265 TH1 *h = fSum->Projection(Form("%s;proj", fName.Data()), 50); 288 266 h->SetTitle("Projection"); … … 290 268 h->Draw(); 291 269 292 pad->cd(3); 293 gPad->SetPad(0.01, 0.01, 3./8, 0.5); 294 gPad->SetBorderMode(0); 270 pad->cd(); 271 name = Form("%s_3", pad->GetName()); 272 p = new TPad(name,name,0.005, 0.005, 3./8, 0.5,col,0,0); 273 p->SetNumber(3); 274 p->Draw(); 275 p->cd(); 295 276 fSum->Draw(); 296 277 297 pad->cd(4); 298 gPad->SetPad(3./8, 0.01, 6./8, 0.5); 299 gPad->SetBorderMode(0); 278 pad->cd(); 279 name = Form("%s_4", pad->GetName()); 280 p = new TPad(name,name,3./8, 0.005, 6./8-0.005, 0.5,col,0,0); 281 p->SetNumber(4); 282 p->Draw(); 283 p->cd(); 300 284 301 285 MHCamera *cam = new MHCamera(*fSum->GetGeometry()); 302 286 cam->SetName(Form("%s;err", fName.Data())); 303 cam->SetTitle( fSum->TestBit(MHCamera::kSqrtVariance)?"Sqrt(Variance)":"Root Mean Squared (rms)");287 cam->SetTitle("Sqrt(Variance)"); 304 288 cam->SetYTitle(fSum->GetYaxis()->GetTitle()); 305 289 cam->SetCamContent(*fSum, 1); … … 307 291 cam->Draw(); 308 292 309 pad->cd(5); 293 pad->cd(); 294 name = Form("%s_5", pad->GetName()); 295 p = new TPad(name,name,6./8,0.25,0.995,0.5,col,0,0); 296 p->SetNumber(5); 297 p->Draw(); 298 p->cd(); 310 299 h = (TH1*)fSum->RadialProfile(Form("%s;rad", fName.Data()), 20); 311 300 h->SetTitle("Radial Profile"); … … 313 302 h->Draw(); 314 303 315 pad->cd(6); 304 pad->cd(); 305 name = Form("%s_6", pad->GetName()); 306 p = new TPad(name,name,6./8,0.005,0.995,0.25,col,0,0); 307 p->SetNumber(6); 308 p->Draw(); 309 p->cd(); 316 310 h = (TH1*)fSum->AzimuthProfile(Form("%s;az", fName.Data()), 30); 317 311 h->SetTitle("Azimuth Profile"); -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r6276 r6855 15 15 static const TString gsDefTitle; 16 16 17 protected: 17 18 MHCamera *fSum; // storing the sum 18 19 MCamEvent *fEvt; //! the current event … … 50 51 51 52 void SetThreshold(Float_t f, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; } 52 void EnableSqrtVariance(Bool_t b=kTRUE);53 53 54 54 ClassDef(MHCamEvent, 1) // Histogram to sum camera events -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r6457 r6855 164 164 fUsed.Set(geom.GetNumPixels()); 165 165 for (Int_t i=0; i<fNcells-2; i++) 166 ResetUsed(i); 166 ResetUsed(i); 167 168 fBinEntries.Set(geom.GetNumPixels()+2); 169 fBinEntries.Reset(); 167 170 } 168 171 … … 213 216 const Int_t bin = (Int_t)x+1; 214 217 AddBinContent(bin); 218 fBinEntries[bin]++; 215 219 if (fSumw2.fN) 216 220 fSumw2.fArray[bin]++; … … 249 253 const Int_t bin = (Int_t)x+1; 250 254 AddBinContent(bin, w); 255 fBinEntries[bin]++; 251 256 if (fSumw2.fN) 252 257 fSumw2.fArray[bin] += w*w; … … 319 324 if ((all || IsUsed(i)) && MatchSector(i, sector, aidx)) 320 325 { 321 mean += fArray[i+1]; 326 if (TestBit(kProfile) && fBinEntries[i+1]==0) 327 continue; 328 329 mean += TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1]; 322 330 n++; 323 331 } 324 332 } 325 333 326 return n==0 ? 0 : Profile(mean/n);334 return n==0 ? 0 : mean/n; 327 335 } 328 336 … … 346 354 if ((all || IsUsed(i)) && MatchSector(i, sector, aidx)) 347 355 { 348 sum += fArray[i+1]; 349 sq += fArray[i+1]*fArray[i+1]; 356 if (TestBit(kProfile) && fBinEntries[i+1]==0) 357 continue; 358 359 const Double_t val = TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1]; 360 361 sum += val; 362 sq += val*val; 350 363 n++; 351 364 } … … 358 371 sq /= n; 359 372 360 return Profile(TMath::Sqrt(sq-sum*sum));373 return TMath::Sqrt(sq-sum*sum); 361 374 } 362 375 … … 377 390 Double_t minimum=FLT_MAX; 378 391 379 for (Int_t idx=0; idx<fNcells-2; idx++) 380 if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]<minimum) 381 minimum = fArray[idx+1]; 382 383 return Profile(minimum); 392 for (Int_t i=0; i<fNcells-2; i++) 393 { 394 if (TestBit(kProfile) && fBinEntries[i+1]==0) 395 continue; 396 397 const Double_t val = TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1]; 398 if (MatchSector(i, sector, aidx) && (all || IsUsed(i)) && val<minimum) 399 minimum = val; 400 } 401 402 return minimum; 384 403 } 385 404 … … 399 418 400 419 Double_t maximum=-FLT_MAX; 401 for (Int_t idx=0; idx<fNcells-2; idx++) 402 if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]>maximum) 403 maximum = fArray[idx+1]; 404 405 return Profile(maximum); 420 for (Int_t i=0; i<fNcells-2; i++) 421 { 422 if (TestBit(kProfile) && fBinEntries[i+1]==0) 423 continue; 424 425 const Double_t val = TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1]; 426 if (MatchSector(i, sector, aidx) && (all || IsUsed(i)) && val>maximum) 427 maximum = val; 428 } 429 430 return maximum; 406 431 } 407 432 … … 458 483 // resized in paint to keep the correct aspect ratio 459 484 // 460 pad->Divide(1, 1, 0, 0, col); 485 // The margin != 0 is a workaround for a problem in root 4.02/00 486 pad->Divide(1, 1, 1e-10, 1e-10, col); 461 487 pad->cd(1); 462 488 gPad->SetBorderMode(0); … … 1125 1151 Double_t val=0; 1126 1152 if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/) 1153 { 1127 1154 SetUsed(idx); 1128 1129 Fill(idx, val); // FIXME: Slow!1155 Fill(idx, val); // FIXME: Slow! 1156 } 1130 1157 } 1131 1158 fEntries++; … … 1153 1180 } 1154 1181 1182 Stat_t MHCamera::GetBinContent(Int_t bin) const 1183 { 1184 if (fBuffer) ((TProfile*)this)->BufferEmpty(); 1185 if (bin < 0) bin = 0; 1186 if (bin >= fNcells) bin = fNcells-1; 1187 if (!fArray) return 0; 1188 1189 if (!TestBit(kProfile)) 1190 return Stat_t (fArray[bin]); 1191 1192 if (fBinEntries.fArray[bin] == 0) return 0; 1193 return fArray[bin]/fBinEntries.fArray[bin]; 1194 } 1195 1155 1196 Stat_t MHCamera::GetBinError(Int_t bin) const 1156 1197 { 1198 if (!TestBit(kProfile)) 1199 return TH1D::GetBinError(bin); 1200 1201 const UInt_t n = (UInt_t)fBinEntries[bin]; 1202 1203 if (n==0) 1204 return 0; 1205 1206 const Double_t sqr = fSumw2.fArray[bin] / n; 1207 const Double_t val = fArray[bin] / n; 1208 1209 return sqr>val*val ? TMath::Sqrt(sqr - val*val) / n : 0; 1210 1211 /* 1157 1212 Double_t rc = 0; 1158 1213 if (TestBit(kSqrtVariance) && GetEntries()>0) // error on the mean … … 1165 1220 rc = TH1D::GetBinError(bin); 1166 1221 1167 return Profile(rc); 1222 return Profile(rc);*/ 1168 1223 } 1169 1224 … … 1266 1321 { 1267 1322 Double_t val=threshold; 1268 if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/) 1323 const Bool_t rc = event.GetPixelContent(val, idx, *fGeomCam, type); 1324 if (rc) 1325 SetUsed(idx); 1326 1327 const Bool_t cond = 1328 ( isabove && val>threshold) || 1329 (!isabove && val<threshold); 1330 1331 Fill(idx, rc && cond ? 1 : 0); 1332 } 1333 fEntries++; 1334 } 1335 1336 // ------------------------------------------------------------------------ 1337 // 1338 // Call this function to add a MCamEvent on top of the present contents. 1339 // - the contents of the pixels in event are added to each pixel 1340 // if the pixel of thresevt<threshold (in case isabove is set 1341 // to kTRUE == default) 1342 // - the contents of the pixels in event are added to each pixel 1343 // if the pixel of thresevt<threshold (in case isabove is set 1344 // to kFALSE) 1345 // 1346 // in unused pixel is not counted if it didn't fullfill the condition. 1347 // 1348 void MHCamera::CntCamContent(const MCamEvent &event, Int_t type1, const MCamEvent &thresevt, Int_t type2, Double_t threshold, Bool_t isabove) 1349 { 1350 if (fNcells<=1 || IsFreezed()) 1351 return; 1352 1353 // FIXME: Security check missing! 1354 for (Int_t idx=0; idx<fNcells-2; idx++) 1355 { 1356 Double_t th=0; 1357 if (!thresevt.GetPixelContent(th, idx, *fGeomCam, type2)) 1358 continue; 1359 1360 if ((isabove && th>threshold) || (!isabove && th<threshold)) 1361 continue; 1362 1363 Double_t val=th; 1364 if (event.GetPixelContent(val, idx, *fGeomCam, type1)) 1269 1365 { 1270 1366 SetUsed(idx); 1271 1272 if (isabove && val>threshold) 1273 Fill(idx); 1274 if (!isabove && val<threshold) 1275 Fill(idx); 1367 Fill(idx, val); 1276 1368 } 1277 1369 } … … 1672 1764 return; 1673 1765 1674 gLog << all << GetTitle() << " <" << GetName() << ">" << endl;1766 gLog << all << GetTitle() << " <" << GetName() << ">" << dec << endl; 1675 1767 gLog << "Software Pixel Idx: " << idx << endl; 1676 1768 gLog << "Hardware Pixel Id: " << idx+1 << endl; … … 1678 1770 if (GetBinError(idx+1)>0) 1679 1771 gLog << " +/- " << GetBinError(idx+1); 1680 gLog << " <" << (IsUsed(idx)?"on":"off") << "> "<< endl;1772 gLog << " <" << (IsUsed(idx)?"on":"off") << "> n=" << fBinEntries[idx+1] << endl; 1681 1773 1682 1774 if (fNotify && fNotify->GetSize()>0) -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r6276 r6855 10 10 #ifndef ROOT_TArrayI 11 11 #include <TArrayI.h> 12 #endif13 #ifndef ROOT_TArrayD14 #include <TArrayD.h>15 12 #endif 16 13 #ifndef ROOT_MArrayD … … 40 37 public: 41 38 enum { 42 kProfile = BIT(18), // FIXME: When changing change max/min! 43 kFreezed = BIT(19), 44 kNoLegend = BIT(20), 45 kSqrtVariance = BIT(21) 39 kProfile = BIT(18), // FIXME: When changing change max/min! 40 kFreezed = BIT(19), 41 kNoLegend = BIT(20)/*, 42 kSqrtVariance = BIT(21), 43 kSinglePixelProfile = BIT(22)*/ 46 44 }; 47 45 private: 48 46 MGeomCam *fGeomCam; // pointer to camera geometry (y-axis) 49 47 TArrayC fUsed; // array containing flags 48 TArrayI fBinEntries; // number of entries per bin 50 49 51 50 TArrayI fColors; //! Color conversion table … … 59 58 60 59 void Init(); 61 60 /* 62 61 Stat_t Profile(Stat_t val) const 63 62 { … … 68 67 return n>0 ? val/n : val; 69 68 } 70 69 */ 71 70 Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog); 72 71 … … 162 161 virtual void CntCamContent(const MCamEvent &evt, TArrayD threshold, Int_t type=0, Bool_t isabove=kTRUE); 163 162 virtual void CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE); 164 165 Stat_t GetBinContent(Int_t bin) const { return Profile(TH1D::GetBinContent(bin)); } 163 virtual void CntCamContent(const MCamEvent &event, Int_t type1, const MCamEvent &thresevt, Int_t type2, Double_t threshold, Bool_t isabove); 164 165 Stat_t GetBinContent(Int_t bin) const; 166 166 Stat_t GetBinContent(Int_t binx, Int_t biny) const { return GetBinContent(binx); } 167 167 Stat_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const { return GetBinContent(binx); } -
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r6569 r6855 59 59 #include "MTaskList.h" 60 60 #include "MParList.h" 61 #include "M CerPhotEvt.h"61 #include "MSignalCam.h" 62 62 #include "MRawEvtHeader.h" 63 63 #include "MRawRunHeader.h" … … 239 239 break; 240 240 case kEvtArrTime: 241 fHist->SetCamContent(*event, 0);241 fHist->SetCamContent(*event, 6); 242 242 break; 243 243 case kEvtTrigPix: -
trunk/MagicSoft/Mars/mhist/MHEvent.h
r5807 r6855 13 13 class MMcEvt; 14 14 class MMcTrig; 15 class M CerPhotEvt;15 class MSignalCam; 16 16 class MImgCleanStd; 17 17 … … 34 34 MMcEvt *fMcEvt; //! 35 35 MMcTrig *fMcTrig; //! 36 M CerPhotEvt*fCerPhotEvt; //!36 MSignalCam *fCerPhotEvt; //! 37 37 MImgCleanStd *fImgCleanStd; //! 38 38 -
trunk/MagicSoft/Mars/mhist/Makefile
r5676 r6855 40 40 MHThetabarTheta.cc \ 41 41 MHGamma.cc \ 42 MHSigmaTheta.cc \43 42 MHSigmaPixel.cc \ 44 43 MHSigmabarTheta.cc \ -
trunk/MagicSoft/Mars/mimage/ImageLinkDef.h
r6848 r6855 10 10 #pragma link C++ class MHillas+; 11 11 #pragma link C++ class MHillasSrc+; 12 #pragma link C++ class MHillasSrcCalc+;13 12 #pragma link C++ class MHillasExt+; 14 13 #pragma link C++ class MHillasCalc+; -
trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc
r4512 r6855 41 41 #include "MGeomPix.h" 42 42 #include "MGeomCam.h" 43 #include "M CerPhotPix.h"44 #include "M CerPhotEvt.h"43 #include "MSignalPix.h" 44 #include "MSignalCam.h" 45 45 46 46 ClassImp(MCameraSmooth); … … 62 62 // -------------------------------------------------------------------------- 63 63 // 64 // - get the M CerPhotEvtfrom the parlist (abort if missing)64 // - get the MSignalCam from the parlist (abort if missing) 65 65 // - get MGeomCam from the parameter list 66 66 // 67 67 Int_t MCameraSmooth::PreProcess (MParList *pList) 68 68 { 69 fEvt = (M CerPhotEvt*)pList->FindObject("MCerPhotEvt");69 fEvt = (MSignalCam*)pList->FindObject("MSignalCam"); 70 70 if (!fEvt) 71 71 { 72 *fLog << err << dbginf << "M CerPhotEvtnot found... aborting." << endl;72 *fLog << err << dbginf << "MSignalCam not found... aborting." << endl; 73 73 return kFALSE; 74 74 } … … 104 104 for (UShort_t i=0; i<entries; i++) 105 105 { 106 M CerPhotPix &pix = (*fEvt)[i];106 MSignalPix &pix = (*fEvt)[i]; 107 107 108 const Int_t id = pix.GetPixId();108 //const Int_t id = pix.GetPixId(); 109 109 110 const MGeomPix &gpix = (*fGeomCam)[i d];110 const MGeomPix &gpix = (*fGeomCam)[i]; 111 111 112 112 const Int_t n = gpix.GetNumNeighbors(); … … 120 120 const UShort_t nid = gpix.GetNeighbor(j); 121 121 122 const M CerPhotPix *evtpix = fEvt->GetPixById(nid);122 const MSignalPix *evtpix = fEvt->GetPixById(nid); 123 123 if (evtpix) 124 124 { -
trunk/MagicSoft/Mars/mimage/MCameraSmooth.h
r4512 r6855 11 11 12 12 class MGeomCam; 13 class M CerPhotEvt;13 class MSignalCam; 14 14 15 15 class MCameraSmooth : public MTask 16 16 { 17 17 private: 18 M CerPhotEvt*fEvt; //! Pointer to data to smooth19 MGeomCam 18 MSignalCam *fEvt; //! Pointer to data to smooth 19 MGeomCam *fGeomCam; //! Camera geometry 20 20 21 21 Byte_t fCounts; // number of smoothing loops -
trunk/MagicSoft/Mars/mimage/MConcentration.cc
r5142 r6855 50 50 #include "MGeomCam.h" 51 51 52 #include "M CerPhotPix.h"53 #include "M CerPhotEvt.h"52 #include "MSignalPix.h" 53 #include "MSignalCam.h" 54 54 55 55 #include "MLog.h" … … 106 106 // Nothing. 107 107 // 108 Int_t MConcentration::Calc(const MGeomCam &geom, const M CerPhotEvt&evt, const MHillas &hillas)108 Int_t MConcentration::Calc(const MGeomCam &geom, const MSignalCam &evt, const MHillas &hillas) 109 109 { 110 110 Float_t maxpix[9] = {0,0,0,0,0,0,0,0,0}; // [#phot] 111 111 112 TIter Next(evt); 113 MCerPhotPix *pix = 0; 114 while ((pix=(MCerPhotPix*)Next())) 115 { 116 const Int_t pixid = pix->GetPixId(); 117 const Double_t nphot = pix->GetNumPhotons()* geom.GetPixRatio(pixid); 112 const UInt_t npix = evt.GetNumPixels(); 113 for (UInt_t i=0; i<npix; i++) 114 { 115 const MSignalPix &pix = evt[i]; 116 if (!pix.IsPixelUsed()) 117 continue; 118 119 const Double_t nphot = pix.GetNumPhotons()* geom.GetPixRatio(i); 118 120 119 121 // Get number of photons in the 8 most populated pixels -
trunk/MagicSoft/Mars/mimage/MConcentration.h
r4710 r6855 8 8 class MHillas; 9 9 class MGeomCam; 10 class M CerPhotEvt;10 class MSignalCam; 11 11 12 12 class MConcentration : public MParContainer … … 20 20 void Reset(); 21 21 22 Int_t Calc(const MGeomCam &geom, const M CerPhotEvt&pix, const MHillas &hil);22 Int_t Calc(const MGeomCam &geom, const MSignalCam &pix, const MHillas &hil); 23 23 24 24 void Print(Option_t *opt=NULL) const; -
trunk/MagicSoft/Mars/mimage/MHillas.cc
r6292 r6855 69 69 #include "MGeomCam.h" 70 70 71 #include "M CerPhotPix.h"72 #include "M CerPhotEvt.h"71 #include "MSignalPix.h" 72 #include "MSignalCam.h" 73 73 74 74 #include "MLog.h" … … 203 203 // Returns: 204 204 // 0 no error 205 // 1 number of pixels < 3205 // 1 number of pixels in event == 0 (special MC events) 206 206 // 2 size==0 207 207 // 3 number of used pixel < 3 208 208 // 4 CorrXY == 0 209 209 // 210 Int_t MHillas::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, Int_t island) 211 { 212 // 213 // sanity check 1 214 // 215 if (evt.GetNumPixels()<3) 210 Int_t MHillas::Calc(const MGeomCam &geom, const MSignalCam &evt, Int_t island) 211 { 212 const UInt_t numpix = evt.GetNumPixels(); 213 214 // 215 // sanity check 1 (special MC events) 216 // 217 if (numpix==0) 216 218 return 1; 217 219 … … 229 231 fSize = 0; 230 232 231 MCerPhotPix *pix = 0; 233 UInt_t numused = 0; 234 /* 235 MSignalPix *pix = 0; 232 236 233 237 TIter Next(evt); 234 UInt_t numused = 0;235 while ((pix=(MCerPhotPix*)Next()))238 while ((pix=(MSignalPix*)Next()))*/ 239 for (UInt_t i=0; i<numpix; i++) 236 240 { 237 if (island>=0 && pix->GetIdxIsland()!=island) 241 MSignalPix &pix = evt[i]; 242 if (!pix.IsPixelUsed()) 238 243 continue; 239 244 240 const MGeomPix &gpix = geom[pix->GetPixId()]; 241 242 const Float_t nphot = pix->GetNumPhotons(); 245 if (island>=0 && pix.GetIdxIsland()!=island) 246 continue; 247 248 const MGeomPix &gpix = geom[i/*pix->GetPixId()*/]; 249 250 const Float_t nphot = pix.GetNumPhotons(); 243 251 244 252 fSize += nphot; // [counter] … … 277 285 Double_t corryy=0; // [m^2] 278 286 279 Next.Reset(); 280 while ((pix=(MCerPhotPix*)Next())) 287 //Next.Reset(); 288 //while ((pix=(MSignalPix*)Next())) 289 //{ 290 for (UInt_t i=0; i<numpix; i++) 281 291 { 282 if (island>=0 && pix->GetIdxIsland()!=island) 292 MSignalPix &pix = evt[i]; 293 if (!pix.IsPixelUsed()) 283 294 continue; 284 295 285 const MGeomPix &gpix = geom[pix->GetPixId()]; 296 if (island>=0 && pix.GetIdxIsland()!=island) 297 continue; 298 299 const MGeomPix &gpix = geom[i/*pix->GetPixId()*/]; 286 300 287 301 const Float_t dx = gpix.GetX() - fMeanX; // [mm] 288 302 const Float_t dy = gpix.GetY() - fMeanY; // [mm] 289 303 290 const Float_t nphot = pix ->GetNumPhotons();// [#phot]304 const Float_t nphot = pix.GetNumPhotons(); // [#phot] 291 305 292 306 corrxx += nphot * dx*dx; // [mm^2] -
trunk/MagicSoft/Mars/mimage/MHillas.h
r6350 r6855 10 10 11 11 class MGeomCam; 12 class M CerPhotEvt;12 class MSignalCam; 13 13 14 14 class MHillas : public MParContainer … … 31 31 void Reset(); 32 32 33 Int_t Calc(const MGeomCam &geom, const M CerPhotEvt&pix, Int_t island=-1);33 Int_t Calc(const MGeomCam &geom, const MSignalCam &pix, Int_t island=-1); 34 34 35 35 void Print(const MGeomCam &geom) const; -
trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
r5352 r6855 117 117 // 118 118 // 1) MGeomCam 5) MHillas 8) MImagePar 119 // 2) M CerPhotEvt6) MHillasSrc 9) MNewImagePar119 // 2) MSignalCam 6) MHillasSrc 9) MNewImagePar 120 120 // 3) MSrcPosCam 7) MHillasExt 10) MConcentration 121 121 // 4) fIdxIslands … … 138 138 #include "MParList.h" 139 139 140 #include "M CerPhotEvt.h"140 #include "MSignalCam.h" 141 141 142 142 #include "MHillas.h" … … 189 189 if (TestFlags(~kCalcHillasSrc)) 190 190 { 191 fCerPhotEvt = (M CerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));191 fCerPhotEvt = (MSignalCam*)pList->FindObject(AddSerialNumber("MSignalCam")); 192 192 if (!fCerPhotEvt) 193 193 { 194 *fLog << err << "M CerPhotEvtnot found... aborting." << endl;194 *fLog << err << "MSignalCam not found... aborting." << endl; 195 195 return kFALSE; 196 196 } … … 355 355 if (TestFlag(kCalcHillas)) 356 356 { 357 PrintSkipped(fErrors[1], " Less than 3 pixels (before cleaning)");357 PrintSkipped(fErrors[1], "0-Pixel Event (before cleaning, MC event?)"); 358 358 PrintSkipped(fErrors[2], "Calculated Size == 0 (after cleaning)"); 359 359 PrintSkipped(fErrors[3], "Number of used pixels < 3"); … … 379 379 *fLog << inf << GetDescriptor() << " calculating:" << endl; 380 380 if (TestFlag(kCalcHillas)) 381 *fLog << " - " << fNameHillas << " from MGeomCam, M CerPhotEvtand fIdxIsland=" << fIdxIsland << endl;381 *fLog << " - " << fNameHillas << " from MGeomCam, MSignalCam and fIdxIsland=" << fIdxIsland << endl; 382 382 if (TestFlag(kCalcHillasSrc)) 383 383 *fLog << " - " << fNameHillasSrc << " from " << fNameSrcPosCam << ", " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl; 384 384 if (TestFlag(kCalcHillasExt)) 385 *fLog << " - " << fNameHillasExt << " from MGeomCam, M CerPhotEvt, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;385 *fLog << " - " << fNameHillasExt << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl; 386 386 if (TestFlag(kCalcImagePar)) 387 *fLog << " - " << fNameImagePar << " from M CerPhotEvt" << endl;387 *fLog << " - " << fNameImagePar << " from MSignalCam" << endl; 388 388 if (TestFlag(kCalcNewImagePar)) 389 *fLog << " - " << fNameNewImagePar << " from MGeomCam, M CerPhotEvt, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;389 *fLog << " - " << fNameNewImagePar << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl; 390 390 if (TestFlag(kCalcConc)) 391 *fLog << " - " << fNameConc << " from MGeomCam, M CerPhotEvtand " << fNameHillas << endl;391 *fLog << " - " << fNameConc << " from MGeomCam, MSignalCam and " << fNameHillas << endl; 392 392 } 393 393 -
trunk/MagicSoft/Mars/mimage/MHillasCalc.h
r5059 r6855 18 18 19 19 class MGeomCam; 20 class M CerPhotEvt;20 class MSignalCam; 21 21 class MHillas; 22 22 class MHillasExt; … … 41 41 42 42 const MGeomCam *fGeomCam; //! Camera Geometry used to calculate Hillas 43 const M CerPhotEvt*fCerPhotEvt; //! Cerenkov Photon Event used for calculation43 const MSignalCam *fCerPhotEvt; //! Cerenkov Photon Event used for calculation 44 44 45 45 MHillas *fHillas; //! output container to store result -
trunk/MagicSoft/Mars/mimage/MHillasExt.cc
r4826 r6855 68 68 #include "MGeomCam.h" 69 69 70 #include "M CerPhotPix.h"71 #include "M CerPhotEvt.h"70 #include "MSignalPix.h" 71 #include "MSignalCam.h" 72 72 73 73 #include "MLog.h" … … 137 137 // and the cerenkov photon event 138 138 // 139 Int_t MHillasExt::Calc(const MGeomCam &geom, const M CerPhotEvt&evt, const MHillas &hil, Int_t island)139 Int_t MHillasExt::Calc(const MGeomCam &geom, const MSignalCam &evt, const MHillas &hil, Int_t island) 140 140 { 141 141 // … … 155 155 Float_t maxdist = 0; 156 156 157 MCerPhotPix *pix = 0; 158 159 TIter Next(evt); 160 while ((pix=(MCerPhotPix*)Next())) 157 // MSignalPix *pix = 0; 158 // TIter Next(evt); 159 // while ((pix=(MSignalPix*)Next())) 160 161 const UInt_t npix = evt.GetNumPixels(); 162 for (UInt_t i=0; i<npix; i++) 161 163 { 162 if (island>=0 && pix->GetIdxIsland()!=island) 164 const MSignalPix &pix = evt[i]; 165 if (!pix.IsPixelUsed()) 163 166 continue; 164 167 165 const Int_t pixid = pix->GetPixId(); 166 167 const MGeomPix &gpix = geom[pixid]; 168 if (island>=0 && pix.GetIdxIsland()!=island) 169 continue; 170 171 //const Int_t pixid = pix->GetPixId(); 172 173 const MGeomPix &gpix = geom[i/*pixid*/]; 168 174 const Double_t dx = gpix.GetX() - hil.GetMeanX(); // [mm] 169 175 const Double_t dy = gpix.GetY() - hil.GetMeanY(); // [mm] 170 176 171 Double_t nphot = pix ->GetNumPhotons(); // [1]177 Double_t nphot = pix.GetNumPhotons(); // [1] 172 178 173 179 const Double_t dzx = hil.GetCosDelta()*dx + hil.GetSinDelta()*dy; // [mm] … … 185 191 // must take pixel size into account 186 192 // 187 nphot *= geom.GetPixRatio( pixid);193 nphot *= geom.GetPixRatio(i/*pixid*/); 188 194 189 195 if (nphot>maxpix) 190 196 { 191 197 maxpix = nphot; // [1] 192 maxpixid = pixid;198 maxpixid = i;//pixid; 193 199 continue; // [1] 194 200 } -
trunk/MagicSoft/Mars/mimage/MHillasExt.h
r4710 r6855 10 10 class MHillas; 11 11 class MGeomCam; 12 class M CerPhotEvt;12 class MSignalCam; 13 13 14 14 class MHillasExt : public MParContainer … … 33 33 Float_t GetMaxDist() const { return fMaxDist; } 34 34 35 Int_t Calc(const MGeomCam &geom, const M CerPhotEvt&pix,35 Int_t Calc(const MGeomCam &geom, const MSignalCam &pix, 36 36 const MHillas &hil, Int_t island=-1); 37 37 -
trunk/MagicSoft/Mars/mimage/MImagePar.cc
r6489 r6855 48 48 #include "MLogManip.h" 49 49 50 #include "MCerPhotEvt.h" 51 #include "MCerPhotPix.h" 50 #include "MSignalCam.h" 52 51 53 52 ClassImp(MImagePar); … … 86 85 // Calculation of new image parameters 87 86 // 88 void MImagePar::Calc(const M CerPhotEvt&evt)87 void MImagePar::Calc(const MSignalCam &evt) 89 88 { 90 89 // Get number of saturating pixels 91 fNumSatPixelsHG = 0; 92 fNumSatPixelsLG = 0; 93 94 const UInt_t npixevt = evt.GetNumPixels(); 95 for (UInt_t i=0; i<npixevt; i++) 96 { 97 const MCerPhotPix &pix = evt[i]; 98 99 if (pix.IsPixelHGSaturated()) 100 fNumSatPixelsHG++; 101 if (pix.IsPixelSaturated()) 102 fNumSatPixelsLG++; 103 } 90 fNumSatPixelsHG = evt.GetNumPixelsSaturatedHiGain(); 91 fNumSatPixelsLG = evt.GetNumPixelsSaturatedLoGain(); 104 92 105 93 // Get number of islands -
trunk/MagicSoft/Mars/mimage/MImagePar.h
r6489 r6855 8 8 class MHillas; 9 9 class MGeomCam; 10 class M CerPhotEvt;10 class MSignalCam; 11 11 12 12 class MImagePar : public MParContainer … … 39 39 void Print(Option_t *opt=NULL) const; 40 40 41 void Calc(const M CerPhotEvt&evt);41 void Calc(const MSignalCam &evt); 42 42 43 43 ClassDef(MImagePar, 2) // Container to hold (geometry and island independant) image parameters -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r6489 r6855 61 61 // 62 62 // When an event is read, before the image cleaning, all the pixels that 63 // are in M CerPhotEvtare set as USED and NOT CORE. All the pixels belong63 // are in MSignalCam are set as USED and NOT CORE. All the pixels belong 64 64 // to RING number 1 (like USED pixels). 65 // Look at M CerPhotPix.h to see how these informations of the pixel are65 // Look at MSignalPix.h to see how these informations of the pixel are 66 66 // stored. 67 67 // The default cleaning METHOD is the STANDARD one and the number of the … … 84 84 // This avoids problems of deformations of the shower images. 85 85 // The signal S_i and the pedestal RMS Prms_i of the pixel are called from 86 // the object M CerPhotPix.86 // the object MSignalPix. 87 87 // If (default method = kStandard) 88 88 //Begin_Html … … 281 281 // MGeomCam 282 282 // MPedPhotCam 283 // M CerPhotEvt283 // MSignalCam 284 284 // 285 285 // Output Containers: 286 // M CerPhotEvt286 // MSignalCam 287 287 // 288 288 ///////////////////////////////////////////////////////////////////////////// … … 307 307 #include "MGeomCam.h" 308 308 309 #include "M CerPhotPix.h"310 #include "M CerPhotEvt.h"309 #include "MSignalPix.h" 310 #include "MSignalCam.h" 311 311 312 312 #include "MGGroupFrame.h" // MGGroupFrame … … 325 325 326 326 const TString MImgCleanStd::gsNamePedPhotCam="MPedPhotCam"; // default name of the 'MPedPhotCam' container 327 const TString MImgCleanStd::gsName CerPhotEvt="MCerPhotEvt"; // default name of the 'MCerPhotEvt' container327 const TString MImgCleanStd::gsNameSignalCam ="MSignalCam"; // default name of the 'MSignalCam' container 328 328 const TString MImgCleanStd::gsNameGeomCam ="MGeomCam"; // default name of the 'MGeomCam' container 329 329 … … 341 341 fCleanLvl2(lvl2), fCleanRings(1), fKeepSinglePixels(kFALSE), 342 342 fNamePedPhotCam(gsNamePedPhotCam), fNameGeomCam(gsNameGeomCam), 343 fName CerPhotEvt(gsNameCerPhotEvt)343 fNameSignalCam(gsNameSignalCam) 344 344 { 345 345 fName = name ? name : gsDefName.Data(); … … 374 374 // set them to 'unused' state if necessary 375 375 // 376 MCerPhotPix *pix; 377 378 // Loop over all pixels 379 MCerPhotEvtIter Next(fEvt, kFALSE); 380 while ((pix=static_cast<MCerPhotPix*>(Next()))) 381 if (!pix->IsPixelUnmapped() && data[pix->GetPixId()] <= fCleanLvl1) 382 pix->SetPixelUnused(); 376 const UInt_t npixevt = fEvt->GetNumPixels(); 377 for (UInt_t idx=0; idx<npixevt; idx++) 378 { 379 if (data[idx]>fCleanLvl1) 380 continue; 381 382 MSignalPix &pix = (*fEvt)[idx]; 383 if (!pix.IsPixelUnmapped()) 384 pix.SetPixelUnused(); 385 } 383 386 } 384 387 … … 395 398 size = 0; 396 399 397 MCerPhotPix *pix; 398 399 // Loop over used pixels only 400 TIter Next(*fEvt); 401 402 while ((pix=static_cast<MCerPhotPix*>(Next()))) 403 { 404 // get pixel id of this entry 405 const Int_t idx = pix->GetPixId(); 400 const UInt_t npixevt = fEvt->GetNumPixels(); 401 for (UInt_t idx=0; idx<npixevt; idx++) 402 { 403 MSignalPix &pix = (*fEvt)[idx]; 404 if (!pix.IsPixelUsed()) 405 continue; 406 406 407 407 // check for 'used' neighbors of this pixel … … 427 427 { 428 428 if (!fKeepSinglePixels) 429 pix ->SetPixelUnused();430 size += pix ->GetNumPhotons();429 pix.SetPixelUnused(); 430 size += pix.GetNumPhotons(); 431 431 n++; 432 432 } 433 433 } 434 434 435 Next.Reset();436 while ((pix=static_cast<MCerPhotPix*>(Next())))437 {438 if (pix ->IsPixelUsed())439 pix ->SetPixelCore();435 for (UInt_t idx=0; idx<npixevt; idx++) 436 { 437 MSignalPix &pix = (*fEvt)[idx]; 438 if (pix.IsPixelUsed()) 439 pix.SetPixelCore(); 440 440 } 441 441 … … 443 443 } 444 444 445 void MImgCleanStd::CleanStep3b( MCerPhotPix &pix)446 { 447 const Int_t idx = pix.GetPixId();445 void MImgCleanStd::CleanStep3b(Int_t idx) 446 { 447 MSignalPix &pix = (*fEvt)[idx]; 448 448 449 449 // … … 475 475 // If a value<2 for fCleanRings is used, no CleanStep4 is done. 476 476 // 477 void MImgCleanStd::CleanStep4(UShort_t r, MCerPhotPix &pix) 478 { 477 void MImgCleanStd::CleanStep4(UShort_t r, Int_t idx/*MSignalPix &pix*/) 478 { 479 MSignalPix &pix = (*fEvt)[idx]; 480 479 481 // 480 482 // Skip events that have already a defined status; … … 488 490 // and tell to which ring it belongs to. 489 491 // 490 const Int_t idx = pix.GetPixId();491 492 492 MGeomPix &gpix = (*fCam)[idx]; 493 493 … … 498 498 const Int_t idx2 = gpix.GetNeighbor(j); 499 499 500 M CerPhotPix *npix = fEvt->GetPixById(idx2);500 MSignalPix *npix = fEvt->GetPixById(idx2); 501 501 if (!npix || !npix->IsPixelUsed() || npix->GetRing()>r-1 ) 502 502 continue; … … 519 519 for (UShort_t r=1; r<fCleanRings+1; r++) 520 520 { 521 MCerPhotPix *pix;522 523 521 // Loop over all pixels 524 525 MCerPhotEvtIter NextAll(fEvt, kFALSE); 526 while ((pix=static_cast<MCerPhotPix*>(NextAll()))) 522 const UInt_t npixevt = fEvt->GetNumPixels(); 523 for (UInt_t idx=0; idx<npixevt; idx++) 527 524 { 525 MSignalPix &pix = (*fEvt)[idx]; 526 528 527 // 529 528 // if pixel is a core pixel or unmapped, go to the next pixel 530 529 // 531 if (pix ->IsPixelCore() || pix->IsPixelUnmapped())530 if (pix.IsPixelCore() || pix.IsPixelUnmapped()) 532 531 continue; 533 532 534 if (data[ pix->GetPixId()] <= fCleanLvl2)533 if (data[idx] <= fCleanLvl2) 535 534 continue; 536 535 537 536 if (r==1) 538 CleanStep3b( *pix);537 CleanStep3b(idx); 539 538 else 540 CleanStep4(r, *pix);539 CleanStep4(r, idx); 541 540 } 542 541 } … … 557 556 } 558 557 559 fEvt = (M CerPhotEvt*)pList->FindObject(AddSerialNumber(fNameCerPhotEvt), "MCerPhotEvt");558 fEvt = (MSignalCam*)pList->FindObject(AddSerialNumber(fNameSignalCam), "MSignalCam"); 560 559 if (!fEvt) 561 560 { 562 *fLog << err << fName CerPhotEvt << " [MCerPhotEvt] not found... aborting." << endl;561 *fLog << err << fNameSignalCam << " [MSignalCam] not found... aborting." << endl; 563 562 return kFALSE; 564 563 } … … 570 569 return kFALSE; 571 570 } 572 573 fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));574 if (!fTime && fCleaningMethod==kProbability)575 *fLog << warn << "MArrivalTime not found... probability cleaning done with signal only!" << endl;576 571 577 572 fData = (MCameraData*)pList->FindCreateObj(AddSerialNumber("MCameraData")); … … 602 597 break; 603 598 case kProbability: 604 fData->CalcCleaningProbability(*fEvt, *fPed, *fCam , fTime);599 fData->CalcCleaningProbability(*fEvt, *fPed, *fCam); 605 600 break; 606 601 case kAbsolute: … … 819 814 if (gsNameGeomCam!=fNameGeomCam) 820 815 out << " " << GetUniqueName() << ".SetNameGeomCam(\"" << fNameGeomCam << "\");" << endl; 821 if (gsName CerPhotEvt!=fNameCerPhotEvt)822 out << " " << GetUniqueName() << ".SetName CerPhotEvt(\"" << fNameCerPhotEvt<< "\");" << endl;816 if (gsNameSignalCam!=fNameSignalCam) 817 out << " " << GetUniqueName() << ".SetNameSignalCam(\"" << fNameSignalCam << "\");" << endl; 823 818 if (fKeepSinglePixels) 824 819 out << " " << GetUniqueName() << ".SetKeepSinglePixels();" << endl; -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r6489 r6855 8 8 class MGeomCam; 9 9 class MSigmabar; 10 class MCerPhotPix; 11 class MCerPhotEvt; 10 class MSignalCam; 12 11 class MPedPhotCam; 13 12 class MArrivalTime; … … 30 29 static const TString gsNamePedPhotCam; // default name of the 'MPedPhotCam' container 31 30 static const TString gsNameGeomCam; // default name of the 'MGeomCam' container 32 static const TString gsName CerPhotEvt; // default name of the 'MCerPhotEvt' container31 static const TString gsNameSignalCam; // default name of the 'MSignalCam' container 33 32 34 33 const MGeomCam *fCam; //! 35 M CerPhotEvt*fEvt; //!34 MSignalCam *fEvt; //! 36 35 MPedPhotCam *fPed; //! 37 MArrivalTime *fTime; //!38 36 MCameraData *fData; //! 39 37 … … 48 46 TString fNamePedPhotCam; // name of the 'MPedPhotCam' container 49 47 TString fNameGeomCam; // name of the 'MGeomCam' container 50 TString fName CerPhotEvt; // name of the 'MCerPhotEvt' container48 TString fNameSignalCam; // name of the 'MSignalCam' container 51 49 52 50 // MImgCleanStd … … 54 52 Short_t CleanStep2(Float_t &size); 55 53 void CleanStep3(); 56 void CleanStep3b( MCerPhotPix &pix);57 void CleanStep4(UShort_t r, MCerPhotPix &pix);54 void CleanStep3b(Int_t idx); 55 void CleanStep4(UShort_t r, Int_t idx); 58 56 59 57 // MGTask, MTask, MParContainer … … 81 79 82 80 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 83 void SetName CerPhotEvt(const char *name) { fNameCerPhotEvt= name; }81 void SetNameSignalCam(const char *name) { fNameSignalCam = name; } 84 82 void SetNameGeomCam(const char *name) { fNameGeomCam = name; } 85 83 -
trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
r4826 r6855 77 77 #include "MGeomPix.h" 78 78 79 #include "M CerPhotEvt.h"80 #include "M CerPhotPix.h"79 #include "MSignalCam.h" 80 #include "MSignalPix.h" 81 81 82 82 ClassImp(MNewImagePar); … … 121 121 // Calculation of new image parameters 122 122 // 123 void MNewImagePar::Calc(const MGeomCam &geom, const M CerPhotEvt&evt,123 void MNewImagePar::Calc(const MGeomCam &geom, const MSignalCam &evt, 124 124 const MHillas &hillas, Int_t island) 125 125 { … … 141 141 Float_t maxpix2 = 0; // [#phot] 142 142 143 MCerPhotPix *pix = 0;144 143 /* 144 MSignalPix *pix = 0; 145 145 TIter Next(evt); 146 while ((pix=(MCerPhotPix*)Next())) 146 while ((pix=(MSignalPix*)Next())) 147 */ 148 UInt_t npix = evt.GetNumPixels(); 149 for (UInt_t i=0; i<npix; i++) 147 150 { 151 const MSignalPix &pix = evt[i]; 152 if (!pix.IsPixelUsed()) 153 continue; 154 148 155 // Check for requested islands 149 if (island>=0 && pix ->GetIdxIsland()!=island)156 if (island>=0 && pix.GetIdxIsland()!=island) 150 157 continue; 151 158 152 159 // Get geometry of pixel 153 const Int_t pixid = pix->GetPixId();154 const MGeomPix &gpix = geom[ pixid];160 //const Int_t pixid = pix->GetPixId(); 161 const MGeomPix &gpix = geom[i/*pixid*/]; 155 162 156 163 // count used and core pixels 157 if (pix ->IsPixelCore())164 if (pix.IsPixelCore()) 158 165 { 159 166 fNumCorePixels++; … … 165 172 fUsedArea += gpix.GetA(); 166 173 167 Double_t nphot = pix ->GetNumPhotons();174 Double_t nphot = pix.GetNumPhotons(); 168 175 169 176 // … … 179 186 // must take pixel size into account 180 187 // 181 nphot *= geom.GetPixRatio( pixid);188 nphot *= geom.GetPixRatio(i/*pixid*/); 182 189 183 190 // count inner pixels: To dependent on MAGIC Camera --> FIXME 184 191 185 if ( pixid<397){192 if (i<397){ 186 193 fInnerSize += nphot; 187 if( pixid>270){194 if(i>270){ 188 195 edgepixin2 += nphot; 189 if( pixid>330)196 if(i>330) 190 197 edgepixin1 += nphot; 191 198 } -
trunk/MagicSoft/Mars/mimage/MNewImagePar.h
r4710 r6855 8 8 class MHillas; 9 9 class MGeomCam; 10 class M CerPhotEvt;10 class MSignalCam; 11 11 12 12 class MNewImagePar : public MParContainer … … 53 53 void Print(const MGeomCam &geom) const; 54 54 55 void Calc(const MGeomCam &geom, const M CerPhotEvt&evt,55 void Calc(const MGeomCam &geom, const MSignalCam &evt, 56 56 const MHillas &hillas, Int_t island=-1); 57 57 -
trunk/MagicSoft/Mars/mimage/Makefile
r6848 r6855 19 19 # connect the include files defined in the config.mk file 20 20 # 21 INCLUDES = -I. -I../mbase -I../mhbase -I../mgeom -I../m analysis\21 INCLUDES = -I. -I../mbase -I../mhbase -I../mgeom -I../msignal \ 22 22 -I../mgui -I../mmc -I../mpointing -I../mpedestal \ 23 -I../mhist 23 -I../mhist -I../manalysis 24 24 25 25 # mhist: MHHillas (MHCamera) … … 32 32 MHillasExt.cc \ 33 33 MHillasCalc.cc \ 34 MHillasSrcCalc.cc \35 34 MImagePar.cc \ 36 35 MNewImagePar.cc \
Note:
See TracChangeset
for help on using the changeset viewer.