Changeset 5869


Ignore:
Timestamp:
01/17/05 11:54:30 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5868 r5869  
    2121                                                 -*-*- END OF LINE -*-*-
    2222
     23 2005/01/17 Thomas Bretz
     24 
     25   * manalysis/MEnergyEstimate.[h,cc]:
     26     - changed to be more general. Energy is now estimated from a rule
     27       (MDataChain) The default behaviour is still the same as before
     28       to copy the energy from MMcEvt
     29
     30   * mbase/MTask.cc:
     31     - changed to write out the descriptor istead of the task-name only
     32       in Pre/PostProcess
     33
     34   * mhbase/MH.cc:
     35     - initialize fSerialNumber and fNumExecutions in constructor
     36
     37   * mhflux/MHFalseSource.cc:
     38     - according to a suggestion by Markus Mayer I have changed
     39       \\sigma_{max}=f to S_{max}=f\\sigma
     40
     41   * mjobs/MJCalibrateSignal.cc:
     42     - as discussed with Markus and Abelardo fixed the MFTriggerPattern
     43       call.
     44
     45   * mtrigger/MFTriggerPattern.cc, mtrigger/MTriggerPattern.cc,
     46     mtrigger/MTriggerPatternDecode.cc:
     47     - added some comment about file version
     48
     49
     50
    2351 2005/01/17 Markus Gaug
    2452
    25   * msignal/MExtractTimeAndChargeDigitalFilter.cc
    26     - remove a situation where the high-gain signal can be 0.
    27 
    28   * mtrigger/MTriggerPattern.h
    29     - fixed a bug in defining the trigger bit pattern (Have to start
    30       from 0 instead of 1)
     53   * msignal/MExtractTimeAndChargeDigitalFilter.cc
     54     - remove a situation where the high-gain signal can be 0.
     55
     56   * mtrigger/MTriggerPattern.h
     57     - fixed a bug in defining the trigger bit pattern (Have to start
     58       from 0 instead of 1)
     59
    3160
    3261
    3362 2005/01/16 Markus Gaug
    3463
    35   * mhcalib/MHCalibrationCam.[h,cc]
    36   * mhcalib/MHCalibrationRelTimeCam.[h,cc]
    37   * mhcalib/MHCalibrationChargeCam.[h,cc]
    38     - put overflow management and results camera initialization into
    39       base class
     64   * mhcalib/MHCalibrationCam.[h,cc], mhcalib/MHCalibrationRelTimeCam.[h,cc],
     65     mhcalib/MHCalibrationChargeCam.[h,cc]
     66     - put overflow management and results camera initialization into
     67       base class
    4068 
    41   * mcalib/MCalibrateData.[h,cc]
    42     - added possibility to re-normalize signal to equiv. photo-electrons
    43       ( SetSignalType(MCalibrateData::kPhe) ).
    44       Default is old version in photons
    45     - speed up Process by storing pre-calculated calibration constants
    46       in arrays (needed 40% of CPU time of the eventloop before, now: 23%)
    47     - added new pointer to different MCalibrationChargeCam used for
    48       updates
    49     - added possibility to update the conversion factors using the
    50       MCalibrationChargeCam stored in fCalibUpdate.
    51     - added Print() function
    52 
    53   * mcalib/MCalibCalcFromPast.[h,cc]
    54     - committed final version, now also in the Makefile
    55 
    56  
    57   * mjobs/MJCalibrateSignalFromOutside.[h,cc]
    58   * macros/calibration.C
    59     - committed final version, now able to calibrate interlaced cal.
    60       events.
     69   * mcalib/MCalibrateData.[h,cc]
     70     - added possibility to re-normalize signal to equiv. photo-electrons
     71       ( SetSignalType(MCalibrateData::kPhe) ).
     72       Default is old version in photons
     73     - speed up Process by storing pre-calculated calibration constants
     74       in arrays (needed 40% of CPU time of the eventloop before, now: 23%)
     75     - added new pointer to different MCalibrationChargeCam used for
     76       updates
     77     - added possibility to update the conversion factors using the
     78       MCalibrationChargeCam stored in fCalibUpdate.
     79     - added Print() function
     80
     81   * mcalib/MCalibCalcFromPast.[h,cc]
     82     - committed final version, now also in the Makefile
     83
     84   * mjobs/MJCalibrateSignalFromOutside.[h,cc], macros/calibration.C
     85     - committed final version, now able to calibrate interlaced cal.
     86       events.
     87
    6188
    6289
    6390 2005/01/14 Hendrik Bartko
    6491
    65   * msignal/calibration_weights_UV.dat
    66     - fixed a small bug in the noise autocorrelation of the AB-noise
    67   * msignal/calibration_weights_blue.dat       
    68     - new weights file for blue calibration pulses
    69   * cosmics_weights.dat
    70     - fixed a small bug in the noise autocorrelation of the AB-noise
     92   * msignal/calibration_weights_UV.dat
     93     - fixed a small bug in the noise autocorrelation of the AB-noise
     94
     95   * msignal/calibration_weights_blue.dat       
     96     - new weights file for blue calibration pulses
     97
     98   * cosmics_weights.dat
     99     - fixed a small bug in the noise autocorrelation of the AB-noise
     100
    71101
    72102
     
    89119     - Use now the new class MTriggerPattern directly to recognize an
    90120       interlaced pedestal event.     
     121
    91122
    92123
  • trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc

    r2206 r5869  
    2525
    2626/////////////////////////////////////////////////////////////////////////////
    27 //                                                                         //
    28 // MEnergyEstimate                                                         //
    29 //                                                                         //
    30 // Task to estimate the energy                                             //
    31 //                                                                         //
    32 //                                                                         //
     27//
     28// MEnergyEstimate
     29//
     30// Task to estimate the energy by a rule, eg:
     31//
     32// MEnergyEstimate est;
     33// est.SetRule("0.5 + (1.1*MHillas.fLength) + (2.2*MHillasSrc.fDist) + (3.3*MHillas.fSize) +"
     34//             "(4.4*MHillas.fSize*MHillas.fLength) + (5.5*MHillasSrc.fDist*MHillas.fLength)");
     35//
     36// For description of rules, see MDataChain.
     37//
     38// The default rule is "MMcEvt.fEnergy"
     39//
     40// Output:
     41//   MEnergyEst
     42//
    3343/////////////////////////////////////////////////////////////////////////////
    3444#include "MEnergyEstimate.h"
     
    3646#include "MParList.h"
    3747
    38 #include "MMcEvt.hxx"
    39 #include "MHillas.h"
     48#include "MDataChain.h"
    4049#include "MEnergyEst.h"
    4150
     
    4756using namespace std;
    4857
     58// --------------------------------------------------------------------------
     59//
     60// Default constructor. Initialize fData with default rule "MMcEvt.fEnergy"
     61//
     62MEnergyEstimate::MEnergyEstimate(const char *name, const char *title)
     63    : fData(0), fEnergy(0)
     64{
     65    fName  = name  ? name  : "MEnergyEstimate";
     66    fTitle = title ? title : "Task to estimate the energy by a rule";
     67
     68    fData = new MDataChain("MMcEvt.fEnergy");
     69}
    4970
    5071// --------------------------------------------------------------------------
    5172//
    52 // Default constructor.
     73// delete fData
    5374//
    54 MEnergyEstimate::MEnergyEstimate(const char *name, const char *title)
     75MEnergyEstimate::~MEnergyEstimate()
    5576{
    56     fName  = name  ? name  : "MEnergyEstimate";
    57     fTitle = title ? title : "Task to estimate the energy";
    58 
    59     AddToBranchList("MMcEvt.fEnergy");
     77    delete fData;
    6078}
    6179
     80// --------------------------------------------------------------------------
     81//
     82// Delete fData. Initialize a new MDataChain with rule.
     83// Returns if fData->IsValid()
     84//
     85Bool_t MEnergyEstimate::SetRule(const char *rule)
     86{
     87    delete fData;
     88    fData = new MDataChain(rule);
     89
     90    return fData->IsValid();
     91}
     92
     93// --------------------------------------------------------------------------
     94//
     95// Forwards SetVariables to fData to allow optimizations.
     96//
     97void MEnergyEstimate::SetVariables(const TArrayD &arr)
     98{
     99    fData->SetVariables(arr);
     100}
     101
     102// --------------------------------------------------------------------------
     103//
     104// FindCreate "MEnergyEst"
     105// PreProcess fData.
     106//
    62107Int_t MEnergyEstimate::PreProcess(MParList *plist)
    63108{
    64    fHillas = (MHillas*)plist->FindObject("MHillas");
    65    if (!fHillas)
    66    {
    67        *fLog << err << dbginf << "MHillas not found... aborting." << endl;
    68        return kFALSE;
    69    }
     109    fEnergy = (MEnergyEst*)plist->FindCreateObj("MEnergyEst");
     110    if (!fEnergy)
     111        return kFALSE;
    70112
    71    fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt");
    72    if (!fMcEvt)
    73    {
    74        *fLog << err << dbginf << "MMcEvt not found... aborting." << endl;
    75        return kFALSE;
    76    }
     113    if (!fData->PreProcess(plist))
     114        return kFALSE;
    77115
    78    fEnergy = (MEnergyEst*)plist->FindCreateObj("MEnergyEst");
    79    if (!fEnergy)
    80       return kFALSE;
     116    *fLog << inf << "Rule for energy estimation: " << fData->GetRule() << endl;
    81117
    82    return kTRUE;   
     118    return kTRUE;
    83119}
    84120
     121// --------------------------------------------------------------------------
     122//
     123// Get value from fData and set it to fEnergy. SetReadyToSave for fEnergy.
     124// Return kCONTINUE if value is NaN (Not a Number)
     125//
    85126Int_t MEnergyEstimate::Process()
    86127{
    87   //fEnergy->SetEnergy(fHillas->GetSize());
    88   fEnergy->SetEnergy(fMcEvt->GetEnergy());
    89   return kTRUE;
     128    const Double_t val = fData->GetValue();
     129    if (TMath::IsNaN(val))
     130        return kCONTINUE;
     131
     132    fEnergy->SetEnergy(val);
     133    fEnergy->SetReadyToSave();
     134    return kTRUE;
    90135}
  • trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.h

    r2206 r5869  
    66#endif
    77
    8 class MMcEvt;
    9 class MHillas;
     8class MData;
    109class MEnergyEst;
    1110
     
    1312{
    1413private:
    15     MMcEvt     *fMcEvt;
    16     MHillas    *fHillas;
     14    MData      *fData;    //->
    1715    MEnergyEst *fEnergy;
    1816
    1917public:
    2018    MEnergyEstimate(const char *name=NULL, const char *title=NULL);
     19    ~MEnergyEstimate();
     20
     21    Bool_t SetRule(const char *rule);
    2122
    2223    Int_t PreProcess(MParList *plist);
    2324    Int_t Process();
    2425
    25     ClassDef(MEnergyEstimate, 0) // Task to copy the MC energy (preliminary)
     26    void SetVariables(const TArrayD &);
     27
     28    ClassDef(MEnergyEstimate, 0) // Task to estimate the energy by a rule
    2629};
    2730
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r5713 r5869  
    207207    fNumExec0 = GetNumExecutionsTotal();
    208208
    209     *fLog << all << fName << "... " << flush;
     209    *fLog << all << GetDescriptor() << "... " << flush;
    210210    if (fDisplay)
    211211        fDisplay->SetStatusLine2(*this);
     
    270270    fIsPreprocessed = kFALSE;
    271271
    272     *fLog << all << fName << "... " << flush;
     272    *fLog << all << GetDescriptor() << "... " << flush;
    273273    if (fDisplay)
    274274        fDisplay->SetStatusLine2(*this);
  • trunk/MagicSoft/Mars/mhbase/MH.cc

    r5143 r5869  
    8686//
    8787MH::MH(const char *name, const char *title)
     88    : fSerialNumber(0), fNumExecutions(0)
     89
    8890{
    8991    //
  • trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc

    r5776 r5869  
    624624            // Than for their projections
    625625            TH1 *h = fHist.ProjectionZ("Alpha_z", maxx, maxx, maxy, maxy);
    626             h->SetTitle(Form("Distribution of \\alpha for x=%.2f y=%.2f (\\sigma_{max}=%.1f)", x, y, s));
     626            h->SetTitle(Form("Distribution of \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma)", x, y, s));
    627627
    628628            TH1D *h0=0;
     
    11041104    if (maxx>0 && maxy>0)
    11051105    {
    1106         const char *title = Form(" \\alpha for x=%.2f y=%.2f (\\sigma_{max}=%.1f) ",
     1106        const char *title = Form(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ",
    11071107                                 hist->GetXaxis()->GetBinCenter(maxx),
    11081108                                 hist->GetYaxis()->GetBinCenter(maxy), maxs);
     
    12111211        leg->SetBorderSize(1);
    12121212        leg->SetTextSize(0.1);
    1213         leg->AddText(Form("\\sigma_{max}=%.1f at \\alpha_{max}=%d\\circ", maxsig, max));
     1213        leg->AddText(Form("S_{max}=%.1f\\sigma at \\alpha_{max}=%d\\circ", maxsig, max));
    12141214        leg->SetBit(kCanDelete);
    12151215        leg->Draw();
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r5841 r5869  
    335335
    336336    MFTriggerPattern ftp;
    337     ftp.DenyCalibration();
    338     ftp.DenyPedestal();
    339     ftp.DenyPinDiode();
     337    ftp.RequireCalibration();
    340338
    341339    MContinue conttp(&ftp, "ContTrigPattern");
  • trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc

    r5725 r5869  
    2727//   MFTriggerPattern
    2828//
    29 //  A Filter for testing the trigger performance using Trigger Pattern
     29//  A Filter for testing the trigger performance using Trigger Pattern.
     30//
     31// For files before file version 5 the trigger pattern is set to 00000000.
    3032//
    3133/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc

    r5725 r5869  
    3838// class version number (ClassDef) and document your change HERE.
    3939//
     40// For files before file version 5 the trigger pattern is set to 00000000.
     41//
    4042/////////////////////////////////////////////////////////////////////////////
    4143#include "MTriggerPattern.h"
  • trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.cc

    r5803 r5869  
    2828//
    2929//  Decodes the trigger pattern from MRawEvtData into MTriggerPattern.
     30//
     31// For files before file version 5 the trigger pattern is set to 00000000.
     32// This can be changed using the information about the file-type.
    3033//
    3134// Input:
     
    9194// --------------------------------------------------------------------------
    9295//
     96// For files before file version 5 the trigger pattern is set to 00000000.
     97// This can be changed using the information about the file-type.
     98//
    9399Int_t MTriggerPatternDecode::Process()
    94100{
     101    // No setting necessary because MTriggerPattern::reset() has
     102    // been called just before
    95103    if (fRunHeader->GetFormatVersion()<5)
    96104        return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.