GGS(GenericGEANT4Simulation)Software  2.99.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations 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 254 of file GGSHitsAction.cpp.

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

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

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

215  {
216 
217  // -----------------
218  // close output file
219  // -----------------
220 
221  if (_outFile) {
222  _outFile->cd();
223  if (_outTreeName != "") {
224  // Write the tree if we are not using the default one
225  _outTree->Write();
226  }
227 
229  run); // Will automatically save detector informations
230  _outFile = nullptr;
231  _outTree = nullptr; // The tree is delete by the file's destructor.
232  } else {
233  throw -1; // TODO handle errors
234  }
235 
236  // -----------------
237  // delete detectors
238  // -----------------
239 
240  // Prepare for an eventual next run
241  _GiveBackAllArrays();
242  for (auto &handleElem : _outputHandles) {
243  if (handleElem.second.posHitCAService) {
244  handleElem.second.posHitCAService->DeleteAll();
245  }
246  if (handleElem.second.partHitCAService) {
247  handleElem.second.partHitCAService->DeleteAll();
248  }
249  }
250 }
void CloseFileForThisRun(const std::filesystem::path &baseName, const G4Run *run)
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 516 of file GGSHitsAction.cpp.

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

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

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

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