Changeset 9341 for trunk


Ignore:
Timestamp:
02/15/09 15:44:45 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9336 r9341  
    1919                                                 -*-*- END OF LINE -*-*-
    2020 2009/02/15 Thomas Bretz
     21
     22   * mpointing/MHSrcPosCam.[h,cc], mpointing/MSrcPosRndm.[h,cc],
     23     mfilter/MFMagicCuts.[h,cc], mmuon/MHMuonPar.[h,cc],
     24     mhflux/MHThetaSqN.[h,cc]:
     25     - support changing geometries (conversion factors) reading
     26       a new geometry from a run header
     27
     28   * mimage/MHVsSize.[h,cc], mimage/MHNewImagePar.[h,cc],
     29     mimage/MHHillasSrc.[h,cc], mimage/MHHillasExt.[h,cc],
     30     mimage/MHHillas.[h,cc], mimage/MNewImagePar2.[h,cc]:
     31     - removed option to set conversion factor manually
     32     - support changing geometries (conversion factors) reading
     33       a new geometry from a run header
     34
     35   * mhflux/MMcSpectrumWeight.cc:
     36     - replaced Form by MString::Format
     37     - made sure that nobody is mixing different energy-range monte
     38       carlos and normalizes by integral (to be implemented)
     39
     40   * manalysis/MMcCalibrationUpdate.cc:
     41     - switched off file Ceres files (this might only be temporary
     42       but it makes the display work quite well even without
     43       calibrated units.
    2144
    2245   * mjobs/MJCalibrateSignal.cc:
  • trunk/MagicSoft/Mars/mhflux/MHThetaSqN.cc

    r9153 r9341  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHThetaSqN.cc,v 1.10 2008-11-11 11:42:14 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHThetaSqN.cc,v 1.11 2009-02-15 15:43:30 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    167167    }
    168168
    169     MGeomCam *geom = (MGeomCam*)pl->FindObject("MGeomCam");
    170     if (!geom)
     169    fGeom = (MGeomCam*)pl->FindObject("MGeomCam");
     170    if (!fGeom)
    171171    {
    172172        *fLog << err << "MGeomCam not found... abort." << endl;
    173173        return kFALSE;
    174174    }
    175     fMm2Deg = geom->GetConvMm2Deg();
    176175
    177176    if (fFit.GetScaleMode()==MAlphaFitter::kNone)
     
    217216Int_t MHThetaSqN::Fill(const MParContainer *par, const Stat_t weight)
    218217{
     218    const Double_t fMm2Deg = fGeom->GetConvMm2Deg();
     219
    219220    const TVector2 norm(GetVec(fHillas->GetNormAxis(), 6));
    220221    const TVector2 mean(GetVec(fHillas->GetMean(),     8));
  • trunk/MagicSoft/Mars/mhflux/MHThetaSqN.h

    r9153 r9341  
    88class TVector2;
    99
     10class MGeomCam;
    1011class MTaskList;
    1112class MSrcPosCam;
     
    1415{
    1516private:
     17    MGeomCam    *fGeom;      //! conversion mm to deg
    1618    MParameterD *fDisp;      //!
    1719    MSrcPosCam  *fSrcPosCam; //!
    1820
    19     Double_t fMm2Deg;        //!
    2021    Double_t fThetaSqCut;    //!
    2122    Double_t fSignificanceCutLevel;
  • trunk/MagicSoft/Mars/mimage/MHNewImagePar2.h

    r9340 r9341  
    2020    TH1F fHistBorder2;  //
    2121
    22     Float_t fMm2Deg;
    23     Bool_t  fUseMmScale;
    24 
    2522public:
    2623    MHNewImagePar2(const char *name=NULL, const char *title=NULL);
  • trunk/MagicSoft/Mars/mimage/MHVsSize.cc

    r9153 r9341  
    5959//
    6060MHVsSize::MHVsSize(const char *name, const char *title)
    61     : fHillas(NULL), fHillasExt(NULL), fNewImagePar(NULL), fMm2Deg(1), fUseMmScale(kTRUE)
     61    : fGeom(0), fHillas(0), fHillasExt(0), fNewImagePar(0)
    6262{
    6363    //
     
    8888    fM3Long.SetXTitle("Size [phe]");
    8989
    90     fLength.SetYTitle("Length [mm]");
    91     fWidth.SetYTitle("Width [mm]");
    92     fDist.SetYTitle("Distance [mm]");
     90    fLength.SetYTitle("Length [\\circ]");
     91    fWidth.SetYTitle("Width [\\circ]");
     92    fDist.SetYTitle("Distance [\\circ]");
    9393    fConc1.SetYTitle("Conc1 [ratio]");
    94     fArea.SetYTitle("Conc1 [mm^{2}]");
    95     fM3Long.SetYTitle("M3Long [mm]");
     94    fArea.SetYTitle("Area [\\circ^{2}]");
     95    fM3Long.SetYTitle("M3Long [\\circ]");
    9696
    9797    MBinning binse, binsl, binsd, binsc, binsa, binsm;
    9898    binse.SetEdgesLog( 50,   10, 1e5);
    99     binsl.SetEdges(   100,    0, 296.7/2);
    100     binsd.SetEdges(   100,    0, 600);
     99    binsl.SetEdges(   100,    0, 0.5);
     100    binsd.SetEdges(   100,    0, 2.0);
    101101    binsc.SetEdgesLog(100, 3e-3, 1);
    102     binsa.SetEdges(   100,    0, 445*45);
    103     binsm.SetEdges(   100, -445, 445);
     102    binsa.SetEdges(   100,    0, 0.25);
     103    binsm.SetEdges(   100, -1.5, 1.5);
    104104
    105105    MH::SetBinning(&fLength, &binse, &binsl);
     
    130130Bool_t MHVsSize::SetupFill(const MParList *plist)
    131131{
    132     MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
    133     if (!geom)
    134         *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
    135     else
    136     {
    137         fMm2Deg = geom->GetConvMm2Deg();
    138         SetMmScale(kFALSE);
     132    fGeom = (MGeomCam*)plist->FindObject("MGeomCam");
     133    if (!fGeom)
     134    {
     135        *fLog << err << "MGeomCam not found... abort." << endl;
     136        return kFALSE;
    139137    }
    140138
     
    173171// --------------------------------------------------------------------------
    174172//
    175 // Use this function to setup your own conversion factor between degrees
    176 // and millimeters. The conversion factor should be the one calculated in
    177 // MGeomCam. Use this function with Caution: You could create wrong values
    178 // by setting up your own scale factor.
    179 //
    180 void MHVsSize::SetMm2Deg(Float_t mmdeg)
    181 {
    182     if (mmdeg<0)
    183     {
    184         *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;
    185         return;
    186     }
    187 
    188     if (fMm2Deg>=0)
    189         *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;
    190 
    191     fMm2Deg = mmdeg;
    192 }
    193 
    194 // --------------------------------------------------------------------------
    195 //
    196 // With this function you can convert the histogram ('on the fly') between
    197 // degrees and millimeters.
    198 //
    199 void MHVsSize::SetMmScale(Bool_t mmscale)
    200 {
    201     if (fUseMmScale == mmscale)
    202         return;
    203 
    204     if (fMm2Deg<0)
    205     {
    206         *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;
    207         return;
    208     }
    209 
    210     const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;
    211     MH::ScaleAxis(&fLength, 1, scale);
    212     MH::ScaleAxis(&fWidth,  1, scale);
    213     MH::ScaleAxis(&fDist,   1, scale);
    214     MH::ScaleAxis(&fM3Long, 1, scale);
    215     MH::ScaleAxis(&fArea,   1, scale*scale);
    216 
    217     if (mmscale)
    218     {
    219         fLength.SetYTitle("Length [mm]");
    220         fWidth.SetYTitle("Width [mm]");
    221         fDist.SetYTitle("Distance [mm]");
    222         fArea.SetYTitle("Area [mm^{2}]");
    223         fM3Long.SetYTitle("M3Long [mm]");
    224     }
    225     else
    226     {
    227         fLength.SetYTitle("Length [\\circ]");
    228         fWidth.SetYTitle("Width [\\circ]");
    229         fDist.SetYTitle("Distance [\\circ]");
    230         fArea.SetYTitle("Area [\\circ^{2}]");
    231         fM3Long.SetYTitle("M3Long [\\circ]");
    232     }
    233 
    234     fUseMmScale = mmscale;
    235 }
    236 
    237 // --------------------------------------------------------------------------
    238 //
    239173// Fill the histograms with data from a MHillas-Container.
    240174// Be careful: Only call this with an object of type MHillas
     
    249183    }
    250184
    251     const Double_t scale = fUseMmScale ? 1 : fMm2Deg;
     185    const Double_t scale = fGeom->GetConvMm2Deg();
    252186
    253187    fLength.Fill(fHillas->GetSize(), scale*fHillas->GetLength(),     w);
  • trunk/MagicSoft/Mars/mimage/MHVsSize.h

    r9153 r9341  
    1010#endif
    1111
     12class MGeomCam;
    1213class MHillas;
    1314class MHillasExt;
     
    1718{
    1819private:
     20    MGeomCam     *fGeom;        //! Conversion from mm to deg
    1921    MHillas      *fHillas;      //!
    2022    MHillasExt   *fHillasExt;   //!
     
    3032    TH2F fArea;    //
    3133
    32     Float_t fMm2Deg;
    33     Bool_t  fUseMmScale;
    34 
    3534public:
    3635    MHVsSize(const char *name=NULL, const char *title=NULL);
    37 
    38     void SetMmScale(Bool_t mmscale=kTRUE);
    39     virtual void SetMm2Deg(Float_t mmdeg);
    4036
    4137    Bool_t SetupFill(const MParList *pList);
Note: See TracChangeset for help on using the changeset viewer.