00001 // BLTrackInfo.hh 00002 /* 00003 This source file is part of G4beamline, http://g4beamline.muonsinc.com 00004 Copyright (C) 2003,2004,2005,2006 by Tom Roberts, all rights reserved. 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 as published by the Free Software Foundation; either version 2 00009 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 http://www.gnu.org/copyleft/gpl.html 00017 */ 00018 00019 #ifndef BLTRACKINFO 00020 #define BLTRACKINFO 00021 00022 #include "BLCoordinates.hh" 00023 00024 /** class BLTrackInfo carries information about the track. 00025 * It is derived from BLCoordinates so all the code that assumes it 00026 * is a BLCoordinates will still work without change. 00027 **/ 00028 class BLTrackInfo : public BLCoordinates { 00029 int externalTrackID; 00030 int externalParentID; 00031 static G4Allocator<BLTrackInfo> alloc; 00032 public: 00033 /// Constructor. 00034 BLTrackInfo() : BLCoordinates() { externalTrackID=externalParentID=0; } 00035 00036 /// Destructor 00037 virtual ~BLTrackInfo() { } 00038 00039 /// operator new - using G4Allocator. 00040 /// NOTE: any derived class MUST re-implement this. 00041 void *operator new(size_t) { return (void *)alloc.MallocSingle(); } 00042 00043 /// operator delete - using G4Allocator. 00044 /// NOTE: any derived class MUST re-implement this. 00045 void operator delete(void *p) { alloc.FreeSingle((BLTrackInfo *)p); } 00046 00047 /// get external trackID 00048 int getExternalTrackID() const { return externalTrackID; } 00049 00050 /// set external trackID 00051 void setExternalTrackID(int v) { externalTrackID = v; } 00052 00053 /// get external ParentID 00054 int getExternalParentID() const { return externalParentID; } 00055 00056 /// set external ParentID 00057 void setExternalParentID(int v) { externalParentID = v; } 00058 }; 00059 00060 #endif // BLTRACKINFO