Changeset 7005


Ignore:
Timestamp:
05/10/05 12:13:12 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7003 r7005  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
     23 2005/05/10 Thomas Bretz
     24
     25   * mreport/MReportStarguider.cc:
     26     - introduced the correct version which marked the fix of the
     27       units of the nominal position
     28
     29   * callisto.rc:
     30     - introduced a new line for new option in MCalibColorFromPast
     31
     32   * ganymed.cc:
     33     - removed option "--full-display" -> now default
     34
     35   * manalysis/MEnergyEstimate.cc:
     36     - print the rule a bit earlier in PreProcess
     37
     38   * mfilter/MFDeltaT.cc:
     39     - fixed a typo in the output
     40
     41   * mhflux/MAlphaFitter.cc:
     42     - some improvements to output
     43
     44   * mjobs/MJCut.cc:
     45     - added ThetaSquared to output
     46
     47   * mjobs/MJStar.cc:
     48     - fixed bug in copying of OriginalMC tree
     49
     50   * mmuon/MMuonCalibParCalc.cc:
     51     - removed obsolete setting of ReadyToSave
     52
     53
     54
     55 2005/05/10 Markus Gaug (2005/05/09)
     56
     57   * mjobs/hilocalib_sp1.root
     58   * mjobs/hilocalib_sp1_mc.root
     59     - new hi-lo intercalibration files with the fixed spline extractor.
     60
     61   * mjobs/hilocalib_df46_mc.root
     62     - new hi-lo intercalibration files from MC with the left out -O5
     63       option. (The real data files had already the correct executable).
     64
     65
     66
     67 2005/05/10 Hendrik Bartko (2005/05/09)
     68
     69   * msignal/MC_weights46.dat
     70     - NEW weights file for digital filter with dedicated MC weights
     71       with 4 slices for the high gain and 6 slices for the low gain
     72
     73
     74
     75 2005/05/10 Markus Gaug (2005/05/08)
     76
     77   * mhcalib/MHCalibrationCam.[h,cc]
     78     - introduce parameters fLowerFitLimit and fHigherFitLimit to
     79       tell explicitly from outside to fit functions in a certain
     80       range. If both are 0. (default), the histogram limits define
     81       the fit limits (as before).
     82
     83
     84
     85 2005/05/10 Abelardo Moralejo (2005/05/07)
     86
     87   * mcalib/MMcCalibrationCalc.cc
     88     - in Process, fixed wrong estimate of true number of "equivalent
     89       photoelectrons" (correctedphotel). This worked roughly OK as long
     90       as the file used for calibration was a (noiselesss) gamma file,
     91       because most light is contained in the inner camera and the
     92       problem was related to the light going into the outer pixels. So
     93       results are not much affected, unless one uses for calibration
     94       a file with events having a lot of light in the outer camera.
     95       Thomas Hengstebeck noticed this problem when he used a file of MC
     96       calibration pulses in mccalibrate.C
     97
     98   * manalysis/MMcCalibrationUpdate.[h,cc]
     99     - Added possibility to set the hi to lo gain conversion factor.
     100       Until now the factor was simply the ratio of pulse areas as read
     101       from MMcFadcHeader. This of course is not the factor to be applied
     102       to the extracted signals unless the extractor integrates the full
     103       pulse in both high and low gain. The factor depends then on the
     104       extractor, and the user has to find out what its value is.
     105       Set as default calibration type kPhe.
     106
     107   * macros/mccalibrate.C, starmc.C
     108     - Added the setting of the hi to lo gain conversion factor (see
     109       above). For now it has to be calculated by the user. However, it
     110       is strongly recommended from now on to use always callisto for the
     111       calibration of real data, and not these macros. These are kept
     112       just for checking purposes, mostly by "experts".
     113
     114
     115
     116 2005/05/10 Robert Wagner (2005/05/06)
     117
     118   * mreport/MReportStarguider.[h,cc]:
     119     - Bugfix: Sequence of extracting fDevZd and fDevAz (switched)
     120
     121
     122
     123 2005/05/10 Markus Gaug (2005/05/05)
     124
     125   * mcalib/MCalibCalcFromPast.[h,cc]
     126     - introduce flag "fUpdateWithFFactorMethod" which allows to use the
     127       entire results obtained with the F-Factor method (including a new
     128       number of mean photo-electrons). This possibility is switched on
     129       (only) if somewhere in the callisto.rc file the following line is
     130       written:
     131         MJCalibrateSignal.MCalibCalcFromPast.UpdateWithFFactorMethod: yes
     132       (Default is still the old way of adjusting the relative extracted
     133       charges w.r.t. the mean charge over the inner camera).
     134
     135
     136
     137 2005/05/10 Markus Gaug (2005/05/02)
     138
     139   * mcalib/MCalibrationChargeCam.[h,cc]
     140     - added new function MergeHiLoConversionFactors
     141
     142   * mcalib/MCalibColorSteer.[h,cc]
     143     - introduce copying of hi-lo calibration factors from one cam to
     144       the next in intensity calibration.
     145     - added storage of averageing histograms of flag fHistStorage is
     146       set
     147
     148   * mcalib/MCalibrationIntensityCam.[h,cc]
     149     - introduce place for storage of averageing histograms (if wanted).
     150
     151
     152
    23153 2005/05/09 Markus Meyer
    24154
     
    27157     - changed the start parameter for the gaussian fit for the
    28158       calculation of ArcWidth
     159
    29160
    30161
  • trunk/MagicSoft/Mars/Makefile.conf.darwin

    r4029 r7005  
    2020#  ----->>>   settings for compilation
    2121#
    22 OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual
     22OPTIM    = -O -Wall -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual
    2323# ggc 3.2: removed -fnonnull-objects -Wtraditional -Wnested-externs
    2424DEBUG    =
  • trunk/MagicSoft/Mars/macros/mccalibrate.C

    r6496 r7005  
    6363
    6464  //
    65   //  Set signal extractor
     65  //  USER CHANGE: Set signal extractor
    6666  //
    6767  //    MExtractFixedWindowPeakSearch sigextract;
    6868  //    sigextract.SetWindows(6, 6, 4);
    6969  //
    70   MExtractTimeAndChargeDigitalFilter sigextract;
    71   sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/MC_weights.dat");
    72   sigextract.SetRange(1, 14, 3, 14);
    73 
     70
     71  //    MExtractTimeAndChargeDigitalFilter sigextract;
     72  //    sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/MC_weights.dat");
     73  //    sigextract.SetRange(1, 14, 3, 14);
     74
     75  MExtractTimeAndChargeSpline sigextract;
     76  sigextract.SetRiseTimeHiGain(0.5);
     77  sigextract.SetFallTimeHiGain(0.5);
     78
     79
     80  // USER CHANGE: high to low gain ratio. DEPENDS on EXTRACTOR!!
     81  // One should calculate somewhere else what this factor is for each extractor!
     82  Float_t hi2low = 12.; // tentative value for spline with risetime 0.5, fall time 0.5
    7483
    7584  MMcCalibrationUpdate  mccalibupdate;
     85  mccalibupdate.SetUserLow2HiGainFactor(hi2low);
    7686  ///// User change: calibrate in photons or phe- :
    7787  mccalibupdate.SetSignalType(MCalibrateData::kPhe);
  • trunk/MagicSoft/Mars/macros/starmc.C

    r6403 r7005  
    5252  // differences in gain of outer pixels)
    5353  //
    54   CalibrationFilename = new TString("/users/emc/moralejo/mcdata/Period021_0.73_mirror/gammas_nonoise/Gamma_zbin0_*.root");
     54  CalibrationFilename = new TString("/data1/magic/mc_data/root/Period025/gammas_nonoise/Gamma_zbin0_*.root");
    5555  // File to be used in the calibration (must be a camera file without added noise)
    5656
    5757
    58   Char_t* AnalysisFilename = "Gamma_*w0.root";  // File to be analyzed
     58  Char_t* AnalysisFilename = "Gamma_zbin1_0_*.root";  // File to be analyzed
    5959
    6060
     
    7474  Float_t accepted_fraction = 1.;
    7575
    76   Float_t CleanLev[2] = {5., 4.};
    77   // User change: tail cuts for image analysis
    78 
     76  // USER CHANGE: tail cuts for image analysis
     77
     78  Float_t CleanLev[2] = {7., 5.};
    7979  MImgCleanStd  clean(CleanLev[0], CleanLev[1]); // Applies tail cuts to image.
    80 
    81 
    82   //  User change: signal extraction
     80  clean.SetMethod(MImgCleanStd::kAbsolute);      // In absolute units (phot or phe- as chosen below)
     81
     82
     83  //  USER CHANGE: signal extraction
    8384  //
    8485  //  MExtractFixedWindowPeakSearch sigextract;
    8586  //  sigextract.SetWindows(6, 6, 4);
    8687
    87   MExtractTimeAndChargeDigitalFilter sigextract;
    88   sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/MC_weights.dat");
    89   sigextract.SetRange(1, 14, 3, 14);
     88  //  MExtractTimeAndChargeDigitalFilter sigextract;
     89  //  sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/MC_weights.dat");
     90  //  sigextract.SetRange(1, 14, 3, 14);
     91
     92  MExtractTimeAndChargeSpline sigextract;
     93  sigextract.SetRiseTimeHiGain(0.5);
     94  sigextract.SetFallTimeHiGain(0.5);
     95
     96  // USER CHANGE: high to low gain ratio. DEPENDS on EXTRACTOR!!
     97  // One should calculate somewhere else what this factor is for each extractor!
     98  Float_t hi2low = 12.; // tentative value for spline with risetime 0.5, fall time 0.5
     99
    90100
    91101  ////////// Calibration //////////
    92 
    93102  MMcCalibrationUpdate  mccalibupdate;
    94   ///// User change: calibrate in photons or phe- :
     103  mccalibupdate.SetUserLow2HiGainFactor(hi2low);
     104
     105  ///// USER CHANGE: calibrate in photons or phe- :
    95106  mccalibupdate.SetSignalType(MCalibrateData::kPhe);
    96107  //  mccalibupdate.SetSignalType(MCalibrateData::kPhot);
     
    233244  //
    234245
    235   //  MProgressBar bar;
    236   //  bar.SetWindowName("Calibrating...");
     246  MProgressBar bar;
     247  bar.SetWindowName("Calibrating...");
    237248
    238249  MEvtLoop evtloop;
    239   //  evtloop.SetProgressBar(&bar);
     250  evtloop.SetProgressBar(&bar);
    240251  evtloop.SetParList(&plist);
    241252
     
    271282  tlist.AddToListBefore(&skip, &sigextract);
    272283
    273   //  bar.SetWindowName("Analyzing...");
     284  bar.SetWindowName("Analyzing...");
    274285
    275286  tlist.RemoveFromList(&mccalibcalc); // Removes calibration task from list.
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc

    r6342 r7005  
    7979
    8080MMcCalibrationUpdate::MMcCalibrationUpdate(const char *name, const char *title)
     81  :  fFillCalibrationCam(kTRUE), fOuterPixelsGainScaling(kTRUE), fAmplitude(-1.),
     82     fAmplitudeOuter(-1.), fConversionHiLo(-1.), fUserLow2HiGainFactor(-1.),
     83     fSignalType(MCalibrateData::kPhe)
    8184{
    8285    fName  = name  ? name  : "MMcCalibrationUpdate";
    8386    fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container";
    84 
    85 
    86     fAmplitude = -1.;
    87     fAmplitudeOuter = -1.;
    88     fConversionHiLo = -1.;
    89 
    90     fSignalType = MCalibrateData::kPhot;
    91 
    92     fFillCalibrationCam = kTRUE;
    93     fOuterPixelsGainScaling = kTRUE;
    9487}
    9588
     
    194187          {
    195188            fAmplitudeOuter = fHeaderFadc->GetAmplitudOuter();
    196             fConversionHiLo = fHeaderFadc->GetLow2HighGain();
     189
     190            fHeaderLow2HiGainFactor = fHeaderFadc->GetLow2HighGain();
     191
     192            // The high to low gain ratio is stored in MMcFadcHeader.Low2HighGain.
     193            // However, this is just the ratio of total pulse integrals. Since the
     194            // shape of the low gain pulse is different from that of the high gain,
     195            // the factor to be applied to signals extracted from low gain depends
     196            // on the type of signal extractor (for instance if we extract the pulse
     197            // height, the factor is larger than Low2HighGain, because the low gain
     198            // pulse shape is wider and hence lower than the high gain pulse. So the
     199            // user can set manually the value of the factor to be applied. If such
     200            // value has not been set by the user, then we takes as default Low2HighGain.
     201
     202            if (fUserLow2HiGainFactor < 0.)
     203              fConversionHiLo = fHeaderLow2HiGainFactor;
     204            else
     205              fConversionHiLo = fUserLow2HiGainFactor;
     206
    197207          }
    198208        else // old MC files, camera  < v0.7
     
    203213
    204214    }
    205     else   // Check that following files have all the same FADC parameters
     215    else   // Check that the following files have all the same FADC parameters as the first
    206216    {
    207217      if ( fabs(fHeaderFadc->GetAmplitud()-fAmplitude) > 1.e-6 )
     
    211221        }
    212222
    213       if (mcrunh->GetCamVersion() > 60) // old MC files, camera < v0.7
     223      if (mcrunh->GetCamVersion() > 60) // files from camera 0.7 or newer
    214224        {
    215225          if( fabs(fHeaderFadc->GetAmplitudOuter()-fAmplitudeOuter) > 1.e-6  ||
    216               fabs(fConversionHiLo-fHeaderFadc->GetLow2HighGain()) > 1.e-6 )
     226              fabs(fHeaderLow2HiGainFactor-fHeaderFadc->GetLow2HighGain()) > 1.e-6 )
    217227            {
    218228              *fLog << err << "Parameters of MMcFadcHeader are not the same for all files... aborting." << endl;
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h

    r6342 r7005  
    4242    Float_t fAmplitude;      // FADC parameters from camera simulation (see camera manual)
    4343    Float_t fAmplitudeOuter; // to be read from the MMcFadcHeader.
    44     Float_t fConversionHiLo; // Ratio of high to low gain.
     44    Float_t fConversionHiLo; // Ratio of high to low gain to be used for low gain signal calibration.
     45
     46    Float_t fHeaderLow2HiGainFactor; // Ratio of high to low gain, as read from the MMcFadcHeader
     47    Float_t fUserLow2HiGainFactor;   // Ratio of high to low gain, as set manually by the user
     48
    4549
    4650    Float_t fOuterPixelsLightCollection;
     
    5862      { fOuterPixelsGainScaling = tf; }
    5963
     64    void SetUserLow2HiGainFactor(Float_t x) { fUserLow2HiGainFactor = x; }
     65
    6066    void SetSignalType (MCalibrateData::SignalType_t x) { fSignalType = x; }
    6167    MCalibrateData::SignalType_t GetSignalType () const { return fSignalType; }
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc

    r6963 r7005  
    7979      fIntensCharge(NULL), fIntensBlind(NULL), fIntensRelTime(NULL), fIntensBad(NULL),
    8080      fChargeCalc(NULL), fRelTimeCalc(NULL), fCalibrate(NULL),
    81       fNumEvents(0), fNumCam(0)
     81      fNumEvents(0), fNumCam(0), fUpdateWithFFactorMethod(kFALSE)
    8282{
    8383
     
    249249    fRelTimeCalc->Finalize();
    250250  if (fCalibrate)
    251     fCalibrate->UpdateConversionFactors((MCalibrationChargeCam*)fIntensCharge->GetCam());
     251      fCalibrate->UpdateConversionFactors(fUpdateWithFFactorMethod ? NULL :
     252                                          (MCalibrationChargeCam*)fIntensCharge->GetCam());
    252253
    253254  ReInitialize();
     
    324325Int_t MCalibCalcFromPast::PostProcess()
    325326{
    326   *fLog << "Number of Calibration Cams: " << fNumCam << endl;
     327  *fLog << inf << "Number of Calibration Cams: " << fNumCam << endl;
    327328  return kTRUE;
    328329 
    329330}
    330331
     332// --------------------------------------------------------------------------
     333//
     334// Read the setup from a TEnv, eg:
     335//   MCalibCalcFromPast.UpdateWithFFactorMethod: Off, On
     336//
     337Int_t MCalibCalcFromPast::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     338{
     339    Bool_t rc = kFALSE;
     340    if (IsEnvDefined(env, prefix, "UpdateWithFFactorMethod", print))
     341    {
     342        rc = kTRUE;
     343        SetUpdateWithFFactorMethod(GetEnvValue(env, prefix, "UpdateWithFFactorMethod", fUpdateWithFFactorMethod));
     344    }
     345
     346    return rc;
     347}
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.h

    r6963 r7005  
    4141  UInt_t fNumEvents;           //! Event counter only for calibration events
    4242  UInt_t fNumCam;              //! Number of currently used Calibration Cam
    43  
     43
     44  Bool_t fUpdateWithFFactorMethod; // Update the interlaced calib events with the full F-Factor method
     45
    4446  Int_t  PreProcess(MParList *pList);
    4547  Int_t  Process();
     
    4850  Bool_t ReInitialize();
    4951  Bool_t Finalize(const char* name);
     52
     53  Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    5054
    5155public:
     
    6165  void SetChargeCalc   ( MCalibrationChargeCalc  *c )  { fChargeCalc  = c; }
    6266  void SetRelTimeCalc  ( MCalibrationRelTimeCalc *c )  { fRelTimeCalc = c; }
     67
     68  void SetUpdateWithFFactorMethod(const Bool_t b=kTRUE){ fUpdateWithFFactorMethod = b; }
    6369 
    6470  ClassDef(MCalibCalcFromPast, 1) // Task to steer the processing of interlace calibration events
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.cc

    r6963 r7005  
    2222!
    2323\* ======================================================================== */
     24
    2425//////////////////////////////////////////////////////////////////////////////
    2526//
     
    8182    : fCalibPattern(NULL), fGeom(NULL), fParList(NULL),
    8283      fIntensCharge(NULL), fIntensRelTime(NULL), fIntensBad(NULL),
    83       fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL)
     84      fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL), fHistCopy(kFALSE)
    8485{
    8586
     
    285286}
    286287
     288// --------------------------------------------------------------------------
     289//
     290// Reads the pattern from MCalibrationPattern and initializes new containers in the
     291// Intensity Cams, if the pattern has changed. Executes Finalize of the
     292// MCalibration*Calc classes in that case.
     293//
     294Int_t MCalibColorSteer::PostProcess()
     295{
     296    //
     297    // Finalize Possible calibration histogram classes...
     298    //
     299    *fLog << inf << "Finalize calibration histograms..." << flush;
     300    if (Finalize("MHCalibrationChargeCam"))      *fLog << inf << "MHCalibrationChargeCam..." << flush;
     301    if (Finalize("MHCalibrationChargeBlindCam")) *fLog << inf << "MHCalibrationChargeBlindCam..." << flush;
     302    if (Finalize("MHCalibrationRelTimeCam"))     *fLog << inf << "MHCalibrationRelTimeCam..." << flush;
     303    if (Finalize("MHCalibrationTestCam"))        *fLog << inf << "MHCalibrationChargeCam..." << flush;
     304    if (Finalize("MHCalibrationTestTimeCam"))    *fLog << inf << "MHCalibrationChargeCam..." << flush;
     305    *fLog << inf << "done." << endl;
     306
     307    return kTRUE;
     308}
    287309
    288310// --------------------------------------------------------------------------
     
    300322
    301323  hist->Finalize();
     324  CopyHist(name);
    302325  hist->ResetHists();
    303326  hist->SetColor( fCalibPattern->GetPulserColor());
     
    331354      MCalibrationChargeCam *cam    = (MCalibrationChargeCam*)fIntensCharge->GetCam();
    332355      cam->SetPulserColor(fCalibPattern->GetPulserColor());
    333       if (!cam->CopyHiLoConversionFactors(*oldcam))
    334         return kFALSE;
     356      if (!cam->MergeHiLoConversionFactors(*oldcam))
     357          return kFALSE;
    335358      *fLog << inf << "New MCalibrationChargeCam with name: " << cam->GetName() << endl;
    336359    }
     
    388411  return result;
    389412}
     413
     414// --------------------------------------------------------------------------
     415//
     416// Copies the histogram classes into the intensity cams
     417//
     418void MCalibColorSteer::CopyHist(const char* name)
     419{
     420  MHCalibrationCam *hcam = (MHCalibrationCam*)fParList->FindObject(name);
     421  TString n(name);
     422  if (n.Contains("ChargeCam"))
     423    {
     424      if (fIntensCharge)
     425          fIntensCharge->AddHist((MHCalibrationCam*)hcam->Clone());
     426    }
     427  if (n.Contains("Blind"))
     428    if (fIntensBlind)
     429          fIntensBlind->AddHist((MHCalibrationCam*)hcam->Clone());
     430
     431  if (n.Contains("RelTime"))
     432    if (fIntensRelTime)
     433          fIntensRelTime->AddHist((MHCalibrationCam*)hcam->Clone());
     434}
     435
     436// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.h

    r6963 r7005  
    2727{
    2828private:
    29 
    30 
    3129  MCalibrationPattern             *fCalibPattern;    //!
    3230  MRawRunHeader                   *fRunHeader;       //!
     
    4543  MCalibrationCam::PulserColor_t   fColor;
    4644  Float_t                          fStrength;
     45
     46  Bool_t                           fHistCopy;        // Decide whether MHCalibrationCams will get copied
    4747 
    4848  Int_t  PreProcess(MParList *pList);
    4949  Int_t  Process();
     50  Int_t  PostProcess();
    5051 
    5152  Bool_t ReInitialize();
    5253  Bool_t Finalize(const char* name);
     54
     55  void    CopyHist(const char* name);
    5356  TString GetNamePattern();
    5457 
    5558public:
     59    MCalibColorSteer(const char *name=NULL, const char *title=NULL);
    5660
    57     MCalibColorSteer(const char *name=NULL, const char *title=NULL);
    58     ~MCalibColorSteer() {}
     61    void SetHistCopy(const Bool_t b=kTRUE) { fHistCopy = b; }
    5962
    6063    ClassDef(MCalibColorSteer, 1) // Task to steer the processing of multiple calibration colours
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r6963 r7005  
    252252// Copy High-gain vs. low-gain conversion factors from cam to this.
    253253//
    254 Bool_t MCalibrationChargeCam::CopyHiLoConversionFactors(const MCalibrationChargeCam &cam) const
     254Bool_t MCalibrationChargeCam::MergeHiLoConversionFactors(const MCalibrationChargeCam &cam) const
    255255{
    256256
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h

    r6963 r7005  
    5959                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
    6060
    61   Bool_t CopyHiLoConversionFactors(const MCalibrationChargeCam &cam) const;
     61  Bool_t MergeHiLoConversionFactors(const MCalibrationChargeCam &cam) const;
    6262 
    6363  // Prints
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc

    r5651 r7005  
    3030// Contains TOrdCollections for the following objects:
    3131// - fCams:  Array of classes derived from MCalibrationCam, one entry
    32 //           per calibration camera result. Has to be created
     32//           per calibration camera result.
     33// - fHists: Array of classes derived from MHCalibrationPix, one entry
     34//           per calibration camera result and area index
    3335//
    3436// See also: MCalibrationIntensityChargeCam, MCalibrationIntensityQECam,
     
    3941//           MCalibrationChargeBlindPix, MCalibrationChargePINDiode
    4042//
     43// ClassVersion 2:
     44//  + fHists
    4145//
    4246/////////////////////////////////////////////////////////////////////////////
     
    4549#include <TOrdCollection.h>
    4650
     51#include "MLog.h"
     52#include "MLogManip.h"
     53
    4754#include "MGeomCam.h"
     55#include "MHCalibrationCam.h"
    4856
    4957ClassImp(MCalibrationIntensityCam);
     
    5765// Set the following pointer to NULL:
    5866// - fCams
     67// - fHists
    5968//
    6069MCalibrationIntensityCam::MCalibrationIntensityCam(const char *name, const char *title)
     
    6675  fCams = new TOrdCollection;
    6776  fCams->SetOwner();
    68  
     77
     78  fHists = new TOrdCollection;
     79  fHists->SetOwner();
    6980}
    7081
     
    7687MCalibrationIntensityCam::~MCalibrationIntensityCam()
    7788{
    78   if (fCams)
    7989    delete fCams;
     90    delete fHists;
     91}
     92
     93// --------------------------------------------------------------------------
     94//
     95// Add a new MHCalibrationCam to fHists
     96//
     97void MCalibrationIntensityCam::AddHist( const MHCalibrationCam *cam)
     98{
     99    const Int_t size = fHists->GetSize();
     100    fHists->AddAt((TObject*)cam,size);
     101
     102    if (size != GetSize()-1)
     103        *fLog << warn << "Histogram Cams and Calibration Cams size mismatch! " << endl;
    80104}
    81105
     
    100124void MCalibrationIntensityCam::Copy(TObject& object) const
    101125{
    102  
    103   MCalibrationIntensityCam &calib = (MCalibrationIntensityCam&)object;
    104  
    105   MParContainer::Copy(calib);
    106  
    107   calib.fOffsets = fOffsets;
    108   calib.fSlopes  = fSlopes;
    109  
    110   const UInt_t n = GetSize();
    111   if (n != 0)
     126    MCalibrationIntensityCam &calib = (MCalibrationIntensityCam&)object;
     127
     128    MParContainer::Copy(calib);
     129
     130    calib.fOffsets = fOffsets;
     131    calib.fSlopes  = fSlopes;
     132
     133    const UInt_t n = GetSize();
     134    if (n != 0)
    112135    {
    113       calib.InitSize(n);
    114       for (UInt_t i=0; i<n; i++)
    115         GetCam(i)->Copy(*(calib.GetCam(i)));
     136        calib.InitSize(n);
     137        for (UInt_t i=0; i<n; i++)
     138        {
     139            GetCam(i)->Copy(*(calib.GetCam(i)));
     140            GetHist(i)->Copy(*(calib.GetHist(i)));
     141        }
    116142    }
    117  
    118143}
    119144
     
    124149void MCalibrationIntensityCam::Clear(Option_t *o)
    125150{
    126 
    127   fCams->ForEach(MCalibrationCam, Clear)();
    128 
    129   return;
     151    fCams->ForEach(MCalibrationCam, Clear)();
     152    fHists->ForEach(MHCalibrationCam, Clear)();
    130153}
    131154
     
    136159void MCalibrationIntensityCam::Print(Option_t *o) const
    137160{
    138   fCams->ForEach(MCalibrationCam, Print)(o);
     161    fCams->ForEach(MCalibrationCam, Print)(o);
     162    fHists->ForEach(MHCalibrationCam, Print)(o);
    139163}
    140164
     
    424448  return size;
    425449}
     450
     451// --------------------------------------------------------------------------
     452//
     453// Get i-th histogram class
     454//
     455MHCalibrationCam *MCalibrationIntensityCam::GetHist(Int_t i)
     456{
     457    return static_cast<MHCalibrationCam*>(i==-1 ? fHists->Last() : fHists->At(i));
     458}
     459
     460// --------------------------------------------------------------------------
     461//
     462// Get i-th histogram class
     463//
     464const MHCalibrationCam *MCalibrationIntensityCam::GetHist(Int_t i) const
     465{
     466    return static_cast<MHCalibrationCam*>(i==-1 ? fHists->Last() : fHists->At(i));
     467}
     468
     469// --------------------------------------------------------------------------
     470//
     471// Get histogram class with name 'name'
     472//
     473MHCalibrationCam *MCalibrationIntensityCam::GetHist(const char *name )
     474{
     475    return static_cast<MHCalibrationCam*>(fHists->FindObject(name));
     476}
     477
     478// --------------------------------------------------------------------------
     479//
     480// Get histogram class with name 'name'
     481//
     482const MHCalibrationCam *MCalibrationIntensityCam::GetHist(const char *name ) const
     483{
     484    return static_cast<MHCalibrationCam*>(fHists->FindObject(name));
     485}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.h

    r5651 r7005  
    1818class MBadPixelsPix;
    1919class MGeomCam;
     20class MHCalibrationCam;
     21
    2022class MCalibrationIntensityCam : public MParContainer, public MCamEvent
    2123{
    2224private:
    23  
    24   MArrayD fOffsets;           //! Arrays of Higain-vs-LoGain fit result Offsets
    25   MArrayD fSlopes;            //! Arrays of Higain-vs-LoGain fit result Slopes
     25  MArrayD fOffsets;        //! Arrays of Higain-vs-LoGain fit result Offsets
     26  MArrayD fSlopes;         //! Arrays of Higain-vs-LoGain fit result Slopes
    2627
    2728protected: 
    28 
    29   TOrdCollection *fCams;        // Array of MCalibrationCams, one per pulse colour and intensity
     29  TOrdCollection *fCams;   // Array of MCalibrationCams, one per pulse colour and intensity
     30  TOrdCollection *fHists;  // Array of MHCalibrationCam's, containing the mean charges per area histograms
    3031
    3132  virtual void Add(const UInt_t from, const UInt_t to);
     
    3334 
    3435public:
    35 
    3636  MCalibrationIntensityCam(const char *name=NULL, const char *title=NULL);
    3737  ~MCalibrationIntensityCam();
     
    4040  void  Copy(TObject& object) const; 
    4141 
    42   void AddToList( const char* name, const MGeomCam &geom );
     42  void AddToList(const char* name, const MGeomCam &geom);
     43  void AddHist(const MHCalibrationCam *cam);
    4344
    4445  Int_t CountNumEntries(const MCalibrationCam::PulserColor_t col) const; 
     
    6970  const MCalibrationCam *GetCam              ( const char *name ) const;
    7071
     72        MHCalibrationCam *GetHist            ( Int_t i=-1);
     73  const MHCalibrationCam *GetHist            ( Int_t i=-1) const;
     74
     75        MHCalibrationCam *GetHist            ( const char *name );
     76  const MHCalibrationCam *GetHist            ( const char *name ) const;
     77
    7178        MCalibrationPix &operator[]          ( UInt_t i );
    7279  const MCalibrationPix &operator[]          ( UInt_t i )  const;
     
    9198                                                                GetCam()->SetPulserColor(col);            }
    9299
    93   ClassDef(MCalibrationIntensityCam, 1) // Base Container Intensity Calibration Results
     100  ClassDef(MCalibrationIntensityCam, 2) // Base Container Intensity Calibration Results
    94101};
    95102
  • trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc

    r4710 r7005  
    242242{
    243243    //
    244     // Exclude events with some saturated pixel
     244    // Exclude events with some high-gain saturated pixel
    245245    //
    246246    if (fPar->GetNumSatPixelsHG()>0)
     
    266266    //
    267267 
    268     const Float_t inner_photel = (Float_t) fMcEvt->GetPhotElfromShower() * innersize / size;
    269     const Float_t outer_photel = (Float_t) fMcEvt->GetPhotElfromShower() - inner_photel;
    270 
    271     const Float_t corrected_photel = inner_photel + outer_photel / fOuterPixelsLightCollection;
    272 
    273 
    274     //    fHistADC2PhotEl->Fill(TMath::Log10(fMcEvt->GetPhotElfromShower()/size));
     268    const Float_t corrected_photel = (Float_t) fMcEvt->GetPhotElfromShower() /
     269      (fOuterPixelsLightCollection + innersize / size * (1. - fOuterPixelsLightCollection));
    275270
    276271    fHistADC2PhotEl->Fill(TMath::Log10(corrected_photel/size));
  • trunk/MagicSoft/Mars/mfilter/MFDeltaT.cc

    r5061 r7005  
    110110// --------------------------------------------------------------------------
    111111//
    112 // Calculate the consition. The consition is true if the time difference
     112// Calculate the condition. The condition is true if the time difference
    113113// between two consecutive events are >0 or <= upper limit.
    114114//
     
    158158    PrintSkipped(fErrors[5], "MTime not initialized");
    159159    *fLog << " " << (int)fErrors[0] << " (";
    160     *fLog << Form("5.1f", 100.*fErrors[0]/GetNumExecutions());
     160    *fLog << Form("%5.1f", 100.*fErrors[0]/GetNumExecutions());
    161161    *fLog << "%) Evts fullfilled filter condition!" << endl;
    162162    *fLog << endl;
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc

    r6926 r7005  
    5252// The flag kAverageing steers if the event-by-event averages are treated at all.
    5353//
     54// Class Version 5:
     55//  + Double_t fLowerFitLimitHiGain;          // Lower limit for the fit range for the hi-gain hist
     56//  + Double_t fUpperFitLimitHiGain;          // Upper limit for the fit range for the hi-gain hist
     57//  + Double_t fLowerFitLimitLoGain;          // Lower limit for the fit range for the lo-gain hist
     58//  + Double_t fUpperFitLimitLoGain;          // Upper limit for the fit range for the lo-gain hist
     59//  + Bool_t   fIsHiGainFitRanges;            // Are high-gain fit ranges defined?
     60//  + Bool_t   fIsLoGainFitRanges;            // Are low-gain fit ranges defined?
     61//
     62//
    5463/////////////////////////////////////////////////////////////////////////////
    5564#include "MHCalibrationCam.h"
     
    8695using namespace std;
    8796
     97const Double_t MHCalibrationCam::fgLowerFitLimitHiGain = 0;
     98const Double_t MHCalibrationCam::fgUpperFitLimitHiGain = 0;
     99const Double_t MHCalibrationCam::fgLowerFitLimitLoGain = 0;
     100const Double_t MHCalibrationCam::fgUpperFitLimitLoGain = 0;
     101
    88102const Int_t   MHCalibrationCam::fgPulserFrequency  = 500;
    89103const Float_t MHCalibrationCam::fgProbLimit        = 0.0001;
    90104const Float_t MHCalibrationCam::fgOverflowLimit    = 0.005;
     105
    91106const TString MHCalibrationCam::gsHistName   = "Hist";
    92107const TString MHCalibrationCam::gsHistTitle  = "";
    93108const TString MHCalibrationCam::gsHistXTitle = "";
    94109const TString MHCalibrationCam::gsHistYTitle = "Nr. events";
     110
    95111// --------------------------------------------------------------------------
    96112//
     
    116132//-  SetSizeCheck   (kTRUE);
    117133//-  SetInterlaced  (kFALSE);
     134//-  SetLowerFitLimitHiGain();
     135//-  SetUpperFitLimitHiGain();
     136//-  SetLowerFitLimitLoGain();
     137//-  SetUpperFitLimitLoGain();
    118138//
    119139MHCalibrationCam::MHCalibrationCam(const char *name, const char *title)
    120     :  fHistName(gsHistName),fHistTitle(gsHistTitle),
    121        fHistXTitle(gsHistXTitle),fHistYTitle(gsHistYTitle),
    122        fColor(MCalibrationCam::kNONE), fIntensBad(NULL),
    123        fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL),
    124        fRunHeader(NULL)
     140    :  fIsHiGainFitRanges(kFALSE), fIsLoGainFitRanges(kFALSE),
     141    fHistName(gsHistName),fHistTitle(gsHistTitle),
     142    fHistXTitle(gsHistXTitle),fHistYTitle(gsHistYTitle),
     143    fColor(MCalibrationCam::kNONE), fIntensBad(NULL),
     144    fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL),
     145    fRunHeader(NULL)
    125146{
    126147
     
    152173    SetOscillations(kTRUE);
    153174    SetSizeCheck   (kTRUE);
     175
     176    SetLowerFitLimitHiGain();
     177    SetUpperFitLimitHiGain();
     178    SetLowerFitLimitLoGain();
     179    SetUpperFitLimitLoGain();
    154180}
    155181
     
    10481074                                       MBadPixelsPix::UncalibratedType_t osctyp)
    10491075{
    1050  
     1076  fIsHiGainFitRanges = TMath::Abs(fUpperFitLimitHiGain - fLowerFitLimitHiGain) > 1E-5;
     1077
    10511078  for (Int_t i=0; i<fHiGainArray->GetSize(); i++)
    10521079    {
     
    10971124                                            MBadPixelsPix::UncalibratedType_t osctyp)
    10981125{
    1099  
     1126  fIsLoGainFitRanges = TMath::Abs(fUpperFitLimitLoGain - fLowerFitLimitLoGain) > 1E-5;
     1127
    11001128  if (!IsLoGain())
    11011129    return;
     
    12071235  // 2) Fit the Hi Gain histograms with a Gaussian
    12081236  //
    1209   if (!hist.FitGaus())
    1210     //
    1211     // 3) In case of failure set the bit Fitted to false and take histogram means and RMS
    1212     //
    1213     if (!hist.RepeatFit())
    1214       {
    1215         hist.BypassFit();
    1216         bad.SetUncalibrated( fittyp );
    1217       }
     1237  if (fIsHiGainFitRanges)
     1238  {
     1239      if (!hist.FitGaus("R",fLowerFitLimitHiGain,fUpperFitLimitHiGain))
     1240          bad.SetUncalibrated( fittyp );
     1241  }
     1242  else
     1243      if (!hist.FitGaus())
     1244          //
     1245          // 3) In case of failure set the bit Fitted to false and take histogram means and RMS
     1246          //
     1247          if (!hist.RepeatFit())
     1248          {
     1249              hist.BypassFit();
     1250              bad.SetUncalibrated( fittyp );
     1251          }
     1252
    12181253 
    12191254  //
     
    12911326  // 2) Fit the Hi Gain histograms with a Gaussian
    12921327  //
    1293   if (!hist.FitGaus())
    1294     //
    1295     // 3) In case of failure set the bit Fitted to false and take histogram means and RMS
    1296     //
    1297     if (!hist.RepeatFit())
    1298       {
    1299         hist.BypassFit();
    1300         if (pix.IsHiGainSaturation())
     1328  if (fIsLoGainFitRanges)
     1329  {
     1330      if (!hist.FitGaus("R",fLowerFitLimitLoGain,fUpperFitLimitLoGain))
    13011331          bad.SetUncalibrated( fittyp );
    1302       }
    1303  
     1332  }
     1333  else
     1334      if (!hist.FitGaus())
     1335          //
     1336          // 3) In case of failure set the bit Fitted to false and take histogram means and RMS
     1337          //
     1338          if (!hist.RepeatFit())
     1339          {
     1340              hist.BypassFit();
     1341              if (pix.IsHiGainSaturation())
     1342                  bad.SetUncalibrated( fittyp );
     1343          }
     1344
    13041345  //
    13051346  // 4) Check for oscillations
     
    14291470}
    14301471
     1472// -----------------------------------------------------------------------------
     1473//
     1474// Available options
     1475//  Debug
     1476//  LoGain
     1477//  Oscillations
     1478//  SizeCheck
     1479//  Averageing
     1480//  Nbins
     1481//  First
     1482//  Last
     1483//  ProbLimit
     1484//  OverflowLimit
     1485//  PulserFrequency
     1486//  LowerFitLimitHiGain
     1487//  UpperFitLimitHiGain
     1488//  LowerFitLimitLoGain
     1489//  UpperFitLimitLoGain
     1490//
    14311491Int_t MHCalibrationCam::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
    14321492{
     
    14931553      rc = kTRUE;
    14941554    }
     1555
     1556  if (IsEnvDefined(env, prefix, "LowerFitLimitHiGain", print))
     1557    {
     1558      SetLowerFitLimitHiGain(GetEnvValue(env, prefix, "LowerFitLimitHiGain", fLowerFitLimitHiGain));
     1559      rc = kTRUE;
     1560    }
     1561
     1562  if (IsEnvDefined(env, prefix, "UpperFitLimitHiGain", print))
     1563    {
     1564      SetUpperFitLimitHiGain(GetEnvValue(env, prefix, "UpperFitLimitHiGain", fUpperFitLimitHiGain));
     1565      rc = kTRUE;
     1566    }
     1567
     1568  if (IsEnvDefined(env, prefix, "LowerFitLimitLoGain", print))
     1569    {
     1570      SetLowerFitLimitLoGain(GetEnvValue(env, prefix, "LowerFitLimitLoGain", fLowerFitLimitLoGain));
     1571      rc = kTRUE;
     1572    }
     1573
     1574  if (IsEnvDefined(env, prefix, "UpperFitLimitLoGain", print))
     1575    {
     1576      SetUpperFitLimitLoGain(GetEnvValue(env, prefix, "UpperFitLimitLoGain", fUpperFitLimitLoGain));
     1577      rc = kTRUE;
     1578    }
     1579
    14951580 
    14961581  return rc;
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h

    r6771 r7005  
    4040 
    4141private:
     42  static const Double_t fgLowerFitLimitHiGain; //! The default for fLowerFitLimitHiGain (now at: 0)
     43  static const Double_t fgUpperFitLimitHiGain; //! The default for fUpperFitLimitHiGain (now at: 0)
     44  static const Double_t fgLowerFitLimitLoGain; //! The default for fLowerFitLimitLoGain (now at: 0)
     45  static const Double_t fgUpperFitLimitLoGain; //! The default for fUpperFitLimitLoGain (now at: 0)
    4246
    4347  static const Int_t   fgPulserFrequency;  //! The default for fPulserFrequency (now set to: 500)
     
    5862  Float_t fProbLimit;                     // Limit for acceptance of probability of Gauss-Fit
    5963  Float_t fOverflowLimit;                 // Part of maximum allowed overflow events
     64
     65  Double_t fLowerFitLimitHiGain;          // Lower limit for the fit range for the hi-gain hist
     66  Double_t fUpperFitLimitHiGain;          // Upper limit for the fit range for the hi-gain hist
     67  Double_t fLowerFitLimitLoGain;          // Lower limit for the fit range for the lo-gain hist
     68  Double_t fUpperFitLimitLoGain;          // Upper limit for the fit range for the lo-gain hist
     69
     70  Bool_t   fIsHiGainFitRanges;            // Are high-gain fit ranges defined?
     71  Bool_t   fIsLoGainFitRanges;            // Are low-gain fit ranges defined?
    6072 
    6173  TString fHistName;                      //! Histogram names
     
    211223  void SetHistXTitle( const char *name )  { fHistXTitle = name; }
    212224  void SetHistYTitle( const char *name )  { fHistYTitle = name; }
     225
     226  void SetLowerFitLimitHiGain( const Double_t d=fgLowerFitLimitHiGain)  {  fLowerFitLimitHiGain = d;  }
     227  void SetUpperFitLimitHiGain( const Double_t d=fgUpperFitLimitHiGain)  {  fUpperFitLimitHiGain = d;  }
     228  void SetLowerFitLimitLoGain( const Double_t d=fgLowerFitLimitLoGain)  {  fLowerFitLimitLoGain = d;  }
     229  void SetUpperFitLimitLoGain( const Double_t d=fgUpperFitLimitLoGain)  {  fUpperFitLimitLoGain = d;  }
    213230   
    214231  void SetNbins                   ( const Int_t  i )       { fNbins   = i; }
     
    223240  void SetPulserFrequency      ( const Int_t   i=fgPulserFrequency )   { fPulserFrequency  = i; }
    224241 
    225   ClassDef(MHCalibrationCam, 4) // Base Histogram class for Calibration Camera
     242  ClassDef(MHCalibrationCam, 5) // Base Histogram class for Calibration Camera
    226243};
    227244
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r6965 r7005  
    292292void MAlphaFitter::PaintResult(Float_t x, Float_t y, Float_t size) const
    293293{
    294     TLatex text(x, y, Form("\\sigma_{Li/Ma}=%.1f  \\omega=%.1f\\circ  E=%d  (\\alpha<%.1f\\circ)  (\\chi_{b}^{2}/ndf=%.1f  \\chi_{s}^{2}/ndf=%.1f  c_{0}=%.1f)",
    295                            fSignificance, GetGausSigma(),
    296                            (int)fEventsExcess, fIntegralMax,
    297                            fChiSqBg, fChiSqSignal, fCoefficients[3]));
     294    const Double_t w  = GetGausSigma();
     295    const Int_t    l  = w<=0 ? 0 : (Int_t)TMath::Ceil(-TMath::Log10(w));
     296    const TString fmt = Form("\\sigma_{Li/Ma}=%%.1f  \\omega=%%.%df\\circ  E=%%d  (\\alpha<%%.1f\\circ)  (\\chi_{b}^{2}/ndf=%%.1f  \\chi_{s}^{2}/ndf=%%.1f  c_{0}=%%.1f)",
     297                             l<1?1:l);
     298
     299    TLatex text(x, y, Form(fmt.Data(), fSignificance, w, (int)fEventsExcess,
     300                           fIntegralMax, fChiSqBg, fChiSqSignal,
     301                           fCoefficients[3]));
    298302
    299303    text.SetBit(TLatex::kTextNDC);
  • trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc

    r6979 r7005  
    390390
    391391  // Check for interleaved events
     392  // This will make that for data with version less than 5, where trigger
     393  // patterns were not yet correct, all the events in the file will be
     394  // processed. For those data there are no interleaved calibration events,
     395  // so it makes no sense to run this test on a _D_ file. So we assume it
     396  // will be a _C_ file, and accept all events.
    392397  MTriggerPatternDecode decode;
    393398  MFTriggerPattern      fcalib;
    394399  fcalib.DenyCalibration();
     400  fcalib.SetDefault(kFALSE);
    395401  MContinue conttp(&fcalib, "ContTrigPattern");
    396402
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6979 r7005  
    460460    MTriggerPatternDecode     decode;
    461461
     462    // This will make that for data with version less than 5, where
     463    // trigger patterns were not yet correct, all the events in the real
     464    // data file will be processed. In any case there are no interleaved
     465    // calibration events in such data, so this is fine.
    462466    MFTriggerPattern ftp;
    463467    ftp.SetDefault(kTRUE);
     
    467471    //    ftp.DenyPinDiode();
    468472    ftp.SetInverted();
     473
     474    // This will skip interleaved calibration events and pedestal events (if any)
     475    // --> tlist2
    469476    MContinue conttp(&ftp, "ContTrigPattern");
    470     // --> tlist2
    471477
    472478    // Do signal and pedestal calculation
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r6998 r7005  
    17991799    // Other Tasks
    18001800    //
     1801
     1802    // Set the default for data version earlier than 5, where no valid
     1803    // trigger pattern exists. There should not be pin diode or other
     1804    // types of events inside the calibration files which should be skipped,
     1805    // anyway. So we set the default such that the MContinue ccalib
     1806    // will never be executed.
    18011807    MTriggerPatternDecode     trgpat;
    18021808    MFTriggerPattern          fcalib("CalibFilter");
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r7001 r7005  
    7777MJCut::MJCut(const char *name, const char *title)
    7878    : fStoreSummary(kFALSE), fStoreResult(kTRUE), fWriteOnly(kFALSE),
    79     fIsWobble(kFALSE), fIsMonteCarlo(kFALSE),  fFullDisplay(kFALSE),
     79    fIsWobble(kFALSE), fIsMonteCarlo(kFALSE),  fFullDisplay(kTRUE),
    8080    fNameHist("MHThetaSq"), fCalcHadronness(0)
    8181{
     
    334334    write->AddContainer("MHadronness",    "Events", kFALSE);
    335335    write->AddContainer("MEnergyEst",     "Events", kFALSE);
     336    write->AddContainer("ThetaSquared",   "Events", kFALSE);
    336337    write->AddContainer("MMcEvt",         "Events", kFALSE);
    337338    write->AddContainer("DataType",       "Events");
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6998 r7005  
    940940    }
    941941
     942    // This will make that for data with version less than 5, where
     943    // trigger patterns were not yet correct, all the events in the real
     944    // data file will be processed. In any case there are no interleaved
     945    // calibration events in such data, so this is fine.
    942946    MFTriggerPattern fcalib("CalibFilter");
     947    fcalib.SetDefault(kFALSE);
    943948    fcalib.RequireCalibration();
    944949    fcalib.SetInverted();
  • trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc

    r7001 r7005  
    178178        return -1;
    179179
    180     TObject *hist = arr.FindObjectInCanvas("Hist", "MHAlpha", "Hist");
    181     cout << "HIST: " << hist << endl;
    182     if (hist)
    183         cout << "TYPE: " << hist->ClassName() << endl;
    184     arr.Print();
    185 
    186180    vstime->Copy(h1);
    187181    size->Copy(h2);
     
    335329Bool_t MJSpectrum::Refill(MParList &plist, TH1D &h2) const
    336330{
     331    // Try to find the class used to determin the signal!
     332    TString cls("MHAlpha");
     333    if (fDisplay)
     334    {
     335        TCanvas *c = fDisplay->GetCanvas("Hist");
     336        if (c)
     337        {
     338            TIter Next(c->GetListOfPrimitives());
     339            TObject *obj=0;
     340            while ((obj=Next()))
     341                if (obj->InheritsFrom(MHAlpha::Class()))
     342                    break;
     343            if (obj)
     344                cls = obj->ClassName();
     345        }
     346    }
     347
     348    cout << "FOUND: "<< cls << endl;
     349
     350    // Now fill the histogram
    337351    *fLog << endl;
    338352    fLog->Separator("Refill Excess");
     
    350364    taskenv1.SetDefault(fEstimateEnergy ? fEstimateEnergy : &est);
    351365
    352     MFillH fill1("HistEOff [MHAlpha]", "MHillasSrc", "FillHistEOff");
    353     MFillH fill2("HistE    [MHAlpha]", "MHillasSrc", "FillHistE");
     366    MFillH fill1(Form("HistEOff [%s]", cls.Data()), "", "FillHistEOff");
     367    MFillH fill2(Form("HistE    [%s]", cls.Data()), "", "FillHistE");
    354368
    355369    MFDataMember f0("DataType.fVal", '<', 0.5, "FilterOffData");
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r6997 r7005  
    325325        write.AddContainer("MMcConfigRunHeader",   "RunHeaders");
    326326        write.AddContainer("MMcCorsikaRunHeader",  "RunHeaders");
    327         write.AddCopySource("OriginalMC");
    328327    }
    329328    else
     
    354353        writem.AddContainer("MMcTrig",    "Muons");
    355354    }
     355
     356    if (ismc)
     357        if (fMuonAnalysis)
     358            writem.AddCopySource("OriginalMC");
     359        else
     360            write.AddCopySource("OriginalMC");
    356361
    357362    MTaskList tlist2("Events");
  • trunk/MagicSoft/Mars/mmuon/MMuonCalibParCalc.cc

    r6986 r7005  
    213213    fMuonCalibPar->SetArcWidth(width);
    214214
    215     // Check if this is a 'Write-Out' candidate
    216     if (fMuonCalibPar->GetArcPhi()>160    && fMuonSearchPar->GetRadius()<400 &&
    217         fMuonSearchPar->GetDeviation()<50 && fMuonSearchPar->GetRadius()>170)
    218         fMuonCalibPar->SetReadyToSave();
    219 
    220215    return kTRUE;
    221216}
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc

    r6325 r7005  
    220220  fTrigPattern = (MTriggerPattern*)pList->FindObject("MTriggerPattern");
    221221  if (!fTrigPattern)
    222     *fLog << warn << "MTriggerPattern not found... Cannot use interlaced pedestal events." << endl;
     222    *fLog << inf << "MTriggerPattern not found... Cannot use interlaced pedestal events." << endl;
    223223
    224224  return MExtractPedestal::PreProcess(pList);
  • trunk/MagicSoft/Mars/mreport/MReportStarguider.cc

    r6922 r7005  
    8484{
    8585    Int_t len;
    86     Int_t n=sscanf(str.Data(), "%lf %lf %n", &fDevAz, &fDevZd, &len);
     86    Int_t n=sscanf(str.Data(), "%lf %lf %n", &fDevZd, &fDevAz, &len);
    8787    if (n!=2)
    8888    {
     
    105105    MAstro::String2Angle(str, fNominalAz);   // Nom Az
    106106
    107     if (ver < 999999999)
     107    if (ver < 200503220)
    108108    {
    109109        // Until a fix in the software the written position was nonsense
  • trunk/MagicSoft/Mars/msignal/MC_weights.dat

    r6545 r7005  
    6363# Low Gain Weights: 6 10
    6464# (Amplitude)  (Time)
    65 0.0138311 -0.0165919
    66 0.0117372 -0.0354005
    67 0.00232654 -0.0581018
    68 -0.00791094 -0.0631271
    69 -0.0131845 -0.0558022
    70 -0.0154786 -0.0480772
    71 -0.0171358 -0.0420274
    72 -0.0199068 -0.0340744
    73 -0.02688 -0.0117278
    74 -0.0404328 0.0754397
    75 -0.0357035 0.342673
    76 0.00409834 0.849274
    77 0.248584 1.52181
    78 0.528673 1.67974
    79 0.67261 1.47068
    80 0.735023 1.24965
    81 0.778865 1.10395
    82 0.832049 1.02856
    83 0.907609 1.00924
    84 1.07304 1.09208
    85 1.25051 1.14906
    86 1.37475 1.0253
    87 1.52056 0.653112
    88 1.53175 0.163076
    89 1.49683 -0.15273
    90 1.47188 -0.344252
    91 1.45258 -0.50129
    92 1.42348 -0.670218
    93 1.3673 -0.87756
    94 1.19832 -1.20557
    95 0.99973 -1.53248
    96 0.808836 -1.68211
    97 0.533208 -1.45238
    98 0.446023 -0.900265
    99 0.459037 -0.529769
    100 0.470945 -0.368053
    101 0.465845 -0.313525
    102 0.446981 -0.311926
    103 0.415815 -0.342317
    104 0.348688 -0.425439
    105 0.271752 -0.495437
    106 0.211195 -0.503879
    107 0.131582 -0.413276
    108 0.109187 -0.245156
    109 0.114005 -0.139006
    110 0.117671 -0.0939116
    111 0.116527 -0.078572
    112 0.11177 -0.0772896
    113 0.103901 -0.0840098
    114 0.0871027 -0.102357
    115 0.0758618 -0.119019
    116 0.0611863 -0.118991
    117 0.0430436 -0.0930814
    118 0.0390695 -0.0517162
    119 0.0409257 -0.027711
    120 0.0420581 -0.0186558
    121 0.0419035 -0.0164813
    122 0.0408279 -0.0174564
    123 0.0389147 -0.0202082
    124 0.0345678 -0.025232
     650.0446612 -0.385273
     660.038191 -0.00418687
     670.0386966 0.0212324
     680.0402881 0.0744799
     690.0415794 0.229615
     700.0598731 0.44332
     710.0758477 0.661518
     720.101509 1.10641
     730.159323 1.64997
     740.497256 2.83685
     750.245087 3.27499
     760.140546 2.46177
     770.58086 2.2849
     780.632721 2.45587
     790.72819 2.52835
     800.889583 2.48099
     810.980812 2.50031
     821.09885 2.55892
     831.21374 2.78769
     841.61928 3.08069
     851.38544 1.95583
     861.31998 1.1792
     871.50633 0.591226
     881.50916 0.0793899
     891.5008 -0.33188
     901.47339 -0.575386
     911.45362 -0.915309
     921.40214 -1.31593
     931.34175 -1.77904
     941.0661 -2.05471
     951.31087 -1.49798
     961.33793 -1.34758
     971.10172 -1.21719
     981.08133 -1.09356
     991.04007 -0.981455
     1000.976745 -1.08299
     1010.930979 -1.14774
     1020.874203 -1.18348
     1030.816708 -1.20126
     1040.587354 -1.92869
     1050.783078 -1.89621
     1060.792771 -1.03439
     1070.622278 -0.781807
     1080.61184 -0.745831
     1090.578792 -0.683741
     1100.537336 -0.596328
     1110.51443 -0.592858
     1120.482294 -0.560586
     1130.462351 -0.827587
     1140.317989 -1.05649
     1150.459672 -0.775035
     1160.468287 -0.619961
     1170.374182 -0.31635
     1180.376946 -0.225242
     1190.367075 -0.347444
     1200.340737 -0.393231
     1210.321054 -0.187384
     1220.320654 -0.225558
     1230.302148 -0.399499
     1240.232954 -0.607578
  • trunk/MagicSoft/Mars/msignal/MC_weights4.dat

    r6545 r7005  
    4343# Low Gain Weights: 4 10
    4444# (Amplitude)  (Time)
    45 -0.0150435 -0.0456535
    46 -0.0167019 -0.0398625
    47 -0.0194073 -0.032228
    48 -0.0261603 -0.0107884
    49 -0.0393003 0.072764
    50 -0.0383678 0.323756
    51 0.000454566 0.807731
    52 0.23557 1.45054
    53 0.504239 1.60174
    54 0.641895 1.40233
    55 0.696427 1.19531
    56 0.740101 1.0546
    57 0.791986 0.981974
    58 0.86479 0.963146
    59 1.02308 1.04186
    60 1.19338 1.09617
    61 1.31232 0.977824
    62 1.45116 0.622149
    63 1.4609 0.154384
    64 1.42695 -0.14665
    65 1.4151 -0.336941
    66 1.39615 -0.485034
    67 1.36751 -0.645756
    68 1.31284 -0.843784
    69 1.14997 -1.15775
    70 0.956626 -1.4693
    71 0.772909 -1.61173
    72 0.5089 -1.39031
    73 0.426731 -0.860608
    74 0.440367 -0.505876
    75 0.459554 -0.35905
    76 0.453541 -0.305066
    77 0.434575 -0.303057
    78 0.403893 -0.332238
    79 0.338482 -0.412519
    80 0.268138 -0.482693
    81 0.208943 -0.491638
    82 0.131208 -0.403936
    83 0.109532 -0.240282
    84 0.114424 -0.136913
     450.178287 2.98244
     460.0799794 2.25048
     470.501997 2.04566
     480.559993 2.18952
     490.636334 2.28558
     500.784832 2.29757
     510.894393 2.36602
     521.01571 2.62578
     531.14191 3.14701
     541.70405 4.27635
     551.25503 1.69442
     561.19843 1.00804
     571.36974 0.493838
     581.37759 0.0452029
     591.37174 -0.336051
     601.34423 -0.563321
     611.31669 -0.852661
     621.26602 -1.28826
     631.20062 -1.85625
     640.874127 -2.44773
     651.2433 -1.47361
     661.27171 -1.3052
     671.03025 -1.1211
     681.00417 -0.992811
     690.968251 -0.911359
     700.907626 -1.02038
     710.852293 -1.06813
     720.797164 -1.16276
     730.739386 -1.25445
     740.447754 -2.34757
     750.777349 -1.83155
     760.779564 -1.01577
     770.600426 -0.733238
     780.5863 -0.688006
     790.557156 -0.650488
     800.514926 -0.584649
     810.485323 -0.569089
     820.454047 -0.573249
     830.429026 -0.907077
     840.245526 -1.35434
Note: See TracChangeset for help on using the changeset viewer.