Changeset 8891 for trunk


Ignore:
Timestamp:
05/15/08 19:37:27 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8890 r8891  
    2323   * mfilter/MFMagicCuts.[h,cc]:
    2424     - fixed a few typos in comments and in the output
    25      - added an option kAreaLin with a linear cut in area for special studies
     25     - added an option kAreaLin with a linear cut in area for special
     26       studies
     27
     28   * mbase/MStatusDisplay.cc:
     29     - if no MStatusArray is found, keys which store a TCanvas object
     30       are displayed instead if available
     31
     32   * mhcalib/MHCalibrationPulseTimeCam.[h,cc]:
     33     - the extraction range to get the maximum is now determined
     34       automatically from the MExtractedSignalCam
     35
     36   * mpedestal/MPedestalSubtract.cc, msignal/MExtractTimeAndCharge.cc:
     37     - raise an error if there is a mismatch in the number of samples
     38
    2639
    2740
     
    4053   * mjtrain/MJTrainEnergy.cc
    4154     - write the dataset to the output file
    42      - added new plots to show the resolution versus several different parameters
     55     - added new plots to show the resolution versus several different
     56       parameters
    4357
    4458   * mpedestal/MPedestalSubtract.[h,cc]:
    45      - added an additional check to compate the number of hi-/lo-gain slices
    46        in the run- and event-header
     59     - added an additional check to compate the number of hi-/lo-gain
     60       slices in the run- and event-header
    4761
    4862   * mpointing/MPointingDevCalc.cc:
  • trunk/MagicSoft/Mars/NEWS

    r8890 r8891  
    6464      Since pedestal and calibration constants are continously recalculated
    6565      this only effected the very first events of every sequence.
     66
     67    * For the extraction of the position of the maximum sample now the
     68      extraction range is set automatically to the extraction window,
     69      before the whole accessible range was used.
     70
     71    * If the number of samples in the events and the number of samples
     72      in the run-header disagrees now an error is raised (this can
     73      happen in not well simulated Monte Carlo files)
    6674
    6775 ;star
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r8795 r8891  
    21572157    if (n==0)
    21582158    {
    2159         *fLog << warn << "MStatusDisplay::Read: No objects read." << endl;
     2159        const Bool_t store = TH1::AddDirectoryStatus();
     2160        TH1::AddDirectory(kFALSE);
     2161
     2162        TIter Next(gFile->GetListOfKeys());
     2163        TObject *key = 0;
     2164        while ((key=Next()))
     2165        {
     2166            TCanvas *c=0;
     2167            gFile->GetObject(key->GetName(), c);
     2168            if (!c)
     2169                break;
     2170
     2171            if (list.GetEntries()==0)
     2172                list.Add(new TNamed(GetName(), GetTitle()));
     2173
     2174            list.Add(c);
     2175        }
     2176
     2177        TH1::AddDirectory(store);
     2178
     2179        if (list.GetEntries()==0)
     2180        {
     2181            *fLog << warn << "MStatusDisplay::Read: No objects read." << endl;
     2182            return 0;
     2183        }
     2184
     2185        *fLog << inf << "MStatusDisplay: " << list.GetEntries() << " canvases directly read from file." << endl;
     2186    }
     2187
     2188
     2189    if (!Display(list, tab))
     2190    {
     2191        *fLog << err << "MStatusDisplay::Display: No entries found." << endl;
    21602192        return 0;
    21612193    }
    21622194
    2163     if (!Display(list, tab))
    2164     {
    2165         *fLog << err << "MStatusDisplay::Display: No entry in " << name << "." << endl;
    2166         return 0;
    2167     }
     2195
     2196    cout << "Display done." << endl;
     2197
     2198    if (n==0)
     2199        return list.GetEntries();
    21682200
    21692201    *fLog << inf << "MStatusDisplay: Key " << name << " with " << n << " keys read from file." << endl;
    2170 
    21712202    return n;
    21722203}
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc

    r8582 r8891  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.41 2007-06-19 09:25:38 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.42 2008-05-15 18:37:26 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    175175//
    176176MHCalibrationPulseTimeCam::MHCalibrationPulseTimeCam(const char *name, const char *title)
    177     : fBadPixels(NULL)
     177    : fSignalCam(NULL), fBadPixels(NULL)
    178178{
    179179
     
    277277Bool_t MHCalibrationPulseTimeCam::ReInitHists(MParList *pList)
    278278{
    279 
    280   MExtractedSignalCam *signal =
    281     (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
    282   if (!signal)
     279  fSignalCam = (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
     280  if (!fSignalCam)
    283281  {
    284282      *fLog << err << "MExtractedSignalCam not found... abort." << endl;
     
    397395            continue;
    398396
    399         // Get position of maximum (FIXME: Extraction range?)
     397        // Get position of maximum
    400398        Float_t max;
    401         const Int_t pos = evt->GetMaxPos(idx, max);
     399        const Int_t pos = evt->GetMax(idx, fSignalCam->GetFirstUsedSliceHiGain(),
     400                                      fSignalCam->GetLastUsedSliceHiGain(), max);
    402401
    403402        // check if maximum is high enough
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.h

    r8554 r8891  
    88class TH1F;
    99class MRawEvtData;
     10class MExtractedSignalCam;
    1011class MHCalibrationChargePix;
    1112
     
    3940  Float_t fOuterRefTime;                       // The reference mean arrival time outer pixels
    4041
    41   MBadPixelsCam *fBadPixels;                   //!  Bad Pixels
     42  MExtractedSignalCam *fSignalCam;             //! Signal cam for extraction range
     43  MBadPixelsCam *fBadPixels;                   //! Bad Pixels
    4244 
    4345  void   InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc

    r8888 r8891  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.10 2008-05-14 11:03:24 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.11 2008-05-15 18:37:26 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    158158Int_t MPedestalSubtract::Process()
    159159{
     160    // Please note:
     161    //   - for data with only hi-gain samples numl is 0
     162    //   - for data with hi- and lo-gain samples
     163    //     numl is 0 if read from a raw-data file or a new MC root-file(?)
     164    //     numl is not 0 if read from an old MC root-file
     165
    160166    // Total number of samples
    161167    const Int_t numh = fRawEvt->GetNumHiGainSamples();
     
    167173
    168174    // Check for consistency (our simulation can do weird things!)
    169     if (numh!=fRunHeader->GetNumSamplesHiGain())
    170     {
    171         *fLog << warn << "WARNING - Number of hi-gain samples (" << numh << ") ";
    172         *fLog << " doesn't match run-header (" << fRunHeader->GetNumSamplesHiGain() << ")." << endl;
    173     }
    174     if (numl!=fRunHeader->GetNumSamplesLoGain())
    175     {
    176         *fLog << warn << "WARNING - Number of lo-gain samples (" << numl << ") ";
    177         *fLog << " doesn't match run-header (" << fRunHeader->GetNumSamplesLoGain() << ")." << endl;
     175    if (numh+numl!=fRunHeader->GetNumSamplesHiGain()+fRunHeader->GetNumSamplesLoGain())
     176    {
     177        *fLog << err << "MPedestalSubtract::Process: ERROR - Number of samples in event ";
     178        *fLog << "(hi+lo=" << numh+numl << ")" << endl << " doesn't match number in run-header ";
     179        *fLog << "(" << fRunHeader->GetNumSamplesHiGain()+fRunHeader->GetNumSamplesLoGain() << ")" << endl;
     180        *fLog << " In case you are processing real data you have just found a bug." << endl;
     181        *fLog << " If you process Monte Carlo data, it means probably that the length" << endl;
     182        *fLog << " of the arrays in MRawEvtData are inconsistent with the run-header." << endl;
     183        return kERROR;
    178184    }
    179185
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc

    r8661 r8891  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndCharge.cc,v 1.68 2007-08-10 11:21:21 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndCharge.cc,v 1.69 2008-05-15 18:37:27 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    219219Int_t MExtractTimeAndCharge::Process()
    220220{
     221    const Int_t nums = fSignal->GetNumSamples();
     222
    221223    const Int_t numh = fRunHeader->GetNumSamplesHiGain();
    222224    const Int_t numl = fRunHeader->GetNumSamplesLoGain();
    223225
     226    // Some sanity checks to get rid of some weird behaviour of the simulation
     227    if (nums!=numh+numl)
     228    {
     229        *fLog << err << "MExtractTimeAndCharge::Process: ERROR - Number of samples in event ";
     230        *fLog << "(" << nums << ")" << endl << " doesn't match number in run-header ";
     231        *fLog << "(" << numh+numl << ")" << endl;
     232        *fLog << " In case you are processing real data you have just found a bug." << endl;
     233        *fLog << " If you process Monte Carlo data, it means probably that the length" << endl;
     234        *fLog << " of the arrays in MRawEvtData are inconsistent with the run-header." << endl;
     235        return kERROR;
     236    }
     237
     238    // Start extraction
    224239    const UInt_t satlim = fSaturationLimit*fRunHeader->GetScale();
    225240
Note: See TracChangeset for help on using the changeset viewer.