GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSTHitsReader.cpp
Go to the documentation of this file.
1 /*
2  * GGSTHitsReader.cpp
3  *
4  * Created on: Nov 8, 2010
5  * Author: Elena Vannuccini
6  * Reworked on: 17 Aug 2011
7  * Author: Nicola Mori
8  * Content: MC truth stripped out. File opening removed.
9  */
10 
15 
16 #include "TFile.h"
17 #include "TFriendElement.h"
18 #include "utils/GGSSmartLog.h"
19 
20 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
21 
22 GGSTHitsReader::GGSTHitsReader() : _chain(nullptr), _firstEntryOfCurrentFile(-1), _detInfo(nullptr) {
23  _detectors.reserve(50);
24  // The elements of these vectors will be used as output buffers for branches,
25  // so their location in memory must not change. The instructions below
26  // guarantee correct behavior for a number of detectors up to 50.
27  _intHitArrays.reserve(50);
28  _partHitArrays.reserve(50);
29  _posHitArrays.reserve(50);
30 }
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
33 
35  for (unsigned int i = 0; i < _intHitArrays.size(); i++)
36  delete _intHitArrays[i];
37  for (unsigned int i = 0; i < _partHitArrays.size(); i++)
38  delete _partHitArrays[i];
39  for (unsigned int i = 0; i < _posHitArrays.size(); i++)
40  delete _posHitArrays[i];
41  delete _detInfo;
42 }
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
45 
46 bool GGSTHitsReader::SetChain(TChain *hitsChain) {
47  _chain = hitsChain;
48  _detInfo = (TClonesArray *)(_chain->GetFile()->Get("GGSHitDetInfo"));
49 
50  // Search for hit branches in master chain
51  for (int iBranch = 0; iBranch < _chain->GetListOfBranches()->GetEntries(); iBranch++) {
52  if (TString(((TBranch *)(_chain->GetListOfBranches()->At(iBranch)))->GetName()).Contains("GGSIntHits")) {
53  return true;
54  }
55  }
56 
57  // Search for hit branches in friend chains
58  if (_chain->GetListOfFriends()) {
59  for (int iFriend = 0; iFriend < _chain->GetListOfFriends()->GetEntries(); iFriend++) {
60  TTree *currFriend = ((TFriendElement *)(_chain->GetListOfFriends()->At(iFriend)))->GetTree();
61  for (int iBranch = 0; iBranch < currFriend->GetListOfBranches()->GetEntries(); iBranch++) {
62  if (TString(((TBranch *)(currFriend->GetListOfBranches()->At(iBranch)))->GetName()).Contains("GGSIntHits")) {
63  return true;
64  }
65  }
66  }
67  }
68 
69  _chain = nullptr;
70  _detInfo = nullptr;
71  _firstEntryOfCurrentFile = -1;
72 
73  return false;
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
77 
78 void GGSTHitsReader::GetEntry(Long64_t entry) {
79  static const std::string routineName("GGSTHitsReader::GetEntry");
80 
81  if (entry != _chain->GetReadEntry()) {
82  _chain->GetEntry(entry);
83  }
84 
85  if (_chain->GetChainEntryNumber(0) != _firstEntryOfCurrentFile) {
86  COUT(DEBUG) << "Switching to file " << _chain->GetFile()->GetName() << ENDL;
87  _firstEntryOfCurrentFile = _chain->GetChainEntryNumber(0);
88 
89  // Read the GGSHitDetInfo TClonesArray from the new file
90  _detInfo = (TClonesArray *)(_chain->GetFile()->Get("GGSHitDetInfo"));
91 
92  // Update the detector indexes in _detectors
93  for (unsigned int iDet = 0; iDet < _detectors.size(); iDet++)
94  _detectors[iDet].detInfoArrayIndex = _GetDetectorIndexFromStorage(_detectors[iDet].logVolName.data());
95 
96  // Reload time bins and thresholds
97  _timeBins.clear();
98  _thresholds.clear();
99  for (unsigned int iDet = 0; iDet < _detectors.size(); iDet++) {
100  delete _timeBins[iDet];
101  _timeBins.push_back((TArrayF *)(_chain->GetFile()->Get(TString(_detectors[iDet].name) + "-GGSIntHits-TimeBins")));
102  delete _thresholds[iDet];
103  _thresholds.push_back(
104  (std::vector<float> *)(_chain->GetFile()->Get(TString(_detectors[iDet].name) + "-GGSIntHits-Thresholds")));
105  }
106  }
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
110 
111 void GGSTHitsReader::SetDetector(const char *detector, bool readPartHits, bool readPosHits) {
112  static const std::string routineName("GGSTHitsReader::SetDetector");
113 
114  if (!_chain)
115  return;
116 
117  if (readPosHits) {
118  readPartHits = true;
119  }
120 
121  TString detBranchName = detector;
122  detBranchName.Append("-GGSIntHits");
123  TBranch *branches[3] = {nullptr, nullptr, nullptr}; // New branches (for integrated, particle and position hits)
124  if (_CheckBranch(detBranchName) == 0) {
125  int detIndex = GetDetectorIndex(detector); // detIndex == -1 if the detector has not been set
126  std::string partHitsBranchName{std::string(detector).append("-GGSPartHits")};
127  std::string posHitsBranchName{std::string(detector).append("-GGSPartHits")};
128  TBranch *partHitsBranch = _chain->GetBranch(partHitsBranchName.c_str());
129  TBranch *posHitsBranch = _chain->GetBranch(posHitsBranchName.c_str());
130 
131  std::string infoString("Set detector ");
132  infoString.append(detector);
133 
134  // Position hits
135  if (readPosHits) {
136  if (posHitsBranch) {
137  infoString.append(" (+PosHits)");
138  if (detIndex == -1) {
139  _posHitArrays.push_back(nullptr);
140  _chain->SetBranchAddress(posHitsBranchName.c_str(), &(_posHitArrays.back()));
141  _readPosHits.push_back(true);
142  } else {
143  _chain->SetBranchAddress(posHitsBranchName.c_str(), &(_posHitArrays[detIndex]));
144  _readPosHits[detIndex] = true;
145  }
146  branches[2] = posHitsBranch;
147  } else {
148  throw std::runtime_error(std::string("PosHits missing for detector ") + detector);
149  }
150  } else {
151  if (detIndex == -1) {
152  _posHitArrays.push_back(nullptr);
153  _readPosHits.push_back(false);
154  } else {
155  if (posHitsBranch) {
156  posHitsBranch->ResetAddress();
157  }
158  _posHitArrays[detIndex] = nullptr; // FIXME: should the element be deleted before this? Is it
159  // owned by the file/branch?
160  _readPosHits[detIndex] = false;
161  }
162  }
163 
164  // Particle hits
165  if (readPartHits) {
166  if (partHitsBranch) {
167  infoString.append(" (+PartHits)");
168  if (detIndex == -1) {
169  _partHitArrays.push_back(nullptr);
170  _chain->SetBranchAddress(partHitsBranchName.c_str(), &(_partHitArrays.back()));
171  _readPartHits.push_back(true);
172  } else {
173  _chain->SetBranchAddress(partHitsBranchName.c_str(), &(_partHitArrays[detIndex]));
174  _readPartHits[detIndex] = true;
175  }
176  branches[1] = partHitsBranch;
177  } else {
178  throw std::runtime_error(std::string("PartHits missing for detector ") + detector);
179  }
180  } else {
181  if (detIndex == -1) {
182  _partHitArrays.push_back(nullptr);
183  _readPartHits.push_back(false);
184  } else {
185  if (partHitsBranch) {
186  partHitsBranch->ResetAddress();
187  }
188  _partHitArrays[detIndex] = nullptr; // FIXME: should the element be deleted before this? Is it
189  // owned by the file/branch?
190  _readPartHits[detIndex] = false;
191  }
192  }
193 
194  if (detIndex == -1) {
195  _intHitArrays.push_back(nullptr);
196  _chain->SetBranchAddress(detBranchName, &(_intHitArrays.back()));
197  branches[0] = _chain->GetBranch(detBranchName);
198  _detInfo = (TClonesArray *)(_chain->GetFile()->Get("GGSHitDetInfo"));
199  _timeBins.push_back((TArrayF *)(_chain->GetFile()->Get(TString(detector) + "-GGSIntHits-TimeBins")));
200  _thresholds.push_back(
201  (std::vector<float> *)(_chain->GetFile()->Get(TString(detector) + "-GGSIntHits-Thresholds")));
202 
203  Detector det;
204  det.name = detector;
205  det.logVolName = detector;
206  det.logVolName =
207  det.logVolName.substr(0, det.logVolName.find_first_of('.')); // remove names of scorer and sensitive detector
208  det.detInfoArrayIndex = _GetDetectorIndexFromStorage(det.logVolName.c_str());
209  _detectors.push_back(det);
210  }
211  COUT(INFO) << infoString << ENDL;
212  } else {
213  throw std::runtime_error(std::string("IntHits missing for detector ") + detector);
214  }
215 
216  // Synchronize the branches that have just been set for reading
217  if (_chain->GetReadEntry() != -1) {
218  for (int iBranch = 0; iBranch < 3; ++iBranch) {
219  if (branches[iBranch]) {
220  branches[iBranch]->GetEntry(_chain->GetReadEntry());
221  }
222  }
223  }
224 }
225 
226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
227 
228 bool GGSTHitsReader::DetectorExists(const char *detector, bool particleHits, bool positionHits) {
229  int type = -1;
230  if (_chain) {
231  std::string detectorString{detector};
232  detectorString += "-GGSIntHits";
233  type = _CheckBranch(detectorString.c_str());
234  }
235  if (type == 0 && particleHits) {
236  std::string detectorString{detector};
237  detectorString += "-GGSPartHits";
238  type = _CheckBranch(detectorString.c_str());
239  }
240  if (type == 1 && positionHits) {
241  std::string detectorString{detector};
242  detectorString += "-GGSPosHits";
243  type = _CheckBranch(detectorString.c_str());
244  }
245 
246  return (type != -1);
247 }
248 
249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
250 
252  static const std::string routineName("GGSTHitsReader::ListDetectors");
253 
254  if (_chain) {
255  TObjArray *branches = _chain->GetListOfBranches();
256  COUT(INFO) << "List of detectors in hits tree:" << ENDL;
257  for (int i = 0; i < branches->GetEntries(); i++) {
258  TBranch *branch = (TBranch *)(branches->At(i));
259  if (_CheckBranch(branch->GetName()) == 0) {
260  TString detName = branch->GetName();
261  detName.Remove(detName.Length() - 11); // Remove the trailing "-GGSIntHits"
262  std::string infoString(" ");
263  infoString.append(detName.Data());
264  if (_CheckBranch(detName + "-GGSPartHits") == 1)
265  infoString.append(" (PartHits)");
266  if (_CheckBranch(detName + "-GGSPosHits") == 2)
267  infoString.append(" (PosHits)");
268  CCOUT(INFO) << infoString << ENDL;
269  }
270  }
271  }
272 }
273 
274 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
275 
276 std::vector<TString> GGSTHitsReader::GetListOfDetectors() {
277  static const std::string routineName("GGSTHitsReader::GetListOfDetectors");
278 
279  std::vector<TString> _list;
280 
281  if (_chain) {
282  TObjArray *branches = _chain->GetListOfBranches();
283  for (int i = 0; i < branches->GetEntries(); i++) {
284  TBranch *branch = (TBranch *)(branches->At(i));
285  std::string branchName(branch->GetName());
286  if (_CheckBranch(branch->GetName()) == 0) {
287  TString detName = branch->GetName();
288  detName.Remove(detName.Length() - 11); // Remove the trailing "-GGSIntHits"
289  _list.emplace_back(detName);
290  }
291  }
292  }
293 
294  return _list;
295 }
296 
297 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
298 
299 Int_t GGSTHitsReader::GetNHits(const char *detector) {
300  static short int iHitArray;
301  iHitArray = GetDetectorIndex(detector);
302  if (iHitArray != -1)
303  return (_GetHitArray(iHitArray))->GetEntries();
304  else
305  return 0;
306 }
307 
308 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
309 
310 Int_t GGSTHitsReader::GetNHits(int iDet) {
311  TClonesArray *detArray = _GetHitArray(iDet);
312  if (detArray)
313  return detArray->GetEntries();
314  else
315  return 0;
316 }
317 
318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
319 
320 GGSTIntHitBase *GGSTHitsReader::GetHit(const char *detector, unsigned int iHit) {
321  int iDet = GetDetectorIndex(detector);
322  if (iDet != -1)
323  return GetHit(iDet, iHit);
324  else
325  return nullptr;
326 }
327 
328 GGSTIntHitBase *GGSTHitsReader::GetHit(int iDet, unsigned int iHit) {
329  static TClonesArray *hitArray = nullptr;
330  hitArray = _GetHitArray(iDet);
331  if (hitArray) {
332  GGSTIntHitBase *hit = (GGSTIntHitBase *)(hitArray->At(iHit));
333  if (hit) {
334  // Compute non-persistent informations
335  hit->eDep = hit->eDepTimeBin.GetSum();
336  hit->_hitDetInfo = _GetDetectorInfo(_detectors[iDet].detInfoArrayIndex);
337  hit->_timeBins = _timeBins[iDet];
338  if (hit->_hitDetInfo)
339  hit->_hitVolInfo = (GGSTHitVolInfo *)(hit->_hitDetInfo->volumes.At(hit->_volumeIndex));
340  else
341  hit->_hitVolInfo = nullptr;
342  if (_readPartHits[iDet]) {
343  hit->_partHits = (TClonesArray *)(_partHitArrays[iDet]->At(iHit));
344  }
345  if (_readPosHits[iDet]) {
346  // Set pointer to position hits collection for each particle hit
347  TClonesArray *partHits = hit->_partHits;
348  int nPartHits = partHits->GetEntries();
349  for (int iPartHit = 0; iPartHit < nPartHits; iPartHit++) {
350  GGSTPartHit *partHit = (GGSTPartHit *)(partHits->At(iPartHit));
351  partHit->_posHits = (TClonesArray *)(_posHitArrays[iDet]->At(partHit->_posHitIndex));
352  }
353  }
354  return hit;
355  }
356  }
357  return nullptr;
358 }
359 
360 std::string GGSTHitsReader::GetIntHitsClassName(const char *detector) {
361  int iDet = GetDetectorIndex(detector);
362  if (iDet >= 0) {
363  return GetIntHitsClassName(iDet);
364  } else {
365  return "";
366  }
367 }
368 
369 std::string GGSTHitsReader::GetIntHitsClassName(int iDet) {
370  TClonesArray *hitArray = _GetHitArray(iDet);
371  if (hitArray) {
372  std::string retValue = hitArray->GetName();
373  return retValue.substr(0, retValue.size() - 1);
374  } else {
375  return "";
376  }
377 }
378 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
379 
380 int GGSTHitsReader::GetDetectorIndex(const char *detector) {
381  for (UInt_t i = 0; i < _detectors.size(); i++) {
382  if (!strcmp(_detectors[i].name.data(), detector))
383  return i;
384  }
385  return -1;
386 }
387 
388 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
389 
390 bool GGSTHitsReader::HasPartHits(const char *detector) {
391  if (_chain) {
392  TString branchName(detector);
393  branchName.Append("-GGSPartHits");
394  TBranch *branch = _chain->GetBranch(branchName);
395  if (branch)
396  return true;
397  else
398  return false;
399  } else
400  return false;
401 }
402 
403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
404 
405 bool GGSTHitsReader::HasPosHits(const char *detector) {
406  if (_chain) {
407  TString branchName(detector);
408  branchName.Append("-GGSPosHits");
409  TBranch *branch = _chain->GetBranch(branchName);
410  if (branch)
411  return true;
412  else
413  return false;
414  } else
415  return false;
416 }
417 
418 float GGSTHitsReader::GetIntHitThreshold(const std::string &detector) {
419  const std::string routineName("GSTHitsReader::GetIntHitThreshold");
420  int detIndex = GetDetectorIndex(detector.c_str());
421  if (detIndex == -1) {
422  throw std::range_error(routineName + ": detector " + detector + " not found");
423  }
424 
425  if (_thresholds[detIndex]) {
426  return (*(_thresholds[detIndex]))[0];
427  } else {
428  throw std::runtime_error(routineName + ": thresholds for integrated hits not available for detector " + detector);
429  }
430 }
431 
432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
433 
434 float GGSTHitsReader::GetPartHitThreshold(const std::string &detector) {
435  const std::string routineName("GSTHitsReader::GetIntHitThreshold");
436  int detIndex = GetDetectorIndex(detector.c_str());
437  if (detIndex == -1) {
438  throw std::range_error(routineName + ": detector " + detector + " not found");
439  }
440 
441  if (_thresholds[detIndex]) {
442  return (*(_thresholds[detIndex]))[1];
443  } else {
444  throw std::runtime_error(routineName + ": thresholds for particle hits not available for detector " + detector);
445  }
446 }
447 
448 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
449 
450 float GGSTHitsReader::GetPosHitThreshold(const std::string &detector) {
451  const std::string routineName("GSTHitsReader::GetIntHitThreshold");
452  int detIndex = GetDetectorIndex(detector.c_str());
453  if (detIndex == -1) {
454  throw std::range_error(routineName + ": detector " + detector + " not found");
455  }
456 
457  if (_thresholds[detIndex]) {
458  return (*(_thresholds[detIndex]))[2];
459  } else {
460  throw std::runtime_error(routineName + ": thresholds for position hits not available for detector " + detector);
461  }
462 }
463 
464 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
465 
466 int GGSTHitsReader::_GetDetectorIndexFromStorage(const char *detector) {
467  if (_detInfo) {
468  for (int iDet = 0; iDet < _detInfo->GetEntries(); iDet++) {
469  static GGSTHitDetInfo *det = nullptr;
470  det = (GGSTHitDetInfo *)(_detInfo->At(iDet));
471  if (det && det->detectorName == detector)
472  return iDet;
473  }
474  }
475  return -1;
476 }
477 
478 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
479 
480 int GGSTHitsReader::_CheckBranch(const char *branchName) {
481  const std::string routineName("GGSTHitsReader::_CheckBranch");
482 
483  std::string branchNameStr{branchName};
484  int type = -1; // 0: integrated, 1: particle, 2: position
485  if (branchNameStr.find("-GGSIntHits") != std::string::npos) {
486  type = 0;
487 
488  } else if (branchNameStr.find("-GGSPartHits") != std::string::npos) {
489  type = 1;
490  } else if (branchNameStr.find("-GGSPosHits") != std::string::npos) {
491  type = 2;
492  } else {
493  return -1;
494  }
495 
496  TBranch *branch = _chain->GetBranch(branchName);
497 
498  // Check whether the branch exists or not
499  if (!branch) {
500  // COUT << routineName << "Warning: branch " << branchName << " not found."
501  // << ENDL;
502  return -1;
503  }
504 
505  // Check whether the branch is a TClonesArray or not
506  if (type == 0) {
507  if (strcmp(branch->GetClassName(), "TClonesArray")) {
508  return -1;
509  }
510  } else {
511  if (strcmp(branch->GetClassName(), "TObjArray")) {
512  return -1;
513  }
514  }
515 
516  if (type == 0) {
517  // Check whether the TClonesArray contains hit objects or not
518  char *oldBuffer = branch->GetAddress();
519  Long64_t oldReadEntry = branch->GetReadEntry();
520  TClonesArray *buffer = nullptr;
521  branch->SetAddress(&buffer);
522  branch->GetEntry(0);
523  branch->SetAddress(oldBuffer);
524  branch->GetEntry(oldReadEntry);
525  std::string hitClassName(buffer->GetName());
526  hitClassName.erase(hitClassName.size() - 1); // Remove the trailing 's' that TClonesArray name
527  // places after the class name
528  TClass *clonesClass = TClass::GetClass(hitClassName.c_str());
529  if (!clonesClass) {
530  COUT(ERROR) << "No dictionary for class " << hitClassName << " inside the TCloneArray in branch " << branchName
531  << ENDL;
532  return -1;
533  }
534  if (!(clonesClass->GetBaseClass("GGSTIntHit"))) {
535  COUT(ERROR) << "Class " << hitClassName << " inside the TCloneArray in branch " << branchName
536  << " does not inherit from GGSTIntHit" << ENDL;
537  return -1;
538  }
539  }
540 
541  return type;
542 }
543 
544 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
545 
546 TClonesArray *GGSTHitsReader::_GetHitArray(int iHitArray) {
547  if (iHitArray > (int)(_intHitArrays.size() - 1) || iHitArray < 0)
548  return nullptr;
549  return _intHitArrays[iHitArray];
550 }
551 
552 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
553 
554 GGSTHitDetInfo *GGSTHitsReader::_GetDetectorInfo(int iDet) {
555  if (_detInfo) {
556  static GGSTHitDetInfo *det = nullptr;
557  det = (GGSTHitDetInfo *)(_detInfo->At(iDet));
558  return det;
559  }
560  return nullptr;
561 }
bool HasPartHits(const char *detector)
Check if particle hits data is available for the specified detector.
float GetIntHitThreshold(const std::string &detector)
Retrieves the thresholds used when saving the integrated hits.
Class to store detector informations.
GGSTIntHitBase * GetHit(const char *detector, unsigned int iHit)
Get the specified hit.
float GetPartHitThreshold(const std::string &detector)
Retrieves the thresholds used when saving the particle hits.
#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 ListDetectors()
Prints a list of detectors which are present in hits tree on standard output.
Class to store G4 particle hits.
Definition: GGSTHits.h:176
GGSTHitsReader()
Constructor.
#define CCOUT(level)
Smart log utility which prints no header at the beginning of the line.
Definition: GGSSmartLog.h:100
TClonesArray volumes
Array of GGSTHitVolInfo objects.
std::string GetIntHitsClassName(const char *detector)
Gets the name of the class of the integrated hits for the given detector.
bool DetectorExists(const char *detector, bool particleHits=false, bool positionHits=false)
Checks the existence of a given detector within the hits tree.
Float_t eDep
Deposited energy (transient).
Definition: GGSTHits.h:222
Int_t GetNHits(const char *detector)
Gets the number of hits for the specified detector.
~GGSTHitsReader()
Destructor.
bool HasPosHits(const char *detector)
Check if position hits data is available for the specified detector.
float GetPosHitThreshold(const std::string &detector)
Retrieves the thresholds used when saving the position hits.
bool SetChain(TChain *hitsChain)
Sets the chain.
int GetDetectorIndex(const char *detector)
Retrieves the index of requested detector.
void GetEntry(Long64_t entry)
std::vector< TString > GetListOfDetectors()
Returns the list of detectors which are present in hits tree on standard output.
TArrayF eDepTimeBin
Energy deposit in each time bin.
Definition: GGSTHits.h:223
GGSTHitVolInfo.h GGSTHitVolInfo class declaration.
TString detectorName
Name of detector associated to integrated hits.
Base class for storing G4 integrated hits.
Definition: GGSTHits.h:218
void SetDetector(const char *detector, bool readPartHits=false, bool readPosHits=false)
Enables reading hit informations of the specified detector.