Skip to content

Commit

Permalink
update R3BNeuland.h documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
YanzhaoW committed Jan 13, 2025
1 parent af43e28 commit 0a77bc0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 24 deletions.
4 changes: 3 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ fetchcontent_getproperties(doxygen-awesome-css SOURCE_DIR AWESOME_CSS_DIR)

# set(DOXYGEN_GENERATE_XML YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_EXTRACT_PRIVATE YES)
set(DOXYGEN_EXTRACT_PRIVATE NO)
set(DOXYGEN_EXTRACT_PRIV_VIRTUAL YES)
set(DOXYGEN_EXTRACT_PACKAGE YES)
set(DOXYGEN_EXTRACT_STATIC YES)
# set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_SOURCE_BROWSER YES)
set(DOXYGEN_REPEAT_BRIEF NO)
# set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_TEMPLATE_RELATIONS YES)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_CLASS_GRAPH NO)
set(DOXYGEN_COLLABORATION_GRAPH NO)
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
set(DOXYGEN_USE_MATHJAX YES)
set(DOXYGEN_MAX_DOT_GRAPH_DEPTH 2)
# set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "${PROJECT_SOURCE_DIR}/README.md")
Expand Down
72 changes: 49 additions & 23 deletions neuland/simulation/R3BNeuland.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ class TClonesArray;
class R3BNeulandGeoPar;

/**
* NeuLAND detector simulation class
* @author Jan Mayer
* \brief NeuLAND detector simulation class
* @author Jan Mayer, Yanzhao Wang
* @since 12.01.2016
* For each simulated event, TClonesArrays are filled:
* - NeulandPoints (R3BNeulandPoint), each representing energy deposition and light yield of a track in a paddle
* Suitable geometry files require proper naming of the active volume (see CheckIfSensitive) and copy numbers.
*
* For each simulated event, a vector data with name "NeulandPoints" is filled:
* - NeulandPoints (R3BNeulandPoint), each representing energy deposition and light yield of a track in a paddle.
*
* Suitable geometry files require proper naming of the active volume (see CheckIfSensitive()) and copy numbers.
*/

class R3BNeuland : public FairDetector
Expand Down Expand Up @@ -64,36 +66,59 @@ class R3BNeuland : public FairDetector
*@param combi position + rotation */
explicit R3BNeuland(int nDP, const TGeoCombiTrans& combi = TGeoCombiTrans());

/**
* \brief Enable the automatic geometry build for NeuLAND.
*
* Automatically build the NeuLAND geometry without a geometry file. The geometry build is done in the class
* R3B::Neuland::Geometry::Creator. If this is disabled, an geometry file corresponding to the number of double
* plane must be present.
* @param is_enabled Whether the geometry build should be enabled or not.
*/
void EnableAutoGeoBuild(bool is_enabled = true) { is_geo_auto_built = is_enabled; }

/**
* \brief Set the translation and rotation of the NeuLAND detector
*
* Set the translation and rotation of the NeuLAND detector using parameter with the type `TGeoCombiTrans`. This will override the value specified by the constructors.
* @param pos Input tranlation and rotation matrix.
* @see <a href="https://root.cern/doc/master/classTGeoCombiTrans.html">TGeoCombiTrans</a>
*/
void SetLocationDirection(const TGeoCombiTrans& pos) { rot_trans_ = pos; }

private:
bool is_geo_auto_built = false;
int num_of_planes_ = R3B::Neuland::MaxNumberOfPlanes;
bool is_geo_auto_built = false; //!< Flag to check if geo-build is needed.
bool is_last_hit_done_ = false; //!< Flag to check if last hit finished.
int num_of_planes_ = R3B::Neuland::MaxNumberOfPlanes; //!< The number of planes.

// Track information to be stored until the track leaves the active volume.
int fTrackId = 0; //!< A buffer for the track IDs.
int fPaddleId = 0; //!< A buffer for the paddle ids.
int particle_id_ = 0; //!< A buffer for the particle IDs.
int parent_particle_id_ = 0; //!< A buffer for the parent particle IDs.
double time_ = 0.; //!< A buffer for time values.
double length_ = 0.; //!< A buffer for track lengths.
double energy_loss_ = 0.; //!< A buffer for the energy losses.
double light_yield_ = 0.; //!< A buffer for the light yields.
TLorentzVector pos_in_; //!< A buffer for the position where the track goes into the volume.
TLorentzVector pos_out_; //!< A buffer for the position where the track goes out of the volume.
TLorentzVector mom_in_; //!< A buffer for the momentum when the track goes into the volume.
TLorentzVector mom_out_; //!< A buffer for the position when the track goes out of the volume.

/// The TCA data buffer used to be returned by virtual method GetCollection(int iColl).
std::unique_ptr<TClonesArray> tca_points_buffer_ = std::make_unique<TClonesArray>(R3BNeulandPoint::Class()); //!
/// Output data written to the ROOT file.
R3B::OutputVectorConnector<R3BNeulandPoint> neuland_points_{ "NeulandPoints" }; //!
std::unique_ptr<TClonesArray> tca_points_buffer_ = std::make_unique<TClonesArray>(R3BNeulandPoint::Class());
/// Output parameter containing the geometry information.
R3BNeulandGeoPar* neuland_geo_par_ = nullptr; //!
/// Creating NeuLAND geometry if EnableAutoGeoBuild() is enabled.
R3B::Neuland::Geometry::Creator geo_creator_; //!
/// Rotation and tranlation of NeuLAND detector.
TGeoCombiTrans rot_trans_;
/// Geometry file name. The file must be present if EnableAutoGeoBuild() is disabled
std::string geo_file_;
/// A map with the track ID as the key and the particle ID as the value. Used to find the parent particle ID of the current track,
std::map<int, int> track_pid_map_;

/** Track information to be stored until the track leaves the active volume. */
int fTrackId = 0;
int fPaddleId = 0;
TLorentzVector pos_in_;
TLorentzVector pos_out_;
TLorentzVector mom_in_;
TLorentzVector mom_out_;
double time_ = 0.;
double length_ = 0.;
double energy_loss_ = 0.;
double light_yield_ = 0.;
bool is_last_hit_done_ = false;
int particle_id_ = 0;
int parent_particle_id_ = 0;

// private virtual functions:

auto ProcessHits(FairVolume* /*v*/ = nullptr) -> bool override;
Expand All @@ -115,6 +140,7 @@ class R3BNeuland : public FairDetector
// private non-virtual member functions:

void reset_values();

void write_parameter_file();

void ConstructGeometry() override;
Expand Down

0 comments on commit 0a77bc0

Please sign in to comment.