Changeset 6820 for trunk/MagicSoft
- Timestamp:
- 03/15/05 11:10:55 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6819 r6820 21 21 22 22 -*-*- END OF LINE -*-*- 23 2005/03/14 Toni Coarasa24 Please use the new CVS25 26 23 2005/03/14 Thomas Bretz 27 24 28 25 * mbase/MGMenu.h: 29 26 - added a fix for root 4.02.00 27 28 29 2005/03/14 Markus Gaug 30 31 * mcalib/MCalibrateData.cc 32 - catch the case that now high-gain low-gian intercalibration const. 33 is available. 34 35 * mjobs/MJPedestal.cc 36 - modify option for pedy*.root: from UPDATE to RECREATE 37 38 39 40 2005/03/11 Markus Gaug 41 42 * callisto.rc 43 - changed default weights for DF to cosmics_weights4.dat. (This has 44 turned out to be the most stable set of weights). 45 46 * mjobs/MJCalibration.cc 47 - some cosmetic changes in the output 48 - in case of WriteHists(), do not overwrite existing signal*.root 49 file, but append histograms (bugfix!) 50 51 52 53 2005/03/10 Toni Coarasa (With Nadia's and Alessandro's inside) 54 55 * mjobs/MJCut.cc 56 - inclusion of (TString) to avoid compiler error under 2.95.3 57 58 * sinope.cc 59 - inclusion of <errno.h> to avoid compiler error under 2.95.3 60 61 62 63 2005/03/10 Markus Gaug 64 65 * msignal/MExtractTimeAndCharge.cc 66 - set fgLoGainStartShift to -4.0 67 - put a check to avoid a dynamic low-gain range < 0 (should not 68 occur with current extractors, but one never knows...) 69 70 * msignal/MExtractor.[h,cc] 71 - introduced Clear()-function, used in SetRange() 72 73 * mjobs/MJCalibrateSignal.cc 74 - changed order of initialization of the 2 MWriteRootFiles whereupon 75 the crash goes away. Have to revise the /dev/null work-around 76 in MWriteRootFile! 30 77 31 78 -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r6199 r6820 669 669 if (sig.IsLoGainUsed()) 670 670 { 671 signal = sig.GetExtractedSignalLoGain()*fHiLoConv [pixidx]; 672 signalErr = sig.GetExtractedSignalLoGain()*fHiLoConvErr[pixidx]; 671 if (fHiLoConv[pixidx] < 0.5) 672 { 673 signal = sig.GetExtractedSignalHiGain()*1.5; 674 signalErr = sig.GetExtractedSignalHiGain()*2.; 675 } 676 else 677 { 678 signal = sig.GetExtractedSignalLoGain()*fHiLoConv [pixidx]; 679 signalErr = sig.GetExtractedSignalLoGain()*fHiLoConvErr[pixidx]; 680 } 673 681 } 674 682 else -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6798 r6820 159 159 Bool_t MJCalibrateSignal::WriteResult(TObjArray &cont) 160 160 { 161 const TString name(Form("signal%08d.root", fSequence.GetSequence())); 162 return WriteContainer(cont, name); 161 if (IsNoStorage()) 162 return kTRUE; 163 164 const TString name(Form("signal%08d.root", fSequence.GetSequence())); 165 return WriteContainer(cont, name); 163 166 } 164 167 … … 367 370 368 371 *fLog << all; 369 if (extractor1)370 {371 *fLog << underline << "Signal Extractor found in calibration file" << endl;372 extractor1->Print();373 *fLog << endl;374 extractor3 = (MExtractor*)extractor1->Clone();375 376 }377 else378 *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl;379 380 if (extractor2)381 {382 *fLog << underline << "Time Extractor found in calibration file" << endl;383 extractor2->Print();384 *fLog << endl;385 }386 else387 *fLog << inf << "No Time Extractor: ExtractTime in file." << endl;388 389 372 if (!geom.IsNull()) 390 373 *fLog << inf << "Camera geometry found in file: " << geom << endl; … … 395 378 if (!ReadExtractorCosmics(extractor1)) 396 379 *fLog << warn << "No extraction window update for signal extractor found" << endl; 380 381 if (extractor1) 382 { 383 *fLog << underline << "Signal Extractor found in calibration file" << endl; 384 extractor1->Print(); 385 *fLog << endl; 386 extractor3 = (MExtractor*)extractor1->Clone(); 387 } 388 else 389 *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl; 390 391 if (extractor2) 392 { 393 *fLog << underline << "Time Extractor found in calibration file" << endl; 394 extractor2->Print(); 395 *fLog << endl; 396 } 397 else 398 *fLog << inf << "No Time Extractor: ExtractTime in file." << endl; 397 399 398 400 // This is necessary for the case in which it is not in the files … … 436 438 const TString fname(Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data())); 437 439 438 // Write the special MC tree 439 MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW"); 440 writemc.SetName("WriteMC"); 441 writemc.AddContainer("MMcEvtBasic", "OriginalMC"); 442 440 443 441 // Skips empty MC events (Not necessary, but faster!) 444 442 MContinue contmc("MRawEvtData.GetNumPixels<0.5", "ContEmptyMC"); … … 689 687 write.AddContainer("MTimeCC", "CC", kFALSE); 690 688 689 // Write the special MC tree 690 MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW"); 691 writemc.SetName("WriteMC"); 692 writemc.AddContainer("MMcEvtBasic", "OriginalMC"); 693 691 694 // Now setup tasklist for events 692 695 MTaskList tlist2; … … 836 839 interlacedcont.Add(&hilcam); 837 840 841 if (IsHistsStorage()) 842 { 843 interlacedcont.Add(plist.FindObject("MHCalibrationHiLoCam")); 844 interlacedcont.Add(plist.FindObject("MHCalibrationPulseTimeCam")); 845 } 846 838 847 if (!WriteResult(interlacedcont)) 839 848 return kFALSE; 840 849 841 // if (IsHistsStorage())842 // {843 // addcont.Add(plist.FindObject("MHCalibrationHiLoCam"));844 // addcont.Add(plist.FindObject("MHCalibrationPulseTimeCam"));845 // }846 847 850 // return if job went ok 848 851 *fLog << all << GetDescriptor() << ": Done." << endl; -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r6777 r6820 177 177 const Int_t MJCalibration::gkThirdBlindPixelInstallation = 43308; 178 178 const TString MJCalibration::fgReferenceFile = "mjobs/calibrationref.rc"; 179 const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df 6.root";179 const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df4.root"; 180 180 // -------------------------------------------------------------------------- 181 181 // … … 1482 1482 MCalibrationHiLoCam hilocam; 1483 1483 1484 *fLog << all << "Initializing High gain vs. Low gain intercalibration from " << fHiLoCalibFile << endl; 1485 *fLog << all << endl; 1486 1484 1487 if (hilocam.Read()<=0) 1485 1488 { … … 1712 1715 } 1713 1716 1714 //if (!CheckEnv())1715 // return kFALSE;1716 1717 if (!CheckEnv())1718 return kFALSE;1719 1720 1717 // -------------------------------------------------------------------------------- 1721 1718 … … 1732 1729 // -------------------------------------------------------------------------------- 1733 1730 1731 if (!CheckEnv()) 1732 return kFALSE; 1733 1734 // -------------------------------------------------------------------------------- 1735 1734 1736 // Setup Tasklist 1735 1737 MParList plist; … … 1975 1977 tlist.PrintStatistics(); 1976 1978 1977 if (fIsPixelCheck) 1978 { 1979 MHCalibrationChargeCam *hcam = (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam"); 1980 MHCalibrationChargePix &pix1 = (MHCalibrationChargePix&)(*hcam)[fCheckedPixId]; 1981 pix1.DrawClone(""); 1982 1983 MHCalibrationChargePix &pix2 = (MHCalibrationChargePix&)(*hcam)(fCheckedPixId); 1984 pix2.DrawClone(""); 1985 1986 if (IsRelTimes()) 1987 { 1988 MHCalibrationRelTimeCam *hccam = (MHCalibrationRelTimeCam*)plist.FindObject("MHCalibrationRelTimeCam"); 1989 MHCalibrationPix &pix11 = (*hccam)[fCheckedPixId]; 1990 pix11.DrawClone(""); 1991 MHCalibrationPix &pix12 = (*hccam)(fCheckedPixId); 1992 pix12.DrawClone(""); 1993 } 1994 } 1995 1979 // -------------------------------------------------------------------------------- 1980 1981 if (fIsPixelCheck) 1982 { 1983 MHCalibrationChargeCam *hcam = (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam"); 1984 MHCalibrationChargePix &pix1 = (MHCalibrationChargePix&)(*hcam)[fCheckedPixId]; 1985 pix1.DrawClone(""); 1986 1987 MHCalibrationChargePix &pix2 = (MHCalibrationChargePix&)(*hcam)(fCheckedPixId); 1988 pix2.DrawClone(""); 1989 1990 if (IsRelTimes()) 1991 { 1992 MHCalibrationRelTimeCam *hccam = (MHCalibrationRelTimeCam*)plist.FindObject("MHCalibrationRelTimeCam"); 1993 MHCalibrationPix &pix11 = (*hccam)[fCheckedPixId]; 1994 pix11.DrawClone(""); 1995 MHCalibrationPix &pix12 = (*hccam)(fCheckedPixId); 1996 pix12.DrawClone(""); 1997 } 1998 } 1999 1996 2000 if (!fCalibrationPINDiode.IsValid()) 1997 1998 2001 SetUsePINDiode(kFALSE); 2002 1999 2003 DisplayResult(plist); 2000 2004 2001 2005 if (!WriteResult(plist)) 2002 2003 2006 return kFALSE; 2007 2004 2008 *fLog << all << GetDescriptor() << ": Done." << endl; 2005 2009 2006 2010 return kTRUE; 2007 2011 } -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r6530 r6820 347 347 TString fname0(path); 348 348 TString fname1(path); 349 fname0 += fNameSummary.IsNull() ? Form("ganymed%08d-summary.root", set.GetNumAnalysis()) : fNameSummary;350 fname1 += fNameResult.IsNull() ? Form("ganymed%08d-result.root", set.GetNumAnalysis()) : fNameResult;349 fname0 += fNameSummary.IsNull() ? (TString) Form("ganymed%08d-summary.root", set.GetNumAnalysis()) : fNameSummary; 350 fname1 += fNameResult.IsNull() ? (TString) Form("ganymed%08d-result.root", set.GetNumAnalysis()) : fNameResult; 351 351 352 352 MWriteRootFile write0(fPathOut.IsNull()?0:fname0.Data(), fOverwrite?"RECREATE":"NEW"); -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r6785 r6820 179 179 const TString fname = GetOutputFile(); 180 180 181 const Bool_t fileexist = !gSystem->AccessPathName(fname, kFileExists); 182 if (!fileexist) 183 { 184 *fLog << inf << "Input file " << fname << " not found, will create pedestals" << endl; 185 return kFALSE; 186 } 187 181 188 *fLog << inf << "Reading pedestals from file: " << fname << endl; 182 189 … … 242 249 *fLog << inf << "Updating extractor in file: " << fname << endl; 243 250 244 TFile file(fname, "UPDATE");251 TFile file(fname, fOverwrite?"RECREATE":"NEW"); 245 252 if (!file.IsOpen()) 246 253 { 247 254 *fLog << err << dbginf << "ERROR - Could not open file " << fname << endl; 255 *fLog << err << dbginf << "Maybe, file " << fname << " already exists, call callisto with option -f then." << endl; 248 256 return kFALSE; 249 257 } … … 252 260 cont.Add(fExtractor); 253 261 254 return WriteContainer(cont ,name, fOverwrite?"RECREATE":"NEW");262 return WriteContainer(cont); 255 263 } 256 264 … … 914 922 if (fRuns && fRuns->GetNumRuns() != fRuns->GetNumEntries()) 915 923 { 916 *fLog << err << "Number of files found doesn't match number of runs... abort." << endl; 924 *fLog << err << "Number of files found doesn't match number of runs... abort." 925 << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl; 917 926 return kFALSE; 918 927 } … … 1007 1016 1008 1017 MHPedestalCam hpedcam; 1009 hpedcam.SetRenorm(kTRUE); 1018 if (fExtractionType != kFundamental) 1019 hpedcam.SetRenorm(kTRUE); 1010 1020 // fPedestalHist.SetRenorm(kTRUE); 1011 1021 // fPedestalHist.SetPedestalsOut(&fPedestalCamOut); 1022 hpedcam.SetPedestalsOut(&fPedestalCamOut); 1012 1023 1013 1024 MPedestalCam pedinter; … … 1038 1049 sel.SetNumSelectEvts(0); 1039 1050 1040 if (fExtract ionType!=kFundamental && fExtractor)1051 if (fExtractor) 1041 1052 { 1042 1053 fExtractor->SetFilter(&sel); … … 1077 1088 1078 1089 if (fIsUseHists) 1079 { 1090 { 1091 if (fExtractor->InheritsFrom("MExtractTimeAndCharge")) 1092 hpedcam.SetFitStart(-10.*((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain()); 1093 1080 1094 pedcalc.SetIntermediateStorage(); 1081 1095 pedlogain.SetIntermediateStorage(); … … 1248 1262 const Float_t meanpulsetime = cam->GetAverageArea(0).GetHiGainMean(); 1249 1263 const Float_t rmspulsetime = cam->GetAverageArea(0).GetHiGainRms(); 1250 *fLog << inf<< "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl;1264 *fLog << all << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl; 1251 1265 const Int_t newfirst = (Int_t)(meanpulsetime-fExtractWinLeft); 1252 1266 Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge") … … 1255 1269 if (wshigain > 6) 1256 1270 wshigain = 6; 1257 constInt_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge")1271 Int_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 1258 1272 ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain() 1259 1273 : 6; 1274 if (wslogain > 6) 1275 wslogain = 6; 1260 1276 const Int_t newlast = (Int_t)(meanpulsetime+fExtractWinRight); 1261 *fLog << inf << "Try to set new range limits: ("<<newfirst<<","<<newlast<<"+"<<wshigain 1262 <<","<<newfirst<<","<<newlast<<"+"<<wslogain<<")"<<endl; 1277 *fLog << all << underline 1278 << "Try to set new range limits: ("<<newfirst<<","<<newlast<<"+"<<wshigain 1279 <<","<<newfirst-1<<","<<newlast<<"+"<<wslogain<<")"<<endl; 1263 1280 if (newfirst < 0) 1264 1281 { … … 1274 1291 if (newlast+wslogain > data->GetNumLoGainSamples()) 1275 1292 { 1276 *fLog << err << "Pulse is too much to the right, cannot go beyond logain limits! " 1277 << " Try to use a different extractor ... " << endl; 1293 *fLog << err << "Pulse is too much to the right, cannot go beyond logaie limits! " << endl; 1294 *fLog << endl; 1295 *fLog << "Try to use a different extractor (e.g. with a window size of only 4 sl.) or:" << endl; 1296 *fLog << "Set the limit to a lower value (callisto.rc: line 310): " << endl; 1297 *fLog << " MJPedestalY2:ExtractWinRight: 5.0 " << endl; 1298 *fLog << "(ATTENTION, you will lose late cosmics pulses!)" << endl; 1299 *fLog << endl; 1278 1300 return kFALSE; 1279 1301 } 1280 fExtractor->SetRange(newfirst,newlast+wshigain,newfirst,data->GetNumLoGainSamples()-1); 1302 fExtractor->SetRange(newfirst,newlast+wshigain, 1303 newfirst>0?newfirst-1:newfirst,data->GetNumLoGainSamples()-1); 1281 1304 if (!WriteExtractor()) 1282 1305 { -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
r6798 r6820 85 85 using namespace std; 86 86 87 const Float_t MExtractTimeAndCharge::fgLoGainStartShift = - 2.8;87 const Float_t MExtractTimeAndCharge::fgLoGainStartShift = -4.0; 88 88 const Byte_t MExtractTimeAndCharge::fgLoGainSwitch = 120; 89 89 // -------------------------------------------------------------------------- … … 217 217 fLoGainFirstSave = fLoGainFirst; 218 218 const Byte_t logainstart = sathi 219 ? (sathi > (Int_t) fLoGainStartShift? sathi + (Int_t)fLoGainStartShift : fLoGainFirst)220 : ( Byte_t)(timehi + fLoGainStartShift);219 ? (sathi > (Int_t)(-fLoGainStartShift) ? sathi + (Int_t)fLoGainStartShift : fLoGainFirst) 220 : (timehi+fLoGainStartShift > 0. ? (Byte_t)(timehi + fLoGainStartShift) : fLoGainFirst); 221 221 fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave; 222 222 -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r6254 r6820 133 133 void MExtractor::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast) 134 134 { 135 fHiGainFirst = hifirst; 136 fHiGainLast = hilast; 137 138 fLoGainFirst = lofirst; 139 fLoGainLast = lolast; 135 136 Clear(); 137 138 fHiGainFirst = hifirst; 139 fHiGainLast = hilast; 140 141 fLoGainFirst = lofirst; 142 fLoGainLast = lolast; 140 143 } 141 144 -
trunk/MagicSoft/Mars/msignal/MExtractor.h
r5976 r6820 72 72 MExtractor(const char *name=NULL, const char *title=NULL); 73 73 74 void Clear(Option_t *o="") 75 { 76 fHiGainFirst = fHiGainLast = fLoGainFirst = fLoGainLast = fHiLoLast = 0; 77 } 78 74 79 Byte_t GetHiGainFirst() const { return fHiGainFirst; } 75 80 Byte_t GetHiGainLast () const { return fHiGainLast ; } -
trunk/MagicSoft/Mars/sinope.cc
r6604 r6820 1 #include <errno.h> 1 2 #include <fstream> 2 3
Note:
See TracChangeset
for help on using the changeset viewer.