#include "LCDEvent.h"

///////////////////////////////////////////////////////////////////////////
//                                                                       
// LCDEvent                                                                 
//                                                                       
// The LCDEvent class is the top level class for the ASCII to ROOT          
// conversion. It contains all the information about a single event.     
// It contains TObjArrays (typically one per detector component) of
// information about hit detector elements, as well as functions to 
// access these arrays.        The "real" objects in these arrays are
// as follows:
//
/*
  MUSTRIP_Hits: LCDStripHit 
  MUCAL_Digi:   LCDCalHit 
  LUMCAL_Digi:  LCDCalHit 
  HADCAL_Digi:  LCDCalHit 
  EMCAL_Digi:   LCDCalHit
  Tracks_List:  LCDTrack
  MCParticles:  LCDMcPart
  VXD_Hit_List: LCDVXD_Hit
  Tracker_Hit_List:LCDTracker_Hit
  Cluster_List:LCDCluster
  LUMCluster_List:LCDCluster
  */
//

///////////////////////////////////////////////////////////////////////////

ClassImp(LCDEvent)
//__________________________________________________________________________
 LCDEvent::LCDEvent(){
  // This is the default constructor.
  BEAM_params      = 0;
  MUSTRIP_Hits     = 0;
  CAL_Digi         = 0;
  VXD_Hit_List     = 0;
  Tracker_Hit_List = 0;
  Tracks_List      = 0;
  Cluster_List     = 0;
  MCParticles      = 0;

  Create();
}

//_________________________________________________________________________
 LCDEvent::~LCDEvent(){
  // Destructor, calls LCDEvent::Clean() to remove the maps and arrays
  if (BEAM_params) {
    delete BEAM_params;
    BEAM_params = 0;
  }

  if (MUSTRIP_Hits) {
    MUSTRIP_Hits->Delete();
    delete MUSTRIP_Hits;
    MUSTRIP_Hits = 0;
  }

  if (CAL_Digi) {
    CAL_Digi->Delete();
    delete CAL_Digi;
    CAL_Digi = 0;
  }

  if (VXD_Hit_List) {
    VXD_Hit_List->Delete();
    delete VXD_Hit_List;
    VXD_Hit_List = 0;
  }

  if(Tracker_Hit_List) {
    Tracker_Hit_List->Delete();
    delete Tracker_Hit_List;
    Tracker_Hit_List = 0;
  }

  if (Tracks_List) {
    Tracks_List->Delete();
    delete Tracks_List;
    Tracks_List = 0;
  }

  if (Cluster_List) {
    Cluster_List->Delete();
    delete Cluster_List;
    Cluster_List = 0;
  }

  if (MCParticles) {
    MCParticles->Delete();
    delete MCParticles;
    MCParticles = 0;  
  }

}
//__________________________________________________________________________
 void LCDEvent::Create(){
  // This is the default constructor.
  if(!BEAM_params)
    BEAM_params      = new LCDBeam();
  if(!MUSTRIP_Hits)
    MUSTRIP_Hits     = new TClonesArray("LCDStripHit"   ,100);
  if(!CAL_Digi)
    CAL_Digi         = new TClonesArray("LCDCalHit"     ,100);
  if(!VXD_Hit_List)     
    VXD_Hit_List     = new TClonesArray("LCDVXD_Hit"    ,100);
  if(!Tracker_Hit_List) 
    Tracker_Hit_List = new TClonesArray("LCDTracker_Hit",100);
  if(!Tracks_List)      
    Tracks_List      = new TClonesArray("LCDTrack"      , 50);
  if(!Cluster_List)     
    Cluster_List     = new TClonesArray("LCDCluster"    ,100);
  if(!MCParticles)      
    MCParticles      = new TClonesArray("LCDMcPart"     ,100);
}

//_________________________________________________________________________
 void LCDEvent::Clean(){
  // This function clears all TClonesArrays contained in the Event object.

  if (MUSTRIP_Hits)     MUSTRIP_Hits->Delete();

  if (CAL_Digi)         CAL_Digi->Delete();

  if (VXD_Hit_List)     VXD_Hit_List->Delete();

  if (Tracker_Hit_List) Tracker_Hit_List->Delete();

  if (Tracks_List)      Tracks_List->Delete();

  if (Cluster_List)     Cluster_List->Delete();

  if (MCParticles)      MCParticles->Delete();

}


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.