Changeset 6858 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 03/18/05 18:07:46 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc
r6777 r6858 50 50 #include "MHCamera.h" 51 51 52 #include "MSignalCam.h" 52 53 #include "MPedestalCam.h" 53 54 #include "MPedPhotCam.h" … … 56 57 #include "MBadPixelsCalc.h" 57 58 #include "MBadPixelsMerge.h" 58 #include "MCerPhotEvt.h"59 #include "MArrivalTime.h"60 59 #include "MCalibrationChargeCam.h" 61 60 #include "MCalibrationRelTimeCam.h" … … 392 391 plist.AddToList(&tmcam); 393 392 394 M CerPhotEvtcerphot;393 MSignalCam cerphot; 395 394 MPedPhotCam pedphot; 396 395 MHCalibrationTestCam testcam; … … 479 478 MHCamEvent evt0(0,"Signal", "Un-Calibrated Signal;;S [FADC cnts]" ); 480 479 MHCamEvent evt1(0,"CalSig", "Cal. and Interp. Sig. by Pixel Size Ratio;;S [phe]"); 481 MHCamEvent evt2( 0,"Times" , "Arrival Time;;T [slice]");480 MHCamEvent evt2(6,"Times" , "Arrival Time;;T [slice]"); 482 481 483 482 MFillH fill0(&evt0, "MExtractedSignalCam", "FillUncalibrated"); 484 MFillH fill1(&evt1, "M CerPhotEvt", "FillCalibrated");485 MFillH fill2(&evt2, "M ArrivalTime","FillTimes");486 487 MFillH fillcam("MHCalibrationTestCam", "M CerPhotEvt" ,"FillTest");488 MFillH filltme("MHCalibrationTestTimeCam", "M ArrivalTime","FillTestTime");483 MFillH fill1(&evt1, "MSignalCam", "FillCalibrated"); 484 MFillH fill2(&evt2, "MSignalCam", "FillTimes"); 485 486 MFillH fillcam("MHCalibrationTestCam", "MSignalCam" ,"FillTest"); 487 MFillH filltme("MHCalibrationTestTimeCam", "MSignalCam", "FillTestTime"); 489 488 fillcam.SetBit(MFillH::kDoNotDisplay); 490 489 filltme.SetBit(MFillH::kDoNotDisplay); -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6839 r6858 53 53 #include "MGeomCam.h" 54 54 #include "MHCamEvent.h" 55 //#include "MHCamEventTH.h" 55 56 #include "MPedestalCam.h" 56 57 #include "MBadPixelsCam.h" … … 610 611 MHCamEvent evt5(0, "Interp'd", "Interpolated Signal;;S [phe]"); 611 612 MHCamEvent evt6(2, "Unsuitable", "Fraction of unsuitable events per Pixel;;[1]"); 612 MHCamEvent evt7( 0, "Times", "Calibrated Arrival Time;;T [fadc sl]");613 MHCamEvent evt7(6, "Times", "Calibrated Arrival Time;;T [fadc sl]"); 613 614 MHCamEvent evt8(0, "Conv", "Calibration Conv. Factors;;[phe/fadc cnts]"); 614 //MHCamEvent evt9(0, "PulsePos", "Pulse Position of cosmics"); //Calibration Conv. Factors;;[phe/fadc cnts] 615 615 MHCamEvent evt9(7, "PulsePos", "Pulse Position of cosmics (>15phe);;T"); //Calibration Conv. Factors;;[phe/fadc cnts] 616 /* 617 MHCamEventTH evt9(6, "PulsePos", "Pulse Position of cosmics"); //Calibration Conv. Factors;;[phe/fadc cnts] 618 evt9.SetNameThreshold("MCerPhotEvt"); 619 evt9.SetThreshold(15); 620 */ 621 /* 616 622 evt0.EnableSqrtVariance(); 617 623 evt1.EnableSqrtVariance(); … … 622 628 evt7.EnableSqrtVariance(); 623 629 evt8.EnableSqrtVariance(); 624 630 */ 625 631 MFillH fill0(&evt0, "MPedestalFundamental", "FillPedFLG"); 626 632 MFillH fill1(&evt1, "MPedestalFromExtractorRndm", "FillPedRmsFLG"); … … 630 636 MFillH fill5(&evt5, "MCerPhotEvt", "FillInterpolated"); 631 637 MFillH fill6(&evt6, "MBadPixelsCam", "FillUnsuitable"); 632 MFillH fill7(&evt7, "M ArrivalTime","FillTimes");638 MFillH fill7(&evt7, "MCerPhotEvt", "FillTimes"); 633 639 MFillH fill8(&evt8, "MCalibConstCam", "FillConv"); 634 //MFillH fill9(&evt9, "MCalibConstCam","FillPulse");640 MFillH fill9(&evt9, "MCerPhotEvt", "FillPulse"); 635 641 636 642 MTaskEnv fillflorian("FinalFantasy"); 637 643 fillflorian.SetDefault(); 638 639 // Write the special MC tree640 MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW");641 writemc.SetName("WriteMC");642 writemc.AddContainer("MMcEvtBasic", "OriginalMC");643 644 644 645 // The second rule is for the case reading raw-files! … … 664 665 write.AddContainer("MTime", "Events", kFALSE); 665 666 write.AddContainer("MRawEvtHeader", "Events"); 666 write.AddContainer("MArrivalTime", "Events", kFALSE);667 //write.AddContainer("MArrivalTime", "Events", kFALSE); 667 668 write.AddContainer("MPointingPos", "Events", kFALSE); 668 669 // Slow-Control: Current-tree … … 688 689 write.AddContainer("MReportCC", "CC", kFALSE); 689 690 write.AddContainer("MTimeCC", "CC", kFALSE); 691 692 // Write the special MC tree 693 MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW"); 694 writemc.SetName("WriteMC"); 695 writemc.AddContainer("MMcEvtBasic", "OriginalMC"); 690 696 691 697 // Now setup tasklist for events … … 754 760 if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge")) 755 761 tlist2.AddToList(&fill7); 762 tlist2.AddToList(&fill9); 756 763 757 764 tlist2.AddToList(&fillflorian); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r6828 r6858 19 19 ! Author(s): Markus Gaug, 02/2004 <mailto:markus@ifae.es> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 421 ! Copyright: MAGIC Software Development, 2000-2005 22 22 ! 23 23 ! 24 24 \* ======================================================================== */ 25 25 26 ///////////////////////////////////////////////////////////////////////////// 26 27 // … … 178 179 const TString MJCalibration::fgReferenceFile = "mjobs/calibrationref.rc"; 179 180 const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df4.root"; 181 180 182 // -------------------------------------------------------------------------- 181 183 // … … 1479 1481 1480 1482 TFile file(fHiLoCalibFile,"READ"); 1483 if (!file.IsOpen()) 1484 { 1485 *fLog << err << "ERROR - Couldn't open hi-lo intercalibration file " << fHiLoCalibFile << " for reading..." << endl; 1486 return kFALSE; 1487 } 1481 1488 1482 1489 MCalibrationHiLoCam hilocam; … … 1774 1781 plist.AddToList(&fIntensQECam); 1775 1782 plist.AddToList(&fIntensCalibCam); 1776 plist.AddToList(&fIntensBlindCam);1777 1783 // plist.AddToList(&fIntensCalibrationPINDiode); 1778 1784 plist.AddToList(&fIntensRelTimeCam); 1779 1785 plist.AddToList(&fIntensBadCam); 1786 if (IsUseBlindPixel()) 1787 plist.AddToList(&fIntensBlindCam); 1780 1788 } 1781 1789 else … … 1783 1791 plist.AddToList(&fQECam); 1784 1792 plist.AddToList(&fCalibrationCam); 1785 plist.AddToList(&fCalibrationBlindCam);1786 plist.AddToList(&fCalibrationPINDiode);1787 1793 plist.AddToList(&fRelTimeCam); 1794 if (IsUseBlindPixel()) 1795 plist.AddToList(&fCalibrationBlindCam); 1796 if (IsUsePINDiode()) 1797 plist.AddToList(&fCalibrationPINDiode); 1788 1798 } 1789 1799 … … 1829 1839 MExtractBlindPixel blindext; 1830 1840 1831 InitBlindPixel(blindext, blindcam); 1841 if (IsUseBlindPixel()) 1842 InitBlindPixel(blindext, blindcam); 1832 1843 1833 1844 MExtractSlidingWindow extract2; … … 2157 2168 Bool_t MJCalibration::WriteResult(MParList &plist) 2158 2169 { 2170 if (IsNoStorage()) 2171 return kTRUE; 2172 2159 2173 TObjArray cont; 2160 2174 2161 if (!IsNoStorage()) 2162 { 2163 if (IsIntensity()) 2164 { 2165 cont.Add(&fIntensBadCam); 2166 cont.Add(&fIntensCalibCam); 2167 cont.Add(&fIntensQECam); 2168 cont.Add(&fIntensBlindCam); 2169 } 2170 else 2171 { 2172 cont.Add(&fBadPixels); 2173 cont.Add(&fCalibrationCam); 2174 cont.Add(&fQECam); 2175 cont.Add(&fCalibrationBlindCam); 2176 } 2177 cont.Add(&fCalibrationPINDiode); 2178 2179 //if (IsRelTimes()) 2180 cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam); 2181 2182 if (fExtractorCam.GetSize() != 0) 2183 cont.Add(&fExtractorCam); 2184 2185 TObject *pedcam = plist.FindObject("MPedestalCam"); 2186 if (!pedcam) 2187 *fLog << warn << " - WARNING - MPedestalCam (fundamental)... not found for writing!" << endl; 2188 else 2189 cont.Add(pedcam); 2190 2191 TObject *geom = plist.FindObject("MGeomCam"); 2192 if (!geom) 2193 *fLog << warn << " - WARNING - MGeomCam... not found for writing!" << endl; 2194 else 2195 cont.Add(geom); 2196 } 2175 if (IsIntensity()) 2176 { 2177 cont.Add(&fIntensBadCam); 2178 cont.Add(&fIntensCalibCam); 2179 cont.Add(&fIntensQECam); 2180 cont.Add(&fIntensBlindCam); 2181 } 2182 else 2183 { 2184 cont.Add(&fBadPixels); 2185 cont.Add(&fCalibrationCam); 2186 cont.Add(&fQECam); 2187 cont.Add(&fCalibrationBlindCam); 2188 } 2189 cont.Add(&fCalibrationPINDiode); 2190 2191 //if (IsRelTimes()) 2192 cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam); 2193 2194 if (fExtractorCam.GetSize() != 0) 2195 cont.Add(&fExtractorCam); 2196 2197 TObject *pedcam = plist.FindObject("MPedestalCam"); 2198 if (!pedcam) 2199 *fLog << warn << " - WARNING - MPedestalCam (fundamental)... not found for writing!" << endl; 2200 else 2201 cont.Add(pedcam); 2202 2203 TObject *geom = plist.FindObject("MGeomCam"); 2204 if (!geom) 2205 *fLog << warn << " - WARNING - MGeomCam... not found for writing!" << endl; 2206 else 2207 cont.Add(geom); 2197 2208 2198 2209 if (IsHistsStorage()) -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r6838 r6858 1233 1233 if (fIsPulsePosCheck) 1234 1234 { 1235 1236 MHCalibrationPulseTimeCam *hcam = (MHCalibrationPulseTimeCam*)plist.FindObject("MHCalibrationPulseTimeCam"); 1237 if (fIsPixelCheck) 1235 1236 Int_t numhigainsamples = 0; 1237 Int_t numlogainsamples = 0; 1238 Float_t meanpulsetime = 0.; 1239 Float_t rmspulsetime = 0.; 1240 1241 if (IsUseMC()) 1238 1242 { 1239 hcam->DrawClone(); 1240 gPad->SaveAs(Form("%s/PulsePosTest_all.root",fPathOut.Data())); 1241 MHCalibrationPix &pix = (*hcam)[fCheckedPixId]; 1242 pix.DrawClone(); 1243 gPad->SaveAs(Form("%s/PulsePosTest_Pixel%04d.root",fPathOut.Data(),fCheckedPixId)); 1244 } 1245 1246 MCalibrationPulseTimeCam *cam = (MCalibrationPulseTimeCam*)plist.FindObject("MCalibrationPulseTimeCam"); 1247 MRawEvtData *data = (MRawEvtData*)plist.FindObject("MRawEvtData"); 1248 if (cam) 1249 { 1250 const Float_t meanpulsetime = cam->GetAverageArea(0).GetHiGainMean(); 1251 const Float_t rmspulsetime = cam->GetAverageArea(0).GetHiGainRms(); 1252 *fLog << all << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl; 1253 const Int_t newfirst = (Int_t)(meanpulsetime-fExtractWinLeft); 1254 Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 1255 ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain() 1256 : 6; 1257 if (wshigain > 6) 1258 wshigain = 6; 1259 Int_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 1260 ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain() 1261 : 6; 1262 if (wslogain > 6) 1263 wslogain = 6; 1264 const Int_t newlast = (Int_t)(meanpulsetime+fExtractWinRight); 1265 *fLog << all << underline 1266 << "Try to set new range limits: ("<<newfirst<<","<<newlast<<"+"<<wshigain 1267 <<","<<newfirst-1<<","<<newlast<<"+"<<wslogain<<")"<<endl; 1268 if (newfirst < 0) 1269 { 1270 *fLog << err << "Pulse is too much to the left, cannot go below 0! " << endl; 1271 return kFALSE; 1272 } 1273 if (newlast+wshigain > data->GetNumHiGainSamples()+data->GetNumLoGainSamples()-1) 1274 { 1275 *fLog << err << "Pulse is too much to the right, cannot go beyond limits! " << endl; 1276 *fLog << " Cannot extract at all! ... " << endl; 1277 return kFALSE; 1278 } 1279 if (newlast+wslogain > data->GetNumLoGainSamples()) 1280 { 1281 *fLog << err << "Pulse is too much to the right, cannot go beyond logain limits! " << endl; 1282 *fLog << endl; 1283 *fLog << "Try to use a different extractor (e.g. with a window size of only 4 sl.) or:" << endl; 1284 *fLog << "Set the limit to a lower value (callisto.rc: line 310): " << endl; 1285 *fLog << " MJPedestalY2:ExtractWinRight: 5.0 " << endl; 1286 *fLog << "(ATTENTION, you will lose late cosmics pulses!)" << endl; 1287 *fLog << endl; 1288 return kFALSE; 1289 } 1290 fExtractor->SetRange(newfirst,newlast+wshigain, 1291 newfirst>0?newfirst-1:newfirst,data->GetNumLoGainSamples()-1); 1292 /*if (!WriteExtractor()) 1293 { 1294 *fLog << err << "Could not write the changes to disk, abort... " << endl; 1295 return kFALSE; 1296 }*/ 1243 // 1244 // FIXME: 1245 // The MC cannot run over the first 2000 pedestal events since almost all 1246 // events are empty, therefore a pulse pos. check is not possible, either. 1247 // For the moment, have to fix the problem hardcoded... 1248 // 1249 // MMcEvt *evt = (MMcEvt*)plist.FindObject("MMcEvt"); 1250 // const Float_t meanpulsetime = evt->GetFadcTimeJitter(); 1251 meanpulsetime = 4.5; 1252 rmspulsetime = 1.0; 1253 1254 *fLog << all << "Mean pulse time (MC): " << meanpulsetime << "+-" << rmspulsetime << endl; 1255 1256 numhigainsamples = 15; 1257 numlogainsamples = 15; 1258 1297 1259 } 1298 1260 else 1299 1261 { 1300 *fLog << err << "Could not determine mean pulse position, abort... " << endl; 1262 MHCalibrationPulseTimeCam *hcam = (MHCalibrationPulseTimeCam*)plist.FindObject("MHCalibrationPulseTimeCam"); 1263 if (fIsPixelCheck) 1264 { 1265 hcam->DrawClone(); 1266 gPad->SaveAs(Form("%s/PulsePosTest_all.root",fPathOut.Data())); 1267 MHCalibrationPix &pix = (*hcam)[fCheckedPixId]; 1268 pix.DrawClone(); 1269 gPad->SaveAs(Form("%s/PulsePosTest_Pixel%04d.root",fPathOut.Data(),fCheckedPixId)); 1270 } 1271 1272 MCalibrationPulseTimeCam *cam = (MCalibrationPulseTimeCam*)plist.FindObject("MCalibrationPulseTimeCam"); 1273 if (!cam) 1274 { 1275 *fLog << err << "Could not determine mean pulse position, abort... " << endl; 1276 return kFALSE; 1277 } 1278 1279 meanpulsetime = cam->GetAverageArea(0).GetHiGainMean(); 1280 rmspulsetime = cam->GetAverageArea(0).GetHiGainRms(); 1281 1282 *fLog << all << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl; 1283 1284 MRawEvtData *data = (MRawEvtData*)plist.FindObject("MRawEvtData"); 1285 1286 numhigainsamples = data->GetNumHiGainSamples(); 1287 numlogainsamples = data->GetNumLoGainSamples(); 1288 } 1289 1290 // 1291 // Get the ranges for the new extractor setting 1292 // 1293 const Int_t newfirst = (Int_t)(meanpulsetime-fExtractWinLeft); 1294 Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 1295 ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain() 1296 : 6; 1297 1298 if (wshigain > 6) 1299 wshigain = 6; 1300 1301 Int_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 1302 ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain() 1303 : 6; 1304 if (wslogain > 6) 1305 wslogain = 6; 1306 1307 const Int_t newlast = (Int_t)(meanpulsetime+fExtractWinRight); 1308 1309 *fLog << all << underline 1310 << "Try to set new range limits: ("<<newfirst<<","<<newlast<<"+"<<wshigain 1311 <<","<<newfirst-1<<","<<newlast<<"+"<<wslogain<<")"<<endl; 1312 // 1313 // Check the ranges for the new extractor setting 1314 // 1315 if (newfirst < 0) 1316 { 1317 *fLog << err << "Pulse is too much to the left, cannot go below 0! " << endl; 1301 1318 return kFALSE; 1302 1319 } 1320 if (newlast+wshigain > numhigainsamples+numlogainsamples-1) 1321 { 1322 *fLog << err << "Pulse is too much to the right, cannot go beyond limits: " 1323 << numhigainsamples << "+" << numlogainsamples << "-1" << endl; 1324 *fLog << " Cannot extract at all! ... " << endl; 1325 return kFALSE; 1326 } 1327 if (newlast+wslogain > numlogainsamples) 1328 { 1329 *fLog << err << "Pulse is too much to the right, cannot go beyond logain limits! " << endl; 1330 *fLog << endl; 1331 *fLog << "Try to use a different extractor (e.g. with a window size of only 4 sl.) or:" << endl; 1332 *fLog << "Set the limit to a lower value (callisto.rc: line 329): " << endl; 1333 *fLog << " MJPedestalY2:ExtractWinRight: 5.0 " << endl; 1334 *fLog << "(ATTENTION, you will lose late cosmics pulses!)" << endl; 1335 *fLog << endl; 1336 return kFALSE; 1337 } 1338 // 1339 // Set and store the new ranges 1340 // 1341 fExtractor->SetRange(newfirst,newlast+wshigain, 1342 newfirst>0?newfirst-1:newfirst,numlogainsamples-1); 1303 1343 } 1304 1344 -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r6561 r6858 203 203 // ------------------ Setup histograms and fill tasks ---------------- 204 204 MHCamEvent evt0a(0, "Cleaned", "Signal after Cleaning;;S [\\gamma]"); 205 MHCamEvent evt0b(0, "UsedPix", " Pixels marked Used;;Used [%]");205 MHCamEvent evt0b(0, "UsedPix", "Fraction of Events in which Pixels are used;;Fraction"); 206 206 evt0b.SetThreshold(0); 207 207 -
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r6846 r6858 175 175 const TString MSequence::GetStandardPath(Bool_t raw) const 176 176 { 177 TString d = MString::Form("/data/MAGIC/Period%03d/", fPeriod);178 d += raw ? "raw data/" : "rootdata/";177 TString d("/magic/data/"); 178 d += raw ? "rawfiles/" : "merpp/"; 179 179 return d; 180 180 } … … 188 188 { 189 189 d = GetStandardPath(raw); 190 d += fNight.GetStringFmt("%Y _%m_%d");190 d += fNight.GetStringFmt("%Y/%m/%d"); 191 191 } 192 192 else
Note:
See TracChangeset
for help on using the changeset viewer.