Ignore:
Timestamp:
03/18/05 18:07:46 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc

    r6777 r6858  
    5050#include "MHCamera.h"
    5151
     52#include "MSignalCam.h"
    5253#include "MPedestalCam.h"
    5354#include "MPedPhotCam.h"
     
    5657#include "MBadPixelsCalc.h"
    5758#include "MBadPixelsMerge.h"
    58 #include "MCerPhotEvt.h"
    59 #include "MArrivalTime.h"
    6059#include "MCalibrationChargeCam.h"
    6160#include "MCalibrationRelTimeCam.h"
     
    392391  plist.AddToList(&tmcam);
    393392
    394   MCerPhotEvt          cerphot;
     393  MSignalCam           cerphot;
    395394  MPedPhotCam          pedphot;
    396395  MHCalibrationTestCam testcam;
     
    479478  MHCamEvent evt0(0,"Signal", "Un-Calibrated Signal;;S [FADC cnts]" );
    480479  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]");
    482481
    483482  MFillH fill0(&evt0, "MExtractedSignalCam", "FillUncalibrated");
    484   MFillH fill1(&evt1, "MCerPhotEvt", "FillCalibrated");
    485   MFillH fill2(&evt2, "MArrivalTime","FillTimes");
    486  
    487   MFillH fillcam("MHCalibrationTestCam",     "MCerPhotEvt" ,"FillTest");
    488   MFillH filltme("MHCalibrationTestTimeCam", "MArrivalTime","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");
    489488  fillcam.SetBit(MFillH::kDoNotDisplay);
    490489  filltme.SetBit(MFillH::kDoNotDisplay);
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6839 r6858  
    5353#include "MGeomCam.h"
    5454#include "MHCamEvent.h"
     55//#include "MHCamEventTH.h"
    5556#include "MPedestalCam.h"
    5657#include "MBadPixelsCam.h"
     
    610611    MHCamEvent evt5(0, "Interp'd",   "Interpolated Signal;;S [phe]");
    611612    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]");
    613614    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/*
    616622    evt0.EnableSqrtVariance();
    617623    evt1.EnableSqrtVariance();
     
    622628    evt7.EnableSqrtVariance();
    623629    evt8.EnableSqrtVariance();
    624 
     630  */
    625631    MFillH fill0(&evt0, "MPedestalFundamental",    "FillPedFLG");
    626632    MFillH fill1(&evt1, "MPedestalFromExtractorRndm", "FillPedRmsFLG");
     
    630636    MFillH fill5(&evt5, "MCerPhotEvt",             "FillInterpolated");
    631637    MFillH fill6(&evt6, "MBadPixelsCam",           "FillUnsuitable");
    632     MFillH fill7(&evt7, "MArrivalTime",            "FillTimes");
     638    MFillH fill7(&evt7, "MCerPhotEvt",             "FillTimes");
    633639    MFillH fill8(&evt8, "MCalibConstCam",          "FillConv");
    634     //MFillH fill9(&evt9, "MCalibConstCam",          "FillPulse");
     640    MFillH fill9(&evt9, "MCerPhotEvt",             "FillPulse");
    635641
    636642    MTaskEnv fillflorian("FinalFantasy");
    637643    fillflorian.SetDefault();
    638 
    639     // Write the special MC tree
    640     MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW");
    641     writemc.SetName("WriteMC");
    642     writemc.AddContainer("MMcEvtBasic", "OriginalMC");
    643644
    644645    // The second rule is for the case reading raw-files!
     
    664665    write.AddContainer("MTime",                     "Events",     kFALSE);
    665666    write.AddContainer("MRawEvtHeader",             "Events");
    666     write.AddContainer("MArrivalTime",              "Events",     kFALSE);
     667    //write.AddContainer("MArrivalTime",              "Events",     kFALSE);
    667668    write.AddContainer("MPointingPos",              "Events",     kFALSE);
    668669    // Slow-Control: Current-tree
     
    688689    write.AddContainer("MReportCC",                 "CC",         kFALSE);
    689690    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");
    690696
    691697    // Now setup tasklist for events
     
    754760    if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge"))
    755761      tlist2.AddToList(&fill7);
     762    tlist2.AddToList(&fill9);
    756763
    757764    tlist2.AddToList(&fillflorian);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r6828 r6858  
    1919!   Author(s): Markus Gaug, 02/2004 <mailto:markus@ifae.es>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2004
     21!   Copyright: MAGIC Software Development, 2000-2005
    2222!
    2323!
    2424\* ======================================================================== */
     25
    2526/////////////////////////////////////////////////////////////////////////////
    2627//
     
    178179const TString MJCalibration::fgReferenceFile = "mjobs/calibrationref.rc";
    179180const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df4.root";
     181
    180182// --------------------------------------------------------------------------
    181183//
     
    14791481
    14801482  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  }
    14811488
    14821489  MCalibrationHiLoCam hilocam;
     
    17741781        plist.AddToList(&fIntensQECam);
    17751782        plist.AddToList(&fIntensCalibCam);
    1776         plist.AddToList(&fIntensBlindCam);
    17771783        //        plist.AddToList(&fIntensCalibrationPINDiode);
    17781784        plist.AddToList(&fIntensRelTimeCam);
    17791785        plist.AddToList(&fIntensBadCam);
     1786        if (IsUseBlindPixel())
     1787            plist.AddToList(&fIntensBlindCam);
    17801788    }
    17811789    else
     
    17831791        plist.AddToList(&fQECam);
    17841792        plist.AddToList(&fCalibrationCam);
    1785         plist.AddToList(&fCalibrationBlindCam);
    1786         plist.AddToList(&fCalibrationPINDiode);
    17871793        plist.AddToList(&fRelTimeCam);
     1794        if (IsUseBlindPixel())
     1795            plist.AddToList(&fCalibrationBlindCam);
     1796        if (IsUsePINDiode())
     1797            plist.AddToList(&fCalibrationPINDiode);
    17881798    }
    17891799
     
    18291839    MExtractBlindPixel       blindext;
    18301840
    1831     InitBlindPixel(blindext, blindcam);
     1841    if (IsUseBlindPixel())
     1842        InitBlindPixel(blindext, blindcam);
    18321843
    18331844    MExtractSlidingWindow    extract2;
     
    21572168Bool_t MJCalibration::WriteResult(MParList &plist)
    21582169{
     2170    if (IsNoStorage())
     2171        return kTRUE;
     2172
    21592173    TObjArray cont;
    21602174
    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);
    21972208
    21982209    if (IsHistsStorage())
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6838 r6858  
    12331233    if (fIsPulsePosCheck)
    12341234      {
    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())
    12381242          {
    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
    12971259          }
    12981260        else
    12991261          {
    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;
    13011318            return kFALSE;
    13021319          }
     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);
    13031343      }
    13041344   
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r6561 r6858  
    203203    // ------------------ Setup histograms and fill tasks ----------------
    204204    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");
    206206    evt0b.SetThreshold(0);
    207207
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r6846 r6858  
    175175const TString MSequence::GetStandardPath(Bool_t raw) const
    176176{
    177     TString d = MString::Form("/data/MAGIC/Period%03d/", fPeriod);
    178     d += raw ? "rawdata/" : "rootdata/";
     177    TString d("/magic/data/");
     178    d += raw ? "rawfiles/" : "merpp/";
    179179    return d;
    180180}
     
    188188    {
    189189        d = GetStandardPath(raw);
    190         d += fNight.GetStringFmt("%Y_%m_%d");
     190        d += fNight.GetStringFmt("%Y/%m/%d");
    191191    }
    192192    else
Note: See TracChangeset for help on using the changeset viewer.