|
145 | 145 | ///
|
146 | 146 | /// * **thetaPrimary**: polar angle of the primary generated particle.
|
147 | 147 | /// * **phiPrimary**: azimuth angle of the primary generated particle.
|
148 |
| -/// |
149 | 148 | /// * **energyPrimary**: energy of the primary event generated.
|
150 | 149 | ///
|
| 150 | +/// * **boundingSize**: It stores a value with the event size calculated |
| 151 | +/// as the diagonal distance of a bounding box defined to contain all the |
| 152 | +/// hits that produced an energy deposit. |
| 153 | +/// |
151 | 154 | /// The following code ilustrates the addition of a primary event
|
152 | 155 | /// observable.
|
153 | 156 | ///
|
@@ -417,8 +420,6 @@ TRestEvent* TRestGeant4AnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
|
417 | 420 | fInputG4Event = (TRestGeant4Event*)inputEvent;
|
418 | 421 | *fOutputG4Event = *((TRestGeant4Event*)inputEvent);
|
419 | 422 |
|
420 |
| - TString obsName; |
421 |
| - |
422 | 423 | Double_t energy = fOutputG4Event->GetSensitiveVolumeEnergy();
|
423 | 424 |
|
424 | 425 | if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) {
|
@@ -456,19 +457,25 @@ TRestEvent* TRestGeant4AnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
|
456 | 457 | SetObservableValue((string) "energyPrimary", energyPrimary);
|
457 | 458 |
|
458 | 459 | Double_t energyTotal = fOutputG4Event->GetTotalDepositedEnergy();
|
459 |
| - obsName = this->GetName() + (TString) ".totalEdep"; |
460 | 460 | SetObservableValue((string) "totalEdep", energyTotal);
|
461 | 461 |
|
| 462 | + Double_t size = fOutputG4Event->GetBoundingBoxSize(); |
| 463 | + SetObservableValue((string) "boundingSize", size); |
| 464 | + |
462 | 465 | // process names as named by Geant4
|
463 | 466 | // processes present here will be added to the list of observables which can be used to see if the event
|
464 | 467 | // contains the process of interest.
|
465 | 468 | vector<string> processNames = {"phot", "compt"};
|
466 |
| - for (const auto& processName : processNames) { |
| 469 | + for (auto& processName : processNames) { |
467 | 470 | Int_t containsProcess = 0;
|
468 | 471 | if (fOutputG4Event->ContainsProcess(fG4Metadata->GetGeant4PhysicsInfo().GetProcessID(processName))) {
|
469 | 472 | containsProcess = 1;
|
470 | 473 | }
|
471 |
| - SetObservableValue("ContainsProcess" + processName, containsProcess); |
| 474 | + |
| 475 | + if (processName.size() > 0) { |
| 476 | + processName[0] = toupper(processName[0]); |
| 477 | + SetObservableValue("containsProcess" + processName, containsProcess); |
| 478 | + } |
472 | 479 | }
|
473 | 480 |
|
474 | 481 | /*
|
@@ -547,7 +554,7 @@ TRestEvent* TRestGeant4AnalysisProcess::ProcessEvent(TRestEvent* inputEvent) {
|
547 | 554 | cout << "----------------------------" << endl;
|
548 | 555 | }
|
549 | 556 |
|
550 |
| - // These cuts should be in another process or eliminated?!! |
| 557 | + /// We should use here ApplyCut |
551 | 558 | if (energy < fLowEnergyCut) return nullptr;
|
552 | 559 | if (fHighEnergyCut > 0 && energy > fHighEnergyCut) return nullptr;
|
553 | 560 |
|
|
0 commit comments