SND@LHC Software
Loading...
Searching...
No Matches
Mufi_monitoring.Mufi_largeVSsmall Class Reference
Inheritance diagram for Mufi_monitoring.Mufi_largeVSsmall:
Collaboration diagram for Mufi_monitoring.Mufi_largeVSsmall:

Public Member Functions

 Init (self, options, monitor)
 
 ExecuteEvent (self, event)
 
 Plot (self)
 

Public Attributes

 M
 

Detailed Description

 make correlation plots of small and large sipms for US and Veto"

Definition at line 807 of file Mufi_monitoring.py.

Member Function Documentation

◆ ExecuteEvent()

Mufi_monitoring.Mufi_largeVSsmall.ExecuteEvent (   self,
  event 
)

Definition at line 832 of file Mufi_monitoring.py.

832 def ExecuteEvent(self,event):
833 W = self.M.Weight
834 M = self.M
835 h = self.M.h
836 sdict = self.M.sdict
837 for aHit in event.Digi_MuFilterHits:
838 if not aHit.isValid(): continue
839 detID = aHit.GetDetectorID()
840 s = detID//10000
841 bar = (detID%1000)
842 if s>2: continue
843 l = (detID%10000)//1000 # plane number
844 sumL,sumS,SumL,SumS = 0,0,0,0
845 allChannels = M.map2Dict(aHit,'GetAllSignals',mask=False)
846 nS = 0
847 nL = 0
848 for c in allChannels:
849 if s==2 and self.M.smallSiPMchannel(c) :
850 sumS+= allChannels[c]
851 nS += 1
852 else:
853 sumL+= allChannels[c]
854 nL+=1
855 if nL>0: SumL=sumL/nL
856 if nS>0: SumS=sumS/nS
857 rc = h['sVSl_'+str(l)].Fill(SumS,SumL,W)
858 rc = h['SVSl_'+str(l)].Fill(sumS/4.,sumL/12.,W)
859#
860 for side in ['L','R']:
861 offset = 0
862 if side=='R': offset = 8
863 for i1 in range(offset,offset+7):
864 if not i1 in allChannels: continue
865 qdc1 = allChannels[i1]
866 for i2 in range(i1+1,offset+8):
867 if not (i2) in allChannels: continue
868 if s==2 and self.M.smallSiPMchannel(i1): tag = 's'+str(i1-offset)
869 else: tag = 'l'+str(i1-offset)
870 if s==2 and self.M.smallSiPMchannel(i2): tag += 's'+str(i2-offset)
871 else: tag += 'l'+str(i2-offset)
872 qdc2 = allChannels[i2]
873 rc = h[sdict[s]+'cor'+tag+'_'+side+str(l)].Fill(qdc1,qdc2,W)
874 rc = h[sdict[s]+'cor'+tag+'_'+side+str(l)+str(bar)].Fill(qdc1,qdc2,W)
875 allChannels.clear()
876

◆ Init()

Mufi_monitoring.Mufi_largeVSsmall.Init (   self,
  options,
  monitor 
)

Definition at line 811 of file Mufi_monitoring.py.

811 def Init(self,options,monitor):
812 self.M = monitor
813 sdict = self.M.sdict
814 h = self.M.h
815 run = ROOT.FairRunAna.Instance()
816 for S in [1,2]:
817 for l in range(monitor.systemAndPlanes[S]):
818 ut.bookHist(h,'SVSl_'+str(l),'QDC large vs small sum',200,0.,200.,200,0.,200.)
819 ut.bookHist(h,'sVSl_'+str(l),'QDC large vs small average',200,0.,200.,200,0.,200.)
820 for side in ['L','R']:
821 for i1 in range(monitor.systemAndPlanes[1]+monitor.systemAndPlanes[2]):
822 for i2 in range(i1+1,8):
823 tag=''
824 if S==2 and monitor.smallSiPMchannel(i1): tag = 's'+str(i1)
825 else: tag = 'l'+str(i1)
826 if S==2 and monitor.smallSiPMchannel(i2): tag += 's'+str(i2)
827 else: tag += 'l'+str(i2)
828 ut.bookHist(h,sdict[S]+'cor'+tag+'_'+side+str(l),'QDC channel i vs channel j',200,0.,200.,200,0.,200.)
829 for bar in range(monitor.systemAndBars[S]):
830 ut.bookHist(h,sdict[S]+'cor'+tag+'_'+side+str(l)+str(bar),'QDC channel i vs channel j',200,0.,200.,200,0.,200.)
831

◆ Plot()

Mufi_monitoring.Mufi_largeVSsmall.Plot (   self)

Definition at line 877 of file Mufi_monitoring.py.

877 def Plot(self):
878 h = self.M.h
879 sdict = self.M.sdict
880 systemAndPlanes = self.M.systemAndPlanes
881 ut.bookCanvas(h,'TSL','',1800,1400,3,2)
882 ut.bookCanvas(h,'STSL','',1800,1400,3,2)
883 S=2
884 for l in range(systemAndPlanes[S]):
885 tc = h['TSL'].cd(l+1)
886 tc.SetLogz(1)
887 aHist = h['sVSl_'+str(l)]
888 aHist.SetTitle(';small SiPM QCD av:large SiPM QCD av')
889 nmax = aHist.GetBinContent(aHist.GetMaximumBin())
890 aHist.SetMaximum( 0.1*nmax )
891 tc = h['sVSl_'+str(l)].Draw('colz')
892 self.M.myPrint(h['TSL'],"largeSiPMvsSmallSiPM",subdir='mufilter/expert')
893 for l in range(systemAndPlanes[S]):
894 tc = h['STSL'].cd(l+1)
895 tc.SetLogz(1)
896 aHist = h['SVSl_'+str(l)]
897 aHist.SetTitle(';small SiPM QCD sum/2:large SiPM QCD sum/6')
898 nmax = aHist.GetBinContent(aHist.GetMaximumBin())
899 aHist.SetMaximum( 0.1*nmax )
900 tc = h['SVSl_'+str(l)].Draw('colz')
901 self.M.myPrint(h['STSL'],"SumlargeSiPMvsSmallSiPM",subdir='mufilter/expert')
902 for S in [1,2]:
903 for l in range(systemAndPlanes[S]):
904 for side in ['L','R']:
905 if S == 1 and l == 2 and side == 'R': continue
906 ut.bookCanvas(h,sdict[S]+'cor'+side+str(l),'',1800,1400,7,4)
907 k=1
908 for i1 in range(7):
909 for i2 in range(i1+1,8):
910 tag=''
911 if S==2 and self.M.smallSiPMchannel(i1): tag = 's'+str(i1)
912 else: tag = 'l'+str(i1)
913 if S==2 and self.M.smallSiPMchannel(i2): tag += 's'+str(i2)
914 else: tag += 'l'+str(i2)
915 tc = h[sdict[S]+'cor'+side+str(l)].cd(k)
916 for bar in range(self.M.systemAndBars[S]):
917 if bar == 0: h[sdict[S]+'cor'+tag+'_'+side+str(l)+str(bar)].Draw('colz')
918 else: h[sdict[S]+'cor'+tag+'_'+side+str(l)+str(bar)].Draw('colzsame')
919 k+=1
920 self.M.myPrint(h[sdict[S]+'cor'+side+str(l)],'QDCcor'+side+str(l),subdir='mufilter/expert')
921

Member Data Documentation

◆ M

Mufi_monitoring.Mufi_largeVSsmall.M

Definition at line 812 of file Mufi_monitoring.py.


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