Changeset 8364
- Timestamp:
- 03/04/07 14:01:14 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r7864 r8364 241 241 fHist->SetCamContent(*event, 0); 242 242 break; 243 case kEvtIdxMax:244 fHist->SetCamContent(*event, 5);245 break;243 // case kEvtIdxMax: 244 // fHist->SetCamContent(*event, 3/*5*/); 245 // break; 246 246 case kEvtArrTime: 247 247 fHist->SetCamContent(*event, 6); … … 255 255 case kEvtIslandIndex: 256 256 fHist->SetCamContent(*event, 5); 257 break; 257 break; 258 default: 259 *fLog << "ERROR - Case " << (int)fType << " not implemented..." << endl; 258 260 } 259 261 -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r8353 r8364 550 550 const UShort_t nhi = fRunHeader->GetNumSamplesHiGain(); 551 551 const UShort_t npic = fRunHeader->GetNumPixInCrate(); 552 553 return (nhi+nlo)*npic; 552 const UShort_t nbps = fRunHeader->GetNumBytesPerSample(); 553 554 return (nhi+nlo)*npic*nbps; 554 555 } 555 556 … … 566 567 Bool_t MRawEvtData::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 567 568 { 569 *fLog << warn << "WARNING - The use of MRawEvtData::GetPixelContent is deprecated!" << endl; 570 571 /* 568 572 MRawEvtPixelIter Next(const_cast<MRawEvtData*>(this)); 569 573 if (!Next.Jump(idx)) … … 592 596 return val >= 0; 593 597 } 594 598 */ 595 599 return kTRUE; 596 600 } -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
r8348 r8364 164 164 } 165 165 166 /* 166 167 // -------------------------------------------------------------------------- 167 168 // 168 169 // Returns the index of the FADC slice the maximum signal in. If the highest 169 // slices have the same value the last one is returned.170 // slices have the same value the first one is returned. 170 171 // 171 172 Byte_t MRawEvtPixelIter::GetIdxMaxHiGainSample(const Byte_t hifirst, const Byte_t hilast) const … … 188 189 // 189 190 // Returns the index of the FADC slice the maximum signal in. If no lo-gains 190 // are available -1 is returned. If the highest slices have the same value the191 // last one is returned.191 // are available -1 is returned. If the highest slices have the same value 192 // the first one is returned. 192 193 // 193 194 Short_t MRawEvtPixelIter::GetIdxMaxLoGainSample(const Byte_t lofirst, const Byte_t lolast) const … … 294 295 // If no lo-gains are existing and the hi-gains have saturating values 295 296 // a negative value (-1) is returned. 296 // 297 // 297 298 Short_t MRawEvtPixelIter::GetIdxMaxHiLoGainSample() const 298 299 { … … 371 372 return sum; 372 373 } 374 */ -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
r8348 r8364 91 91 */ 92 92 93 Byte_t GetNumHiGainSamples() const { return fNumHiGainSamples ; }// Use is deprecated!94 Byte_t GetNumLoGainSamples() const { return fNumLoGainSamples ; }// Use is deprecated!93 // Byte_t GetNumHiGainSamples() const { return fNumHiGainSamples ; }// Use is deprecated! 94 // Byte_t GetNumLoGainSamples() const { return fNumLoGainSamples ; }// Use is deprecated! 95 95 Byte_t GetNumSamples() const { return fNumHiGainSamples+fNumLoGainSamples; } 96 96 97 Byte_t GetIdxMaxHiGainSample(const Byte_t hifirst=0, const Byte_t hilast=0xff) const;98 Short_t GetIdxMaxLoGainSample(const Byte_t lofirst=0, const Byte_t lolast=0xff) const;97 // Byte_t GetIdxMaxHiGainSample(const Byte_t hifirst=0, const Byte_t hilast=0xff) const; 98 // Short_t GetIdxMaxLoGainSample(const Byte_t lofirst=0, const Byte_t lolast=0xff) const; 99 99 100 Byte_t GetMaxHiGainSample(const Byte_t hifirst=0, const Byte_t hilast=0xff) const;100 // Byte_t GetMaxHiGainSample(const Byte_t hifirst=0, const Byte_t hilast=0xff) const; 101 101 102 ULong_t GetSumHiGainSamples() const;103 ULong_t GetSumSqrHiGainSamples() const;104 Float_t GetVarHiGainSamples() const;102 // ULong_t GetSumHiGainSamples() const; 103 // ULong_t GetSumSqrHiGainSamples() const; 104 // Float_t GetVarHiGainSamples() const; 105 105 106 Byte_t GetMaxLoGainSample() const;107 Short_t GetIdxMaxHiLoGainSample() const;106 // Byte_t GetMaxLoGainSample() const; 107 // Short_t GetIdxMaxHiLoGainSample() const; 108 108 109 ULong_t GetSumLoGainSamples() const;110 ULong_t GetSumSqrLoGainSamples() const;109 // ULong_t GetSumLoGainSamples() const; 110 // ULong_t GetSumSqrLoGainSamples() const; 111 111 112 112 Bool_t HasLoGain() const { return fNumLoGainSamples>0; } -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r8358 r8364 17 17 ! 18 18 ! Author(s): Markus Gaug, 04/2004 <mailto:markus@ifae.es> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 19 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 20 ! 21 ! Copyright: MAGIC Software Development, 2000-2007 21 22 ! 22 23 ! … … 74 75 // - Byte_t fHiLoLast; // Number of slices in fLoGainSamples counted for the High-Gain signal 75 76 // 77 // Class Version 8: 78 // ---------------- 79 // - Byte_t fSaturationLimit; 80 // + Uint_t fSaturationLimit; 81 // 76 82 // 77 83 // Input Containers: … … 108 114 using namespace std; 109 115 110 const Byte_t MExtractor::fgSaturationLimit = 245;116 const UInt_t MExtractor::fgSaturationLimit = 245; 111 117 const TString MExtractor::fgNamePedestalCam = "MPedestalCam"; 112 118 const TString MExtractor::fgNameSignalCam = "MExtractedSignalCam"; … … 255 261 if (numl==0) 256 262 { 257 *fLog << inf << "No lo-gains... resetting lo-gain range and saturation limit." << endl;263 *fLog << inf << "No lo-gains... resetting lo-gain range"; 258 264 fLoGainFirst=0; 259 265 fLoGainLast =0; 260 fSaturationLimit=0xff; 266 if (fSaturationLimit>0xff) 267 { 268 *fLog << " and saturation limit"; 269 fSaturationLimit=0xff; 270 } 271 *fLog << "." << endl; 261 272 } 262 273 … … 443 454 if (IsEnvDefined(env, prefix, "SaturationLimit", print)) 444 455 { 445 SetSaturationLimit(GetEnvValue(env, prefix, "SaturationLimit", fSaturationLimit));456 SetSaturationLimit(GetEnvValue(env, prefix, "SaturationLimit", (Int_t)fSaturationLimit)); 446 457 rc = kTRUE; 447 458 } -
trunk/MagicSoft/Mars/msignal/MExtractor.h
r8358 r8364 32 32 33 33 protected: 34 static const Byte_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 254)34 static const UInt_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 254) 35 35 static const TString fgNamePedestalCam; //! "MPedestalCam" 36 36 static const TString fgNameSignalCam; //! "MExtractedSignalCam" … … 59 59 Float_t fSqrtLoGainSamples; // Sqrt. nr. Low Gain FADC slices used to extract the signal 60 60 61 Byte_t fSaturationLimit; // Highest FADC slice value until being declared saturated61 UInt_t fSaturationLimit; // Highest FADC slice value until being declared saturated 62 62 63 63 TString fNamePedestalCam; // Name of the 'MPedestalCam' container … … 94 94 Float_t GetResolutionPerPheHiGain() const { return fResolutionPerPheHiGain; } 95 95 Float_t GetResolutionPerPheLoGain() const { return fResolutionPerPheLoGain; } 96 Byte_t GetSaturationLimit() const { return fSaturationLimit; }96 UInt_t GetSaturationLimit() const { return fSaturationLimit; } 97 97 98 98 Bool_t HasLoGain() const { return fLoGainFirst>0 || fLoGainLast>0; } … … 106 106 107 107 void SetOffsetLoGain ( const Float_t f=fgOffsetLoGain ) { fOffsetLoGain = f; } 108 void SetSaturationLimit ( const Byte_t lim=fgSaturationLimit ) { fSaturationLimit = lim; }108 void SetSaturationLimit ( const UInt_t lim=fgSaturationLimit ) { fSaturationLimit = lim; } 109 109 void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; } 110 110 void SetNameSignalCam ( const char *name=fgNameSignalCam.Data() ) { fNameSignalCam = name; } … … 122 122 void Print(Option_t *o="") const; //*MENU* 123 123 124 ClassDef(MExtractor, 7) // Signal Extractor Base Class124 ClassDef(MExtractor, 8) // Signal Extractor Base Class 125 125 }; 126 126 -
trunk/MagicSoft/Mars/msignal/MSignalCalc.cc
r8357 r8364 46 46 47 47 #include "MRawRunHeader.h" 48 #include "MRawEvtData.h" // MRawEvtData::GetNumPixels49 48 #include "MSignalCam.h" 50 49 #include "MPedestalPix.h" 51 50 #include "MPedestalCam.h" 52 51 #include "MRawEvtPixelIter.h" 52 #include "MPedestalSubtractedEvt.h" 53 53 54 54 ClassImp(MSignalCalc); … … 66 66 fName = name ? name : "MSignalCalc"; 67 67 fTitle = title ? title : "Task to calculate Cerenkov photons from raw data"; 68 69 AddToBranchList("MRawEvtData.fHiGainPixId");70 AddToBranchList("MRawEvtData.fLoGainPixId");71 AddToBranchList("MRawEvtData.fHiGainFadcSamples");72 AddToBranchList("MRawEvtData.fLoGainFadcSamples");73 68 } 74 69 … … 95 90 } 96 91 97 fRawEvt = (M RawEvtData*)pList->FindObject("MRawEvtData");92 fRawEvt = (MPedestalSubtractedEvt*)pList->FindObject("MPedestalSubtractedEvt"); 98 93 if (!fRawEvt) 99 94 { 100 *fLog << dbginf << "M RawEvtDatanot found... aborting." << endl;95 *fLog << dbginf << "MPedestalSubtractedEvt not found... aborting." << endl; 101 96 return kFALSE; 102 97 } … … 130 125 // pixel in the MSignalCam container. 131 126 // 127 #include <TSystem.h> 132 128 Int_t MSignalCalc::Process() 133 129 { 134 MRawEvtPixelIter pixel(fRawEvt); 135 136 while (pixel.Next()) 130 const Int_t npix = fRawEvt->GetNumPixels(); 131 const Int_t nhi = fRunHeader->GetNumSamplesHiGain(); 132 const Int_t nlo = fRunHeader->GetNumSamplesLoGain(); 133 134 for (int i=0; i<npix; i++) 137 135 { 138 Byte_t *ptr = pixel.GetHiGainSamples(); 139 Byte_t *max = ptr+pixel.GetIdxMaxHiGainSample(); 140 Byte_t *end = ptr+fRunHeader->GetNumSamplesHiGain(); 136 Byte_t *raw = fRawEvt->GetSamplesRaw(i); 137 138 Byte_t *ptr = raw; 139 Byte_t *max = ptr+fRawEvt->GetMax(i, 0, nhi); 140 Byte_t *end = ptr+nhi; 141 141 Byte_t *first = max-fBefore; 142 142 Byte_t *last = max+fAfter; … … 144 144 ULong_t sumb = 0; // sum background 145 145 ULong_t sqb = 0; // sum sqares background 146 ULong_t sumsb = 0; // sum signal+background146 //ULong_t sumsb = 0; // sum signal+background 147 147 ULong_t sqsb = 0; // sum sqares signal+background 148 148 … … 168 168 else 169 169 { 170 sumsb += *ptr;170 //sumsb += *ptr; 171 171 sqsb += *ptr* *ptr; 172 172 nsb++; … … 175 175 } 176 176 177 if ( sat==0 && ishi)177 if (nlo>0 && sat==0 && ishi) 178 178 { 179 179 // Area: x9 180 ptr = pixel.GetLoGainSamples();181 end = ptr+ fRunHeader->GetNumSamplesLoGain();180 ptr = raw+nhi; 181 end = ptr+nlo; 182 182 183 183 sumb = 0; // sum background … … 187 187 while (ptr<end) 188 188 { 189 // Background already ca lced from hi-gains!189 // Background already caced from hi-gains! 190 190 sumb += *ptr; 191 191 sqb += *ptr* *ptr; … … 195 195 } 196 196 197 if ( sat>1 && !ishi)197 if (nlo>0 && sat>1 && !ishi) 198 198 { 199 199 // Area: x9 200 ptr = pixel.GetLoGainSamples();201 max = ptr+ pixel.GetIdxMaxLoGainSample();200 ptr = raw+nhi; 201 max = ptr+fRawEvt->GetMax(i, nhi, nhi+nlo); 202 202 203 203 if (*max>250) … … 207 207 } 208 208 209 end = ptr+ fRunHeader->GetNumSamplesLoGain();209 end = ptr+nlo; 210 210 first = max-fBefore; 211 211 last = max+fAfter; 212 212 213 sumsb = 0; // sum signal+background214 sqsb = 0; // sum sqares signal+background215 //sumb = 0; // sum background213 //sumsb = 0; // sum signal+background 214 //sqsb = 0; // sum sqares signal+background 215 sumb = 0; // sum background 216 216 //sqb = 0; // sum sqares background 217 217 … … 230 230 else 231 231 { 232 sumsb += *ptr;232 //sumsb += *ptr; 233 233 sqsb += *ptr* *ptr; 234 234 nsb++; … … 238 238 } 239 239 240 Float_t b = (float)sumb/nb; // background241 Float_t sb = (float)sumsb/nsb; // signal+background242 243 Float_t msb = (float)sqb/nb; // mean square background240 Float_t b = nb==0 ? 0 : (float)sumb/nb; // background 241 //Float_t sb = (float)sumsb/nsb; // signal+background 242 243 Float_t msb = nb==0 ? 0 : (float)sqb/nb; // mean square background 244 244 //Float_t mssb = (float)sqsb/nsb; // mean square signal+background 245 245 … … 247 247 //Float_t sigsb = sqrt(mssb-sb*sb); // sigma signal+background 248 248 249 Float_t s = sb-b; // signal249 //Float_t s = sb-b; // signal 250 250 //Float_t sqs = sqsb-nsb*b; // sum squares signal 251 251 … … 253 253 //Float_t sigs = sqrt(mss-s*s); // sigma signal 254 254 255 if (sat>1) 256 s *= 11.3; 257 258 Int_t idx = pixel.GetPixelId(); 255 //if (sat>1) 256 // s *= 11.3; 257 259 258 //fCerPhotEvt->AddPixel(idx, s, sigs); 260 259 … … 262 261 // MMcPedestalCopy and MMcPedestalNSBAdd 263 262 if (fPedestals) 264 (*fPedestals)[i dx].Set(b, sigb);263 (*fPedestals)[i].Set(b, sigb); 265 264 } 266 265 -
trunk/MagicSoft/Mars/msignal/MSignalCalc.h
r8357 r8364 6 6 #endif 7 7 8 class MRawEvtData;9 8 class MPedestalCam; 10 9 class MSignalCam; 11 10 class MRawRunHeader; 11 class MPedestalSubtractedEvt; 12 12 13 13 class MSignalCalc : public MTask 14 14 { 15 15 private: 16 M PedestalCam *fPedestals; // Pedestals of all pixels in the camera17 M RawEvtData*fRawEvt; // raw event data (time slices)18 MSignalCam *fCerPhotEvt; // Cerenkov Photon Event used for calculation19 M RawRunHeader *fRunHeader; // RunHeader information16 MRawRunHeader *fRunHeader; // RunHeader information 17 MPedestalSubtractedEvt *fRawEvt; // raw event data (time slices) 18 MSignalCam *fCerPhotEvt; // Cerenkov Photon Event used for calculation 19 MPedestalCam *fPedestals; // Pedestals of all pixels in the camera 20 20 21 21 Byte_t fBefore;
Note:
See TracChangeset
for help on using the changeset viewer.