Belle II Software  release-06-00-14
CreateLogics Class Reference
Inheritance diagram for CreateLogics:
Collaboration diagram for CreateLogics:

Public Member Functions

def event (self)
 
def terminate (self)
 

Static Public Attributes

 file = ROOT.TFile(argvs[2], 'recreate')
 the output file
 
 tgrl = ROOT.TTree('tgrl', 'tree with GRL_Logic')
 the tree in the output file
 
 ntrk_2dfinder_t = array('i', [-1])
 #2d finder tracks
 
 ntrk_2dfitter_t = array('i', [-1])
 #2d fitter tracks
 
 ntrk_3dfitter_t = array('i', [-1])
 #3d fitter tracks
 
 ntrk_NN_t = array('i', [-1])
 #NN tracks
 
 ntrk_2Dmatch_t = array('i', [-1])
 #2d matched tracks
 
 ntrk_3Dmatch_t = array('i', [-1])
 #3d matched tracks
 
 max_deltphi_2dfinder_t = array('f', [0.0])
 #max phi angle between two 2d finder tracks
 
 cpair_t = array('i', 8 * [0])
 #cluster pairs with different energy threshold
 
int ncomp_clu = 3
 #array components
 
 etot_t = array('f', [0.0])
 the total deposited cluster energy in ecl
 
 ncluster_1000b_t = array('i', [-1])
 #ecl cluster with threshold >1.0GeV, exclude TC ID 1,2, 17
 
 ncluster_2000e_t = array('i', [-1])
 
 ncluster_t = array('i', [-1])
 
 ncluster_neutral_t = array('i', [-1])
 
 max_cluster_neutral_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the largest energetic ecl neutral cluster
 
 max_cms_cluster_neutral_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the largest energetic ecl neutral cluster in CMS
 
 max_cluster_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the largest energetic ecl cluster
 
 max_cms_cluster_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the largest energetic ecl cluster in CMS
 
 smax_cluster_neutral_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the secondary energetic ecl neutral cluster
 
 smax_cms_cluster_neutral_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the secondary energetic ecl neutral cluster in CMS
 
 smax_cluster_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the secondary energetic ecl cluster
 
 smax_cms_cluster_t = array('f', ncomp_clu * [0.0])
 [energy, theta, phi] of the secondary energetic ecl cluster in CMS
 
 max_deltphi_cluster_t = array('f', [0.0])
 max delt phi angle between two clusters
 
 time_cluster_t = array('f', 100 * [-99999.])
 the timing of clusters
 
 ntrk_klm_t = array('i', [-1])
 #KLM track
 
 nhit_klm_t = array('i', [-1])
 #KLM hits
 
 npair_tc_t = array('i', [-1])
 
 npair_cc_t = array('i', [-1])
 
int nbha_var = 5
 #array components
 
 bhabha_t = array('i', [0])
 bhabha veto logic, 1: bhabha, 0: non bhabha
 
 sbhabha_t = array('i', [0])
 bhabha with single track veto logic, 1: bhabha, 0: non bhabha
 
 eclbhabha_t = array('i', [0])
 eclbhabha veto logic, 1: bhabha, 0: non bhabha
 
 bhabha_var_t = array('f', nbha_var * [0.0])
 variables used in bhabha logic, [Delt_theta, Delt_phi, E1, E2, E1+E2]
 
 eclbhabha_var_t = array('f', nbha_var * [0.0])
 variables used in eclbhabha logic, [Delt_theta, Delt_phi, E1, E2, E1+E2]
 

Detailed Description

This module is to calculate some variables which are useful for the trigger development

Definition at line 387 of file ReadTSIMInfo.py.

Member Function Documentation

◆ event()

def event (   self)
MCPart = Belle2.PyStoreArray('MCParticles')
if len(MCPart)>=4:
    self.eplus_t[0]=Theta_MCTruth(MCPart[2])
    self.eminus_t[0]=Theta_MCTruth(MCPart[3])
    if self.eplus_t[0] > self.eminus_t[0]:
         self.efrd_t[0]=self.eminus_t[0]
         self.ebkd_t[0]=self.eplus_t[0]
    else:
         self.efrd_t[0]=self.eplus_t[0]
         self.ebkd_t[0]=self.eminus_t[0]
count_part = Count_part_inDetector(MCPart)
self.n_par_t[0]=count_part[0]
self.n_par_t[1]=count_part[1]
count_mcpart = Count_mcpart(MCPart)
self.n_mcpar_t[0]=count_mcpart[0]
self.n_mcpar_t[1]=count_mcpart[1]

Definition at line 503 of file ReadTSIMInfo.py.

503  def event(self):
504  """
505  MCPart = Belle2.PyStoreArray('MCParticles')
506  if len(MCPart)>=4:
507  self.eplus_t[0]=Theta_MCTruth(MCPart[2])
508  self.eminus_t[0]=Theta_MCTruth(MCPart[3])
509  if self.eplus_t[0] > self.eminus_t[0]:
510  self.efrd_t[0]=self.eminus_t[0]
511  self.ebkd_t[0]=self.eplus_t[0]
512  else:
513  self.efrd_t[0]=self.eplus_t[0]
514  self.ebkd_t[0]=self.eminus_t[0]
515  count_part = Count_part_inDetector(MCPart)
516  self.n_par_t[0]=count_part[0]
517  self.n_par_t[1]=count_part[1]
518  count_mcpart = Count_mcpart(MCPart)
519  self.n_mcpar_t[0]=count_mcpart[0]
520  self.n_mcpar_t[1]=count_mcpart[1]
521  """
522  trk_2d_finder = Belle2.PyStoreArray('TRG2DFinderTracks')
523  self.ntrk_2dfinder_t[0] = len(trk_2d_finder)
524  trk_2d_fitter = Belle2.PyStoreArray('TRG2DFitterTracks')
525  self.ntrk_2dfitter_t[0] = len(trk_2d_fitter)
526  trk_3d_fitter = Belle2.PyStoreArray('TRG3DFitterTracks')
527  self.ntrk_3dfitter_t[0] = len(trk_3d_fitter)
528  tracks = Belle2.PyStoreArray('TRGNNTracks')
529  self.ntrk_NN_t[0] = len(tracks)
530 
531  # clusters
532  clusters_original = Belle2.PyStoreArray('TRGECLClusters')
533  eventtime = Belle2.PyStoreArray('TRGECLTrgs')
534  # get clusters list in time window [-100,100]
535  clusters = Time_Window(clusters_original, eventtime)
536  self.ncluster_t[0] = len(clusters)
537  # get the cluster timing before time window requirement
538  time_clu_list = Time_Cluster(clusters_original, eventtime)
539  for i in range(len(time_clu_list)):
540  if i < 100:
541  self.time_cluster_t[i] = time_clu_list[i]
542 
543  clusters_100 = Cluster_Threshold(clusters, 0.1, False)
544  clusters_100_cms = Cluster_Threshold(clusters, 0.1, False)
545  clusters_300_cms = Cluster_Threshold(clusters, 0.3, False)
546  clusters_400_cms = Cluster_Threshold(clusters, 0.4, False)
547  clusters_500_cms = Cluster_Threshold(clusters, 0.5, False)
548  clusters_700_cms = Cluster_Threshold(clusters, 0.7, False)
549  clusters_1000_cms = Cluster_Threshold(clusters, 1.0, False)
550  clusters_2000_cms = Cluster_Threshold(clusters, 2.0, False)
551  clusters_2500_cms = Cluster_Threshold(clusters, 2.5, False)
552  self.cpair_t[0] = Back_to_Back(clusters, clusters)
553  self.cpair_t[1] = Back_to_Back(clusters_300_cms, clusters)
554  self.cpair_t[2] = Back_to_Back(clusters_400_cms, clusters)
555  self.cpair_t[3] = Back_to_Back(clusters_500_cms, clusters)
556  self.cpair_t[4] = Back_to_Back(clusters_700_cms, clusters)
557  self.cpair_t[5] = Back_to_Back(clusters_1000_cms, clusters)
558  self.cpair_t[6] = Back_to_Back(clusters_2000_cms, clusters)
559  self.cpair_t[7] = Back_to_Back(clusters_2500_cms, clusters)
560 
561  klmtrkcol = Belle2.PyStoreArray('TRGKLMTracks')
562  self.ntrk_klm_t[0] = len(klmtrkcol)
563  klmhitcol = Belle2.PyStoreArray('TRGKLMHits')
564  self.nhit_klm_t[0] = len(klmhitcol)
565 
566  matchlist = Belle2.PyStoreArray('TRG3DMatchTracks')
567  self.ntrk_3Dmatch_t[0] = len(matchlist)
568 
569  trginfo = Belle2.PyStoreObj('TRGGRLObjects')
570  self.npair_tc_t[0] = trginfo.getNbbTrkCluster()
571  self.npair_cc_t[0] = trginfo.getNbbCluster()
572  self.ncluster_1000b_t[0] = trginfo.getNhighcluster2()
573  self.ncluster_2000e_t[0] = trginfo.getNhighcluster4()
574  self.max_deltphi_2dfinder_t[0] = Max_DeltPhi_trk(trk_2d_finder)
575 
576  neutral_clusters = NeutralCluster(clusters)
577  self.ncluster_neutral_t[0] = len(neutral_clusters)
578  max_cluster_neu = Max_Cluster(neutral_clusters, False, 0)
579  max_cluster = Max_Cluster(clusters, False, 0)
580  # max_cms_cluster_neu = Max_Cluster(neutral_clusters, False, 0)
581  # max_cms_cluster = Max_Cluster(clusters, False, 0)
582  smax_cluster_neu = Max_Cluster(neutral_clusters, False, 1)
583  smax_cluster = Max_Cluster(clusters, False, 1)
584  # smax_cms_cluster_neu = Max_Cluster(neutral_clusters, False, 1)
585  # smax_cms_cluster = Max_Cluster(clusters, False, 1)
586  for i in range(self.ncomp_clu):
587  self.max_cluster_neutral_t[i] = max_cluster_neu[i]
588  # self.max_cms_cluster_neutral_t[i] = max_cms_cluster_neu[i]
589  self.max_cluster_t[i] = max_cluster[i]
590  # self.max_cms_cluster_t[i] = max_cms_cluster[i]
591  self.smax_cluster_neutral_t[i] = smax_cluster_neu[i]
592  # self.smax_cms_cluster_neutral_t[i] = smax_cms_cluster_neu[i]
593  self.smax_cluster_t[i] = smax_cluster[i]
594  # self.smax_cms_cluster_t[i] = smax_cms_cluster[i]
595 
596  self.etot_t[0] = Etot_Cluster(clusters)
597 
598  # bhabha
599  bhabhaveto_1 = BhabhaVeto1(matchlist)
600  bha_logic = 0
601  for bha in bhabhaveto_1:
602  if math.fabs(bha[0]) < 50 and math.fabs(bha[0]) > 10 and math.fabs(bha[1]) < 20:
603  if bha[2] > 2.0 and bha[3] > 2.0 and bha[4] > 6.0:
604  if bha[2] > 3.0 or bha[3] > 3.0:
605  if len(trk_2d_finder) == 2:
606  bha_logic = 1
607  self.bhabha_t[0] = bha_logic
608 
609  if len(bhabhaveto_1) >= 1:
610  for i in range(self.nbha_var):
611  self.bhabha_var_t[i] = bhabhaveto_1[0][i]
612 
613  # eclbhabha
614  eclbhabhaveto = eclBhabhaVeto(clusters)
615  eclbha_logic = 0
616  for eclbha in eclbhabhaveto:
617  if math.fabs(eclbha[0]) < 50 and math.fabs(eclbha[1]) < 50:
618  if eclbha[2] > 2.0 and eclbha[3] > 2.0 and eclbha[4] > 6.0:
619  if eclbha[2] > 3.0 or eclbha[3] > 3.0:
620  eclbha_logic = 1
621  self.eclbhabha_t[0] = eclbha_logic
622 
623  # sbhahba
624  sbha_logic = 0
625  if len(trk_2d_finder) == 1:
626  if eclbha_logic == 1:
627  ecol = SBhabhaVeto(matchlist)
628  for i, etr in ecol:
629  if etr[i] > 1.0:
630  sbha_logic = 1
631  self.sbhabha_t[0] = sbha_logic
632 
633  self.max_deltphi_cluster_t[0] = Max_DeltPhi_cluster(clusters)
634  if len(eclbhabhaveto) >= 1:
635  for i in range(self.nbha_var):
636  self.eclbhabha_var_t[i] = eclbhabhaveto[0][i]
637  self.tgrl.Fill()
638 
a (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:56
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ terminate()

def terminate (   self)
Write and close the file

Definition at line 639 of file ReadTSIMInfo.py.

Member Data Documentation

◆ ncluster_2000e_t

ncluster_2000e_t = array('i', [-1])
static

ecl cluster with threshold >2.0GeV in TC ID 1, 17

Definition at line 416 of file ReadTSIMInfo.py.

◆ ncluster_neutral_t

ncluster_neutral_t = array('i', [-1])
static

ecl cluster w/o associated cdc track

Definition at line 420 of file ReadTSIMInfo.py.

◆ ncluster_t

ncluster_t = array('i', [-1])
static

ecl clusters

Definition at line 418 of file ReadTSIMInfo.py.

◆ npair_cc_t

npair_cc_t = array('i', [-1])
static

back to back cluster pairs

Definition at line 448 of file ReadTSIMInfo.py.

◆ npair_tc_t

npair_tc_t = array('i', [-1])
static

back to back track and cluster pairs

Definition at line 446 of file ReadTSIMInfo.py.


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