55 t2 = (t2 > t1 ? t1 : t2);
64 fCell.push_back(cell);
124 if (
fEdep[iCell] > threshold)
221 if (i_cell < 0 || i_cell >=
fNCells)
236 cl->
AddCell(
i, c, r, l, x, y, z, t, e, b);
261 Int_t iCellInCluster = 0;
262 while (iCellInCluster < cl->
GetNCells()) {
264 for (
Int_t dIx : {-1, 0, 1}) {
268 for (
Int_t dIy : {-1, 0, 1}) {
272 for (
Int_t dIz : {-1, 0, 1}) {
314 checkAllLayers =
kTRUE;
316 Int_t iCellInCluster = 0;
317 while (iCellInCluster < cl->
GetNCells()) {
319 for (
Int_t dIx : {-1, 0, 1}) {
323 for (
Int_t dIy : {-1, 0, 1}) {
327 if (checkAllLayers) {
337 for (
Int_t dIz : {-1, 0, 1}) {
379 Int_t iCellInCluster = 0;
380 while (iCellInCluster < cl->
GetNCells()) {
382 for (
Int_t dIx : {-1, 0, 1}) {
386 for (
Int_t dIy : {-1, 0, 1}) {
390 for (
Int_t dIz : {-1, 0, 1}) {
431 Int_t iCellInCluster = 0;
432 while (iCellInCluster < cl->
GetNCells()) {
434 for (
Int_t dIx : {-1, 0, 1}) {
438 for (
Int_t dIy : {-1, 0, 1}) {
442 for (
Int_t dIz : {-1, 0, 1, 2}) {
484 Int_t iCellInCluster = 0;
485 while (iCellInCluster < cl->
GetNCells()) {
487 for (
Int_t dIx : {-1, 0, 1}) {
491 for (
Int_t dIy : {-1, 0, 1}) {
495 for (
Int_t dIz : {-1, 0, 1}) {
545 Int_t iCellInCluster = 0;
546 while (iCellInCluster < cl->
GetNCells()) {
552 for (
Int_t dIx : {-1, 0, 1}) {
556 for (
Int_t dIy : {-1, 0, 1}) {
560 for (
Int_t dIz : {-1, 0, 1}) {
580 d_time20 <= 0 ? -1. : distance20 * 1.E-2 / (d_time20 * 1.E-9) /
TMath::C();
582 d_time21 <= 0 ? -1. : distance21 * 1.E-2 / (d_time21 * 1.E-9) /
TMath::C();
583 if (beta20 > 1. || beta20 < 0.)
585 if (beta21 > 1. || beta21 < 0.)
605 if (i_cluster_1 == i_cluster_2)
607 Int_t i1 =
min(i_cluster_1, i_cluster_2);
608 Int_t i2 =
max(i_cluster_1, i_cluster_2);
652 Int_t n_clusters = 0;
665 Double_t separation_parameter = weight_edep * edep + weight_ncells * n_cells + weight_nclusters * n_clusters;
666 if (separation_parameter > threshold12)
708 cout <<
"----------------------------- BmnNdetClusterFinder -----------------------------" << endl;
713 cout <<
"\tt: " <<
fTime[
i] <<
"[ns], Edep: " << 1.E3 *
fEdep[
i] <<
"[MeV]" << endl;
717 cout <<
"Sorted time" << endl;
723 cout <<
"Sorted edep" << endl;
729 cout <<
"Sorted beta" << endl;
734 cout <<
"------------------------------------------------------------------------------------" << endl;
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
vector< Int_t > fRow
Row index of a cell. It must be proportional to Y coordinate in self coordinate system of a detector.
Int_t FindClusters1_2()
Main method of a class.
vector< eCellStatus > fCellStatus
Flag if cell belongs to some cluster.
vector< BmnNdetCluster * > fClusters
Recognized clusters.
Int_t fNClusters
Number of recognized clusters.
vector< Double_t > fEdep
Energy deposited in the cell [GeV].
vector< Double_t > GetZ()
void Clear()
Clear all vectors, set fNCells=0.
Int_t FindClusters2()
Main method of a class.
vector< vector< vector< Int_t > > > fIndexXYZ
vector< Int_t > GetCells()
Int_t fNUncheckedCellsInEvent
Number of cells not belonging to any cluster.
vector< Double_t > GetTime()
vector< Int_t > fIndexEdep
Index of cells sorted by decending deposited energy.
vector< Double_t > fTime
Time of actuation of the cell [ns].
vector< Int_t > GetLayers()
vector< Double_t > GetEdep()
BmnNdetClusterFinder(const Int_t kNColumns=11, const Int_t kNRows=11, const Int_t kNLayers=16)
Default constructor.
@ kIsNotUsed
the cell doesn't belong to any cluster
@ kIsUsed
the cell belongs to some cluster
vector< Int_t > fColumn
Column index of a cell. It must be proportional to X coordinate in self coordinate system of a detect...
Int_t SelectNeutrons(Double_t cut_angle=45., Int_t cut_ncells=3, Bool_t check_border=kFALSE)
Select neutrons.
Int_t FindClusters1()
Main method of a class.
Int_t CalculateNumberOfNeutrons(Double_t weight_edep=1., Double_t weight_ncells=0.01, Double_t weight_nclusters=0.05, Double_t threshold12=0.)
Estimate number of neutrons based on:
Int_t FindClusters4(Double_t cut_beta=0.01)
Second method of searching for the clusters.
vector< Int_t > fLayer
Layer index of a cell. It must be proportional to Z coordinate in self coordinate system of a detecto...
vector< eClusterStatus > fClusterStatus
Flag if cell belongs to some cluster.
Int_t FindClusters3(Double_t cut_beta=0.03)
Main method of a class.
vector< Double_t > GetY()
vector< Double_t > fBeta
Beta = v/c, v = d/t.
vector< Int_t > GetColumns()
BmnNdetCluster * AddCluster()
Add empty BmnNdetCluster to the list of clusters.
Int_t GetClusterStatus(Int_t i_cluster)
Status of a cluster.
vector< Double_t > GetBeta()
vector< Int_t > fCell
Index of a cell in BmnNdetCell array in BmnNdetEvent object.
Int_t fNCells
Number of fired cells in event.
vector< Double_t > fZcoord
Z coordinate [cm].
vector< Double_t > fXcoord
X coordinate [cm].
vector< Double_t > fYcoord
Y coordinate [cm].
vector< Int_t > fIndexTime
Index of cells sorted by ascending time.
BmnNdetCluster * GetCluster(Int_t i_cluster)
Get BmnNdetCluster object.
eClusterStatus
Status of the cluster.
@ kNotNeutron
the cluster can't be produced by neutron
@ kUnchecked
the cluster is not checked yet
@ kIsNeutron
the cluster is produced by neutron
@ kNoCluster
there is no cluster
void SetClusterStatus(Int_t i_cluster, eClusterStatus status)
Set status of a cluster.
vector< Int_t > GetRows()
Int_t FindClusters2_2()
Main method of a class.
Int_t MergeClusters(Int_t i_cluster_1, Int_t i_cluster_2)
Merge clusters The cells of cluster with maximal i_cluster are added to the cluster with minimal i_cl...
vector< Double_t > GetX()
vector< Int_t > fIndexBeta
Index of cells sorted by decending beta.
void Fill(Int_t cell, Int_t column, Int_t row, Int_t layer, Double_t x, Double_t y, Double_t z, Double_t t, Double_t e_dep)
Add cell to the list of fired cells For correct work of the code it is needed that columns,...
void AddCellToCluster(Int_t i_cell, Int_t i_cluster)
Mark a cell i_cell as belonging to cluster i_cluster.
~BmnNdetClusterFinder()
Default destructor.
Class for description of recognized cluster in Bmn Ndet detector.
vector< Double_t > GetZ()
Double_t EnergyDeposited(Double_t threshold=0.003)
Energy deposited in cluster [GeV].
vector< Double_t > GetBeta()
vector< Int_t > GetLayers()
void AddCell(Int_t cell, Int_t column, Int_t row, Int_t layer, Double_t x, Double_t y, Double_t z, Double_t t, Double_t e_dep, Double_t beta=-1.)
Add cell to the cluster.
vector< Double_t > GetTime()
vector< Double_t > GetY()
vector< Double_t > GetEdep()
Double_t BetaFirst()
Beta calculated for first fired cell in cluster beta = v / c v = d / t d = sqrt(x^2+y^2+z^2) .
vector< Int_t > GetColumns()
Double_t AngleToTarget()
Angle between direction to first cell and average direction of cluster Direction of cluster is sum of...
vector< Double_t > GetX()
Bool_t StartsOnBorder(Int_t size_x=11, Int_t size_y=11, Int_t size_z=8)
Function for selection of particles coming from side.
vector< Int_t > GetRows()
double beta(double x, double y)
Double_t Sqrt(Double_t x)