Changeset 695 for trunk/MagicSoft


Ignore:
Timestamp:
03/20/01 17:25:33 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r670 r695  
    11                                                                  -*-*- END -*-*-
     2
     3 2000/03/20: Thomas Bretz
     4                                                                 
     5   * manalysis/MPedestalPix.[h,cc], manalysis/MPedestalCam.[h,cc],
     6     manalysis/MHillas.[h,cc], manalysis/MHillasCalc.[h,cc],
     7     mgui/MGeomCamCT1.[h,cc], mgui/MGeomCamMagic.[h,cc]
     8     - added
     9
     10   * macros/readCT1.C:
     11     - added calculation of Hillas parameters
     12     - changed from pointers to objects
     13
     14   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
     15     - added MPedestalPix/Cam, MHillas, MHillasCalc
     16
     17   * manalysis/MCerPhotEvt.[h,cc]:
     18     - removed fType
     19     - commented out Draw function - should be fixed soon
     20     - renamed *Nb* to *Num*
     21     - renamed Get[Min,Max]NumPhotons to GetNumPhontons[Min,Max]
     22
     23   * meventdisp/MGFadcDisp.[h,cc]:
     24     - changed parameter of ReadinEvent to unsigned
     25
     26   * mgui/GuiLinkDef.h, mgui/Makefile:
     27     - added MGeomCamCT1, MGeomCamMagic
     28
     29   * mgui/MCamDisplay.[h,cc]:
     30     - changed constructor argument from int to MGeomCam
     31     - renamed *Nb* to *Num*
     32
     33   * mgui/MGeomCam.[h,cc]:
     34     - removed all camara specific stuff
     35     - MGeomCam is now used as a base class for the classes
     36       MGeomCam[Magic,CT1] which are containing the camera specific stuff
     37
     38   * mgui/MGeomPix.h:
     39     - added Set function
     40   
     41                                                                 
    242 2000/03/02: Thomas Bretz
    343   
  • trunk/MagicSoft/Mars/macros/readCT1.C

    r655 r695  
    11void readCT1()
    22{
    3     MParList  *plist = new MParList() ;
     3    MParList plist;
    44
    5     MCT1ReadAscii *readct1 = new MCT1ReadAscii("CT1_99_on1.dat") ;
     5    MGeomCamMagic camct1;
     6    MHillas       hillas;
     7    MTaskList     tlist;
    68
    7     if (!readct1->PreProcess(plist))
     9    plist->AddToList(&camct1);
     10    plist->AddToList(&hillas);
     11    plist->AddToList(&tlist);
     12
     13    MCT1ReadAscii readct1("CT1_99_on1.dat") ;
     14    MHillasCalc hcalc;
     15
     16    tlist.AddToList(&readct1);
     17    tlist.AddToList(&hcalc);
     18
     19    MEvtLoop evtloop;
     20    evtloop.SetParList(&plist);
     21
     22    if (!evtloop.PreProcess())
    823        return;
    924
    10     MCerPhotEvt *phevt = (MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
     25    MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
    1126
    1227    Int_t icount = 0 ;
    13     MCamDisplay display(0) ;
     28    MCamDisplay display(&camct1) ;
    1429
    15     while ( readct1->Process() )
     30    while (readct1.Process())
    1631    {
    1732        cout << "Event: " << icount++  << endl  ;
    1833
    19         if (icount >= 45 )
    20         {
    21             display->DrawPhotNum( phevt ) ;
     34        if (icount < 45 )
     35            continue;
    2236
    23             gClient->HandleInput();
    24             if(getchar()=='q')
    25                 break;
     37        display.DrawPhotNum(&phevt);
     38        gClient->HandleInput();
     39        if(getchar()=='q')
     40            break;
    2641
    27             phevt->CleanLevel1() ;
    28             phevt->CleanLevel2() ;
    29             display->DrawPhotNum( phevt ) ;
    30             gClient->HandleInput();
    31             if(getchar()=='q')
    32                 break;
     42        phevt.CleanLevel1();
     43        phevt.CleanLevel2();
     44        display.DrawPhotNum(&phevt);
     45        gClient->HandleInput();
     46        if(getchar()=='q')
     47            break;
    3348
    34             phevt->CleanLevel3() ;
     49        phevt.CleanLevel3();
    3550
    36             display->DrawPhotNum( phevt ) ;
    37             gClient->HandleInput();
    38             if(getchar()=='q')
    39                 break;
    40         }
     51        hcalc.Process();
     52
     53        hillas.Print();
     54        hillas.Draw();
     55
     56        display.DrawPhotNum(&phevt);
     57
     58        gClient->HandleInput();
     59        if(getchar()=='q')
     60            break;
     61
     62        hillas.Clear();
    4163    }
    4264
    43     readct1->PostProcess();
     65    evtloop.PostProcess();
    4466}
  • trunk/MagicSoft/Mars/manalysis/AnalysisIncl.h

    r597 r695  
    11#ifndef __CINT__
    2 
    32
    43#include <TClonesArray.h>
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r653 r695  
    1111#pragma link C++ class MCT1Pedestals;
    1212
     13#pragma link C++ class MPedestalPix;
     14#pragma link C++ class MPedestalCam;
     15
     16#pragma link C++ class MHillas;
     17#pragma link C++ class MHillasCalc;
     18
    1319#endif
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r653 r695  
    88
    99#include "MLog.h"
    10 #include "MGeomCam.h"
    1110#include "MCamNeighbor.h"
    1211#include "MCamDisplay.h"
     
    1514ClassImp(MCerPhotEvt)
    1615
    17 MCerPhotEvt::MCerPhotEvt(const char *name, const char *title ) : fType(0), fNbPixels(0)
     16MCerPhotEvt::MCerPhotEvt(const char *name, const char *title) : fNumPixels(0)
    1817{
    1918  //   the default constructor
     
    3130}
    3231
     32#include "MGeomCamMagic.h"
     33#include "MGeomCamCT1.h"
     34
    3335void MCerPhotEvt::Draw(Option_t* option)
    3436{
    35   //   FIXME!!!
    36   //
    37  
    38   MCamDisplay *disp = new MCamDisplay(fType)  ;
    39  
    40   disp->DrawPhotNum(this) ;
    41 }
    42 
    43 Int_t MCerPhotEvt::GetNbPixels()
    44 {
    45   return fNbPixels;
     37    //
     38    //   FIXME!!! Here the Draw function of the CamDisplay
     39    //   should be called to add the CamDisplay to the Pad.
     40    //   The drawing should be done in MCamDisplay::Paint
     41    //
     42
     43    //    MGeomCam *geom = fType ? new MGeomCamMagic : new MGeomCamCT1;
     44    //    MCamDisplay *disp = new MCamDisplay(geom);
     45    //    delete geom;
     46    //    disp->DrawPhotNum(this);
     47}
     48
     49Int_t MCerPhotEvt::GetNumPixels()
     50{
     51    return fNumPixels;
    4652}
    4753
     
    5258    // of valid pixels in the list by one
    5359    //
    54     (*fPixels)[fNbPixels++] = new MCerPhotPix( id, nph, err);
     60    (*fPixels)[fNumPixels++] = new MCerPhotPix( id, nph, err);
    5561}
    5662
     
    6066    // reset counter and delete netries in list.
    6167    //
    62     fNbPixels = 0 ;
     68    fNumPixels = 0 ;
    6369    fPixels->Clear() ;
    6470}
     
    6975
    7076    *fLog << "MCerPhotEvt::Print()" << endl
    71         << "Number of Pixels: " << fNbPixels
     77        << "Number of Pixels: " << fNumPixels
    7278        << "(" << entries << ")"
    7379        << endl ;
     
    276282}
    277283
    278 Float_t MCerPhotEvt::GetMinNumPhotons()
     284Float_t MCerPhotEvt::GetNumPhotonsMin()
    279285{
    280286    //
    281287    // get the minimum number of photons of all valid pixels in the list
    282288    //
    283     if (fNbPixels <= 0)
     289    if (fNumPixels <= 0)
    284290        return -5. ;
    285291
     
    287293
    288294    Float_t testval;
    289     for (Int_t i=1 ; i<fNbPixels; i++ )
     295    for (Int_t i=1 ; i<fNumPixels; i++ )
    290296    {
    291297        testval = (*this)[i].GetNumPhotons();
     
    298304}
    299305
    300 Float_t MCerPhotEvt::GetMaxNumPhotons()
     306Float_t MCerPhotEvt::GetNumPhotonsMax()
    301307{
    302308    //
    303309    // get the maximum number of photons of all valid pixels in the list
    304310    //
    305     if (fNbPixels <= 0)
     311    if (fNumPixels <= 0)
    306312        return 50.;
    307313
     
    309315
    310316    Float_t testval;
    311     for (Int_t i=1; i<fNbPixels; i++)
     317    for (Int_t i=1; i<fNumPixels; i++)
    312318    {
    313319        testval = (*this)[i].GetNumPhotons();
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r653 r695  
    2121private:
    2222
    23     Int_t         fType;
    24     Int_t         fNbPixels;
     23    Int_t         fNumPixels;
    2524    TClonesArray *fPixels;
    2625
     
    3231  void Draw(Option_t* option = "" ) ;
    3332
    34   Int_t    GetNbPixels() ;
     33  Int_t    GetNumPixels() ;
    3534
    3635  void AddPixel(Int_t id, Float_t nph, Float_t err );
     
    4847  Bool_t  IsPixelCore    ( Int_t id ) ;
    4948 
    50   Float_t GetMinNumPhotons();
    51   Float_t GetMaxNumPhotons();
     49  Float_t GetNumPhotonsMin();
     50  Float_t GetNumPhotonsMax();
    5251
    5352  MCerPhotPix &operator[](int i) { return *(MCerPhotPix*)(fPixels->At(i)); }
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r665 r695  
    3030SRCFILES = MCT1Pedestals.cc \
    3131           MCT1ReadAscii.cc \
     32           MPedestalCam.cc \
     33           MPedestalPix.cc \
     34           MHillas.cc \
     35           MHillasCalc.cc \
    3236           MCerPhotEvt.cc \
    3337           MCerPhotPix.cc
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc

    r663 r695  
    339339}
    340340
    341 void MGFadcDisp::ReadinEvent(Int_t iEvt)
     341void MGFadcDisp::ReadinEvent(UInt_t iEvt)
    342342{
    343343    Int_t buttons = 4;
     
    346346    //  first check if the new event is in the range of possible events
    347347 
    348     if ( iEvt < 0 || iEvt >= fReadTree->GetEntries() )
     348    if ( iEvt >= fReadTree->GetEntries() )
    349349    {
    350350        new TGMsgBox(fClient->GetRoot(), this,
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.h

    r663 r695  
    114114  void CreatePixelList() ;
    115115  void UpdateEventCounter() ;
    116   void ReadinEvent(Int_t iEvt) ;
     116  void ReadinEvent(UInt_t iEvt) ;
    117117
    118118  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
  • trunk/MagicSoft/Mars/mgui/GuiLinkDef.h

    r654 r695  
    1313
    1414#pragma link C++ class MHexagon;
     15#pragma link C++ class MCamNeighbor;
     16
    1517#pragma link C++ class MGeomPix;
    1618#pragma link C++ class MGeomCam;
    17 #pragma link C++ class MCamNeighbor;
     19#pragma link C++ class MGeomCamCT1;
     20#pragma link C++ class MGeomCamMagic;
    1821
    1922#pragma link C++ class MCamDisplay;
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.cc

    r653 r695  
    1818ClassImp(MCamDisplay)
    1919
    20     MCamDisplay::MCamDisplay (Int_t type ) : fAutoScale(kTRUE)
     20MCamDisplay::MCamDisplay (MGeomCam *geom) : fAutoScale(kTRUE)
    2121{
    2222    // default constructor
    2323
    2424    //
    25     // create a object which contains the camera geometry
    26     //
    27     MGeomCam geom(type) ;
    28 
    29     //
    3025    //    set the color palette
    3126    //
     
    3530    //  create the hexagons of the display
    3631    //
    37     fNbPixels = geom.GetNbPixels() ;
    38     fPixels   = new TClonesArray("MHexagon", fNbPixels ) ;
    39 
    40     for (Int_t i=0; i< fNbPixels; i++ )
    41     {
    42         (*fPixels)[i] = new MHexagon(geom[i]) ;
    43     }
     32    fNumPixels = geom->GetNumPixels() ;
     33    fPixels    = new TClonesArray("MHexagon", fNumPixels ) ;
     34
     35    for (UInt_t i=0; i< fNumPixels; i++ )
     36        (*fPixels)[i] = new MHexagon((*geom)[i]) ;
    4437
    4538    //
     
    9891    // draw all pixels of the camera
    9992    //
    100     for (Int_t i=0; i< fNbPixels; i++)
     93    for (UInt_t i=0; i< fNumPixels; i++)
    10194        (*this)[i].Draw();
    10295
     
    149142    if ( fAutoScale )
    150143    {
    151         fMinPhe = event->GetMinNumPhotons() ;
    152         fMaxPhe = event->GetMaxNumPhotons() ;
     144        fMinPhe = event->GetNumPhotonsMin() ;
     145        fMaxPhe = event->GetNumPhotonsMax() ;
    153146
    154147        if (fMaxPhe < 20.)
     
    161154    //   update the colors in the picture
    162155    //
    163     const Int_t entries = event->GetNbPixels();
     156    const Int_t entries = event->GetNumPixels();
    164157
    165158    for (Int_t i=0 ; i<entries; i++ )
     
    190183    // determine the Pixel Id and the content
    191184    //
    192     const Int_t entries = event->GetNbPixels() ;
     185    const Int_t entries = event->GetNumPixels() ;
    193186
    194187    for (Int_t i=0 ; i<entries; i++ )
     
    211204    // reset the all pixel colors to a default value
    212205    //
    213     for ( Int_t i=0 ; i< fNbPixels ; i++ )
     206    for ( UInt_t i=0 ; i< fNumPixels ; i++ )
    214207        (*this)[i].SetFillColor(10) ;
    215208}
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.h

    r653 r695  
    1818#endif
    1919
    20 class TClonesArray ;
    21 class MCerPhotEvt  ;
    2220class TBox;
    2321class TText;
     22class TClonesArray ;
     23
     24class MCerPhotEvt  ;
     25class MGeomCam;
    2426
    2527class MCamDisplay : public TObject
    2628{
    2729 private:
    28   Bool_t        fAutoScale ;   //!  indicating the autoscale function
     30  Bool_t         fAutoScale ;   //!  indicating the autoscale function
    2931 
    30   Int_t         fNbPixels ;    //!
    31   TClonesArray  *fPixels   ;   //!
     32  UInt_t         fNumPixels ;   //!
     33  TClonesArray  *fPixels   ;    //!
    3234
    33   Float_t       fMinPhe ;      //!  The minimal number of Phe
    34   Float_t       fMaxPhe ;      //!  The maximum number of Phe
     35  Float_t        fMinPhe ;      //!  The minimal number of Phe
     36  Float_t        fMaxPhe ;      //!  The maximum number of Phe
    3537
    36   TClonesArray  *fLegend  ;    //!
    37   TClonesArray  *fLegText ;    //!
     38  TClonesArray  *fLegend  ;     //!
     39  TClonesArray  *fLegText ;     //!
    3840
    3941  TBox *GetBox(Int_t i)   { return (TBox*) fLegend->At(i); }
     
    4749 public:
    4850 
    49   MCamDisplay ( Int_t type=0 ) ;
     51  MCamDisplay (MGeomCam *geom);
    5052
    5153  ~MCamDisplay () ;
  • trunk/MagicSoft/Mars/mgui/MGeomCam.cc

    r653 r695  
    11#include "MGeomCam.h"
    2 
    3 
    4 #include <math.h>     // floor
    5 #include "TCanvas.h"
    62
    73#include "MLog.h"
     
    106ClassImp(MGeomCam)
    117
    12 MGeomCam::MGeomCam(Int_t type )
    13 {
    14   //    default constructor
     8MGeomCam::MGeomCam(UInt_t npix, const char *name, const char *title)
     9{
     10    *fName  = name  ? name  : "MGeomCam";
     11    *fTitle = title ? title : "Storage container for  a camera geometry";
    1512
    16   if ( type == 1 ) {
    17     // set up the Geometry of CT1
    18    
    19     fNbPixels = 127 ;
    20     fPixels = new TObjArray ( fNbPixels ) ;
    21    
    22     CreateCT1() ;
    23   }
    24   else {
    25     // set up the standard Geometry MAGIC
    26     fNbPixels = 577 ;
    27     fPixels = new TObjArray ( fNbPixels ) ;
     13    fNumPixels = npix;
     14    fPixels    = new TObjArray(npix);
    2815
    29     CreateMagic() ;
    30   }
    31 }
     16    //
     17    // make sure that the destructor delete all contained objects
     18    //
     19    fPixels->SetOwner();
     20
     21    for (UInt_t i=0; i<npix; i++)
     22        (*fPixels)[i] = new MGeomPix;
     23}
    3224
    3325void MGeomCam::Draw( Option_t * )
    34 {
    35   TCanvas *can = new TCanvas("can", "Camera Geometry", 4 ) ;
    36  
    37   //   set the range of the canvas
    38   if ( fNbPixels == 127 )        // case of CT1
    39     can->Range(-175, -175, 175, 175 ) ;
    40   else
    41     can->Range(-600, -600, 600, 600 ) ;
    42 
    43   //   draw all pixels
    44  
    45   for ( Int_t i=0; i < fNbPixels ; i++ ) {
    46       MHexagon *el = new MHexagon ( (*this)[i] )    ;
    47 
    48       el->Draw() ;
    49   }
    50  
    51 }
    52 
    53 void MGeomCam::Print(Option_t *)
    54 {
    55   //   Print Information about the Geometry of the camera
    56   gLog << " Number of Pixels: " << fNbPixels << endl ;
    57 
    58   for ( Int_t i=0; i<fNbPixels; i++ ) {
    59     gLog << " Pixel: " << i << "  " ;
    60     (*this)[i].Print() ;
    61   }
    62 }
    63 
    64 Int_t MGeomCam::GetNbPixels ()
    65 {
    66   //   return the Number of pixels in the MCamGeom class
    67   return fNbPixels ;
    68 
    69 }
    70 
    71 
    72 void MGeomCam::CreateMagic()
    73 {
    74   //   fill the geometry class with the coordinates of the MAGIC camera
    75   gLog << " Create Magic geometry " << endl ;
    76 
    77   //   here define the hardwire things of the magic telescope
    78   //
    79   Float_t xtemp[577] = {
    80     0.000,   30.000,   15.000,  -15.000,  -30.000,  -15.000,   15.000,   60.000,
    81    45.000,   30.000,    0.000,  -30.000,  -45.000,  -60.000,  -45.000,  -30.000,
    82     0.000,   30.000,   45.000,   90.000,   75.000,   60.000,   45.000,   15.000,
    83   -15.000,  -45.000,  -60.000,  -75.000,  -90.000,  -75.000,  -60.000,  -45.000,
    84   -15.000,   15.000,   45.000,   60.000,   75.000,  120.000,  105.000,   90.000,
    85    75.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,  -75.000,  -90.000,
    86  -105.000, -120.000, -105.000,  -90.000,  -75.000,  -60.000,  -30.000,    0.000,
    87    30.000,   60.000,   75.000,   90.000,  105.000,  150.000,  135.000,  120.000,
    88   105.000,   90.000,   75.000,   45.000,   15.000,  -15.000,  -45.000,  -75.000,
    89   -90.000, -105.000, -120.000, -135.000, -150.000, -135.000, -120.000, -105.000,
    90   -90.000,  -75.000,  -45.000,  -15.000,   15.000,   45.000,   75.000,   90.000,
    91   105.000,  120.000,  135.000,  180.000,  165.000,  150.000,  135.000,  120.000,
    92   105.000,   90.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,  -90.000,
    93  -105.000, -120.000, -135.000, -150.000, -165.000, -180.000, -165.000, -150.000,
    94  -135.000, -120.000, -105.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,
    95    60.000,   90.000,  105.000,  120.000,  135.000,  150.000,  165.000,  210.000,
    96   195.000,  180.000,  165.000,  150.000,  135.000,  120.000,  105.000,   75.000,
    97    45.000,   15.000,  -15.000,  -45.000,  -75.000, -105.000, -120.000, -135.000,
    98  -150.000, -165.000, -180.000, -195.000, -210.000, -195.000, -180.000, -165.000,
    99  -150.000, -135.000, -120.000, -105.000,  -75.000,  -45.000,  -15.000,   15.000,
    100    45.000,   75.000,  105.000,  120.000,  135.000,  150.000,  165.000,  180.000,
    101   195.000,  240.000,  225.000,  210.000,  195.000,  180.000,  165.000,  150.000,
    102   135.000,  120.000,   90.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,
    103   -90.000, -120.000, -135.000, -150.000, -165.000, -180.000, -195.000, -210.000,
    104  -225.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,
    105  -135.000, -120.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,   60.000,
    106    90.000,  120.000,  135.000,  150.000,  165.000,  180.000,  195.000,  210.000,
    107   225.000,  270.000,  255.000,  240.000,  225.000,  210.000,  195.000,  180.000,
    108   165.000,  150.000,  135.000,  105.000,   75.000,   45.000,   15.000,  -15.000,
    109   -45.000,  -75.000, -105.000, -135.000, -150.000, -165.000, -180.000, -195.000,
    110  -210.000, -225.000, -240.000, -255.000, -270.000, -255.000, -240.000, -225.000,
    111  -210.000, -195.000, -180.000, -165.000, -150.000, -135.000, -105.000,  -75.000,
    112   -45.000,  -15.000,   15.000,   45.000,   75.000,  105.000,  135.000,  150.000,
    113   165.000,  180.000,  195.000,  210.000,  225.000,  240.000,  255.000,  300.000,
    114   285.000,  270.000,  255.000,  240.000,  225.000,  210.000,  195.000,  180.000,
    115   165.000,  150.000,  120.000,   90.000,   60.000,   30.000,    0.000,  -30.000,
    116   -60.000,  -90.000, -120.000, -150.000, -165.000, -180.000, -195.000, -210.000,
    117  -225.000, -240.000, -255.000, -270.000, -285.000, -300.000, -285.000, -270.000,
    118  -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,
    119  -120.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,   60.000,   90.000,
    120   120.000,  150.000,  165.000,  180.000,  195.000,  210.000,  225.000,  240.000,
    121   255.000,  270.000,  285.000,  330.000,  315.000,  300.000,  285.000,  270.000,
    122   255.000,  240.000,  225.000,  210.000,  195.000,  180.000,  165.000,  135.000,
    123   105.000,   75.000,   45.000,   15.000,  -15.000,  -45.000,  -75.000, -105.000,
    124  -135.000, -165.000, -180.000, -195.000, -210.000, -225.000, -240.000, -255.000,
    125  -270.000, -285.000, -300.000, -315.000, -330.000, -315.000, -300.000, -285.000,
    126  -270.000, -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000,
    127  -135.000, -105.000,  -75.000,  -45.000,  -15.000,   15.000,   45.000,   75.000,
    128   105.000,  135.000,  165.000,  180.000,  195.000,  210.000,  225.000,  240.000,
    129   255.000,  270.000,  285.000,  300.000,  315.000,  360.000,  330.000,  300.000,
    130   270.000,  240.000,  210.000,  150.000,   90.000,   30.000,  -30.000,  -90.000,
    131  -150.000, -210.000, -240.000, -270.000, -300.000, -330.000, -360.000, -360.000,
    132  -330.000, -300.000, -270.000, -240.000, -210.000, -150.000,  -90.000,  -30.000,
    133    30.000,   90.000,  150.000,  210.000,  240.000,  270.000,  300.000,  330.000,
    134   360.000,  420.000,  390.000,  360.000,  330.000,  300.000,  270.000,  240.000,
    135   180.000,  120.000,   60.000,    0.000,  -60.000, -120.000, -180.000, -240.000,
    136  -270.000, -300.000, -330.000, -360.000, -390.000, -420.000, -420.000, -390.000,
    137  -360.000, -330.000, -300.000, -270.000, -240.000, -180.000, -120.000,  -60.000,
    138     0.000,   60.000,  120.000,  180.000,  240.000,  270.000,  300.000,  330.000,
    139   360.000,  390.000,  420.000,  480.000,  450.000,  420.000,  390.000,  360.000,
    140   330.000,  300.000,  270.000,  210.000,  150.000,   90.000,   30.000,  -30.000,
    141   -90.000, -150.000, -210.000, -270.000, -300.000, -330.000, -360.000, -390.000,
    142  -420.000, -450.000, -480.000, -480.000, -450.000, -420.000, -390.000, -360.000,
    143  -330.000, -300.000, -270.000, -210.000, -150.000,  -90.000,  -30.000,   30.000,
    144    90.000,  150.000,  210.000,  270.000,  300.000,  330.000,  360.000,  390.000,
    145   420.000,  450.000,  480.000,  540.000,  510.000,  480.000,  450.000,  420.000,
    146   390.000,  360.000,  330.000,  300.000,  240.000,  180.000,  120.000,   60.000,
    147     0.000,  -60.000, -120.000, -180.000, -240.000, -300.000, -330.000, -360.000,
    148  -390.000, -420.000, -450.000, -480.000, -510.000, -540.000, -540.000, -510.000,
    149  -480.000, -450.000, -420.000, -390.000, -360.000, -330.000, -300.000, -240.000,
    150  -180.000, -120.000,  -60.000,    0.000,   60.000,  120.000,  180.000,  240.000,
    151   300.000,  330.000,  360.000,  390.000,  420.000,  450.000,  480.000,  510.000,
    152   540.000
    153   } ;
    154 
    155   Float_t ytemp[577] = {
    156     0.000,    0.000,   25.981,   25.981,    0.000,  -25.981,  -25.981,    0.000,
    157    25.981,   51.961,   51.961,   51.961,   25.981,    0.000,  -25.981,  -51.961,
    158   -51.961,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,   77.942,
    159    77.942,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
    160   -77.942,  -77.942,  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,
    161    77.942,  103.923,  103.923,  103.923,  103.923,  103.923,   77.942,   51.961,
    162    25.981,    0.000,  -25.981,  -51.961,  -77.942, -103.923, -103.923, -103.923,
    163  -103.923, -103.923,  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,
    164    77.942,  103.923,  129.904,  129.904,  129.904,  129.904,  129.904,  129.904,
    165   103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
    166  -103.923, -129.904, -129.904, -129.904, -129.904, -129.904, -129.904, -103.923,
    167   -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,
    168   129.904,  155.885,  155.885,  155.885,  155.885,  155.885,  155.885,  155.885,
    169   129.904,  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,
    170   -77.942, -103.923, -129.904, -155.885, -155.885, -155.885, -155.885, -155.885,
    171  -155.885, -155.885, -129.904, -103.923,  -77.942,  -51.961,  -25.981,    0.000,
    172    25.981,   51.961,   77.942,  103.923,  129.904,  155.885,  181.865,  181.865,
    173   181.865,  181.865,  181.865,  181.865,  181.865,  181.865,  155.885,  129.904,
    174   103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
    175  -103.923, -129.904, -155.885, -181.865, -181.865, -181.865, -181.865, -181.865,
    176  -181.865, -181.865, -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,
    177   -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,
    178   181.865,  207.846,  207.846,  207.846,  207.846,  207.846,  207.846,  207.846,
    179   207.846,  207.846,  181.865,  155.885,  129.904,  103.923,   77.942,   51.961,
    180    25.981,    0.000,  -25.981,  -51.961,  -77.942, -103.923, -129.904, -155.885,
    181  -181.865, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846,
    182  -207.846, -207.846, -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,
    183   -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,
    184   181.865,  207.846,  233.827,  233.827,  233.827,  233.827,  233.827,  233.827,
    185   233.827,  233.827,  233.827,  233.827,  207.846,  181.865,  155.885,  129.904,
    186   103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
    187  -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -233.827, -233.827,
    188  -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -207.846,
    189  -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,  -25.981,    0.000,
    190    25.981,   51.961,   77.942,  103.923,  129.904,  155.885,  181.865,  207.846,
    191   233.827,  259.808,  259.808,  259.808,  259.808,  259.808,  259.808,  259.808,
    192   259.808,  259.808,  259.808,  259.808,  233.827,  207.846,  181.865,  155.885,
    193   129.904,  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,
    194   -77.942, -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808,
    195  -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808,
    196  -259.808, -259.808, -233.827, -207.846, -181.865, -155.885, -129.904, -103.923,
    197   -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,
    198   129.904,  155.885,  181.865,  207.846,  233.827,  259.808,  285.788,  285.788,
    199   285.788,  285.788,  285.788,  285.788,  285.788,  285.788,  285.788,  285.788,
    200   285.788,  285.788,  259.808,  233.827,  207.846,  181.865,  155.885,  129.904,
    201   103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
    202  -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808, -285.788,
    203  -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788,
    204  -285.788, -285.788, -285.788, -259.808, -233.827, -207.846, -181.865, -155.885,
    205  -129.904, -103.923,  -77.942,  -51.961,  -25.981,   34.641,   86.603,  138.564,
    206   190.526,  242.487,  294.449,  329.090,  329.090,  329.090,  329.090,  329.090,
    207   329.090,  294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,
    208   -86.603, -138.564, -190.526, -242.487, -294.449, -329.090, -329.090, -329.090,
    209  -329.090, -329.090, -329.090, -294.449, -242.487, -190.526, -138.564,  -86.603,
    210   -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,  294.449,  346.410,
    211   381.051,  381.051,  381.051,  381.051,  381.051,  381.051,  381.051,  346.410,
    212   294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,  -86.603,
    213  -138.564, -190.526, -242.487, -294.449, -346.410, -381.051, -381.051, -381.051,
    214  -381.051, -381.051, -381.051, -381.051, -346.410, -294.449, -242.487, -190.526,
    215  -138.564,  -86.603,  -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,
    216   294.449,  346.410,  398.372,  433.013,  433.013,  433.013,  433.013,  433.013,
    217   433.013,  433.013,  433.013,  398.372,  346.410,  294.449,  242.487,  190.526,
    218   138.564,   86.603,   34.641,  -34.641,  -86.603, -138.564, -190.526, -242.487,
    219  -294.449, -346.410, -398.372, -433.013, -433.013, -433.013, -433.013, -433.013,
    220  -433.013, -433.013, -433.013, -398.372, -346.410, -294.449, -242.487, -190.526,
    221  -138.564,  -86.603,  -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,
    222   294.449,  346.410,  398.372,  450.333,  484.974,  484.974,  484.974,  484.974,
    223   484.974,  484.974,  484.974,  484.974,  484.974,  450.333,  398.372,  346.410,
    224   294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,  -86.603,
    225  -138.564, -190.526, -242.487, -294.449, -346.410, -398.372, -450.333, -484.974,
    226  -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974,
    227  -450.333, -398.372, -346.410, -294.449, -242.487, -190.526, -138.564,  -86.603,
    228  -34.641
    229   } ;
    230 
    231   Float_t rtemp[577] = {
    232     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    233     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    234     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    235     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    236     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    237     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    238     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    239     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    240     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    241     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    242     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    243     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    244     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    245     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    246     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    247     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    248     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    249     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    250     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    251     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    252     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    253     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    254     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    255     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    256     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    257     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    258     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    259     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    260     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    261     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    262     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    263     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    264     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    265     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    266     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    267     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    268     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    269     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    270     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    271     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    272     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    273     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    274     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    275     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    276     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    277     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    278     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    279     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    280     30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
    281     30.00,30.00,30.00,30.00,30.00,60.00,60.00,60.00,
    282     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    283     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    284     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    285     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    286     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    287     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    288     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    289     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    290     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    291     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    292     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    293     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    294     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    295     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    296     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    297     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    298     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    299     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    300     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    301     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    302     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
    303     60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00, 
    304     60.00  } ;
    305  
    306   //   fill the pixels list with this data
    307  
    308   for ( Int_t i = 0 ; i< fNbPixels ; i++ ) {     
    309     fPixels->Add( new MGeomPix(xtemp[i], ytemp[i], rtemp[i]) ) ;
    310   }   
    311 }
    312 
    313 void MGeomCam::CreateCT1()
    31426{
    31527    //
    316     // fill the geometry class with the coordinates of the CT1 camera
     28    // Draw the Camera
    31729    //
    318     gLog << " Create CT1 geometry " << endl ;
    319 
    320     //
    321     // this algorithm is from Martin Kestel originally
    322     // it was punt into a root/C++ context by Harald Kornmayer and Thomas Bretz
    323    
    324     const Float_t pixdiameter = 21 ;    // units are cm
    325 
    326     //
    327     //  add the first pixel to the list
    328     //
    329     fPixels->Add( new MGeomPix( 0, 0, pixdiameter ) ) ;
    330 
    331     const Float_t kS32  = sqrt(3)/2;
    332     const Float_t kPI23 = kPI*2/3;
    333 
    334     for (Int_t ringcounter=1; ringcounter<7; ringcounter++) {
    335         //
    336         // calc. numofpix in ring number i first
    337         //
    338         const Int_t numpixthisring = ringcounter*6;
    339 
    340         //
    341         // calc. coords for this ring counting from the
    342         // starting number to the ending number
    343         //
    344         for (Int_t ipix = 0; ipix < numpixthisring; ipix++) {
    345 
    346             Float_t ang     = 60.0/ringcounter * ipix;
    347             Float_t fracang = ang - 60*(int)floor(ang/60);
    348 
    349             ang     /= kRad2Deg;
    350             fracang /= kRad2Deg;
    351 
    352             Float_t rad  = pixdiameter * ringcounter;
    353                     rad *= sin(kPI23-fracang) * kS32;
    354 
    355             //   fill the ObjArray with the pixels data ;
    356 
    357             fPixels->Add( new MGeomPix(rad * cos(ang),
    358                                        rad * sin(ang),
    359                                        pixdiameter ) ) ;
    360         }
     30    for (UInt_t i=0; i<fNumPixels; i++)
     31    {
     32        MHexagon *el = new MHexagon((*this)[i]);
     33        el->Draw();
    36134    }
    36235}
    36336
     37void MGeomCam::Print(Option_t *)
     38{
     39    //
     40    //   Print Information about the Geometry of the camera
     41    //
     42    *fLog << " Number of Pixels: " << fNumPixels << endl ;
     43
     44    for (UInt_t i=0; i<fNumPixels; i++ )
     45    {
     46        *fLog << " Pixel: " << i << "  ";
     47        (*this)[i].Print() ;
     48    }
     49}
     50
  • trunk/MagicSoft/Mars/mgui/MGeomCam.h

    r653 r695  
    88#include <TObjArray.h>
    99#endif
     10#ifndef MPARCONTAINER_H
     11#include "MParContainer.h"
     12#endif
    1013#ifndef MGEOMPIX_H
    1114#include "MGeomPix.h"
    1215#endif
    1316
    14 class MGeomCam
     17class MGeomCam : public MParContainer
    1518{
    1619private:
    17     Int_t          fNbPixels ;  //!
    18     TObjArray     *fPixels   ;  //!
    19  
    20     void CreateMagic() ;
    21     void CreateCT1() ;
     20    UInt_t     fNumPixels;  // Number of pixels in this camera
     21    TObjArray *fPixels;     // Array of singel pixels storing the geometry
    2222
    2323public:
    2424
    25     MGeomCam( Int_t type=0 ) ;
     25    MGeomCam(UInt_t npix, const char *name=NULL, const char *title=NULL);
     26
    2627    virtual ~MGeomCam() { delete fPixels; }
    2728
    28     void Draw(Option_t *option = "" ) ;
     29    virtual void Draw(Option_t *option = "" );
    2930
    30     Int_t    GetNbPixels() ;
     31    UInt_t GetNumPixels() const { return fNumPixels; }
    3132
    3233    MGeomPix &operator[](Int_t i) { return *(MGeomPix*)fPixels->At(i); }
    3334
    34     void Print(Option_t *opt=NULL) ;
     35    virtual void Print(Option_t *opt=NULL);
    3536
    36     ClassDef(MGeomCam, 1)               // Geometry class for the camera
     37    ClassDef(MGeomCam, 1)               // Geometry base class for the camera
    3738};
    3839
  • trunk/MagicSoft/Mars/mgui/MGeomPix.h

    r669 r695  
    1111  Float_t  fX ;  //   the x coordinate
    1212  Float_t  fY ;  //   the y coordinate
    13   Float_t  fR ;  //   the y coordinate
     13  Float_t  fR ;  //   the r coordinate
    1414
    1515 public:
     
    1818 
    1919  void Print(Option_t *opt=NULL) ;
     20
     21  void Set (Float_t x, Float_t y, Float_t r) { fX=x; fY=y; fR=r; }
    2022 
    21   void SetX ( Float_t x )     {      fX = x ;    }
    22   void SetY ( Float_t y )     {      fY = y ;    }
    23   void SetR ( Float_t r )     {      fR = r ;    }
    24   Float_t GetX()              {      return fX ;    }
    25   Float_t GetY()              {      return fY ;    }
    26   Float_t GetR()              {      return fR ;    }
     23  void SetX (Float_t x) { fX = x; }
     24  void SetY (Float_t y) { fY = y; }
     25  void SetR (Float_t r) { fR = r; }
     26
     27  Float_t GetX() const  { return fX; }
     28  Float_t GetY() const  { return fY; }
     29  Float_t GetR() const  { return fR; }
    2730
    2831  ClassDef(MGeomPix, 1)         // Geometric class for one pixel
  • trunk/MagicSoft/Mars/mgui/Makefile

    r665 r695  
    3535           MGMonteCarloMain.cc \
    3636           MGPrototyp.cc \
     37           MGeomCamCT1.cc \
     38           MGeomCamMagic.cc \
    3739           MGeomCam.cc \
    3840           MGeomPix.cc \
Note: See TracChangeset for help on using the changeset viewer.