Changeset 5156 for trunk/MagicSoft
- Timestamp:
- 10/01/04 16:41:51 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r5133 r5156 1 1 2 /* ======================================================================== *\ 2 3 ! … … 955 956 if (cal.GetMean() < fChargeLimit*cal.GetPedRms()) 956 957 { 957 *fLog << warn << GetDescriptor()958 << Form(" : Fitted Charge: %5.2f is smaller than%2.1f",cal.GetMean(),fChargeLimit)959 << Form(" Pedestal RMS: %5.2f in %s%4i",cal.GetPedRms(),what,cal.GetPixId()) << endl;958 *fLog << warn 959 << Form("Fitted Charge: %5.2f < %2.1f",cal.GetMean(),fChargeLimit) 960 << Form(" * Pedestal RMS %5.2f in %s%3i",cal.GetPedRms(),what,cal.GetPixId()) << endl; 960 961 bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal); 961 962 } … … 963 964 if (cal.GetMean() < fChargeRelErrLimit*cal.GetMeanErr()) 964 965 { 965 *fLog << warn << GetDescriptor()966 << Form(" : Fitted Charge: %4.2f is smaller than %2.1f",cal.GetMean(),fChargeRelErrLimit)967 << Form(" times its error: %4.2f in %s%4i",cal.GetMeanErr(),what,cal.GetPixId()) << endl;966 *fLog << warn 967 << Form("Fitted Charge: %4.2f < %2.1f",cal.GetMean(),fChargeRelErrLimit) 968 << Form(" * its error %4.2f in %s%3i",cal.GetMeanErr(),what,cal.GetPixId()) << endl; 968 969 bad.SetUncalibrated( MBadPixelsPix::kChargeRelErrNotValid ); 969 970 } … … 971 972 if (cal.GetSigma() < cal.GetPedRms()) 972 973 { 973 *fLog << warn << GetDescriptor()974 << Form(" : Sigma of Fitted Charge: %6.2f is smaller than",cal.GetSigma())975 << Form(" Ped. RMS : %5.2f in %s%4i",cal.GetPedRms(),what,cal.GetPixId()) << endl;974 *fLog << warn 975 << Form("Sigma of Fitted Charge: %6.2f <",cal.GetSigma()) 976 << Form(" Ped. RMS=%5.2f in %s%3i",cal.GetPedRms(),what,cal.GetPixId()) << endl; 976 977 bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid ); 977 978 return kFALSE; … … 980 981 if (!cal.CalcReducedSigma()) 981 982 { 982 *fLog << warn << GetDescriptor()983 << Form(" :Could not calculate the reduced sigma in %s: ",what)983 *fLog << warn 984 << Form("Could not calculate the reduced sigma in %s: ",what) 984 985 << Form(" %4i",cal.GetPixId()) 985 986 << endl; … … 990 991 if (!cal.CalcFFactor()) 991 992 { 992 *fLog << warn << GetDescriptor()993 << Form(" :Could not calculate the F-Factor in %s: ",what)993 *fLog << warn 994 << Form("Could not calculate the F-Factor in %s: ",what) 994 995 << Form(" %4i",cal.GetPixId()) 995 996 << endl; … … 1000 1001 if (!cal.CalcConvFFactor()) 1001 1002 { 1002 *fLog << warn << GetDescriptor()1003 << Form(" :Could not calculate the Conv. FADC counts to Phes in %s: ",what)1003 *fLog << warn 1004 << Form("Could not calculate the Conv. FADC counts to Phes in %s: ",what) 1004 1005 << Form(" %4i",cal.GetPixId()) 1005 1006 << endl; -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
r5134 r5156 418 418 if ( res < lowlim[aidx] || res > upplim[aidx] ) 419 419 { 420 *fLog << warn << GetDescriptor() << ": Deviating time resolution: "421 << Form("%4.2f",res) << " out of accepted limits : ["422 << Form("%4.2f %s%4.2f",lowlim[aidx],",",upplim[aidx]) << "] in pixel " << i << endl;420 *fLog << warn << "Deviating time resolution: " 421 << Form("%4.2f",res) << " out of accepted limits [" 422 << Form("%4.2f,%4.2f",lowlim[aidx],upplim[aidx]) << "] in pixel " << i << endl; 423 423 bad.SetUncalibrated( MBadPixelsPix::kDeviatingTimeResolution); 424 424 pix.SetExcluded(); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r5151 r5156 923 923 if (overflow > 0.1) 924 924 { 925 *fLog << warn << GetDescriptor()926 << " : HiGain Histogram Overflow occurred " << overflow927 << " times in pix el: " << i << " (withoutsaturation!) " << endl;925 *fLog << warn 926 << "HiGain Hist-overflow " << overflow 927 << " times in pix: " << i << " (w/o saturation!) " << endl; 928 928 bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow ); 929 929 } … … 932 932 if (overflow > 0.1) 933 933 { 934 *fLog << warn << GetDescriptor()935 << " : HiGain Histogram Underflow occurred" << overflow936 << " times in pix el: " << i << " (withoutsaturation!) " << endl;934 *fLog << warn 935 << "HiGain Hist-underflow " << overflow 936 << " times in pix: " << i << " (w/o saturation!) " << endl; 937 937 bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow ); 938 938 } … … 965 965 if (overflow > 0.1) 966 966 { 967 *fLog << warn << GetDescriptor()968 << " : LoGain Histogram Overflow occurred" << overflow969 << " times in pix el: " << i << " (withoutsaturation!) " << endl;967 *fLog << warn 968 << "LoGain Hist-overflow " << overflow 969 << " times in pix: " << i << " (w/o saturation!) " << endl; 970 970 bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow ); 971 971 } … … 974 974 if (overflow > 0.1) 975 975 { 976 *fLog << warn << GetDescriptor()977 << " : LoGain Histogram Underflow occurred" << overflow978 << " times in pix el: " << i << " (withoutsaturation!) " << endl;976 *fLog << warn 977 << "LoGain Hist-underflow " << overflow 978 << " times in pix: " << i << " (w/o saturation!) " << endl; 979 979 bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow ); 980 980 } … … 1108 1108 if ( mean < lowerlimit) 1109 1109 { 1110 *fLog << warn << GetDescriptor()1111 << Form("%s%3.1f%s%2.1f%s%s"," : Mean ArrivalTime: ",mean," smaller than",fTimeLowerLimit,1112 " FADCslices from lower edge in pixel ",hist.GetName()) << endl;1110 *fLog << warn 1111 << Form("%s%3.1f%s%2.1f%s%s","Mean ArrivalTime=",mean," < ",fTimeLowerLimit, 1112 " slices from lower edge in pixel ",hist.GetName()) << endl; 1113 1113 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin ); 1114 1114 } … … 1116 1116 if ( mean > upperlimit ) 1117 1117 { 1118 *fLog << warn << GetDescriptor()1119 << Form("%s%3.1f%s%2.1f%s%s"," : Mean ArrivalTime: ",mean," greater than",fTimeUpperLimit,1120 " FADCslices from upper edge in pixel ",hist.GetName()) << endl;1118 *fLog << warn 1119 << Form("%s%3.1f%s%2.1f%s%s","Mean ArrivalTime=",mean," > ",fTimeUpperLimit, 1120 " slices from upper edge in pixel ",hist.GetName()) << endl; 1121 1121 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins ); 1122 1122 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
r5137 r5156 436 436 if (overflow > 0.1) 437 437 { 438 *fLog << warn << GetDescriptor() 439 << ": HiGain Histogram Overflow occurred " << overflow 440 << " times in pixel: " << i << " (without saturation!) " << endl; 438 *fLog << warn << "HiGain Hist-overflow occurred " << overflow 439 << " times in pix: " << i << " (w/o saturation!) " << endl; 441 440 // bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow ); 442 441 } … … 445 444 if (overflow > 0.1) 446 445 { 447 *fLog << warn << GetDescriptor() 448 << ": HiGain Histogram Underflow occurred " << overflow 449 << " times in pixel: " << i << " (without saturation!) " << endl; 446 *fLog << warn << "HiGain Hist-underflow occurred " << overflow 447 << " times in pix: " << i << " (w/o saturation!) " << endl; 450 448 // bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow ); 451 449 } -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r5143 r5156 30 30 // currents or enything else derived from MCamEvent 31 31 // 32 // Setup 33 // ===== 34 // 32 35 // To plot the variance instead of the rms use: 33 36 // MHCamEvent::SetBit(MHCamera::kVariance); 37 // or 38 // MHCamEvent::EnableVariance() 39 // 40 // To count how often a certain pixel is above or below a threshold do: 41 // MHCamEvent::SetThreshold(5.5); // Default=LowerBound 42 // MHCamEvent::SetThreshold(5.5, MHCamEvent::kIsUpperBound); 43 // 34 44 // 35 45 // Axis titles … … 47 57 // MHCamEvent myhist("Titele;;y [cm]"); 48 58 // 49 //50 59 ///////////////////////////////////////////////////////////////////////////// 51 60 #include "MHCamEvent.h" … … 88 97 // 89 98 MHCamEvent::MHCamEvent(const char *name, const char *title) 90 : fSum(NULL), fEvt(NULL), fType(0) 99 : fSum(NULL), fEvt(NULL), fType(0), fThreshold(0), fUseThreshold(0) 91 100 { 92 101 Init(name, title); … … 98 107 // 99 108 MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title) 100 : fSum(NULL), fEvt(NULL), fType(type) 109 : fSum(NULL), fEvt(NULL), fType(type), fThreshold(0), fUseThreshold(0) 101 110 { 102 111 Init(name, title); … … 111 120 if (fSum) 112 121 delete fSum; 122 } 123 124 // -------------------------------------------------------------------------- 125 // 126 // use this to display the variance instead of the rms. 127 // 128 void MHCamEvent::EnableVariance(Bool_t b) 129 { 130 b ? SetBit(MHCamera::kVariance) : ResetBit(MHCamera::kVariance); 113 131 } 114 132 … … 140 158 } 141 159 160 // Delete a posible old histogram from a previous loop 142 161 if (fSum) 143 162 delete (fSum); 144 163 164 // combine name 145 165 const TString name = fNameEvt.IsNull() ? fName : fNameEvt; 146 166 167 // create and setup MHCamera 147 168 fSum = new MHCamera(*cam, name+";avg"); 148 169 if (fTitle!=gsDefTitle) … … 169 190 return kFALSE; 170 191 } 171 fSum->AddCamContent(*evt, fType); 192 if (fUseThreshold) 193 fSum->CntCamContent(*evt, fThreshold, fType, fUseThreshold>0); 194 else 195 fSum->AddCamContent(*evt, fType); 172 196 return kTRUE; 173 197 } … … 274 298 MHCamera *cam = new MHCamera(*fSum->GetGeometry()); 275 299 cam->SetName(Form("Err_%p", this)); 276 cam->SetTitle( TestBit(MHCamera::kVariance)?"Variance":"Root Mean Squared (rms)");300 cam->SetTitle(fSum->TestBit(MHCamera::kVariance)?"Variance":"Root Mean Squared (rms)"); 277 301 cam->SetYTitle(fSum->GetYaxis()->GetTitle()); 278 302 cam->SetCamContent(*fSum, 1); … … 292 316 h->Draw(); 293 317 } 318 -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r5143 r5156 15 15 static const TString gsDefTitle; 16 16 17 MHCamera *fSum; // storing the sum18 MCamEvent *fEvt; //! the current event17 MHCamera *fSum; // storing the sum 18 MCamEvent *fEvt; //! the current event 19 19 20 TString fNameEvt; 20 TString fNameEvt; // Nameof MCamEvent to fill into histogram 21 21 22 Int_t fType; 22 Int_t fType; // Type to used for calling GetPixelContent 23 24 Float_t fThreshold; // Count pixel above/below this threshold 25 Char_t fUseThreshold; // Use a threshold? Which direction has it? 23 26 24 27 void Init(const char *name, const char *title); … … 28 31 29 32 public: 33 enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0 }; 34 30 35 MHCamEvent(const char *name=NULL, const char *title=NULL); 31 36 MHCamEvent(Int_t type, const char *name=NULL, const char *title=NULL); … … 42 47 void PrintOutliers(Float_t s) const; 43 48 49 void SetThreshold(Float_t f, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; } 50 void EnableVariance(Bool_t b=kTRUE); 51 44 52 ClassDef(MHCamEvent, 1) // Histogram to sum camera events 45 53 }; -
trunk/MagicSoft/Mars/mhist/MHCamEventRot.cc
r3786 r5156 71 71 // 72 72 MHCamEventRot::MHCamEventRot(const char *name, const char *title) 73 : fTime(0), fPointPos(0), fObservatory(0), fType(0), fNameTime("MTime") 73 : fTime(0), fPointPos(0), fObservatory(0), fType(0), fNameTime("MTime"), 74 fThreshold(0), fUseThreshold(kNoBound) 74 75 { 75 76 // … … 192 193 193 194 // Fill histogram 194 fHist.Fill(cx[ix], cy[iy], val); 195 if (fUseThreshold!=kNoBound) 196 { 197 if (val>fThreshold && fUseThreshold==kIsLowerBound || 198 val<fThreshold && fUseThreshold==kIsUpperBound) 199 fHist.Fill(cx[ix], cy[iy]); 200 } 201 else 202 fHist.Fill(cx[ix], cy[iy], val); 195 203 } 196 204 } -
trunk/MagicSoft/Mars/mhist/MHCamEventRot.h
r3786 r5156 28 28 TH2D fHist; // Alpha vs. x and y 29 29 30 Int_t fType; 30 Int_t fType; // Type to used for calling GetPixelContent 31 31 32 32 Double_t fRa; … … 35 35 TString fNameTime; 36 36 37 Float_t fThreshold; // Count pixel above/below this threshold 38 Char_t fUseThreshold; // Use a threshold? Which direction has it? 39 37 40 TObject *GetCatalog(); 38 41 39 42 public: 43 enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0 }; 44 40 45 MHCamEventRot(const char *name=NULL, const char *title=NULL); 41 46 … … 49 54 void Draw(Option_t *option=""); 50 55 56 void SetThreshold(Float_t f, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; } 57 51 58 ClassDef(MHCamEventRot, 1) //2D-histogram in MCamEvent data (derotated) 52 59 }; -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r5143 r5156 1257 1257 // 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE) 1258 1258 // 1259 // in unused pixel is not counted if it didn't fullfill the condition. 1260 // 1259 1261 void MHCamera::CntCamContent(const MCamEvent &event, Double_t threshold, Int_t type, Bool_t isabove) 1260 1262 { … … 1267 1269 Double_t val=threshold; 1268 1270 if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/) 1271 { 1269 1272 SetUsed(idx); 1270 1273 1271 if (val>threshold && isabove) 1272 Fill(idx); 1273 if (val<threshold && !isabove) 1274 Fill(idx); 1274 if (isabove && val>threshold) 1275 Fill(idx); 1276 if (!isabove && val<threshold) 1277 Fill(idx); 1278 } 1275 1279 } 1276 1280 fEntries++; … … 1283 1287 // 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE) 1284 1288 // 1289 // in unused pixel is not counted if it didn't fullfill the condition. 1290 // 1285 1291 void MHCamera::CntCamContent(const MCamEvent &event, TArrayD threshold, Int_t type, Bool_t isabove) 1286 1292 { … … 1293 1299 Double_t val=threshold[idx]; 1294 1300 if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/) 1301 { 1295 1302 SetUsed(idx); 1296 1303 1297 if (val>threshold[idx] && isabove) 1298 Fill(idx); 1299 if (val<threshold[idx] && !isabove) 1300 Fill(idx); 1304 if (val>threshold[idx] && isabove) 1305 Fill(idx); 1306 if (val<threshold[idx] && !isabove) 1307 Fill(idx); 1308 } 1301 1309 } 1302 1310 fEntries++; … … 1315 1323 for (Int_t idx=0; idx<fNcells-2; idx++) 1316 1324 { 1317 if ( const_cast<TArrayD&>(event)[idx]>threshold)1325 if (event[idx]>threshold) 1318 1326 Fill(idx); 1319 1327
Note:
See TracChangeset
for help on using the changeset viewer.