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

Legend:

Unmodified
Added
Removed
  • 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.