Belle II Software  release-05-02-19
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 379 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 495 of file ReadTSIMInfo.py.

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

◆ terminate()

def terminate (   self)
Write and close the file

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

◆ ncluster_neutral_t

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

ecl cluster w/o associated cdc track

Definition at line 412 of file ReadTSIMInfo.py.

◆ ncluster_t

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

ecl clusters

Definition at line 410 of file ReadTSIMInfo.py.

◆ npair_cc_t

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

back to back cluster pairs

Definition at line 440 of file ReadTSIMInfo.py.

◆ npair_tc_t

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

back to back track and cluster pairs

Definition at line 438 of file ReadTSIMInfo.py.


The documentation for this class was generated from the following file:
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:69
ClusterEfficiency.ClusterEfficiency.event
def event(self)
Definition: ClusterEfficiency.py:146
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:58