#include <DsOpStackAction.h>
Inheritance diagram for DsOpStackAction:
Public Types | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
enum | Status |
enum | Status |
Public Member Functions | |
DsOpStackAction (const std::string &type, const std::string &name, const IInterface *parent) | |
virtual | ~DsOpStackAction () |
virtual StatusCode | initialize () |
virtual StatusCode | finalize () |
virtual G4ClassificationOfNewTrack | ClassifyNewTrack (const G4Track *aTrack) |
virtual void | NewStage () |
virtual void | PrepareNewEvent () |
virtual G4bool | IsNeutronDaughter (const G4int id, const vector< G4int > aList) |
virtual G4bool | IsAInterestingTrack (const G4Track *aTrack) |
virtual G4bool | PossibleInterestingTrack (const G4Track *aTrack) |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface)=0 |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface)=0 |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface)=0 |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
virtual unsigned long | addRef ()=0 |
virtual unsigned long | addRef ()=0 |
virtual unsigned long | addRef ()=0 |
virtual unsigned long | addRef () |
virtual unsigned long | release ()=0 |
virtual unsigned long | release ()=0 |
virtual unsigned long | release ()=0 |
StatusCode | release (const IInterface *interface) const |
virtual unsigned long | release () |
virtual const std::string & | type () const =0 |
virtual const std::string & | type () const |
virtual const IInterface * | parent () const =0 |
virtual const IInterface * | parent () const |
virtual StatusCode | configure ()=0 |
virtual StatusCode | configure () |
virtual StatusCode | start ()=0 |
virtual StatusCode | start () |
virtual StatusCode | stop ()=0 |
virtual StatusCode | stop () |
virtual StatusCode | terminate ()=0 |
virtual StatusCode | terminate () |
virtual StatusCode | reinitialize ()=0 |
virtual StatusCode | reinitialize () |
virtual StatusCode | restart ()=0 |
virtual StatusCode | restart () |
virtual Gaudi::StateMachine::State | FSMState () const =0 |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual StatusCode | sysInitialize ()=0 |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysStart ()=0 |
virtual StatusCode | sysStart () |
virtual StatusCode | sysStop ()=0 |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize ()=0 |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysReinitialize ()=0 |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart ()=0 |
virtual StatusCode | sysRestart () |
virtual unsigned long | refCount () const =0 |
virtual const std::string & | name () const =0 |
virtual const std::string & | name () const |
virtual void | handle (const Incident &i) |
IGiGaSvc * | gigaSvc () const |
IGiGaSetUpSvc * | setupSvc () const |
INTupleSvc * | ntupleSvc () const |
INTupleSvc * | evtColSvc () const |
IDataProviderSvc * | detSvc () const |
IDataProviderSvc * | evtSvc () const |
IIncidentSvc * | incSvc () const |
IChronoStatSvc * | chronoSvc () const |
IHistogramSvc * | histoSvc () const |
IAlgContextSvc * | contextSvc () const |
DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const |
DataObject * | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const |
TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const |
TYPE * | getDet (const std::string &location) const |
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
bool | exist (const std::string &location, const bool useRootInTES=true) const |
bool | existDet (IDataProviderSvc *svc, const std::string &location) const |
bool | existDet (const std::string &location) const |
TYPE * | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
TYPE * | getOrCreate (const std::string &location, const bool useRootInTES=true) const |
TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const |
TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const |
SERVICE * | svc (const std::string &name, const bool create=true) const |
IUpdateManagerSvc * | updMgrSvc () const |
IDataProviderSvc * | fastContainersSvc () const |
StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const |
StatusCode | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
MsgStream & | msgStream (const MSG::Level level) const |
MsgStream & | always () const |
MsgStream & | fatal () const |
MsgStream & | err () const |
MsgStream & | error () const |
MsgStream & | warning () const |
MsgStream & | info () const |
MsgStream & | debug () const |
MsgStream & | verbose () const |
MsgStream & | msg () const |
const Statistics & | counters () const |
StatEntity & | counter (const std::string &tag) const |
MSG::Level | msgLevel () const |
bool | msgLevel (const MSG::Level level) const |
void | resetMsgStream () const |
bool | typePrint () const |
bool | propsPrint () const |
bool | statPrint () const |
bool | errorsPrint () const |
long | printStat (const MSG::Level level=MSG::ALWAYS) const |
long | printErrors (const MSG::Level level=MSG::ALWAYS) const |
long | printProps (const MSG::Level level=MSG::ALWAYS) const |
void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL) |
StatusCode | runUpdate () |
TransientFastContainer< T > * | getFastContainer (const std::string &location, typename TransientFastContainer< T >::size_type initial=0) |
const std::string & | context () const |
const std::string & | rootInTES () const |
double | globalTimeOffset () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual StatusCode | setProperty (const Property &p) |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
virtual const std::vector< Property * > & | getProperties () const |
PropertyMgr * | getPropertyMgr () |
ISvcLocator * | serviceLocator () const |
ISvcLocator * | svcLoc () const |
IMessageSvc * | msgSvc () const |
IToolSvc * | toolSvc () const |
StatusCode | setProperties () |
StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const |
StatusCode | service (const std::string &type, const std::string &name, T *&svc) const |
void | declInterface (const InterfaceID &, void *) |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
IAuditorSvc * | auditorSvc () const |
IMonitorSvc * | monitorSvc () const |
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Types | |
typedef std::map< std::string, StatEntity > | Statistics |
typedef std::map< std::string, unsigned int > | Counter |
typedef std::vector< IAlgTool * > | AlgTools |
typedef std::pair< IInterface *, std::string > | ServiceEntry |
typedef std::vector< ServiceEntry > | Services |
Protected Member Functions | |
virtual unsigned long | refCount () const |
StatusCode | releaseTool (const IAlgTool *tool) const |
StatusCode | releaseSvc (const IInterface *svc) const |
int | outputLevel () const |
IntegerProperty & | outputLevelProperty () |
void | initOutputLevel (Property &prop) |
Static Protected Attributes | |
static const bool | IgnoreRootInTES |
static const bool | UseRootInTES |
Private Attributes | |
G4int | stage |
G4int | PhotonNumbers |
G4int | NeutronNumbers |
G4bool | interestingEvt |
std::vector< G4int > | neutronList |
G4bool | m_tightCut |
G4bool | m_photonCut |
G4double | m_maxPhoton |
ICoordSysSvc * | m_csvc |
Definition at line 27 of file DsOpStackAction.h.
DsOpStackAction::DsOpStackAction | ( | const std::string & | type, | |
const std::string & | name, | |||
const IInterface * | parent | |||
) |
Definition at line 22 of file DsOpStackAction.cc.
00025 : GiGaStackActionBase( type, name, parent ) , 00026 stage(0), 00027 PhotonNumbers(0), 00028 NeutronNumbers(0), 00029 interestingEvt(false), 00030 m_csvc(0) 00031 { 00032 declareProperty("TightCut",m_tightCut = false, " cut to select Neutron only event in the AD."); 00033 declareProperty("PhotonCut",m_photonCut = false, " Kill all the optical photons in the process."); 00034 declareProperty("MaxPhoton",m_maxPhoton = 1e6, " Max number of photons to be hold."); 00035 }
virtual DsOpStackAction::~DsOpStackAction | ( | ) | [inline, virtual] |
StatusCode DsOpStackAction::initialize | ( | ) | [virtual] |
Reimplemented from GiGaStackActionBase.
Definition at line 38 of file DsOpStackAction.cc.
00039 { 00040 info() << "DsOpStackAction::initialize()" << endreq; 00041 00042 StatusCode sc = GiGaStackActionBase::initialize(); 00043 if (sc.isFailure()) return sc; 00044 00045 00046 if ( service("CoordSysSvc", m_csvc).isFailure()) { 00047 error() << " No CoordSysSvc available." << endreq; 00048 return StatusCode::FAILURE; 00049 } 00050 00051 return StatusCode::SUCCESS; 00052 }
StatusCode DsOpStackAction::finalize | ( | ) | [virtual] |
Reimplemented from GiGaStackActionBase.
Definition at line 54 of file DsOpStackAction.cc.
00055 { 00056 info() << "DsOpStackAction::finalize()" << endreq; 00057 neutronList.clear(); 00058 return GiGaStackActionBase::finalize(); 00059 }
G4ClassificationOfNewTrack DsOpStackAction::ClassifyNewTrack | ( | const G4Track * | aTrack | ) | [virtual] |
Reimplemented from GiGaStackActionBase.
Definition at line 63 of file DsOpStackAction.cc.
00063 { 00064 00065 // info() << "DsOpStackAction::ClassifyNewTrack: " << endreq; 00066 00067 G4ClassificationOfNewTrack classification = fUrgent; 00068 //info()<< " ParentID: "<< aTrack->GetParentID()<< " CurrentID: "<<aTrack->GetTrackID()<<endreq; 00069 00070 00071 switch(stage) 00072 { 00073 case 0: // if optical photon is the the secondary particles and below memory threshold, 00074 // put them in waiting. 00075 00076 // tightcut selection here. 00077 if(aTrack->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition()){ 00078 if(m_tightCut){ 00079 if( aTrack->GetDefinition()==G4Neutron::NeutronDefinition()) 00080 { 00081 info()<<" It is a neutron event! " <<endreq; 00082 NeutronNumbers++; 00083 neutronList.push_back(aTrack->GetTrackID()); //save neutron's trackID for later use. 00084 break; 00085 } 00086 00087 00088 if( aTrack->GetDefinition()==G4Gamma::GammaDefinition() 00089 && (aTrack->GetTrackID()-aTrack->GetParentID())==1) //only if the gamma has a direct parent. 00090 { 00091 if(!interestingEvt){ 00092 interestingEvt=this->IsAInterestingTrack(aTrack); 00093 //info()<< "Particle: "<<aTrack->GetDefinition()->GetParticleName() <<endreq; 00094 } 00095 break; 00096 } 00097 } 00098 else { 00099 if( aTrack->GetDefinition()==G4Neutron::NeutronDefinition()) 00100 { 00101 NeutronNumbers++; 00102 break; 00103 } 00104 if (aTrack->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition()) { 00105 if(!interestingEvt){ 00106 interestingEvt=this->PossibleInterestingTrack(aTrack); 00107 } 00108 break; 00109 } 00110 } 00111 } 00112 else{ 00113 00114 PhotonNumbers++; 00115 00116 00117 // ------unother way of doing this is to use the processname to select events-- 00118 // if(aTrack->GetCreatorProcess()){ 00119 // G4String ProcessName=aTrack->GetCreatorProcess()->GetProcessName(); 00120 // info()<< " Proccess Name: "<< ProcessName<<endreq; 00121 // } 00122 00123 00125 if (m_photonCut) { 00126 classification=fKill; 00127 break; 00128 } 00129 else if(aTrack->GetParentID()>0 && PhotonNumbers<=m_maxPhoton && !interestingEvt) 00130 { 00131 //if too many optical photons been generated and too many optical photons hold 00132 //in the stack, may cause 'out of memory' problem 00133 00134 // only hold optical photon if it is secondary 00135 00136 // G4ThreeVector position = aTrack->GetPosition(); 00137 // G4ThreeVector direction = aTrack->GetMomentumDirection(); 00138 // G4ThreeVector polarization = aTrack->GetPolarization(); 00139 // G4double energy = aTrack->GetKineticEnergy(); 00140 // G4double time = aTrack->GetGlobalTime(); 00141 // info()<< " Position " << position.x()<< " time: " <<time<<endreq; 00142 classification=fWaiting; 00143 break; 00144 } 00145 } 00146 00147 classification = fUrgent; 00148 break; 00149 00150 case 1: 00151 // info()<<" In Stage 1, propogating all the stacked optical photons! "<<endreq; 00152 classification = fUrgent; 00153 break; 00154 00155 default: 00156 classification = fUrgent; 00157 } 00158 return classification; 00159 }
void DsOpStackAction::NewStage | ( | ) | [virtual] |
Reimplemented from GiGaStackActionBase.
Definition at line 166 of file DsOpStackAction.cc.
00167 { 00168 00169 info()<< " StackingAction::NewStage! "<<endreq; 00170 info()<< " Number of Optical Photons generated: "<< PhotonNumbers<<endreq; 00171 info()<< " Number of Neutron generated: "<< NeutronNumbers<<endreq; 00172 00173 if(m_tightCut){ 00174 info() << "Tight Cut selected: only select AD gamma events from neutrons! " <<endreq; 00175 } 00176 else{ 00177 info() << " select Events with any new particles generated in the AD! " <<endreq; 00178 } 00179 00180 if(PhotonNumbers>m_maxPhoton) { 00181 info() << " Get an event with Large number of Photons! " <<endreq; 00182 } 00183 00184 if(m_photonCut){ 00185 info() << " All the Optical Photons killed in this event! " <<endreq; 00186 } 00187 00188 stage++; 00189 00190 if(interestingEvt) 00191 { 00192 info()<<" An interesting event! Let's go on!"<<endreq; 00193 stackManager->ReClassify(); 00194 } 00195 else { 00196 info()<< "Boring event, aborting..."<<endreq; 00197 stackManager->clear(); //abort the event 00198 } 00199 }
void DsOpStackAction::PrepareNewEvent | ( | ) | [virtual] |
Reimplemented from GiGaStackActionBase.
Definition at line 203 of file DsOpStackAction.cc.
00204 { 00205 info()<< " StackingAction::PrepareNewEvent! "<<endreq; 00206 interestingEvt=false; 00207 stage=0; 00208 PhotonNumbers=0; 00209 NeutronNumbers=0; 00210 neutronList.clear(); 00211 }
G4bool DsOpStackAction::IsNeutronDaughter | ( | const G4int | id, | |
const vector< G4int > | aList | |||
) | [virtual] |
Definition at line 215 of file DsOpStackAction.cc.
00216 { 00217 00218 //check if the gamma is the daughter of neutrons. 00219 G4bool isDaughter(false); 00220 for(size_t ii=0;ii<aList.size();ii++){ 00221 if(aList[ii]==id || aList[ii]==id-1) { 00222 info()<<" neutron TrackID: "<<aList[ii]<< " been Captured! "<< endreq; 00223 isDaughter=true; 00224 break; 00225 } 00226 } 00227 return isDaughter; 00228 };
G4bool DsOpStackAction::IsAInterestingTrack | ( | const G4Track * | aTrack | ) | [virtual] |
Definition at line 232 of file DsOpStackAction.cc.
00233 { 00234 00235 // info()<< " Am I an interesting event???" <<endreq; 00236 00237 G4int trkID=aTrack->GetParentID(); //get Gamma's parentID 00238 00239 IDetectorElement *de; 00240 Gaudi::XYZPoint gp(aTrack->GetPosition().x(),aTrack->GetPosition().y(),aTrack->GetPosition().z()); 00241 00242 //Get DetectorElement from the global postion. 00243 de = m_csvc->coordSysDE(gp); 00244 if(!de){ 00245 debug()<<" Particle Name: "<<aTrack->GetDefinition()->GetParticleName()<< " at position: "<<gp 00246 <<" with Process Name: "<<aTrack->GetCreatorProcess()->GetProcessName()<<endreq; 00247 } 00248 00249 //Ignore the track outside of our global volumes. 00250 if(de){ 00251 IGeometryInfo *ginfo=de->geometry(); 00252 if(ginfo){ 00253 if( IsNeutronDaughter(trkID, neutronList)) 00254 //if Gamma's parent is neutron, check if they are in the AD. 00255 { 00256 // G4String ProcessName=aTrack->GetCreatorProcess()->GetProcessName(); 00257 const ILVolume *lv=ginfo->lvolume(); 00258 if(lv){ 00259 G4String MaterialName = lv->materialName(); 00260 00261 // info() << " materialName: "<< MaterialName <<endreq; 00262 00263 if( MaterialName=="/dd/Materials/MineralOil" 00264 || MaterialName== "/dd/Materials/GdDopedLS" 00265 || MaterialName== "/dd/Materials/LiquidScintillator" 00266 || MaterialName== "/dd/Materials/Acrylic") { 00267 00268 info()<< "Find a Interesting Event in %s !!!" << MaterialName<<endreq; 00269 return true; 00270 } 00271 } 00272 } 00273 } 00274 } 00275 return false; 00276 }
G4bool DsOpStackAction::PossibleInterestingTrack | ( | const G4Track * | aTrack | ) | [virtual] |
Definition at line 281 of file DsOpStackAction.cc.
00282 { 00283 00284 //info()<< " Am I an possible interesting event???" <<endreq; 00285 00286 IDetectorElement *de; 00287 Gaudi::XYZPoint gp(aTrack->GetPosition().x(),aTrack->GetPosition().y(),aTrack->GetPosition().z()); 00288 00289 //Get DetectorElement from the global postion. 00290 de = m_csvc->coordSysDE(gp); 00291 00292 // If the new particle generated inside of the AD, accept it 00293 if(de){ 00294 IGeometryInfo *ginfo=de->geometry(); 00295 if(ginfo){ 00296 { 00297 const ILVolume *lv=ginfo->lvolume(); 00298 if(lv){ 00299 G4String MaterialName = lv->materialName(); 00300 00301 if( MaterialName=="/dd/Materials/MineralOil" 00302 || MaterialName== "/dd/Materials/GdDopedLS" 00303 || MaterialName== "/dd/Materials/LiquidScintillator" 00304 || MaterialName== "/dd/Materials/Acrylic") { 00305 00306 info()<< "Find a good Event in AD in "<< MaterialName<< " !! "<< endreq; 00307 return true; 00308 } 00309 } 00310 } 00311 } 00312 } 00313 return false; 00314 }
G4int DsOpStackAction::stage [private] |
Definition at line 48 of file DsOpStackAction.h.
G4int DsOpStackAction::PhotonNumbers [private] |
Definition at line 49 of file DsOpStackAction.h.
G4int DsOpStackAction::NeutronNumbers [private] |
Definition at line 50 of file DsOpStackAction.h.
G4bool DsOpStackAction::interestingEvt [private] |
Definition at line 51 of file DsOpStackAction.h.
std::vector<G4int> DsOpStackAction::neutronList [private] |
Definition at line 53 of file DsOpStackAction.h.
G4bool DsOpStackAction::m_tightCut [private] |
Definition at line 57 of file DsOpStackAction.h.
G4bool DsOpStackAction::m_photonCut [private] |
Definition at line 60 of file DsOpStackAction.h.
G4double DsOpStackAction::m_maxPhoton [private] |
Definition at line 63 of file DsOpStackAction.h.
ICoordSysSvc* DsOpStackAction::m_csvc [private] |
Definition at line 68 of file DsOpStackAction.h.