Geant4  10.01.p03
G4ITReaction.cc
Go to the documentation of this file.
1 /*
2  * G4ITReactionInfo.cc
3  *
4  * Created on: 1 févr. 2015
5  * Author: matkara
6  */
7 
8 #include <G4ITReaction.hh>
9 #include "globals.hh"
10 
11 //G4ThreadLocal std::set<G4ITReaction*>* G4ITReaction::gAll(0);
12 
13 
14 G4ITReaction::G4ITReaction(double time, G4Track* trackA, G4Track* trackB) :
16  fTime(time),
17  fReactants(trackA,trackB)
18 {
19  //if(gAll == 0) gAll = new std::set<G4ITReaction*>();
20  //gAll->insert(this);
21 }
22 
24 {
25  //gAll->erase(this);
26 }
27 
29 {
30  G4ITReactionPtr backMeUp = this->shared_from_this();
31  for(G4ReactionPerTrackIt::iterator it = fReactionPerTrack.begin() ;
32  it != fReactionPerTrack.end() ; ++it)
33  {
34  // G4cout << it->first.get() << G4endl;
35  // assert(it->first.get() != 0);
36  it->first->RemoveReaction(it->second, reactionSet);
37  }
38  fReactionPerTrack.clear();
39 }
40 
41 bool G4ITReactionPerTrack::RemoveReaction(G4ITReactionList::iterator it,
42  G4ITReactionSet* reactionSet)
43 {
44  // G4cout << "G4ITReactionPerTrack::RemoveReaction" << G4endl;
45  fReactions.erase(it);
46  if(fReactions.empty())
47  {
48  // G4cout << "G4ITReactionPerTrack is empty" << G4endl;
49  reactionSet->RemoveReactionPerTrack(this->shared_from_this());
50  return true;
51  }
52  return false;
53 }
bool RemoveReaction(G4ITReactionList::iterator it, G4ITReactionSet *reactionSet)
Definition: G4ITReaction.cc:41
G4ITReaction(double time, G4Track *, G4Track *)
Definition: G4ITReaction.cc:14
virtual ~G4ITReaction()
Definition: G4ITReaction.cc:23
#define G4enable_shared_from_this
Definition: G4memory.hh:48
G4shared_ptr< G4ITReaction > G4ITReactionPtr
Definition: G4ITReaction.hh:34
void RemoveReactionPerTrack(G4ITReactionPerTrackPtr reactionPerTrack)
G4ITReactionList fReactions
void RemoveMe(G4ITReactionSet *reactionSet)
Definition: G4ITReaction.cc:28
G4ReactionPerTrackIt fReactionPerTrack
Definition: G4ITReaction.hh:75