GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
Data Structures | Public Member Functions | Friends
GGSHitsAction Class Reference

An action which saves hits in sensitive volumes on ROOT file. More...

#include <GGSHitsAction.h>

Inheritance diagram for GGSHitsAction:
Inheritance graph
[legend]
Collaboration diagram for GGSHitsAction:
Collaboration graph
[legend]

Public Member Functions

 GGSHitsAction ()
 Constructor.
 
 ~GGSHitsAction ()
 Destructor.
 
void BeginOfRunAction (const G4Run *run)
 Actions executed at beginning of run. More...
 
void EndOfRunAction (const G4Run *run)
 Actions executed at end of run. More...
 
void BeginOfEventAction (const G4Event *event)
 Actions executed at beginning of event. More...
 
void EndOfEventAction (const G4Event *event)
 Actions executed at end of event. More...
 
void SetOutputFileBase (const std::string &outFileBase)
 Sets the output file base name. More...
 
void SetOutputTreeName (const std::string &outTreeName)
 Sets the output tree name. More...
 
void SetOutputIntHitClass (std::string detectorName, const std::string &className)
 Sets the name of the integrated hit class to be used for output of a given detector. More...
 
void SetOutputPartHitClass (std::string detectorName, const std::string &className)
 Sets the name of the particle hit class to be used for output. More...
 
void SetOutputPosHitClass (std::string detectorName, const std::string &className)
 Sets the name of the position hit class to be used for output. More...
 
void SetHitThreshold (const std::string &detectorName, const std::string &hitType, const std::string &valueStr, const std::string &unit)
 Sets a lower energy deposit threshold for hits. More...
 
- Public Member Functions inherited from GGSUserAction
 GGSUserAction ()
 Constructor. More...
 
virtual ~GGSUserAction ()
 Destructor.
 
G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *)
 Override of the ClassifyNewTrack method. More...
 

Friends

class GGSHitsActionPrivateMessenger
 

Detailed Description

An action which saves hits in sensitive volumes on ROOT file.

This action reads the hits in sensitive volumes, as defined by GGS sensitive logical volumes naming convention. It then converts the hits in ROOT format and saves them on a ROOT file. For each sensitive logical volume, a branch will be created whose name is equal to that of logical volume. This branch is made by a TClonesArray containing all the hits in physical sensitive volumes associated to the logical. This action can handle different kind of output hit classes derived from standard GGS ones (GGSTIntHitBase, GGSTPartHitBase and GGSTPosHitBase).The actual classes to be used is specified by calling the related setter methods (e.g. SetOutputIntHitClass); the hit classes must have a Root dictionary. If no class is specified then the standard GGS hit classes (GGSTIntHit, GGSTPartHit, GGSTPosHit) will be used.

See Also
GGSIntHit
GGSPartHit
GGSPosHit

Definition at line 64 of file GGSHitsAction.h.

Member Function Documentation

void GGSHitsAction::BeginOfEventAction ( const G4Event *  event)

Actions executed at beginning of event.

Method executed at the beginning of each event. Hits buffers are cleared.

Parameters
eventPointer to a G4Event

Definition at line 250 of file GGSHitsAction.cpp.

250  {
251 
252  // Give back arrays to the TCLonesArray services.
253  _GiveBackAllArrays();
254 
255  for (auto &handleElem : _outputHandles) {
256  OutputHandle &handle = handleElem.second;
257  if (handle.partHitArray) {
258 
259  // Clear the TObjarray persistence structures. These contains TClonesArrays which
260  // must not be deleted since they are owned and managed by the GGSTClonesArrayService...
261 
262  // ... so set the TObjArray to not own them...
263  handle.partHitArray->SetOwner(false);
264  // ... then clean to make size=0 without deleting the contained objects...
265  handle.partHitArray->Clear();
266  // ... and then restore ownership to avoid memory leak on readout of ROOT file.
267  // (see http://root.cern.ch/root/roottalk/roottalk02/0444.html)
268  handle.partHitArray->SetOwner(true);
269  }
270 
271  if (handle.posHitArray) {
272  handle.posHitArray->SetOwner(false);
273  handle.posHitArray->Clear();
274  handle.posHitArray->SetOwner(true);
275  }
276  }
277 }
void GGSHitsAction::BeginOfRunAction ( const G4Run *  run)

Actions executed at beginning of run.

Method executed at the beginning of each run. A new ROOT file is created for each run.

Parameters
runPointer to the G4Run

Definition at line 73 of file GGSHitsAction.cpp.

73  {
74  static const std::string routineName("GSHitsAction::BeginOfRunAction");
75 
76  // -----------------
77  // Open the run file
78  // -----------------
79  _outFile = GGSRootFileService::GetInstance().GetFileForThisRun(_outFileBase, run);
80  if (!_outFile || (_outFile && _outFile->IsZombie())) {
81  COUT(ERROR) << "Cannot open ROOT file " << _outFileBase << "for run" << run->GetRunID() << ENDL;
82  throw -1;
83  }
84 
85  // -----------------
86  // Create a new tree
87  // -----------------
88  if (_outTreeName == "") {
89  _outTree = GGSRootFileService::GetInstance().GetDefaultTree(_outFile);
90  _outTree->SetTitle(TString(_outTree->GetTitle()) + "Hits ");
91  } else
92  _outTree = new TTree(_outTreeName, "GGS hits");
93 
94  // Loop over logical volumes...
95  G4LogicalVolumeStore *logicalVS = G4LogicalVolumeStore::GetInstance();
96  if (!logicalVS)
97  return;
98 
99  std::vector<G4VSensitiveDetector *> processedSDs;
100  for (unsigned int i = 0; i < logicalVS->size(); i++) {
101  G4LogicalVolume *logicalV = logicalVS->at(i);
102 
103  // ...and select sensitive volumes with GGS hits SD
104  std::vector<G4VSensitiveDetector *> sDets(0);
105  G4VSensitiveDetector *sd = logicalV->GetSensitiveDetector();
106  if (sd) {
107  GGSMultiSensitiveDetector *msd = dynamic_cast<GGSMultiSensitiveDetector *>(sd);
108  if (msd) {
109  sDets = msd->GetListOfSensitiveDetectors();
110  } else {
111  sDets.push_back(sd);
112  }
113  }
114 
115  for (auto &sdPtr : sDets) {
116  if (std::find(processedSDs.begin(), processedSDs.end(), sdPtr) != processedSDs.end()) {
117  continue;
118  }
119  auto sdName = sdPtr->GetName();
120  auto ggssdNamePos = sdName.find(".GGSIntHitSD", 0);
121  if (ggssdNamePos != std::string::npos) {
122  GGSIntHitSD *intHitSD = dynamic_cast<GGSIntHitSD *>(sdPtr);
123  if (intHitSD && intHitSD->isActive()) {
124  std::string sdNameReduced = sdName;
125  sdNameReduced.erase(ggssdNamePos, 12); // Remove ".GGSIntHitSD"
126 
127  std::unordered_map<std::string, OutputHandle>::iterator handleIter = _outputHandles.find(sdName);
128  if (handleIter == _outputHandles.end()) {
129  // The handle for this detector does not exist yet, so create a standard one
130 
131  auto insertResult = _outputHandles.insert(std::pair<std::string, OutputHandle>{sdName, OutputHandle()});
132  if (insertResult.second) {
133  handleIter = insertResult.first;
134  }
135  }
136 
137  // Create arrays et al.
138  auto &newHandle = handleIter->second;
139  newHandle.intHitArray = std::unique_ptr<TClonesArray>(new TClonesArray(
140  newHandle.intHitClassName.c_str())); // Create it here and Clear("C") it at beginning of event
141  // Create a branch to store hits in the output file
142  _outTree->Branch((sdNameReduced + "-GGSIntHits").data(), "TClonesArray", newHandle.intHitArray.get(), 64000);
143 
144  // Set output threshold
145  {
146  auto thresholdIter = std::find_if(
147  _thresholds.begin(), _thresholds.end(), [&sdNameReduced](const ThresholdStruct &threshold) {
148  return (threshold.hitType == 0) && (sdNameReduced == threshold.detectorName);
149  });
150  if (thresholdIter != _thresholds.end()) {
151  newHandle.intHitThreshold = thresholdIter->value;
152  }
153  }
154  if (intHitSD->GetPartHitsStorage()) {
155  newHandle.partHitArray = std::unique_ptr<TObjArray>(new TObjArray());
156  // Set ownership to avoid memory leaks when reading back the TObjArray.
157  // http://root.cern.ch/root/roottalk/roottalk02/0444.html
158  newHandle.partHitArray->SetOwner(true);
159  _outTree->Branch((sdNameReduced + "-GGSPartHits").data(), "TObjArray", newHandle.partHitArray.get(), 64000);
160  newHandle.partHitCAService =
161  std::unique_ptr<GGSTClonesArrayService>(new GGSTClonesArrayService(newHandle.partHitClassName.c_str()));
162  // Set output threshold
163  auto thresholdIter = std::find_if(
164  _thresholds.begin(), _thresholds.end(), [&sdNameReduced](const ThresholdStruct &threshold) {
165  return (threshold.hitType == 1) && (sdNameReduced == threshold.detectorName);
166  });
167  if (thresholdIter != _thresholds.end()) {
168  newHandle.partHitThreshold = thresholdIter->value;
169  }
170  }
171  if (intHitSD->GetPosHitsStorage()) {
172  newHandle.posHitArray = std::unique_ptr<TObjArray>(new TObjArray());
173  newHandle.posHitArray->SetOwner(true);
174  _outTree->Branch((sdNameReduced + "-GGSPosHits").data(), "TObjArray", newHandle.posHitArray.get(), 64000);
175  newHandle.posHitCAService =
176  std::unique_ptr<GGSTClonesArrayService>(new GGSTClonesArrayService(newHandle.posHitClassName.c_str()));
177  // Set output threshold
178  auto thresholdIter = std::find_if(
179  _thresholds.begin(), _thresholds.end(), [&sdNameReduced](const ThresholdStruct &threshold) {
180  return (threshold.hitType == 2) && (sdNameReduced == threshold.detectorName);
181  });
182  if (thresholdIter != _thresholds.end()) {
183  newHandle.posHitThreshold = thresholdIter->value;
184  }
185  }
186 
187  // Save the time bins as run products
188  unsigned int nBins = intHitSD->GetTimeBins().size();
189  TArrayF timeBins(nBins);
190  for (unsigned int iBin = 0; iBin < nBins; iBin++)
191  timeBins[iBin] = intHitSD->GetTimeBins()[iBin];
192  _outFile->WriteObject(&timeBins, (sdNameReduced + "-GGSIntHits-TimeBins").data());
193 
194  // Save the hit thresholds
195  std::vector<float> detThresholds{(float)(newHandle.intHitThreshold / GeV),
196  (float)(newHandle.partHitThreshold / GeV),
197  (float)(newHandle.posHitThreshold / GeV)};
198  _outFile->WriteObject(&detThresholds, (sdNameReduced + "-GGSIntHits-Thresholds").data());
199 
200  } // Check on active volume
201 
202  } // Check on sensitive volume name
203  processedSDs.push_back(sdPtr);
204  } // End loop on sensitive detectors
205 
206  } // End loop on logical volumes
207 }
TFile * GetFileForThisRun(const path &baseName, const G4Run *run)
Opens a file for a given run and returns a pointer to it.
Sensitive detector class for integrated hits.
Definition: GGSIntHitSD.h:29
A service which manages a pool of reusable TClonesArray.
const std::vector< G4VSensitiveDetector * > & GetListOfSensitiveDetectors()
Retrieves a list of sensitive detectors collected into this object.
#define ENDL
Definition: GGSSmartLog.h:105
#define COUT(level)
Smart log macro. It writes on stdout only if the specified verbosity level is lesser than the maximum...
Definition: GGSSmartLog.h:76
bool GetPosHitsStorage()
Return current status of particle hits storage (i.e. persistence).
Definition: GGSIntHitSD.h:142
A multiple sensitive detector.
const std::vector< G4double > & GetTimeBins()
Time bins getter.
Definition: GGSIntHitSD.h:83
bool GetPartHitsStorage()
Return current status of particle hits storage (i.e. persistence).
Definition: GGSIntHitSD.h:117
TTree * GetDefaultTree(TFile *file)
Gets the default tree for this file.
static GGSRootFileService & GetInstance()
Get reference to GGSRootFileService unique instance.
void GGSHitsAction::EndOfEventAction ( const G4Event *  event)

Actions executed at end of event.

Method executed at the end of each event. Hits are read, converted to ROOT format and filled into output tree.

Parameters
eventPointer to a G4Event

Definition at line 281 of file GGSHitsAction.cpp.

281  {
282 
283  //-------------------------------
284  // Set hits info
285  //-------------------------------
286 
287  // Retrieve SD manager
288  G4SDManager *SDman = G4SDManager::GetSDMpointer();
289 
290  // Retrieve event hits
291  G4HCofThisEvent *evHitColl = event->GetHCofThisEvent();
292 
293  // Loop on detectors
294  for (auto &handleElem : _outputHandles) {
295 
296  const std::string &detectorName = handleElem.first;
297  OutputHandle &handle = handleElem.second;
298  // Get hits of current detector
299  G4int hitsCollID = SDman->GetCollectionID(detectorName);
300 
301  // Convert hits to persistent data format
302  handle.intHitArray->Clear(); // Set entries to 0 but do not clear elements (will be cleared in _Convert)
303  _Convert(*((GGSIntHitsCollection *)(evHitColl->GetHC(hitsCollID))), *(handle.intHitArray), handle, detectorName);
304 
305  // Link particle and position hit collections to persistence array
306  for (int iIntHit = 0; iIntHit < handle.intHitArray->GetEntries(); ++iIntHit) {
307  GGSTIntHitBase *tIntHit = (GGSTIntHitBase *)(handle.intHitArray->At(iIntHit));
308  if (tIntHit->_partHits) {
309  handle.partHitArray->AddAtAndExpand(tIntHit->_partHits, handle.partHitArray->GetEntries());
310  if (tIntHit->_partHits->GetEntries() > 0 && ((GGSTPartHitBase *)(tIntHit->_partHits->At(0)))->_posHits) {
311  static TClonesArray *partHits = NULL;
312  static Int_t nPartHits = 0;
313  partHits = tIntHit->_partHits;
314  nPartHits = partHits->GetEntries();
315  for (Int_t iPartHit = 0; iPartHit < nPartHits; iPartHit++) {
316  GGSTPartHitBase *partHit = (GGSTPartHitBase *)(tIntHit->_partHits->At(iPartHit));
317  partHit->_posHitIndex = handle.posHitArray->GetEntries(); // Save reference to pos hit array
318  handle.posHitArray->AddAtAndExpand(partHit->_posHits, handle.posHitArray->GetEntries());
319  }
320  }
321  }
322  }
323  }
324 
325  //-----------
326  // Fill tree
327  //-----------
328  if (_outTreeName != "") {
329  // Call fill only if not using the default tree
330  _outFile->cd();
331  _outTree->Fill();
332  }
333 }
Base class for storing G4 particle hits.
Definition: GGSTHits.h:106
G4THitsCollection< GGSIntHit > GGSIntHitsCollection
Alias for G4 template hits collection for GGSIntHit.
Definition: GGSIntHit.h:256
Base class for storing G4 integrated hits.
Definition: GGSTHits.h:218
void GGSHitsAction::EndOfRunAction ( const G4Run *  run)

Actions executed at end of run.

Method executed at the end of each run. The ROOT tree is written to file and the file is closed.

Parameters
runPointer to a G4Run

Definition at line 211 of file GGSHitsAction.cpp.

211  {
212 
213  // -----------------
214  // close output file
215  // -----------------
216 
217  if (_outFile) {
218  _outFile->cd();
219  if (_outTreeName != "") {
220  // Write the tree if we are not using the default one
221  _outTree->Write();
222  }
223 
225  _outFileBase); // Will automatically save detector informations
226  _outFile = NULL;
227  _outTree = NULL; // The tree is delete by the file's destructor.
228  } else {
229  throw -1; // TODO handle errors
230  }
231 
232  // -----------------
233  // delete detectors
234  // -----------------
235 
236  // Prepare for an eventual next run
237  _GiveBackAllArrays();
238  for (auto &handleElem : _outputHandles) {
239  if (handleElem.second.posHitCAService) {
240  handleElem.second.posHitCAService->DeleteAll();
241  }
242  if (handleElem.second.partHitCAService) {
243  handleElem.second.partHitCAService->DeleteAll();
244  }
245  }
246 }
void CloseFileForThisRun(const path &baseName)
Closes the ROOT output file.
static GGSRootFileService & GetInstance()
Get reference to GGSRootFileService unique instance.
void GGSHitsAction::SetHitThreshold ( const std::string &  detectorName,
const std::string &  hitType,
const std::string &  valueStr,
const std::string &  unit 
)

Sets a lower energy deposit threshold for hits.

Hits with a total energy deposit lower than the corresponding threshold will not be saved in the output file. If a finer-grained hit is above its threshold then the parent hit will be saved regardless of its value. For example, if particle hits have threshold 1 and position hits 0.1, then a particle hit with a total release of 0.2 containing a single position hit with release 0.2 will be saved (since position hits are contained inside particle hits, so the particle hit is necessary to store the above-threshold position hit). The energy deposit of parent hits will be the total one computed by the MC simulation, irrespective of the total energy deposit of above-threshold children hits. Extending the example above, if the particle hit have a release of 1.05 due to five position hits with release 0.2 and one position hit with release 0.05 then only the five position hits with release 0.2 will be saved; but the energy deposit of the particle hit will still be 1.05 although the sum of stored position hits is 1. The above consideration apply also to integrated-particle hits hierarchy. In case custom hits are used, which eventually customize the meaning of energy deposit, then the thresholds will be relative to the customized deposits.

Parameters
detectorNameThe name of the detector.
hitTypeThe type of the hit (integrated, particle or position).
valueStrThe threshold value.
unitThe unit of the threshold value.

Definition at line 512 of file GGSHitsAction.cpp.

513  {
514 
515  const std::string routineName("GGSHitsAction::SetHitThreshold");
516 
517  int hitTypeNo = -1;
518  if (hitType == "integrated") {
519  hitTypeNo = 0;
520  } else if (hitType == "particle") {
521  hitTypeNo = 1;
522  } else if (hitType == "position") {
523  hitTypeNo = 2;
524  } else {
525  throw std::runtime_error(routineName + ": Unknown hit type " + hitType + " for detector " + detectorName);
526  }
527 
528  float value = 0.;
529  try {
530  value = std::stof(valueStr);
531  } catch (std::invalid_argument &exc) {
532  COUT(ERROR) << "Invalid threshold for " << hitType << " hits of detector " << detectorName << ENDL;
533  throw exc;
534  } catch (std::out_of_range &exc) {
535  COUT(ERROR) << "Invalid value for threshold of " << hitType << " hits of detector " << detectorName << ENDL;
536  throw exc;
537  }
538 
539  auto &unitsTable = G4UnitDefinition::GetUnitsTable();
540  auto unitCatIter = std::find_if(unitsTable.begin(), unitsTable.end(),
541  [&unit](const G4UnitsCategory *unitCat) { return (unitCat->GetName() == "Energy"); });
542  if (unitCatIter == unitsTable.end()) {
543  throw std::runtime_error(routineName + ": energy unit category not found");
544  }
545 
546  auto &unitsList = (*unitCatIter)->GetUnitsList();
547  auto unitIter = std::find_if(unitsList.begin(), unitsList.end(), [&unit](const G4UnitDefinition *unitDef) {
548  return unit == unitDef->GetSymbol().c_str();
549  });
550  if (unitIter == unitsList.end()) {
551  throw std::runtime_error(routineName + ": unit " + unit + " not found");
552  }
553 
554  auto thresholdIter = std::find_if(
555  _thresholds.begin(), _thresholds.end(), [&detectorName, hitTypeNo](const ThresholdStruct &threshold) {
556  return (threshold.hitType == hitTypeNo) && (threshold.detectorName == detectorName);
557  });
558  if (thresholdIter == _thresholds.end()) {
559  _thresholds.push_back(ThresholdStruct{detectorName, hitTypeNo, -1.});
560  thresholdIter = _thresholds.end() - 1;
561  }
562 
563  auto *sd =
564  dynamic_cast<GGSIntHitSD *>(G4SDManager::GetSDMpointer()->FindSensitiveDetector(detectorName + ".GGSIntHitSD"));
565  if (!sd) {
566  throw std::invalid_argument(routineName + ": detector " + detectorName + " not found");
567  }
568 
569  switch (hitTypeNo) {
570  case 0:
571  thresholdIter->value = value * (*unitIter)->GetValue();
572  sd->SetIntHitThreshold(thresholdIter->value);
573  break;
574  case 1:
575  thresholdIter->value = value * (*unitIter)->GetValue();
576  sd->SetPartHitThreshold(thresholdIter->value);
577  break;
578  case 2:
579  thresholdIter->value = value * (*unitIter)->GetValue();
580  sd->SetPosHitThreshold(thresholdIter->value);
581  break;
582  }
583 }
Sensitive detector class for integrated hits.
Definition: GGSIntHitSD.h:29
#define ENDL
Definition: GGSSmartLog.h:105
#define COUT(level)
Smart log macro. It writes on stdout only if the specified verbosity level is lesser than the maximum...
Definition: GGSSmartLog.h:76
void GGSHitsAction::SetOutputFileBase ( const std::string &  outFileBase)
inline

Sets the output file base name.

The file base name can be with or without extension (.root will be automatically used as extension). For each run, the run number will be appended to the base name before the .root extension. If no value is provided the file base name will fallback to the default value set in GSRootFileservice.

Parameters
outFileBaseThe output file base name.
See Also
GGSRootFileservice

Definition at line 117 of file GGSHitsAction.h.

117 { _outFileBase = outFileBase; }
void GGSHitsAction::SetOutputIntHitClass ( std::string  detectorName,
const std::string &  className 
)

Sets the name of the integrated hit class to be used for output of a given detector.

Parameters
detectorNamename of the detector
classNamename of the output class for integrated hits

Definition at line 446 of file GGSHitsAction.cpp.

446  {
447  const std::string routineName("[GGSHitsAction::SetOutputIntHitClass] ");
448 
449  // Check if the given class has a dictionary
450  TClass *intHitClass = TClass::GetClass(className.c_str());
451  if (!intHitClass) {
452  throw std::runtime_error(routineName + "Dictionary for class " + className + " not found");
453  }
454 
455  // Check if the given detector already has a specified output class
456  detectorName.insert(detectorName.find_first_of('.'), ".GGSIntHitSD");
457  auto handleIter = _outputHandles.find(detectorName);
458  if (handleIter == _outputHandles.end()) {
459  handleIter = _outputHandles.insert(std::pair<std::string, OutputHandle>{detectorName, OutputHandle()}).first;
460  }
461 
462  // Set output facilities
463  handleIter->second.intHitClassName = className;
464 }
void GGSHitsAction::SetOutputPartHitClass ( std::string  detectorName,
const std::string &  className 
)

Sets the name of the particle hit class to be used for output.

Parameters
detectorNamename of the detector
classNamename of the output class for particle hits

Definition at line 468 of file GGSHitsAction.cpp.

468  {
469  const std::string routineName("[GGSHitsAction::SetOutputPartHitClass] ");
470 
471  // Check if the given class has a dictionary
472  TClass *partHitClass = TClass::GetClass(className.c_str());
473  if (!partHitClass) {
474  throw std::runtime_error(routineName + "Dictionary for class " + className + " not found");
475  }
476 
477  // Check if the given detector already has a specified output class
478  detectorName.insert(detectorName.find_first_of('.'), ".GGSIntHitSD");
479  auto handleIter = _outputHandles.find(detectorName);
480  if (handleIter == _outputHandles.end()) {
481  handleIter = _outputHandles.insert(std::pair<std::string, OutputHandle>{detectorName, OutputHandle()}).first;
482  }
483 
484  // Set output facilities
485  handleIter->second.partHitClassName = className;
486 }
void GGSHitsAction::SetOutputPosHitClass ( std::string  detectorName,
const std::string &  className 
)

Sets the name of the position hit class to be used for output.

Parameters
detectorNamename of the detector
classNamename of the output class for position hits

Definition at line 490 of file GGSHitsAction.cpp.

490  {
491  const std::string routineName("[GGSHitsAction::SetOutputPosHitClass] ");
492 
493  // Check if the given class has a dictionary
494  TClass *posHitClass = TClass::GetClass(className.c_str());
495  if (!posHitClass) {
496  throw std::runtime_error(routineName + "Dictionary for class " + className + " not found");
497  }
498 
499  // Check if the given detector already has a specified output class
500  detectorName.insert(detectorName.find_first_of('.'), ".GGSIntHitSD");
501  auto handleIter = _outputHandles.find(detectorName);
502  if (handleIter == _outputHandles.end()) {
503  handleIter = _outputHandles.insert(std::pair<std::string, OutputHandle>{detectorName, OutputHandle()}).first;
504  }
505 
506  // Set output facilities
507  handleIter->second.posHitClassName = className;
508 }
void GGSHitsAction::SetOutputTreeName ( const std::string &  outTreeName)
inline

Sets the output tree name.

This name will be used for the TTree object where th hits for each event will be stored. By default, this value is set to "Hits" in constructor.

Parameters
outTreeNameThe output tree name.

Definition at line 126 of file GGSHitsAction.h.

126 { _outTreeName = outTreeName; }

The documentation for this class was generated from the following files: