Ignore:
Timestamp:
01/18/05 10:53:10 (20 years ago)
Author:
rico
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mifae/library
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MControlPlots.cc

    r5379 r5879  
    6363    fCameraHisto[kOn] = NULL;
    6464    fCameraHisto[kOff] = NULL;
     65
    6566}
    6667// -------------------------------------------------------------------------
     
    7071MControlPlots::~MControlPlots()
    7172{
    72   if(fGeomCam)
    73     delete fGeomCam;
     73  Clear();
    7474
    7575  if(fCameraHisto[kOn])
     
    7979}
    8080
     81void MControlPlots::Clear(const Option_t *o)
     82{
     83
     84  if(fGeomCam)
     85    delete fGeomCam;
     86
     87  fGeomCam = NULL;
     88}
     89
    8190
    8291// -------------------------------------------------------------------------
     
    8695Int_t MControlPlots::PreProcess(MParList* pList)
    8796{
     97
     98  Reset();
     99
    88100  // FIXME! only valid for Magic geometry for the time being!
    89101  fGeomCam = new MGeomCamMagic;
     
    94106    *fLog << warn << AddSerialNumber("MIslands") << " [MIslands] not found... Some control plots will not be produced" << endl;
    95107  else
    96     fCameraHisto[fMode] = new MHCamera(*fGeomCam,"Survive","Pixels surviving Image Cleaning");
     108    { 
     109      if (fCameraHisto[fMode])
     110        {
     111          *fLog << err << GetDescriptor()
     112                << "Camera with mode " << fMode << " already existing " << endl;
     113          return kFALSE;
     114        }
     115      TString name = "";
     116      switch (fMode)
     117        {
     118        case kOn:
     119          name += "On";
     120          break;
     121        case kOff:
     122          name += "Off";
     123          break;
     124        }
     125      fCameraHisto[fMode] = new MHCamera(*fGeomCam,
     126                                         name.Data(),
     127                                         "Pixels surviving Image Cleaning");
     128    }
    97129  return kTRUE;
    98130}
     
    105137  if(!fIslands) return kTRUE;
    106138
    107   MImgIsland *imgIsl = new MImgIsland;
     139  MImgIsland *imgIsl = NULL;
    108140  TIter Next(fIslands->GetList());
    109141 
     
    111143  Int_t idPix = -1;
    112144 
    113   while ((imgIsl=(MImgIsland*)Next())) {
    114 
    115     pixNum = imgIsl->GetPixNum();
    116    
    117     for(Int_t k = 0; k<pixNum; k++)
    118       {
    119         idPix = imgIsl->GetPixList(k);
    120         fCameraHisto[fMode]->Fill(idPix,1);
    121         fCameraHisto[fMode]->SetUsed(idPix);
    122       }
    123   }
     145  while ((imgIsl=(MImgIsland*)Next()))
     146    {
     147      pixNum = imgIsl->GetPixNum();
     148     
     149      for(Int_t k = 0; k<pixNum; k++)
     150        {
     151          idPix = imgIsl->GetPixList(k);
     152          fCameraHisto[fMode]->Fill(idPix,1.);
     153          fCameraHisto[fMode]->SetUsed(idPix);
     154        }
     155    }
    124156
    125157  /*  for (UInt_t i=0;i<fGeomCam->GetNumPixels();i++)
     
    142174Int_t MControlPlots::PostProcess()
    143175{
    144   fCameraHisto[fMode]->SetEntries(fGeomCam->GetNumPixels());
    145 
    146176  if(!fProduceFile) return kTRUE;
    147177  if(fProduceFile && !fFileName.Length())
     
    165195  if(fCameraHisto[kOn] && fCameraHisto[kOff])
    166196    {     
    167       diff = new MHCamera(*fGeomCam,"Diff","Pixels surviving Image Cleaning");
     197      diff = new MHCamera(*fGeomCam,"Diff","Difference of pixels surviving Image Cleaning");
    168198
    169199      // Normalize Off to On
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MControlPlots.h

    r5170 r5879  
    1515{
    1616 public:
    17   enum OnOffMode_t {kOn=0,kOff};
     17  enum OnOffMode_t {kOn=0,kOff=1};
    1818 
    1919 private:
     
    3434  virtual ~MControlPlots();
    3535
     36  void Reset() { Clear(); }
     37  void Clear(const Option_t *o="");
     38
    3639  void SetFilename(TString fname)           {fFileName=fname;}
    3740  void SetMode(OnOffMode_t mode)            {fMode=mode;}
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MIslands.cc

    r5186 r5879  
    2424
    2525    fIslands = new TList;
    26    
     26    fIslands->SetOwner();   
    2727}
    2828
     
    3333MIslands::~MIslands()
    3434{
    35    fIslands->SetOwner();
    3635   fIslands->Delete();
    3736}
Note: See TracChangeset for help on using the changeset viewer.