FEDRA emulsion software from the OPERA Collaboration
AcqTrackReconstructor.cxx File Reference
Include dependency graph for AcqTrackReconstructor.cxx:

Functions

 ClassImp (AcqTrackReconstructor)
 
int Propagate (int *Rating, int iX, int iY, int iZ)
 

Variables

int MinRating
 
int NCellX
 
int NCellY
 
int NCellZ
 
TObjArray * Volume
 

Function Documentation

◆ ClassImp()

ClassImp ( AcqTrackReconstructor  )

◆ Propagate()

int Propagate ( int *  Rating,
int  iX,
int  iY,
int  iZ 
)
33 {
34  int ind;
35  TObjArray *farr;
36  bool Neighbours=false;
37  EdbCluster* fcl;
38  int res;
39  (*Rating)++; //increase rating
40  int cZ=iZ+1; //next layer
41  if(cZ>=NCellZ)
42  if ((*Rating)<MinRating) {(*Rating)--; return 0;} //last layer, not a valid chain
43  else {(*Rating)--; return 1;}
44  for(int cX=iX-1;cX<=iX+1;cX++) for(int cY=iY-1;cY<=iY+1;cY++)
45  {//loop on all neighbour cells in the next layer
46  if(cX<0 || cY<0 || cX>=NCellX || cY>=NCellY) continue; //out of bounds
47  ind=cZ*NCellX*NCellY+cY*NCellX+cX;
48  farr=(TObjArray*)(Volume->At(ind)); //get array of clusters in the cell
49  if(farr->GetEntries()>0 && !Neighbours) { Neighbours=true;}
50  for(int j=0;j<farr->GetEntries();j++) //loop on clusters
51  {
52  // here we have a neighbour cluster fcl
53  fcl=(EdbCluster*)(farr->At(j));
54  if(fcl->GetSegment() < (*Rating) ) fcl->SetSegment(*Rating); //set rating
55  res=Propagate( Rating, cX,cY,cZ); //propagate rating to it's neighbours
56  if((*Rating)>0) printf("Propagate(%d, %d,%d,%d) returned %d\n",(*Rating),iX,iY,iZ, res);
57 
58  if(res) fcl->SetSegment(*Rating); //update rating
59  }
60  }
61  if(!Neighbours && (*Rating)<MinRating) {(*Rating)--; return 0;} //not a valid chain
62 (*Rating)--;
63 return 1;
64 }
int NCellY
Definition: AcqTrackReconstructor.cxx:27
int NCellZ
Definition: AcqTrackReconstructor.cxx:27
TObjArray * Volume
Definition: AcqTrackReconstructor.cxx:28
int Propagate(int *Rating, int iX, int iY, int iZ)
Definition: AcqTrackReconstructor.cxx:32
int NCellX
Definition: AcqTrackReconstructor.cxx:27
int MinRating
Definition: AcqTrackReconstructor.cxx:29
Definition: EdbCluster.h:19
Int_t GetSegment() const
Definition: EdbCluster.h:58
void SetSegment(int seg)
Definition: EdbCluster.h:49

Variable Documentation

◆ MinRating

int MinRating

◆ NCellX

int NCellX

◆ NCellY

int NCellY

◆ NCellZ

int NCellZ

◆ Volume

TObjArray* Volume