SND@LHC Software
Loading...
Searching...
No Matches
ScifiCluster.ScifiCluster Class Reference

Class of SciFi Tracker ######################################################. More...

Public Member Functions

 __init__ (self, DetID, Xraw, Yraw, Edep, Xshift=0, Yshift=0)
 
 SetLYRange (self, ly_min, ly_max)
 
 SetSipmPosition (self, sipm_hor_pos, sipm_vert_pos)
 
 SetSipmIsReversed (self, is_sipm_hor_reversed, is_sipm_vert_reversed)
 
 ClusterGen (self, Print=False)
 
 GetType (self)
 
 GetNSiPMs (self)
 
 GetXYZ (self)
 

Public Attributes

 DetID
 
 Xraw
 
 Yraw
 
 Edep
 
 ly
 
 cluster
 
 station
 
 matnum
 
 Xrec
 
 Yrec
 
 is_created
 
 recovery_globalpos
 
 delta
 
 sipm_hor_pos
 
 sipm_vert_pos
 
 is_sipm_hor_reversed
 
 is_sipm_vert_reversed
 
 ly_min
 
 ly_max
 
 Xshift
 
 Yshift
 

Detailed Description

Class of SciFi Tracker ######################################################.

Definition at line 636 of file ScifiCluster.py.

Constructor & Destructor Documentation

◆ __init__()

ScifiCluster.ScifiCluster.__init__ (   self,
  DetID,
  Xraw,
  Yraw,
  Edep,
  Xshift = 0,
  Yshift = 0 
)

Definition at line 638 of file ScifiCluster.py.

638 def __init__(self, DetID, Xraw, Yraw, Edep, Xshift=0, Yshift=0):
639 self.DetID = DetID
640 self.Xraw = Xraw
641 self.Yraw = Yraw
642 self.Edep = Edep * 1000 # to MeV
643 self.ly = 0.
644 self.cluster = []
645 self.station = 0
646 self.matnum = 0
647 self.Xrec = None
648 self.Yrec = None
649 self.is_created = False
650 # Only to check the edge events
651 self.recovery_globalpos = 0
652 self.delta = -13
653 # The default values should be set
654 self.sipm_hor_pos = +1 # +1 at X = +len_vert / 2
655 self.sipm_vert_pos = +1 #-1 at Y = -len_hor / 2
656 self.is_sipm_hor_reversed = False # Channels and axis are co-directional or not
657 self.is_sipm_vert_reversed = False
658 self.ly_min = 4.5
659 self.ly_max = 104
660 self.Xshift = Xshift
661 self.Yshift = Yshift
662

Member Function Documentation

◆ ClusterGen()

ScifiCluster.ScifiCluster.ClusterGen (   self,
  Print = False 
)

Definition at line 676 of file ScifiCluster.py.

676 def ClusterGen(self, Print = False):
677
678 if GetMatType(self.DetID) is False:
679 return False
680 elif GetMatType(self.DetID) == 1: # vert
681 first_coord = self.Xraw
682 second_coord = self.Yraw
683 sipm_pos = self.sipm_vert_pos
684 is_sipm_reversed = self.is_sipm_hor_reversed
685 if Print: print("Detector ID -> " + str(self.DetID) + " -> Vertical")
686 elif GetMatType(self.DetID) == 0: # hor
687 first_coord = self.Yraw
688 second_coord = self.Xraw
689 sipm_pos = self.sipm_hor_pos
690 is_sipm_reversed = self.is_sipm_vert_reversed
691 if Print: print("Detector ID -> " + str(self.DetID) + " -> Horizontal")
692 self.matnum = GetMatNum(self.DetID)
693 nmats = GetMatQty()
694 matlen = GetMatLength()
695 self.station = GetStationNum(self.DetID)
696 if Print: print("First coordinate = " + str(first_coord))
697 localpos = global_to_local(self.DetID, first_coord)
698 if Print: print("Local Pos = " + str(localpos))
699
700 if sipm_pos == +1:
701 distance = GetMatLength()/2. - second_coord
702 elif sipm_pos == -1:
703 distance = GetMatLength()/2. + second_coord
704
705 channelpos = cm_to_channel(localpos, reverse=is_sipm_reversed)
706
707 self.ly = int(round(
708 edep_to_ly(self.Edep) * ly_attenuation(distance)
709 ))
710
711 if not self.ly_min < self.ly < self.ly_max:
712 return False
713
714 cluster_width = int(round(cluster_width_random(distance, ly=self.ly)))
715 if Print: print("Cluster width: " + str(cluster_width))
716 if Print: print("Channel position: " + str(channelpos))
717 cluster = create_cluster(self.ly, cluster_width, channelpos)
718
719 check_wall = fcheck_wall(cluster,channelpos)
720 #Cluster is returned if wmp is not in the 2 channels that are entirely in the mat gaps
721 if check_wall!=False:
722 self.is_created=True
723 cluster=check_wall
724 else:
725 self.is_created=False
726
727 wmp_of_cluster = weigthed_mean_pos(cluster)
728 recovery_localpos = channel_to_cm(wmp_of_cluster, reverse=is_sipm_reversed)
729
730 self.recovery_globalpos = local_to_global(self.DetID, recovery_localpos)
731 if Print: print("Position readout by the SiPMs => " + str(self.recovery_globalpos))
732 self.delta = first_coord - self.recovery_globalpos
733
734 # Some edge events may be reconstructed incorrectly
735 if abs(self.delta) > 1:
736 return False
737
738 if GetMatType(self.DetID) == 1: # vert
739 self.Xrec = self.recovery_globalpos
740 elif GetMatType(self.DetID) == 0: # hor
741 self.Yrec = self.recovery_globalpos
742

◆ GetNSiPMs()

ScifiCluster.ScifiCluster.GetNSiPMs (   self)

Definition at line 750 of file ScifiCluster.py.

750 def GetNSiPMs(self):
751
752 return GetSiPMs() #n_sipms
753

◆ GetType()

ScifiCluster.ScifiCluster.GetType (   self)

Definition at line 743 of file ScifiCluster.py.

743 def GetType(self):
744
745 if GetMatType(self.DetID) == 0: #hor
746 return 0
747 else: #vert
748 return 1
749

◆ GetXYZ()

ScifiCluster.ScifiCluster.GetXYZ (   self)

Definition at line 754 of file ScifiCluster.py.

754 def GetXYZ(self):
755
756 if self.is_created:
757 return self.Xrec, self.Yrec, self.station
758 else:
759 return None, None, None

◆ SetLYRange()

ScifiCluster.ScifiCluster.SetLYRange (   self,
  ly_min,
  ly_max 
)

Definition at line 663 of file ScifiCluster.py.

663 def SetLYRange(self, ly_min, ly_max):
664 self.ly_min = ly_min
665 self.ly_max = ly_max
666

◆ SetSipmIsReversed()

ScifiCluster.ScifiCluster.SetSipmIsReversed (   self,
  is_sipm_hor_reversed,
  is_sipm_vert_reversed 
)

Definition at line 671 of file ScifiCluster.py.

671 def SetSipmIsReversed(self, is_sipm_hor_reversed, is_sipm_vert_reversed):
672 self.is_sipm_hor_reversed = is_sipm_hor_reversed
673 self.is_sipm_vert_reversed = is_sipm_vert_reversed
674

◆ SetSipmPosition()

ScifiCluster.ScifiCluster.SetSipmPosition (   self,
  sipm_hor_pos,
  sipm_vert_pos 
)

Definition at line 667 of file ScifiCluster.py.

667 def SetSipmPosition(self, sipm_hor_pos, sipm_vert_pos):
668 self.sipm_hor_pos = sipm_hor_pos
669 self.sipm_vert_pos = sipm_vert_pos
670

Member Data Documentation

◆ cluster

ScifiCluster.ScifiCluster.cluster

Definition at line 644 of file ScifiCluster.py.

◆ delta

ScifiCluster.ScifiCluster.delta

Definition at line 652 of file ScifiCluster.py.

◆ DetID

ScifiCluster.ScifiCluster.DetID

Definition at line 639 of file ScifiCluster.py.

◆ Edep

ScifiCluster.ScifiCluster.Edep

Definition at line 642 of file ScifiCluster.py.

◆ is_created

ScifiCluster.ScifiCluster.is_created

Definition at line 649 of file ScifiCluster.py.

◆ is_sipm_hor_reversed

ScifiCluster.ScifiCluster.is_sipm_hor_reversed

Definition at line 656 of file ScifiCluster.py.

◆ is_sipm_vert_reversed

ScifiCluster.ScifiCluster.is_sipm_vert_reversed

Definition at line 657 of file ScifiCluster.py.

◆ ly

ScifiCluster.ScifiCluster.ly

Definition at line 643 of file ScifiCluster.py.

◆ ly_max

ScifiCluster.ScifiCluster.ly_max

Definition at line 659 of file ScifiCluster.py.

◆ ly_min

ScifiCluster.ScifiCluster.ly_min

Definition at line 658 of file ScifiCluster.py.

◆ matnum

ScifiCluster.ScifiCluster.matnum

Definition at line 646 of file ScifiCluster.py.

◆ recovery_globalpos

ScifiCluster.ScifiCluster.recovery_globalpos

Definition at line 651 of file ScifiCluster.py.

◆ sipm_hor_pos

ScifiCluster.ScifiCluster.sipm_hor_pos

Definition at line 654 of file ScifiCluster.py.

◆ sipm_vert_pos

ScifiCluster.ScifiCluster.sipm_vert_pos

Definition at line 655 of file ScifiCluster.py.

◆ station

ScifiCluster.ScifiCluster.station

Definition at line 645 of file ScifiCluster.py.

◆ Xraw

ScifiCluster.ScifiCluster.Xraw

Definition at line 640 of file ScifiCluster.py.

◆ Xrec

ScifiCluster.ScifiCluster.Xrec

Definition at line 647 of file ScifiCluster.py.

◆ Xshift

ScifiCluster.ScifiCluster.Xshift

Definition at line 660 of file ScifiCluster.py.

◆ Yraw

ScifiCluster.ScifiCluster.Yraw

Definition at line 641 of file ScifiCluster.py.

◆ Yrec

ScifiCluster.ScifiCluster.Yrec

Definition at line 648 of file ScifiCluster.py.

◆ Yshift

ScifiCluster.ScifiCluster.Yshift

Definition at line 661 of file ScifiCluster.py.


The documentation for this class was generated from the following file: