CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SaveSimTrack.cc
Go to the documentation of this file.
2 
5 
7 
8 #include "G4Track.hh"
9 
11 
12  pdgMin = p.getUntrackedParameter<int>("MinimumPDGCode", 1000000);
13  pdgMax = p.getUntrackedParameter<int>("MaximumPDGCode", 2000000);
14 
15  edm::LogInfo("SaveSimTrack") << "SaveSimTrack:: Save Sim Track if PDG code "
16  << "lies between " << pdgMin << " and "
17  << pdgMax;
18 }
19 
21 
23 
24  G4Track* theTrack = (G4Track*)((*trk)());
25  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
26  if (trkInfo) {
27  int pdg = std::abs(theTrack->GetDefinition()->GetPDGEncoding());
28  if (pdg >= pdgMin && pdg <= pdgMax) {
29  trkInfo->storeTrack(true);
30  LogDebug("SaveSimTrack") << "Save SimTrack the Track "
31  << theTrack->GetTrackID() << " Type "
32  << theTrack->GetDefinition()->GetParticleName()
33  << " Momentum " << theTrack->GetMomentum()/MeV
34  << " MeV/c";
35  }
36  }
37 }
38 
#define LogDebug(id)
T getUntrackedParameter(std::string const &, T const &) const
bool storeTrack() const
#define abs(x)
Definition: mlp_lapack.h:159
void update(const BeginOfTrack *trk)
This routine will be called when the appropriate signal arrives.
Definition: SaveSimTrack.cc:22
SaveSimTrack(edm::ParameterSet const &p)
Definition: SaveSimTrack.cc:10