#include <MCApplication.h>
Public Member Functions | |
| MCApplication (const char *name, const char *title, short detId) | |
| virtual | ~MCApplication () |
| MCStack * | GetStack () const |
| sim::ParticleList | GetParticleList () |
| sim::FLSHitList | GetFLSHitList () |
| virtual void | ConstructGeometry () |
| virtual void | InitGeometry () |
| virtual void | GeneratePrimaries () |
| virtual void | BeginEvent () |
| virtual void | BeginPrimary () |
| virtual void | PreTrack () |
| virtual void | Stepping () |
| virtual void | PostTrack () |
| virtual void | FinishPrimary () |
| virtual void | FinishEvent () |
| virtual void | Field (const Double_t *x, Double_t *b) const |
| void | SetInt (int i) |
Private Attributes | |
| MCStack * | fStack |
| sim::FLSHit | fFLSHit |
| geo::Geometry * | fGeo |
| std::map< int, sim::Particle > | fParticleMap |
| unsigned int | fInt |
| sim::ParticleList | fParticleList |
| sim::FLSHitList | fHitList |
| Int_t | nMedScintillator |
| Int_t | nMedWLSFiber |
| short | fGeantVer |
|
||||||||||||||||
|
Definition at line 32 of file MCApplication.cxx. References fGeo, fStack, and geo::Geometry::Instance().
00033 : TVirtualMCApplication(name,title), fStack(0), nMedScintillator(7), nMedWLSFiber(10), fGeantVer(4) { 00034 00035 if(!fStack) fStack = new MCStack(); 00036 fGeo = &geo::Geometry::Instance(1,detId); 00037 00038 } |
|
|
Definition at line 41 of file MCApplication.cxx. References fStack.
|
|
|
Definition at line 78 of file MCApplication.cxx. References fHitList, sim::FLSHitList::fHits, fParticleList, and sim::ParticleList::fParticles.
00078 {
00079 fParticleList.fParticles.clear();
00080 fHitList.fHits.clear();
00081 }
|
|
|
Definition at line 84 of file MCApplication.cxx.
00084 {
00085 }
|
|
|
Definition at line 48 of file MCApplication.cxx. References nMedScintillator, and nMedWLSFiber.
00048 {
00049
00050 if ( !gMC ) {
00051 cerr << "!gMC" << endl;
00052 abort();
00053 }
00054
00055 if ( !(gMC -> IsRootGeometrySupported()) ) {
00056 cerr << "!(gMC -> IsRootGeometrySupported())" << endl;
00057 abort();
00058 }
00059
00060 gMC -> SetRootGeometry();
00061
00062 nMedScintillator = gMC->MediumId("Scintillator");
00063 nMedWLSFiber = gMC->MediumId("WLSFiber");
00064
00065 return;
00066
00067 }
|
|
||||||||||||
|
Definition at line 211 of file MCApplication.cxx.
00212 {
00213 b[0] = 0.;
00214 b[1] = 0.;
00215 b[2] = 0.;
00216 }
|
|
|
Definition at line 197 of file MCApplication.cxx. References fParticleList, fParticleMap, and sim::ParticleList::fParticles.
00197 {
00198 //Fill particles in this event (= neutrino interaction)
00199 fParticleList.fParticles.clear();
00200
00201 map<int,sim::Particle>::iterator itr = fParticleMap.begin();
00202 while( itr != fParticleMap.end() ) {
00203 fParticleList.fParticles.push_back(itr->second);
00204 ++itr;
00205 }
00206 fParticleMap.clear();
00207
00208 }
|
|
|
Definition at line 193 of file MCApplication.cxx.
00193 {
00194 }
|
|
|
Definition at line 74 of file MCApplication.cxx.
00074 {
00075 }
|
|
|
Definition at line 37 of file MCApplication.h. References fHitList. Referenced by novamc::NOVAMC::Reco().
00037 { return fHitList; }
|
|
|
Definition at line 36 of file MCApplication.h. References fParticleList. Referenced by novamc::NOVAMC::Reco().
00036 { return fParticleList; };
|
|
|
Definition at line 35 of file MCApplication.h. References fStack. Referenced by novamc::NOVAMC::InitMC().
00035 { return fStack; }
|
|
|
Definition at line 70 of file MCApplication.cxx.
00070 {
00071 }
|
|
|
Definition at line 189 of file MCApplication.cxx.
00189 {
00190 }
|
|
|
Definition at line 88 of file MCApplication.cxx. References fParticleMap, fStack, and novamc::MCStack::GetOriginTrackId().
00088 {
00089 // All particles are stores in fParticleMap
00090 TParticle *particle = gMC->GetStack()->GetCurrentTrack();
00091 int trackid = gMC->GetStack()->GetCurrentTrackNumber();
00092 sim::Particle simparticle(trackid, particle);
00093
00094 // Only the original particle is stored for EM shower
00095 if(trackid==fStack->GetOriginTrackId(trackid)) {
00096 fParticleMap.insert(map<int,sim::Particle>::value_type(trackid,simparticle));
00097 }
00098 }
|
|
|
Definition at line 51 of file MCApplication.h. References fInt. Referenced by novamc::NOVAMC::Reco().
00051 { fInt = i; }
|
|
|
Definition at line 101 of file MCApplication.cxx. References sim::FLSHit::AddEdep(), sim::FLSHit::Clear(), fFLSHit, fGeantVer, fGeo, fHitList, sim::FLSHitList::fHits, sim::FLSHit::fId, fStack, sim::FLSHit::GetEdep(), novamc::MCStack::GetOriginTrackId(), geo::Geometry::IdToCell(), nMedScintillator, geo::PathToUniqueId(), sim::FLSHit::SetCell(), sim::FLSHit::SetPDG(), sim::FLSHit::SetPlane(), sim::FLSHit::SetPos1(), sim::FLSHit::SetPos2(), sim::FLSHit::SetT(), sim::FLSHit::SetTrackId(), and geo::CellGeo::WorldToLocal().
00101 {
00102
00103 /* Fiber should be active, but cancelled until the cellId etc. will
00104 be implemented. if( gMC->CurrentMedium()!=nMedScintillator &&
00105 gMC->CurrentMedium()!=nMedWLSFiber) return;
00106 */
00107
00108 if( gMC->CurrentMedium()!=nMedScintillator) return;
00109
00110 fFLSHit.AddEdep(gMC->Edep());
00111 int ip, ic;
00112
00113 if ( gMC -> IsTrackEntering() ) {
00114
00115 fFLSHit.Clear();
00116
00117 TLorentzVector pos;
00118 gMC->TrackPosition(pos);
00119
00120 TLorentzVector mom;
00121 gMC->TrackMomentum(mom);
00122
00123 Int_t pdg = gMC->TrackPid();
00124
00125 // Note: Current medium in gMC is not always the same as in
00126 // gGeoManager at boundary. You need to get Path from gMC, not
00127 // from gGeoManager in MC.
00128 fFLSHit.fId = geo::PathToUniqueId(gMC->CurrentVolPath());
00129
00130 double tpos1[3] = {pos.X(),pos.Y(),pos.Z()};
00131 double tpos2[3];
00132
00133 fGeo->IdToCell(fFLSHit.fId,&ip,&ic).WorldToLocal(tpos1,tpos2);
00134
00135 fFLSHit.SetPos1((float)tpos2[0], (float)tpos2[1], (float)tpos2[2]);
00136
00137 // pos.T() is set as total time considering particle generation + tracking in Geant3,
00138 // while it is set as tracking time (not include the time when particle generated) in Geant4
00139 double time = (fGeantVer==3)? pos.T(): pos.T()+gMC->GetStack()->GetCurrentTrack()->T();
00140 fFLSHit.SetT((float)time);
00141
00142 fFLSHit.SetPDG(pdg);
00143
00144 fFLSHit.SetPlane(ip);
00145 fFLSHit.SetCell(ic);
00146
00147 int trackid = gMC->GetStack()->GetCurrentTrackNumber();
00148 fFLSHit.SetTrackId(fStack->GetOriginTrackId(trackid));
00149 }
00150
00151 if ( gMC -> IsTrackExiting() || gMC -> IsTrackStop()
00152 || gMC -> IsTrackDisappeared() ) {
00153
00154 TLorentzVector pos;
00155 gMC->TrackPosition(pos);
00156
00157 double tpos1[3] = {pos.X(),pos.Y(),pos.Z()};
00158 double tpos2[3];
00159
00160 fGeo->IdToCell(fFLSHit.fId,&ip,&ic).WorldToLocal(tpos1,tpos2);
00161
00162 fFLSHit.SetPos2((float)tpos2[0], (float)tpos2[1], (float)tpos2[2]);
00163
00164 if( fFLSHit.GetEdep() > 0. ) {
00165
00166 bool firsthit = true;
00167
00168 /* Option to reduce file size
00169 for(unsigned int ih=0; ih<fHitList.fHits.size(); ++ih) {
00170 if(fHitList.fHits[ih].fTrackId == fFLSHit.fTrackId &&
00171 fHitList.fHits[ih].fId == fFLSHit.fId &&
00172 TMath::Abs((fHitList.fHits[ih].fPos1[2]+fHitList.fHits[ih].fPos2[2])/2.
00173 - (fFLSHit.fPos1[2]+fFLSHit.fPos2[2])/2.)<1.) {
00174 fHitList.fHits[ih].AddEdep(fFLSHit.GetEdep());
00175 firsthit = false;
00176 }
00177 }
00178 */
00179 if(firsthit) fHitList.fHits.push_back(fFLSHit);
00180
00181 }
00182
00183 fFLSHit.Clear();
00184 }
00185
00186 }
|
|
|
Definition at line 56 of file MCApplication.h. Referenced by Stepping(). |
|
|
Definition at line 70 of file MCApplication.h. Referenced by Stepping(). |
|
|
Definition at line 57 of file MCApplication.h. Referenced by MCApplication(), and Stepping(). |
|
|
Definition at line 65 of file MCApplication.h. Referenced by BeginEvent(), GetFLSHitList(), and Stepping(). |
|
|
Definition at line 61 of file MCApplication.h. Referenced by SetInt(). |
|
|
Definition at line 64 of file MCApplication.h. Referenced by BeginEvent(), FinishEvent(), and GetParticleList(). |
|
|
Definition at line 59 of file MCApplication.h. Referenced by FinishEvent(), and PreTrack(). |
|
|
Definition at line 55 of file MCApplication.h. Referenced by GetStack(), MCApplication(), PreTrack(), Stepping(), and ~MCApplication(). |
|
|
Definition at line 67 of file MCApplication.h. Referenced by ConstructGeometry(), and Stepping(). |
|
|
Definition at line 68 of file MCApplication.h. Referenced by ConstructGeometry(). |
1.3.5