Changeset 8357
- Timestamp:
- 03/03/07 22:33:56 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
r8305 r8357 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.2 6 2007-02-04 15:49:08tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.27 2007-03-03 22:27:50 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 311 311 } 312 312 313 Bool_t MExtractPedestal::SetRangeFromExtractor(const MExtractor &ext, Bool_t logain) 314 { 315 const Bool_t haslogains = ext.GetLoGainFirst()!=0 && ext.GetLoGainLast()!=0; 316 317 Bool_t rc1 = kTRUE; 318 if (!haslogains) 319 { 320 // We assume that in case without lo-gains we 321 // deal with pedestal events only 322 rc1 = SetCheckRange(ext.GetHiGainFirst(), ext.GetHiGainLast()); 323 } 324 325 const Int_t f = logain && haslogains ? ext.GetLoGainFirst() : ext.GetHiGainFirst(); 326 const Int_t l = logain && haslogains ? ext.GetLoGainLast() : ext.GetHiGainLast(); 327 328 const Int_t w = (l-f+1); 329 330 // Setup to use the hi-gain extraction window in the lo-gain 331 // range (the start of the lo-gain range is added automatically 332 // by MPedCalcFromLoGain) 333 const Bool_t rc2 = SetExtractWindow(f, w); 334 335 return rc1 && rc2; 336 } 313 337 314 338 // -------------------------------------------------------------------------- … … 556 580 return kFALSE; 557 581 582 SetRangeFromExtractor(*fExtractor); 583 /* 558 584 // If an extractor is set determin the window size automatically! 559 585 fExtractWinFirst = fExtractor->GetHiGainFirst(); 560 586 fExtractWinLast = fExtractor->GetHiGainLast(); 561 587 588 if (!fExtractor->HasLoGain()) 589 { 590 fCheckWinFirst=fExtractWinFirst; 591 fCheckWinLast =fExtractWinLast; 592 }*/ 562 593 // fSignal->GetNumSamples() not yet initialized!!! 563 594 const UInt_t num = fRunHeader->GetNumSamplesHiGain()+fRunHeader->GetNumSamplesLoGain(); -
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.h
r8296 r8357 15 15 16 16 class MGeomCam; 17 class MExtractor; 17 18 class MPedestalCam; 18 19 class MRawEvtData; … … 103 104 void CheckExtractionWindow(UInt_t offset=0); 104 105 106 Bool_t SetRangeFromExtractor(const MExtractor &ext, Bool_t logain); 107 105 108 public: 106 109 MExtractPedestal(const char *name=NULL, const char *title=NULL); … … 112 115 Bool_t SetExtractWindow(UShort_t first, UShort_t size); 113 116 Bool_t SetCheckRange(UShort_t checkfirst=fgCheckWinFirst, UShort_t checklast=fgCheckWinLast); 117 118 virtual Bool_t SetRangeFromExtractor(const MExtractor &ext) = 0; 114 119 115 120 void SetMaxSignalVar(UShort_t maxvar=40) { fMaxSignalVar = maxvar; } -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.h
r8151 r8357 63 63 void SetPedestalUpdate(Bool_t b=kTRUE) { fPedestalUpdate = b; } 64 64 65 Bool_t SetRangeFromExtractor(const MExtractor &ext) 66 { 67 return MExtractPedestal::SetRangeFromExtractor(ext, kTRUE); 68 } 69 65 70 void Print(Option_t *o="") const; 66 71 -
trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.h
r8151 r8357 38 38 void Print(Option_t *o="") const; 39 39 void Reset(); 40 41 Bool_t SetRangeFromExtractor(const MExtractor &ext) 42 { 43 return MExtractPedestal::SetRangeFromExtractor(ext, kFALSE); 44 } 40 45 41 46 Int_t Finalize(); -
trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc
r8304 r8357 658 658 { 659 659 // FIXME: fLoGain* is used to determine the FILTER/CHECK range 660 const Int_t numh = pixel.GetNumHiGainSamples();660 const Int_t numh = fRunHeader->GetNumSamplesHiGain(); 661 661 662 662 const Int_t sum = fSignal->GetIntegralRaw(fBlindPixelIdx[id], fLoGainFirst+numh, fLoGainLast+numh); -
trunk/MagicSoft/Mars/msignal/MSignalCalc.cc
r6899 r8357 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 115 115 // This must be done in ReInit because in PreProcess the 116 116 // headers are not available 117 const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 118 if (!runheader) 119 *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl; 120 else 121 { 122 if (runheader->IsMonteCarloRun()) 123 return kTRUE; 124 } 117 if (fRunHeader->IsMonteCarloRun()) 118 return kTRUE; 125 119 126 120 fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 127 if ( runheader &&!fPedestals)121 if (!fPedestals) 128 122 return kFALSE; 129 123 … … 144 138 Byte_t *ptr = pixel.GetHiGainSamples(); 145 139 Byte_t *max = ptr+pixel.GetIdxMaxHiGainSample(); 146 Byte_t *end = ptr+fR awEvt->GetNumHiGainSamples();140 Byte_t *end = ptr+fRunHeader->GetNumSamplesHiGain(); 147 141 Byte_t *first = max-fBefore; 148 142 Byte_t *last = max+fAfter; … … 185 179 // Area: x9 186 180 ptr = pixel.GetLoGainSamples(); 187 end = ptr+fR awEvt->GetNumLoGainSamples();181 end = ptr+fRunHeader->GetNumSamplesLoGain(); 188 182 189 183 sumb = 0; // sum background … … 213 207 } 214 208 215 end = ptr+fR awEvt->GetNumLoGainSamples();209 end = ptr+fRunHeader->GetNumSamplesLoGain(); 216 210 first = max-fBefore; 217 211 last = max+fAfter; … … 254 248 255 249 Float_t s = sb-b; // signal 256 //Float_t sqs = sqsb-nsb*b; // sum sq aures signal250 //Float_t sqs = sqsb-nsb*b; // sum squares signal 257 251 258 252 //Float_t mss = (float)sqs/nsb; // mean quare signal … … 260 254 261 255 if (sat>1) 262 s *=10; // tgb has measured 9, but Florian said it's 10.256 s *= 11.3; 263 257 264 258 Int_t idx = pixel.GetPixelId(); -
trunk/MagicSoft/Mars/msignal/MSignalCalc.h
r6856 r8357 16 16 MPedestalCam *fPedestals; // Pedestals of all pixels in the camera 17 17 MRawEvtData *fRawEvt; // raw event data (time slices) 18 MSignalCam *fCerPhotEvt; // Cerenkov Photon Event used for calculation18 MSignalCam *fCerPhotEvt; // Cerenkov Photon Event used for calculation 19 19 MRawRunHeader *fRunHeader; // RunHeader information 20 20
Note:
See TracChangeset
for help on using the changeset viewer.