Skip to content

Commit

Permalink
Merge pull request #112 from rest-for-physics/lobis-gas-pressure
Browse files Browse the repository at this point in the history
Correctly initialize gas pressure
  • Loading branch information
lobis authored Apr 5, 2024
2 parents d3ee48f + 9f82b0c commit df38ee6
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 65 deletions.
10 changes: 5 additions & 5 deletions inc/TRestDetectorGarfieldDriftProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ class TRestDetectorGarfieldDriftProcess : public TRestEventProcess {
#endif
protected:
#if defined USE_Garfield
Double_t fGasPressure; // atm
// Double_t fElectricField; // V/cm
Double_t fDriftPotential; // V
Double_t fPEReduction; // reduction factor of primary electrons to track
double fStopDistance; ///< Distance from readout to stop electron drift, in mm
Double_t fGasPressure = -1; // atm
// Double_t fElectricField; // V/cm
Double_t fDriftPotential; // V
Double_t fPEReduction; // reduction factor of primary electrons to track
double fStopDistance; ///< Distance from readout to stop electron drift, in mm

TString fGDML_Filename;

Expand Down
4 changes: 2 additions & 2 deletions inc/TRestDetectorHitsToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class TRestDetectorHitsToSignalProcess : public TRestEventProcess {
Double_t fSampling = 1; //<

/// The gas pressure. If defined it will change the TRestDetectorGas pressure in atm.
Double_t fGasPressure = 1; // atm
Double_t fGasPressure = -1; // atm

/// The electric field in V/mm. Used to calculate the drift velocity if TRestDetectorGas is defined.
Double_t fElectricField = 100; //<
Double_t fElectricField = -1; //<

/// The drift velocity in mm/us. If it is negative, it will be calculated from TRestDetectorGas.
Double_t fDriftVelocity = -1; // mm/us
Expand Down
8 changes: 4 additions & 4 deletions inc/TRestDetectorSignalToHitsProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TRestDetectorSignalToHitsProcess : public TRestEventProcess {
/// A pointer to the specific TRestDetectorHitsEvent input
TRestDetectorSignalEvent* fSignalEvent; //!

/// A pointer to the detector readout definition accesible to TRestRun
/// A pointer to the detector readout definition accessible to TRestRun
TRestDetectorReadout* fReadout; //!

/// A pointer to the detector gas definition accessible to TRestRun
Expand All @@ -51,10 +51,10 @@ class TRestDetectorSignalToHitsProcess : public TRestEventProcess {

protected:
/// The electric field in standard REST units (V/mm). Only relevant if TRestDetectorGas is used.
Double_t fElectricField = 100;
Double_t fElectricField = -1;

/// The gas pressure in atm. Only relevant if TRestDetectorGas is used.
Double_t fGasPressure = 1;
Double_t fGasPressure = -1;

/// The drift velocity in standard REST units (mm/us).
Double_t fDriftVelocity = -1;
Expand Down Expand Up @@ -98,7 +98,7 @@ class TRestDetectorSignalToHitsProcess : public TRestEventProcess {

TRestDetectorSignalToHitsProcess();
TRestDetectorSignalToHitsProcess(const char* configFilename);
~TRestDetectorSignalToHitsProcess();
~TRestDetectorSignalToHitsProcess() override;

ClassDefOverride(TRestDetectorSignalToHitsProcess, 4);
};
Expand Down
4 changes: 2 additions & 2 deletions src/TRestDetectorElectronDiffusionProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void TRestDetectorElectronDiffusionProcess::LoadDefaultConfig() {

fElectricField = 2000;
fAttachment = 0;
fGasPressure = 1;
fGasPressure = -1;
}

void TRestDetectorElectronDiffusionProcess::Initialize() {
Expand All @@ -44,7 +44,7 @@ void TRestDetectorElectronDiffusionProcess::Initialize() {

fElectricField = 0;
fAttachment = 0;
fGasPressure = 1;
fGasPressure = -1;

fTransversalDiffusionCoefficient = 0;
fLongitudinalDiffusionCoefficient = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/TRestDetectorGarfieldDriftProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,9 @@ TRestEvent* TRestDetectorGarfieldDriftProcess::ProcessEvent(TRestEvent* inputEve
}
}

if (fOutputHitsEvent->GetNumberOfHits() == 0) return nullptr;
if (fOutputHitsEvent->GetNumberOfHits() == 0) {
return nullptr;
}

// fSignalEvent->PrintEvent();

Expand Down
4 changes: 2 additions & 2 deletions src/TRestDetectorHitsToSignalProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ void TRestDetectorHitsToSignalProcess::LoadDefaultConfig() {
cout << "Hits to signal metadata not found. Loading default values" << endl;

fSampling = 1;
fElectricField = 1000;
fGasPressure = 10;
fElectricField = -1;
fGasPressure = -1;
}

///////////////////////////////////////////////
Expand Down
Loading

0 comments on commit df38ee6

Please sign in to comment.