Changeset 7876 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 08/16/06 16:11:32 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MArrivalTimeCam.cc
r7842 r7876 128 128 idx++; 129 129 130 if (!pix->Is Valid())130 if (!pix->IsArrivalTimeValid()) 131 131 continue; 132 132 … … 147 147 case 0: 148 148 val = pix.GetArrivalTimeHiGain(); 149 return pix.IsHiGainValid() ;149 return pix.IsHiGainValid() && !pix.IsHiGainSaturated(); 150 150 151 151 case 1: … … 155 155 case 2: 156 156 val = pix.GetArrivalTimeLoGain(); 157 return pix.IsLoGainValid() ;157 return pix.IsLoGainValid() && !pix.IsLoGainSaturated(); 158 158 159 159 case 3: … … 164 164 case 6: 165 165 val = pix.GetArrivalTime(); 166 return pix.Is Valid();166 return pix.IsArrivalTimeValid(); 167 167 168 168 // This is for the case the signal has been 169 169 // extracted from lo- and hi-gain 170 170 case 7: 171 // Lo- and hi-gain must be successfully extracted 171 172 if (!pix.IsLoGainValid() || !pix.IsHiGainValid()) 173 return kFALSE; 174 175 // Lo- and hi-gain must not be saturated 176 if (pix.IsLoGainSaturated() || pix.IsHiGainSaturated()) 172 177 return kFALSE; 173 178 174 179 val = pix.GetArrivalTimeLoGain()-pix.GetArrivalTimeHiGain(); 175 180 176 if (pix.GetArrivalTimeHiGain()<3 || pix.GetArrivalTimeHiGain()>12 ||177 pix.GetArrivalTimeLoGain()<3 || pix.GetArrivalTimeLoGain()>12)178 return kFALSE;181 // if (pix.GetArrivalTimeHiGain()<3 || pix.GetArrivalTimeHiGain()>12 || 182 // pix.GetArrivalTimeLoGain()<3 || pix.GetArrivalTimeLoGain()>12) 183 // return kFALSE; 179 184 180 185 val = pix.GetArrivalTimeLoGain()-pix.GetArrivalTimeHiGain(); -
trunk/MagicSoft/Mars/msignal/MArrivalTimePix.cc
r7810 r7876 90 90 } 91 91 92 Bool_t MArrivalTimePix::IsValid() const92 Float_t MArrivalTimePix::GetArrivalTime() const 93 93 { 94 return (!IsLoGainUsed() && fArrivalTimeHiGainError >= 0) || (IsLoGainUsed() && fArrivalTimeLoGainError >= 0); 94 // If hi-gain is not saturated and has successfully been 95 // extracted use the hi-gain arrival time 96 if (!IsHiGainSaturated() && IsHiGainValid()) 97 return GetArrivalTimeHiGain(); 98 99 // If hi-gain could not be used ans the lo-gain could 100 // not be extracted return 101 if (!IsLoGainValid()) 102 return 0; 103 104 // in all other cases use the lo-gain arrival time 105 return GetArrivalTimeLoGain(); 106 } 107 108 Bool_t MArrivalTimePix::IsArrivalTimeValid() const 109 { 110 // If hi-gain is not saturated and has successfully been 111 // extracted use the hi-gain arrival time 112 if (!IsHiGainSaturated() && IsHiGainValid()) 113 return kTRUE; 114 115 // If hi-gain could not be used ans the lo-gain could 116 // not be extracted return kFALSE (no valid arrival time) 117 if (!IsLoGainValid()) 118 return kFALSE; 119 120 // in all other cases use the lo-gain arrival time 121 return kTRUE; 95 122 } 96 123 -
trunk/MagicSoft/Mars/msignal/MArrivalTimePix.h
r7843 r7876 47 47 Float_t GetArrivalTimeLoGainError() const { return fArrivalTimeLoGainError; } 48 48 49 Float_t GetArrivalTime() const { return IsLoGainUsed() ? fArrivalTimeLoGain : fArrivalTimeHiGain; } 49 Float_t GetArrivalTime() const; 50 Bool_t IsArrivalTimeValid() const; 50 51 51 52 Byte_t GetNumHiGainSaturated() const { return fNumHiGainSaturated; } 52 53 Byte_t GetNumLoGainSaturated() const { return fNumLoGainSaturated; } 53 54 54 Bool_t IsLoGainUsed() const { return fNumHiGainSaturated > 0; } 55 Bool_t IsLoGainValid() const { return fArrivalTimeLoGainError>=0 && fNumLoGainSaturated==0; } 56 Bool_t IsHiGainValid() const { return fArrivalTimeHiGainError>=0 && fNumHiGainSaturated==0; } 57 Bool_t IsValid() const; 55 Bool_t IsHiGainSaturated() const { return fNumHiGainSaturated>0; } 56 Bool_t IsLoGainSaturated() const { return fNumLoGainSaturated>0; } 57 58 Bool_t IsLoGainValid() const { return fArrivalTimeLoGainError>=0; } 59 Bool_t IsHiGainValid() const { return fArrivalTimeHiGainError>=0; } 58 60 59 61 ClassDef(MArrivalTimePix, 1) // Storage Container for ArrivalTime information of one pixel -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r7844 r7876 399 399 { 400 400 maxpos = ids-fHiGainFirst-1; 401 fMaxBinContent = *p; 401 // range-fWindowSizeHiGain+1 == fHiLoLast isn't it? 402 if (maxpos > 1 && maxpos < (range - fWindowSizeHiGain + 1)) 403 fMaxBinContent = *p; 402 404 } 403 405 … … 420 422 if (*logain > fMaxBinContent) 421 423 { 422 maxpos = ids-fHiGainFirst-1; 423 fMaxBinContent = *logain; 424 maxpos = ids-fHiGainFirst-1; 425 // range-fWindowSizeHiGain+1 == fHiLoLast isn't it? 426 //if (maxpos > 1 && maxpos < (range - fWindowSizeHiGain + 1)) 427 // fMaxBinContent = *logain; 424 428 } 425 429 … … 1088 1092 // between every two FADC slices, instead of numerically 1089 1093 } 1094 1090 1095 sum *= step; // Transform sum in integral 1091 1096 return sum; … … 1105 1110 1106 1111 // The order is important. In some cases (limlo-/limup-check) it can 1107 // happen tha nmax<0. In this case we start at 01112 // happen that max<0. In this case we start at 0 1108 1113 if (start > max) 1109 1114 start = max; -
trunk/MagicSoft/Mars/msignal/MExtractedSignalCam.cc
r7864 r7876 144 144 idx++; 145 145 146 if (!pix->Is Valid())146 if (!pix->IsLoGainValid() && ! pix->IsHiGainValid()) 147 147 continue; 148 148 … … 163 163 case 0: 164 164 val = pix.GetExtractedSignalHiGain(); 165 return pix.IsHiGainValid() ;165 return pix.IsHiGainValid() && !pix.IsHiGainSaturated(); 166 166 167 167 case 1: … … 171 171 case 2: 172 172 val = pix.GetExtractedSignalLoGain(); 173 return pix.IsLoGainValid() ;173 return pix.IsLoGainValid() && !pix.IsLoGainSaturated(); 174 174 175 175 case 3: … … 180 180 // extracted from lo- and hi-gain 181 181 case 4: 182 // Lo- and hi-gain must be successfully extracted 182 183 if (!pix.IsLoGainValid() || !pix.IsHiGainValid()) 183 184 return kFALSE; 184 185 186 // Lo- and hi-gain must not be saturated 187 if (pix.IsLoGainSaturated() || pix.IsHiGainSaturated()) 188 return kFALSE; 189 190 // Both signals must have a positive value 185 191 if (pix.GetExtractedSignalLoGain()<=0 || pix.GetExtractedSignalHiGain()<=0) 186 192 return kFALSE; -
trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc
r7829 r7876 47 47 48 48 static const Float_t gkSignalInitializer = -99999.9; 49 49 50 // ------------------------------------------------------------------------ 50 51 // … … 95 96 } 96 97 97 Bool_t MExtractedSignalPix::IsValid() const98 {99 return (!IsLoGainUsed() && fExtractedSignalHiGainError >= 0) || (IsLoGainUsed() && fExtractedSignalLoGainError >= 0);100 }101 102 98 void MExtractedSignalPix::SetGainSaturation(Byte_t higain, Byte_t logain) 103 99 { -
trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.h
r7842 r7876 39 39 Byte_t GetNumLoGainSaturated() const { return fNumLoGainSaturated; } 40 40 41 Bool_t IsLoGainUsed() const { return fNumHiGainSaturated>0; } 42 Bool_t IsLoGainValid() const { return fExtractedSignalLoGainError>=0 && fNumLoGainSaturated==0; } 43 Bool_t IsHiGainValid() const { return fExtractedSignalHiGainError>=0 && fNumHiGainSaturated==0; } 44 Bool_t IsValid() const; 41 Bool_t IsHiGainSaturated() const { return fNumHiGainSaturated>0; } 42 Bool_t IsLoGainSaturated() const { return fNumLoGainSaturated>0; } 43 44 Bool_t IsLoGainValid() const { return fExtractedSignalLoGainError>=0; } 45 Bool_t IsHiGainValid() const { return fExtractedSignalHiGainError>=0; } 45 46 46 47 ClassDef(MExtractedSignalPix, 3) // Storage Container for Extracted Signal information of one pixel -
trunk/MagicSoft/Mars/msignal/MSignalCam.cc
r7832 r7876 656 656 break; 657 657 658 /* 658 659 case 10: // lo gain time 659 660 if (pix->IsPixelUnmapped() || !pix->IsLoGainUsed() || … … 672 673 val = pix->GetArrivalTime(); 673 674 return kTRUE; 675 */ 674 676 675 677 default: -
trunk/MagicSoft/Mars/msignal/MSignalPix.cc
r7829 r7876 93 93 fPhot = 0; 94 94 fErrPhot = 0; 95 fLoGainUsed = kFALSE;96 95 } 97 96 -
trunk/MagicSoft/Mars/msignal/MSignalPix.h
r7829 r7876 20 20 Float_t fArrivalTime; // Calibrated Arrival Time 21 21 22 Bool_t fLoGainUsed; //! Is lo gain used23 24 22 public: 25 23 MSignalPix(Float_t phot=0, Float_t errphot=0); … … 34 32 pix.fPhot = fPhot; 35 33 pix.fErrPhot = fErrPhot; 36 pix.fLoGainUsed = fLoGainUsed;37 34 } 38 35 … … 60 57 void SetArrivalTime(Float_t tm) { MMath::ReducePrecision(tm); fArrivalTime = tm; } 61 58 62 void SetLoGainUsed(Bool_t b=kTRUE) { fLoGainUsed=b; }63 Bool_t IsLoGainUsed() const { return fLoGainUsed; }64 65 59 void AddNumPhotons(Float_t f) { fPhot += f; } 66 60 void Scale(Float_t f) { fPhot /= f; }
Note:
See TracChangeset
for help on using the changeset viewer.