GEMC  2.3
Geant4 Monte-Carlo Framework
MEventAction.cc
Go to the documentation of this file.
1 // G4 headers
2 #include "G4Event.hh"
3 #include "G4RunManager.hh"
4 #include "G4Trajectory.hh"
5 
6 // gemc headers
7 #include "MEventAction.h"
8 #include "Hit.h"
9 
10 #include <iostream>
11 using namespace std;
12 
13 // CLHEP units
14 #include "CLHEP/Units/PhysicalConstants.h"
15 using namespace CLHEP;
16 
17 
18 // return original track id of a vector of tid
19 vector<int> MEventAction::vector_otids(vector<int> tids)
20 {
21  vector<int> otids;
22  for(unsigned int t=0; t<tids.size(); t++)
23  {
24  if(hierarchy.find(tids[t]) != hierarchy.end())
25  otids.push_back(hierarchy[tids[t]]);
26  else
27  otids.push_back(0);
28  }
29  return otids;
30 }
31 
32 
33 // the following functions return the pid, mpid and charges vector<int> from a map<int, TInfos>
34 vector<int> vector_zint(int size)
35 {
36  vector<int> zints;
37  for(int t=0; t<size; t++)
38  zints.push_back(0);
39 
40  return zints;
41 }
42 
43 vector<G4ThreeVector> vector_zthre(int size)
44 {
45  vector<G4ThreeVector> zthre;
46  for(int t=0; t<size; t++)
47  zthre.push_back(G4ThreeVector(0,0,0));
48 
49  return zthre;
50 }
51 
52 vector<int> vector_mtids(map<int, TInfos> tinfos, vector<int> tids)
53 {
54  vector<int> mtids;
55  for(unsigned int t=0; t<tids.size(); t++)
56  mtids.push_back(tinfos[tids[t]].mtid);
57 
58  return mtids;
59 }
60 
61 vector<int> vector_mpids(map<int, TInfos> tinfos, vector<int> tids)
62 {
63  vector<int> mpids;
64  for(unsigned int t=0; t<tids.size(); t++)
65  mpids.push_back(tinfos[tids[t]].mpid);
66 
67  return mpids;
68 }
69 
70 vector<G4ThreeVector> vector_mvert(map<int, TInfos> tinfos, vector<int> tids)
71 {
72  vector<G4ThreeVector> mvert;
73  for(unsigned int t=0; t<tids.size(); t++)
74  mvert.push_back(tinfos[tids[t]].mv);
75 
76  return mvert;
77 }
78 
79 MEventAction::MEventAction(goptions opts, map<string, double> gpars)
80 {
81  gemcOpt = opts;
82  hd_msg = gemcOpt.optMap["LOG_MSG"].args + " Event Action: >> ";
83  Modulo = (int) gemcOpt.optMap["PRINT_EVENT"].arg ;
84  VERB = gemcOpt.optMap["BANK_VERBOSITY"].arg ;
85  catch_v = gemcOpt.optMap["CATCH"].args;
86  SAVE_ALL_MOTHERS = (int) gemcOpt.optMap["SAVE_ALL_MOTHERS"].arg ;
87  gPars = gpars;
88  MAXP = (int) gemcOpt.optMap["NGENP"].arg;
89  rw = runWeights(opts);
90 
91  WRITE_ALLRAW = replaceCharWithChars(gemcOpt.optMap["ALLRAWS"].args, ",", " ");
92  WRITE_INTRAW = replaceCharWithChars(gemcOpt.optMap["INTEGRATEDRAW"].args, ",", " ");
93  WRITE_INTDGT = replaceCharWithChars(gemcOpt.optMap["INTEGRATEDDGT"].args, ",", " ");
94  SIGNALVT = replaceCharWithChars(gemcOpt.optMap["SIGNALVT"].args, ",", " ");
95 
96  if(SAVE_ALL_MOTHERS>1)
97  {
98  lundOutput = new ofstream("background.dat");
99  cout << " > Opening background.dat file to save background particles in LUND format." << endl;
100  }
101 
102  evtN = gemcOpt.optMap["EVTN"].arg;
103 }
104 
106 {
107  if(SAVE_ALL_MOTHERS>1)
108  lundOutput->close();
109 }
110 
111 void MEventAction::BeginOfEventAction(const G4Event* evt)
112 {
113  rw.getRunNumber(evtN);
114  bgMap.clear();
115 
116  if(evtN%Modulo == 0 )
117  {
118  cout << hd_msg << " Begin of event " << evtN << " Run Number: " << rw.runNo;
119  if(rw.isNewRun) cout << " (new) ";
120  cout << endl;
121  cout << hd_msg << " Random Number: " << G4UniformRand() << endl;
122  // CLHEP::HepRandom::showEngineStatus();
123  }
124 }
125 
126 void MEventAction::EndOfEventAction(const G4Event* evt)
127 {
128 
129  MHitCollection* MHC;
130  int nhits;
131 
132  if(evtN%Modulo == 0 )
133  cout << hd_msg << " Starting Event Action Routine " << evtN << " Run Number: " << rw.runNo << endl;
134 
135 
136  // building the tracks set database with all the tracks in all the hits
137  // if SAVE_ALL_MOTHERS is set
138  set<int> track_db;
139  if(SAVE_ALL_MOTHERS)
140  for(map<string, sensitiveDetector*>::iterator it = SeDe_Map.begin(); it!= SeDe_Map.end(); it++)
141  {
142  string hitType;
143 
144  MHC = it->second->GetMHitCollection();
145  nhits = MHC->GetSize();
146 
147  for(int h=0; h<nhits; h++)
148  {
149  vector<int> tids = (*MHC)[h]->GetTIds();
150 
151  for(unsigned int t=0; t<tids.size(); t++)
152  track_db.insert(tids[t]);
153 
154 
155  if(SAVE_ALL_MOTHERS>1)
156  {
157  vector<int> pids = (*MHC)[h]->GetPIDs();
158  // getting the position of the hit, not vertex of track
159  vector<G4ThreeVector> vtxs = (*MHC)[h]->GetPos();
160  vector<G4ThreeVector> mmts = (*MHC)[h]->GetMoms();
161  vector<double> tims = (*MHC)[h]->GetTime();
162  // only put the first step of a particular track
163  // (don't fill if track exist already)
164  for(unsigned int t=0; t<tids.size(); t++)
165  if(bgMap.find(tids[t]) == bgMap.end())
166  bgMap[tids[t]] = BGParts(pids[t], tims[t], vtxs[t], mmts[t]);
167  }
168  }
169  }
170 
171 
172  // now filling the map of tinfos with tracks infos from the track_db database
173  // this won't get the mother particle infos except for their track ID
174  map<int, TInfos> tinfos;
175  set<int>::iterator it;
176 
177  // the container is full only if /tracking/storeTrajectory 2
178  G4TrajectoryContainer *trajectoryContainer;
179 
180  if(SAVE_ALL_MOTHERS)
181  {
182  trajectoryContainer = evt->GetTrajectoryContainer();
183  momDaughter.clear();
184 
185  if(VERB>3)
186  cout << " >> Total number of tracks " << trajectoryContainer->size() << endl;
187 
188  while(trajectoryContainer && track_db.size())
189  {
190  // looping over all tracks
191  for(unsigned int i=0; i< trajectoryContainer->size(); i++)
192  {
193  // cout << " index track " << i << endl;
194  G4Trajectory* trj = (G4Trajectory*)(*(evt->GetTrajectoryContainer()))[i];
195  int tid = trj->GetTrackID();
196 
197  // adding track in mom daughter relationship
198  // for all tracks
199  if(momDaughter.find(tid) == momDaughter.end())
200  momDaughter[tid] = trj->GetParentID();
201 
202  // is this track involved in a hit?
203  // if yes, add it to the track map db
204  it = track_db.find(tid);
205  if(it != track_db.end())
206  {
207  int mtid = trj->GetParentID();
208  tinfos[tid] = TInfos(mtid);
209  // cout << " At map level: " << tid << " " <<mtid << " " << pid << " charge: " << q << endl;
210  // remove the track from the database so we don't have to loop over it next time
211  track_db.erase(it);
212  }
213  }
214  }
215 
216  // building the hierarchy map
217  // for all secondary tracks
218  for(map<int, int>::iterator itm = momDaughter.begin(); itm != momDaughter.end(); itm++)
219  {
220  int ancestor = itm->first;
221  if(momDaughter[ancestor] == 0)
222  hierarchy[itm->first] = itm->first;
223 
224  while (momDaughter[ancestor] != 0)
225  {
226  hierarchy[itm->first] = momDaughter[ancestor];
227  ancestor = momDaughter[ancestor];
228  }
229  }
230 
231  // now accessing the mother particle infos
232  for(map<int, TInfos>::iterator itm = tinfos.begin(); itm != tinfos.end(); itm++)
233  {
234  int mtid = (*itm).second.mtid;
235  // looking for mtid infos in the trajectoryContainer
236  for(unsigned int i=0; i< trajectoryContainer->size() && mtid != 0; i++)
237  {
238  G4Trajectory* trj = (G4Trajectory*)(*(evt->GetTrajectoryContainer()))[i];
239  int tid = trj->GetTrackID();
240  if(tid == mtid)
241  {
242  tinfos[(*itm).first].mpid = trj->GetPDGEncoding();
243  tinfos[(*itm).first].mv = trj->GetPoint(0)->GetPosition();
244  }
245  }
246  }
247  // removing daughter tracks if mother also gave hits
248  if(SAVE_ALL_MOTHERS>2)
249  {
250  vector<int> bgtIDs;
251  for(map<int, BGParts>::iterator it = bgMap.begin(); it != bgMap.end(); it++)
252  bgtIDs.push_back(it->first);
253 
254  for(unsigned i=0; i<bgtIDs.size(); i++)
255  {
256  int daughter = bgtIDs[i];
257  int momCheck = 0;
258  if(momDaughter.find(daughter) != momDaughter.end())
259  momCheck = momDaughter[daughter];
260 
261  while(momCheck != 0)
262  {
263  // mom has a hit
264  if(bgMap.find(momCheck) != bgMap.end())
265  {
266  // so if daughter is found, delete it
267  // daughter may already be deleted before
268  if(bgMap.find(daughter) != bgMap.end())
269  bgMap.erase(bgMap.find(daughter));
270  }
271  // going up one generation
272  if(momDaughter.find(momCheck) != momDaughter.end())
273  momCheck = momDaughter[momCheck];
274  else
275  momCheck = 0;
276  }
277  }
278  }
279  }
280 
281 
282 
283 
284 
285  // Making sure the output routine exists in the ProcessOutput map
286  // If no output selected, or HitProcess not found, end current event
287  map<string, outputFactoryInMap>::iterator ito = outputFactoryMap->find(outContainer->outType);
288  if(ito == outputFactoryMap->end())
289  {
290  if(outContainer->outType != "no")
291  cout << hd_msg << " Warning: output type <" << outContainer->outType
292  << "> is not registered in the outContainerput Factory. " << endl
293  << " This event will not be written out." << endl;
294  evtN++;
295  return;
296  }
297  outputFactory *processOutputFactory = getOutputFactory(outputFactoryMap, outContainer->outType);
298 
299 
300 
301 
302  // Header Bank contains event number
303  // Need to change this to read DB header bank
304  map<string, double> header;
305  header["runNo"] = rw.runNo;
306  header["evn"] = evtN;
307  header["evn_type"] = -1; // physics event. Negative is MonteCarlo event
308  header["beamPol"] = gen_action->getBeamPol();
309 
310  for(unsigned i=0; i<gen_action->lundUserDefined.size(); i++)
311  {
312  string tmp = "var" + stringify((int) i+1);
313  header[tmp] = gen_action->lundUserDefined[i];
314  }
315 
316  // write event header bank
317  processOutputFactory->writeHeader(outContainer, header, getBankFromMap("header", banksMap));
318 
319  // Getting Generated Particles info
320  // Are these loops necessary, revisit later1
321  vector<generatedParticle> MPrimaries;
322  for(int pv=0; pv<evt->GetNumberOfPrimaryVertex() && pv<MAXP; pv++)
323  {
324  generatedParticle Mparticle;
325  G4PrimaryVertex* MPV = evt->GetPrimaryVertex(pv);
326  Mparticle.vertex = MPV->GetPosition();
327  for(int pp = 0; pp<MPV->GetNumberOfParticle() && pv<MAXP; pp++)
328  {
329 
330  G4PrimaryParticle *PP = MPV->GetPrimary(pp);
331  Mparticle.momentum = PP->GetMomentum();
332  Mparticle.PID = PP->GetPDGcode();
333  }
334  MPrimaries.push_back(Mparticle) ;
335  }
336 
337  if(SAVE_ALL_MOTHERS>1)
338  saveBGPartsToLund();
339 
340  for(map<string, sensitiveDetector*>::iterator it = SeDe_Map.begin(); it!= SeDe_Map.end(); it++)
341  {
342  MHC = it->second->GetMHitCollection();
343  nhits = MHC->GetSize();
344 
345  // The same ProcessHit Routine must apply to all the hits in this HitCollection.
346  // Instantiating the ProcessHitRoutine only once for the first hit.
347  if(nhits)
348  {
349  // the bank idtag is the one that corresponds to the hitType
350  //MHit* aHit = (*MHC)[0];
351  string vname = (*MHC)[0]->GetDetector().name;
352  string hitType = it->second->GetDetectorHitType(vname);
353 
354  HitProcess *hitProcessRoutine = getHitProcess(hitProcessMap, hitType);
355  if(!hitProcessRoutine)
356  return;
357 
358  hitProcessRoutine->init(hitType, gemcOpt, gPars);
359 
360  bool WRITE_TRUE_INTEGRATED = 0;
361  bool WRITE_TRUE_ALL = 0;
362  if(WRITE_INTRAW.find(hitType) != string::npos) WRITE_TRUE_INTEGRATED = 1;
363  if(WRITE_ALLRAW.find(hitType) != string::npos) WRITE_TRUE_ALL = 1;
364 
365  vector<hitOutput> allRawOutput;
366 
367  // creating summary information for each generated particle
368  for(unsigned pi = 0; pi<MPrimaries.size(); pi++)
369  MPrimaries[pi].pSum.push_back(summaryForParticle("na"));
370 
371 
372  for(int h=0; h<nhits; h++)
373  {
374  MHit* aHit = (*MHC)[h];
375 
376  hitOutput thisHitOutput;
377 
378  // mother particle infos
379  if(SAVE_ALL_MOTHERS)
380  {
381  // setting track infos before processing the hit
382  vector<int> tids = aHit->GetTIds();
383  vector<int> otids = vector_otids(tids);
384  aHit->SetmTrackIds(vector_mtids(tinfos, tids));
385  aHit->SetoTrackIds(otids);
386  aHit->SetmPIDs( vector_mpids(tinfos, tids));
387  aHit->SetmVerts( vector_mvert(tinfos, tids));
388 
389  // for every particle initializing a vector
390  // the index is the primary particle index
391  // the int will increase for each step
392  // if the int > 0
393  // then we count it as ONE hit by the track
394  vector<int> hitByPrimary;
395  for(unsigned pi = 0; pi<MPrimaries.size(); pi++)
396  hitByPrimary.push_back(0);
397 
398  // all these vector have the same length.
399  for(unsigned pi = 0; pi<MPrimaries.size(); pi++)
400  {
401  vector<double> edeps = aHit->GetEdep();
402  vector<double> times = aHit->GetTime();
403  MPrimaries[pi].pSum.back().nphe = aHit->GetTIds().size();
404  for(unsigned ss =0; ss<edeps.size(); ss++)
405  {
406  if(otids[ss] == (int) pi+1)
407  {
408  MPrimaries[pi].pSum.back().etot += edeps[ss];
409  hitByPrimary[pi]++;
410  // getting fastest time - should we put threshold here?
411  if(MPrimaries[pi].pSum.back().t < 0 || MPrimaries[pi].pSum.back().t > times[ss])
412  MPrimaries[pi].pSum.back().t = times[ss];
413 
414  }
415  }
416 
417  if(hitByPrimary[pi]) MPrimaries[pi].pSum.back().stat++;
418 
419  if(MPrimaries[pi].pSum.back().etot > 0 || MPrimaries[pi].pSum.back().nphe > 0)
420  MPrimaries[pi].pSum.back().dname = hitType;
421  }
422  }
423  else
424  {
425  // filling mother infos with zeros
426  int thisHitSize = aHit->GetId().size();
427  vector<int> zint = vector_zint(thisHitSize);
428  vector<G4ThreeVector> zthre = vector_zthre(thisHitSize);
429  aHit->SetoTrackIds(zint);
430  aHit->SetmTrackIds(zint);
431  aHit->SetmPIDs( zint);
432  aHit->SetmVerts( zthre);
433  }
434 
435  thisHitOutput.setRaws(hitProcessRoutine->integrateRaw(aHit, h+1, WRITE_TRUE_INTEGRATED));
436 
437  if(WRITE_TRUE_ALL)
438  thisHitOutput.setAllRaws(hitProcessRoutine->allRaws(aHit, h+1));
439 
440 
441  allRawOutput.push_back(thisHitOutput);
442 
443  string vname = aHit->GetId()[aHit->GetId().size()-1].name;
444  if(VERB > 4 || vname.find(catch_v) != string::npos)
445  {
446  cout << hd_msg << " Hit " << h + 1 << " -- total number of steps this hit: " << aHit->GetPos().size() << endl;
447  cout << aHit->GetId();
448  double Etot = 0;
449  for(unsigned int e=0; e<aHit->GetPos().size(); e++) Etot = Etot + aHit->GetEdep()[e];
450  cout << " Total energy deposited: " << Etot/MeV << " MeV" << endl;
451  }
452  }
453 
454  // geant4 integrated raw information
455  // by default they are all DISABLED
456  // user can enable them one by one
457  // using the INTEGRATEDRAW option
458  if(WRITE_TRUE_INTEGRATED)
459  processOutputFactory->writeG4RawIntegrated(outContainer, allRawOutput, hitType, banksMap);
460 
461  // geant4 all raw information
462  // by default they are all DISABLED
463  // user can enable them one by one
464  // using the ALLRAWS option
465  if(WRITE_TRUE_ALL)
466  processOutputFactory->writeG4RawAll(outContainer, allRawOutput, hitType, banksMap);
467 
468 
469 
470  if(VERB > 4)
471  for(unsigned pi = 0; pi<MPrimaries.size(); pi++)
472  {
473  cout << " Particle " << pi + 1 << " has " << MPrimaries[pi].pSum.size() << " particle summaries:" << endl;
474  for(unsigned ss =0; ss<MPrimaries[pi].pSum.size(); ss++)
475  {
476  cout << " \t det: " << MPrimaries[pi].pSum[ss].dname <<
477  " Etot: " << MPrimaries[pi].pSum[ss].etot <<
478  " time: " << MPrimaries[pi].pSum[ss].t << endl;
479  }
480  cout << endl;
481 
482  }
483 
484  // geant4 integrated digitized information
485  // by default they are all ENABLED
486  // user can disable them one by one
487  // using the INTEGRATEDDGT option
488  if(WRITE_INTDGT.find(hitType) == string::npos)
489  {
490  hitProcessRoutine->initWithRunNumber(rw.runNo);
491 
492  vector<hitOutput> allDgtOutput;
493  for(int h=0; h<nhits; h++)
494  {
495 
496  hitOutput thisHitOutput;
497  MHit* aHit = (*MHC)[h];
498 
499  thisHitOutput.setDgtz(hitProcessRoutine->integrateDgt(aHit, h+1));
500  allDgtOutput.push_back(thisHitOutput);
501 
502  string vname = aHit->GetId()[aHit->GetId().size()-1].name;
503  if(VERB > 4 || vname.find(catch_v) != string::npos)
504  {
505  cout << hd_msg << " Hit " << h + 1 << " -- total number of steps this hit: " << aHit->GetPos().size() << endl;
506  cout << aHit->GetId();
507  double Etot = 0;
508  for(unsigned int e=0; e<aHit->GetPos().size(); e++) Etot = Etot + aHit->GetEdep()[e];
509  cout << " Total energy deposited: " << Etot/MeV << " MeV" << endl;
510  }
511  }
512  processOutputFactory->writeG4DgtIntegrated(outContainer, allDgtOutput, hitType, banksMap);
513 
514  } // end of geant4 integrated digitized information
515 
516 
517  // geant4 voltage versus time
518  // by default they are all DISABLED
519  // user can enable them one by one
520  // using the SIGNALVT option
521  if(SIGNALVT.find(hitType) != string::npos)
522  {
523  vector<hitOutput> allVTOutput;
524 
525  for(int h=0; h<nhits; h++)
526  {
527  hitOutput thisHitOutput;
528 
529  MHit* aHit = (*MHC)[h];
530 
531  thisHitOutput.setSignal(hitProcessRoutine->signalVT(aHit));
532  thisHitOutput.setQuantumS(hitProcessRoutine->quantumS(thisHitOutput.getSignalVT(), aHit));
533 
534  allVTOutput.push_back(thisHitOutput);
535 
536  // this is not written out yet
537 
538  string vname = aHit->GetId()[aHit->GetId().size()-1].name;
539  if(VERB > 4 || vname.find(catch_v) != string::npos)
540  {
541  cout << hd_msg << " Hit " << h + 1 << " -- total number of steps this hit: " << aHit->GetPos().size() << endl;
542  cout << aHit->GetId();
543  double Etot = 0;
544  for(unsigned int e=0; e<aHit->GetPos().size(); e++) Etot = Etot + aHit->GetEdep()[e];
545  cout << " Total energy deposited: " << Etot/MeV << " MeV" << endl;
546  }
547  }
548  }
549 
550  delete hitProcessRoutine;
551  }
552  }
553  // writing out generated particle infos
554  processOutputFactory->writeGenerated(outContainer, MPrimaries, banksMap);
555 
556  processOutputFactory->writeEvent(outContainer);
557  delete processOutputFactory;
558 
559 
560  if(evtN%Modulo == 0 )
561  cout << hd_msg << " End of Event " << evtN << " Routine..." << endl << endl;
562 
563  // Increase event number. Notice: this is different than evt->GetEventID()
564  evtN++;
565 
566  return;
567 }
568 
569 
570 
571 
572 
574 {
575  // for lund format see documentation at gemc.jlab.org:
576  // https://gemc.jlab.org/gemc/html/documentation/generator/lund.html
577 
578  // this should work also for no hits, map size will be zero.
579 
580  *lundOutput << (int) bgMap.size() << "\t" << evtN << "\t 0 0 0 0 0 0 0 0 " << endl;
581 
582  int i = 1;
583  for(map<int, BGParts>::iterator it = bgMap.begin(); it != bgMap.end(); it++)
584  *lundOutput << i++ << "\t0\t1\t" << it->second.pid << "\t0\t" << it->first << "\t"
585  << it->second.p.x()/GeV << "\t" << it->second.p.y()/GeV << "\t" << it->second.p.z()/GeV << "\t" << it->second.time << "\t0\t"
586  << it->second.v.x()/cm << "\t" << it->second.v.y()/cm << "\t" << it->second.v.z()/cm << endl;
587 }
588 
589 
590 
591 
592 
593 
594 
595 
596 
597 
598 
599 
600 
601 
602 
virtual map< double, double > signalVT(MHit *)
Definition: HitProcess.cc:171
void setSignal(map< double, double > s)
Definition: outputFactory.h:67
virtual void initWithRunNumber(int runno)
Definition: HitProcess.h:88
void init(string name, goptions go, map< string, double > gp)
Definition: HitProcess.h:68
void SetmPIDs(vector< int > mpid)
Definition: Hit.h:130
virtual map< int, int > quantumS(map< double, double >, MHit *)
Definition: HitProcess.cc:244
MEventAction(goptions, map< string, double >)
Constructor copies gemc options.
Definition: MEventAction.cc:79
void setQuantumS(map< int, int > s)
Definition: outputFactory.h:68
virtual map< string, double > integrateDgt(MHit *, int)=0
STL namespace.
void SetmTrackIds(vector< int > tid)
Definition: Hit.h:120
vector< identifier > GetId()
Definition: Hit.h:103
virtual void writeHeader(outputContainer *, map< string, double >, gBank)=0
vector< G4ThreeVector > vector_zthre(int size)
provides a vector of (0,0,0)
Definition: MEventAction.cc:43
string replaceCharWithChars(string input, string x, string y)
vector< int > vector_mpids(map< int, TInfos > tinfos, vector< int > tids)
Definition: MEventAction.cc:61
void saveBGPartsToLund()
void EndOfEventAction(const G4Event *)
Routine at the end of each event.
void setRaws(map< string, double > r)
Definition: outputFactory.h:64
map< string, vector< double > > allRaws(MHit *, int)
Definition: HitProcess.cc:75
void BeginOfEventAction(const G4Event *)
Routine at the start of each event.
gBank getBankFromMap(string name, map< string, gBank > *banksMap)
Definition: gbank.cc:424
vector< G4ThreeVector > vector_mvert(map< int, TInfos > tinfos, vector< int > tids)
Definition: MEventAction.cc:70
string stringify(double x)
vector< G4ThreeVector > GetPos()
Definition: Hit.h:72
map< string, aopt > optMap
Options map.
Definition: options.h:75
G4THitsCollection< MHit > MHitCollection
Definition: Hit.h:194
vector< int > vector_otids(vector< int > tids)
return original track id of a vector of tid
Definition: MEventAction.cc:19
void SetoTrackIds(vector< int > tid)
Definition: Hit.h:125
Definition: Hit.h:22
void setDgtz(map< string, double > d)
Definition: outputFactory.h:65
vector< double > GetTime()
Definition: Hit.h:89
vector< int > vector_mtids(map< int, TInfos > tinfos, vector< int > tids)
Definition: MEventAction.cc:52
virtual void writeG4RawIntegrated(outputContainer *, vector< hitOutput >, string, map< string, gBank > *)=0
virtual void writeEvent(outputContainer *)=0
vector< int > GetTIds()
Definition: Hit.h:101
map< double, double > getSignalVT()
Definition: outputFactory.h:82
outputFactory * getOutputFactory(map< string, outputFactoryInMap > *outputFactoryMap, string outputType)
void setAllRaws(map< string, vector< double > > r)
Definition: outputFactory.h:66
virtual void writeG4RawAll(outputContainer *, vector< hitOutput >, string, map< string, gBank > *)=0
G4ThreeVector vertex
virtual void writeG4DgtIntegrated(outputContainer *, vector< hitOutput >, string, map< string, gBank > *)=0
vector< double > GetEdep()
Definition: Hit.h:83
void SetmVerts(vector< G4ThreeVector > ver)
Definition: Hit.h:135
HitProcess * getHitProcess(map< string, HitProcess_Factory > *hitProcessMap, string HCname)
Definition: HitProcess.cc:8
~MEventAction()
Destructor.
G4ThreeVector momentum
vector< int > vector_zint(int size)
provides a vector of 0
Definition: MEventAction.cc:34
map< string, double > integrateRaw(MHit *, int, bool)
Definition: HitProcess.cc:35
virtual void writeGenerated(outputContainer *, vector< generatedParticle >, map< string, gBank > *banksMap)=0