Belle II Software  release-08-01-10
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])
 number of 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])
 number of cluster pairs with different energy threshold
 
int ncomp_clu = 3
 number of array components
 
 etot_t = array('f', [0.0])
 the total deposited cluster energy in ecl
 
 ncluster_1000b_t = array('i', [-1])
 number of 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])
 number of KLM tracks
 
 nhit_klm_t = array('i', [-1])
 number of KLM hits
 
 npair_tc_t = array('i', [-1])
 
 npair_cc_t = array('i', [-1])
 
int nbha_var = 5
 number of 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 362 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 478 of file ReadTSIMInfo.py.

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

◆ terminate()

def terminate (   self)
Write and close the file

Definition at line 612 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 391 of file ReadTSIMInfo.py.

◆ ncluster_neutral_t

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

ecl cluster w/o associated cdc track

Definition at line 395 of file ReadTSIMInfo.py.

◆ ncluster_t

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

ecl clusters

Definition at line 393 of file ReadTSIMInfo.py.

◆ npair_cc_t

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

back to back cluster pairs

Definition at line 423 of file ReadTSIMInfo.py.

◆ npair_tc_t

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

back to back track and cluster pairs

Definition at line 421 of file ReadTSIMInfo.py.


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