From 7165dd7a3197cee44f71550374d4fd7496f9eeb2 Mon Sep 17 00:00:00 2001
From: Sourav Dey <sdey@post.kek.jp>
Date: Fri, 16 Feb 2024 14:17:17 +0900
Subject: [PATCH] added topoana instructions

---
 PartialReco_Dpluspi.card                     | 121 +++++++++
 README.md                                    |  25 +-
 continuumsupression/README.txt~              |   3 -
 continuumsupression/checkjobs.sh~            | 179 --------------
 continuumsupression/mytestntuplemaker_mc.py~ | 247 -------------------
 topoana.sh                                   |  64 +++++
 6 files changed, 209 insertions(+), 430 deletions(-)
 create mode 100644 PartialReco_Dpluspi.card
 delete mode 100644 continuumsupression/README.txt~
 delete mode 100644 continuumsupression/checkjobs.sh~
 delete mode 100644 continuumsupression/mytestntuplemaker_mc.py~
 create mode 100644 topoana.sh

diff --git a/PartialReco_Dpluspi.card b/PartialReco_Dpluspi.card
new file mode 100644
index 0000000..4559f37
--- /dev/null
+++ b/PartialReco_Dpluspi.card
@@ -0,0 +1,121 @@
+% Names of input root files
+{
+ dummy.root 
+}
+
+% TTree name
+{
+ dpluspi
+}
+
+% Component analysis --- decay trees
+{
+  Y 100
+}
+
+% Process charge conjugate objects together (Two options: Y and N. Default: N)
+{
+  Y
+}
+
+
+% PDG code of ISR photons (Default: 222222222)
+{
+  222222222
+}
+
+% PDG code of FSR photons (Default: -22)
+{
+  -22
+}
+% Ignore ISR photons (Three options: Ys, Yg and N. Default: N)
+{
+ Yg
+}
+
+% Ignore FSR photons (Three options: Ys, Yg and N. Default: N)
+{
+ Yg
+}
+
+
+% Signal identification --- decay branches
+{
+
+  D+ --> K- pi+ pi+    & DplusisSig
+  D0 --> K- pi+     &  D0isSig
+}
+
+
+% Signal identification --- cascade decay branches
+{
+  0 &  B- --> D0   pi-   &  -1 & B2D0pim
+  1 &  D0 --> K- pi+     &  0
+
+
+  0 &  B- --> D0   K-   &  -1 & B2D0Km
+  1 &  D0 --> K- pi+     &  0
+
+  0 &  B- --> D*0   pi-   &  -1 & B2Dst0pim_pi0
+  1 &  D*0 --> D0 pi0     &  0
+  2 &  D0 --> K- pi+     &  1
+
+  0 &  B- --> D*0   pi-   &  -1 & B2Dst0pim_gamma
+  1 &  D*0 --> D0 gamma     &  0
+  2 &  D0 --> K- pi+     &  1
+
+  0 &  B- --> D*0   K-   &  -1 & B2Dst0Km_pi0
+  1 &  D*0 --> D0 pi0     &  0
+  2 &  D0 --> K- pi+     &  1
+
+  0 &  B- --> D*0   K-   &  -1 & B2Dst0Km_gamma
+  1 &  D*0 --> D0 gamma     &  0
+  2 &  D0 --> K- pi+     &  1
+
+  0 &  B- --> D0   rho-   &  -1 & B2D0rhom
+  1 &  D0 --> K- pi+     &  0
+
+
+  0 &  anti-B0 --> D+   pi-   &  -1 & B2Dppim
+  1 &  D+ --> K- pi+ pi+    &  0
+
+  0 &  anti-B0 --> D+   K-   &  -1 & B2DpKm
+  1 &  D+ --> K- pi+ pi+    &  0
+
+  0 &  anti-B0 --> D+   rho-   &  -1 & B2Dprhom
+  1 &  D+ --> K- pi+ pi+    &  0
+
+  0 &  anti-B0 --> D*+   pi-   &  -1 & B2Dstppim_pi0 
+  1 &  D*+ --> D+ pi0     &  0
+  2 &  D+ --> K- pi+ pi+    &  1
+
+  0 &  anti-B0 --> D*+   pi-   &  -1 & B2Dstppim_gamma
+  1 &  D*+ --> D+ gamma     &  0
+  2 &  D+ --> K- pi+ pi+    &  1
+
+  0 &  anti-B0 --> D*+   K-   &  -1 & B2DstpKm_pi0   
+  1 &  D*+ --> D+ pi0     &  0
+  2 &  D+ --> K- pi+ pi+    &  1
+
+  0 &  anti-B0 --> D*+   K-   &  -1 & B2DstpKm_gamma
+  1 &  D*+ --> D+ gamma     &  0
+  2 &  D+ --> K- pi+ pi+    &  1
+
+  0 &  anti-B0 --> D+   K*-   &  -1 & B2DpKstm
+  1 &  D+ --> K- pi+ pi+    &  0
+
+  0 &  anti-B0 --> D*+   pi-   &  -1 & B2Dstppim_piplus
+  1 &  D*+ --> D0 pi+     &  0
+  2 &  D0 --> K- pi+     &  1
+
+  0 &  anti-B0 --> D*+   K-   &  -1 & B2DstpKm_piplus
+  1 &  D*+ --> D0 pi+     &  0
+  2 &  D0 --> K- pi+     &  1
+
+}
+
+% Main name of output files (Default: Main name of the card file)
+{
+  
+}
+
diff --git a/README.md b/README.md
index 687173a..7dc6066 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,24 @@
-Measurement of the Ratio of Branching Fractions of B0->D+pi- and B0->D*+pi-
\ No newline at end of file
+Measurement of the Ratio of Branching Fractions of B0->D+pi- and B0->D*+pi-
+
+Analysis Directories:
+
+Ntuplizers: /home/belle2/sdey/BRratio/
+
+Ntuples Location: /group/belle2/users2022/sdey/BRratio
+
+After ntuple production jobs are done, we apply topoana module on charged and mixed samples.
+
+Topoana installation instructions:
+
+git clone git@gitlab.desy.de:belle2/software/topoana.git
+cd topoana
+./Configure
+make
+./Setup Belle_II
+
+then add path to bash_profile
+currently, the topoana is installed in /group/belle2/users2022/sdey/BRratio/mytopoana
+
+example script: topoana.sh
+
+At the end, the outputs are: /group/belle2/users2022/sdey/BRratio/MC15ri/*.root
\ No newline at end of file
diff --git a/continuumsupression/README.txt~ b/continuumsupression/README.txt~
deleted file mode 100644
index b253bb0..0000000
--- a/continuumsupression/README.txt~
+++ /dev/null
@@ -1,3 +0,0 @@
-We borrowed these continuum supression scripts from soft pi0 efficiency analysis
-
-After completion of all the jobs. We take equal number of continuum events and non-continuum events for training purpose. The truncation of these root files according to their cross section is taken care of by 
diff --git a/continuumsupression/checkjobs.sh~ b/continuumsupression/checkjobs.sh~
deleted file mode 100644
index 658b67f..0000000
--- a/continuumsupression/checkjobs.sh~
+++ /dev/null
@@ -1,179 +0,0 @@
-
-echo "sdey_MC15ri_b_uubar1" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_uubar1  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_uubar2" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_uubar2  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_uubar3" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_uubar3  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_uubar4" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_uubar4  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_uubar5" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_uubar5  | tail -2 >> jobstatus.txt    
-
-#echo "sdey_MC15ri_b_uubar6" >> jobstatus.txt
-#gb2_job_status -p sdey_MC15ri_b_uubar6  | tail -2 >> jobstatus.txt    
-
-
-
-echo "sdey_MC15ri_b_ddbar1" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ddbar1  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ddbar2" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ddbar2  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ddbar3" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ddbar3  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ddbar4" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ddbar4  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ddbar5" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ddbar5  | tail -2 >> jobstatus.txt    
-
-#echo "sdey_MC15ri_b_ddbar6" >> jobstatus.txt
-#gb2_job_status -p sdey_MC15ri_b_ddbar6  | tail -2 >> jobstatus.txt
-
-
-
-echo "sdey_MC15ri_b_ssbar1" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ssbar1  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ssbar2" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ssbar2  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ssbar3" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ssbar3  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ssbar4" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ssbar4  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ssbar5" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ssbar5  | tail -2 >> jobstatus.txt    
-
-#echo "sdey_MC15ri_b_ssbar6" >> jobstatus.txt
-#gb2_job_status -p sdey_MC15ri_b_ssbar6  | tail -2 >> jobstatus.txt
-
-
-
-echo "sdey_MC15ri_b_ccbar1" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ccbar1  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ccbar2" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ccbar2  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ccbar3" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ccbar3  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ccbar4" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ccbar4  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_ccbar5" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_ccbar5  | tail -2 >> jobstatus.txt    
-
-#echo "sdey_MC15ri_b_ccbar6" >> jobstatus.txt
-#gb2_job_status -p sdey_MC15ri_b_ccbar6  | tail -2 >> jobstatus.txt
-
-
-
-
-echo "sdey_MC15ri_b_charged1" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged1  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged2" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged2  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged3" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged3  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged4" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged4  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged5" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged5  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged6" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged6  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged7" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged7  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged8" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged8  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged9" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged9  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged10" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged10  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged11" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged11  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged12" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged12  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged13" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged13  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged14" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged14  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_charged15" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_charged15  | tail -2 >> jobstatus.txt    
-
-
-
-
-
-echo "sdey_MC15ri_b_mixed1" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed1  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed2" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed2  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed3" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed3  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed4" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed4  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed5" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed5  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed6" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed6  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed7" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed7  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed8" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed8  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed9" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed9  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed10" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed10  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed11" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed11  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed12" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed12  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed13" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed13  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed14" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed14  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed15" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed15  | tail -2 >> jobstatus.txt    
-
-echo "sdey_MC15ri_b_mixed16" >> jobstatus.txt
-gb2_job_status -p sdey_MC15ri_b_mixed16  | tail -2 >> jobstatus.txt    
-
diff --git a/continuumsupression/mytestntuplemaker_mc.py~ b/continuumsupression/mytestntuplemaker_mc.py~
deleted file mode 100644
index 8d024fb..0000000
--- a/continuumsupression/mytestntuplemaker_mc.py~
+++ /dev/null
@@ -1,247 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-import basf2 as b2
-import modularAnalysis as ma
-from variables import variables
-from stdPhotons import stdPhotons
-from modularAnalysis import fillParticleList
-from modularAnalysis import matchMCTruth
-from modularAnalysis import fillParticleListFromMC
-from variables.MCGenTopo import mc_gen_topo
-import stdCharged as stdc
-import stdV0s as stdv0
-import vertex as vx
-import variables.utils as vu
-import variables.collections as vc
-import sys
-import os
-from vertex import kFit
-# create path
-my_path = b2.create_path()
-
-
-ma.inputMdstList('default', '', path=my_path)
-
-
-ma.fillParticleList(decayString='pi+:goodtracks',
-                    cut='pt> 0.1',
-                    path=my_path)
-ma.fillParticleList(decayString='gamma:goodclusters',
-                    cut='E > 0.1',
-                    path=my_path)
-
-# Second, create event shape
-ma.buildEventShape(inputListNames=['pi+:goodtracks', 'gamma:goodclusters'],
-                   allMoments=True,
-                   foxWolfram=True,
-                   harmonicMoments=True,
-                   cleoCones=True,
-                   thrust=True,
-                   collisionAxis=True,
-                   jets=True,
-                   sphericity=True,
-                   checkForDuplicates=False,
-                   path=my_path)
-
-# Apply a selection at the event level, to avoid
-# processing useless events
-ma.applyEventCuts(cut='foxWolframR2 < 0.4', path=my_path)
-
-variables.addAlias("CMclusterE", "useCMSFrame(clusterE)")
-variables.addAlias('CMpx', 'useCMSFrame(px)')
-variables.addAlias('CMpy', 'useCMSFrame(py)')
-variables.addAlias('CMpz', 'useCMSFrame(pz)')
-variables.addAlias('CMpt', 'useCMSFrame(pt)')
-variables.addAlias('CMp', 'useCMSFrame(p)')
-variables.addAlias('CME', 'useCMSFrame(E)')
-
-stdc.stdPi('all', path=my_path)
-stdc.stdK('all', path=my_path)
-
-# Calling standard particle lists
-ma.cutAndCopyList('pi+:slow', 'pi+:all', 'abs(d0) < 0.5 and abs(z0) < 2', path=my_path)
-ma.cutAndCopyList('pi-:slow', 'pi-:all', 'abs(d0) < 0.5 and abs(z0) < 2', path=my_path)
-ma.cutAndCopyList('pi+:sig', 'pi+:all', 'abs(d0) < 0.5 and abs(z0) < 2 and thetaInCDCAcceptance and nCDCHits>0', path=my_path)
-ma.cutAndCopyList('pi-:sig', 'pi-:all', 'abs(d0) < 0.5 and abs(z0) < 2 and thetaInCDCAcceptance and nCDCHits>0', path=my_path)
-ma.cutAndCopyList('K+:sig', 'K+:all', 'abs(d0) < 0.5 and abs(z0) < 2 and thetaInCDCAcceptance and nCDCHits>0', path=my_path)
-ma.cutAndCopyList('K-:sig', 'K-:all', 'abs(d0) < 0.5 and abs(z0) < 2 and thetaInCDCAcceptance and nCDCHits>0', path=my_path)
-
-ma.matchMCTruth('pi+:sig', path=my_path)
-ma.matchMCTruth('pi-:sig', path=my_path)
-ma.matchMCTruth('K+:sig', path=my_path)
-ma.matchMCTruth('K-:sig', path=my_path)
-ma.matchMCTruth('pi-:slow', path=my_path)
-ma.matchMCTruth('pi+:slow', path=my_path)
-
-
-ma.reconstructDecay('D0:kpi -> K-:sig pi+:sig', '1.8 < M < 1.95', path=my_path)
-ma.matchMCTruth('D0:kpi', path=my_path)
-
-ma.reconstructDecay('D+:kpipi -> K-:sig pi+:sig pi+:sig', '1.8 < M < 1.95', path=my_path)
-ma.matchMCTruth('D+:kpipi', path=my_path)
-
-#ma.reconstructDecay('D*+:kpi -> D0:kpi pi+:slow', '0.135<massDifference(0)<0.16', path=my_path)
-ma.reconstructDecay('D*+:kpi -> D0:kpi pi+:slow', '', path=my_path) 
-ma.matchMCTruth('D*+:kpi', path=my_path)
-
-ma.reconstructDecay('anti-B0:Dstpi -> D*+:kpi pi-:sig', 'Mbc > 5.2 and abs(deltaE) < 0.5', path=my_path)
-ma.matchMCTruth('anti-B0:Dstpi', path=my_path)
-
-ma.reconstructDecay('anti-B0:Dpluspi -> D+:kpipi pi-:sig', 'Mbc > 5.2 and abs(deltaE) < 0.5', path=my_path)
-ma.matchMCTruth('anti-B0:Dpluspi', path=my_path)
-
-#ma.reconstructDecay('B-:Dpi -> D0:kpi pi-:sig', 'Mbc > 5.2 and abs(deltaE) < 0.5', path=my_path)
-#ma.matchMCTruth('B-:Dpi', path=my_path)
-
-
-
-
-#building continuum supression
-cleanMask = ('cleanMask', 'p >= 0.05 and useCMSFrame(p)<=3.5','')
-
-#ma.buildRestOfEvent('anti-B0:Dstpi',path=my_path)
-ma.buildRestOfEvent('anti-B0:Dpluspi',path=my_path)
-#ma.buildRestOfEvent('B-:Dpi',path=my_path)
-
-
-ma.appendROEMasks(list_name='anti-B0:Dpluspi', mask_tuples=[cleanMask], path=my_path)
-
-ma.buildContinuumSuppression(list_name='anti-B0:Dpluspi', roe_mask='cleanMask', path=my_path)
-
-
-cont_suppr_base = [
-    'R2',
-    'thrustBm',
-    'thrustOm',
-    'cosTBTO',
-    'cosTBz'
-]
-
-#: Transverse energy and missing momentum squared (calculated within the KSFW moments)
-
-et_mm2 = [
-    'KSFWVariables(et)',
-    'KSFWVariables(mm2)'
-]
-
-#: KSFW Moments calculated using primary particles
-ksfw_moments = [
-    'KSFWVariables(hso10)',
-    'KSFWVariables(hso12)'
-]
-
-#: All available continuum suppression variables
-cont_suppr_all = cont_suppr_base + ksfw_moments
-
-trainVars = cont_suppr_all
-# Save target variable necessary for training.
-targetVar = ['isNotContinuumEvent']
-
-vextra = ['Mbc', 'deltaE']
-vids = ['kaonID','pionID']
-vkin = ["px","py","pz","pt","InvM","genMotherPDG(0)","genMotherPDG(1)","mcPDG"]
-cms_kinematics = ['CMpx', 'CMpy', 'CMpz', 'CMpt', 'CMp', 'CME']
-v4mom = ["px","py","pz","pt","E"]
-vmcgen = ['genMotherID(0)','genMotherPDG(0)','genNStepsToDaughter(0)', 'genMotherID(1)','genMotherPDG(1)','genNStepsToDaughter(1)', 'genMotherID(2)','genMotherPDG(2)','genNStepsToDaughter(2)','genMotherID(3)','genMotherPDG(3)','genNStepsToDaughter(3)','genMotherID(4)','genMotherPDG(4)','genNStepsToDaughter(4)','genMotherID(5)','genMotherPDG(5)','genNStepsToDaughter(5)','genParticleID']
-
-V_dpluspi = vu.create_aliases_for_selected(list_of_variables=vkin,
-                                   decay_string='anti-B0:Dpluspi -> [^D+:kpipi -> K-:sig pi+:sig pi+:sig] ^pi-:sig') + \
-   vu.create_aliases_for_selected(list_of_variables=vids,
-                                   decay_string='anti-B0:Dpluspi -> [D+:kpipi -> ^K-:sig ^pi+:sig ^pi+:sig] ^pi-:sig') + \
-   vu.create_aliases_for_selected(list_of_variables=vc.mc_truth,
-                                   decay_string='^anti-B0:Dpluspi -> [^D+:kpipi -> ^K-:sig ^pi+:sig ^pi+:sig] ^pi-:sig') 
-
-
-ma.variablesToNtuple(decayString='anti-B0:Dpluspi', variables=V_dpluspi + trainVars + targetVar + vextra + mc_gen_topo(160), filename='output_MC15.root', treename='dpluspi', path=my_path)
-
-#----------------------- soft pi0 dependent things                                                                                                                                                               
-  
-mylist = ['eff60_May2020Fit','eff50_May2020Fit','eff40_May2020Fit','eff30_May2020Fit','eff20_May2020Fit','eff10_May2020Fit']
-
-ma.fillParticleList('gamma:eff60_May2020','[[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180]] and [[clusterReg==1 and E>0.0225] or [clusterReg==2 and E>0.020] or [clusterReg==3 and E>0.020]]', path=my_path)
-
-ma.reconstructDecay('pi0:eff60_May2020 -> gamma:eff60_May2020 gamma:eff60_May2020', '0.03<InvM', path=my_path)
-ma.cutAndCopyList('pi0:eff60_May2020Fit', 'pi0:eff60_May2020', '', True, my_path)
-kFit('pi0:eff60_May2020Fit', 0.0, 'mass', path=my_path)
-ma.matchMCTruth('pi0:eff60_May2020Fit', my_path)
-
-
-
-ma.fillParticleList('gamma:eff50_May2020','[[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180]] and [[clusterReg==1 and E>0.025] or [clusterReg==2 and E>0.025] or [clusterReg==3 and E>0.040]]', path=my_path)
-ma.reconstructDecay('pi0:eff50_May2020 -> gamma:eff50_May2020 gamma:eff50_May2020', '0.105<InvM<0.150', path=my_path)
-ma.cutAndCopyList('pi0:eff50_May2020Fit', 'pi0:eff50_May2020', '', True, my_path)
-kFit('pi0:eff50_May2020Fit', 0.0, 'mass', path=my_path)
-ma.matchMCTruth('pi0:eff50_May2020Fit', my_path)
-
-
-
-ma.fillParticleList('gamma:eff40_May2020','[[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180]] and [[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060]]', path=my_path)
-ma.reconstructDecay('pi0:eff40_May2020 -> gamma:eff40_May2020 gamma:eff40_May2020', '0.120<InvM<0.145', path=my_path)
-ma.cutAndCopyList('pi0:eff40_May2020Fit', 'pi0:eff40_May2020', '', True, my_path)
-kFit('pi0:eff40_May2020Fit', 0.0, 'mass', path=my_path)
-ma.matchMCTruth('pi0:eff40_May2020Fit', my_path)
-
-
-ma.fillParticleList('gamma:eff30_May2020','[[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180]] and [[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060 ]] ', path=my_path)
-ma.reconstructDecay('pi0:eff30_May2020 -> gamma:eff30_May2020 gamma:eff30_May2020', '0.120<InvM<0.145 and -1.5<daughterDiffOfPhi(0,1)<1.5 and daughterAngle(0,1)<1.4', path=my_path)
-ma.cutAndCopyList('pi0:eff30_May2020Fit', 'pi0:eff30_May2020', '', True, my_path)
-kFit('pi0:eff30_May2020Fit', 0.0, 'mass', path=my_path)
-ma.matchMCTruth('pi0:eff30_May2020Fit', my_path)
-
-
-
-ma.fillParticleList('gamma:eff20_May2020','[[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180]] and [[clusterReg==1 and E>0.120] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.080 ]] and clusterE1E9\
->0.4', path=my_path)
-ma.reconstructDecay('pi0:eff20_May2020 -> gamma:eff20_May2020 gamma:eff20_May2020', '0.121<InvM<0.142 and -1.0<daughterDiffOfPhi(0,1)<1.0 and daughterAngle(0,1)<0.9', path=my_path)
-ma.cutAndCopyList('pi0:eff20_May2020Fit', 'pi0:eff20_May2020', '', True, my_path)
-kFit('pi0:eff20_May2020Fit', 0.0, 'mass', path=my_path)
-ma.matchMCTruth('pi0:eff20_May2020Fit', my_path)
-
-ma.fillParticleList('gamma:eff10_May2020','[[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180]] and [[clusterReg==1 and E>0.200] or [clusterReg==2 and E>0.100] or [clusterReg==3 and E>0.180]] and clusterE1E9>\
-0.5', path=my_path)
-ma.reconstructDecay('pi0:eff10_May2020 -> gamma:eff10_May2020 gamma:eff10_May2020', '0.127<InvM<0.139 and -0.9<daughterDiffOfPhi(0,1)<0.9 and daughterAngle(0,1)<0.8', path=my_path)
-ma.cutAndCopyList('pi0:eff10_May2020Fit', 'pi0:eff10_May2020', '', True, my_path)
-kFit('pi0:eff10_May2020Fit', 0.0, 'mass', path=my_path)
-ma.matchMCTruth('pi0:eff10_May2020Fit', my_path)
-
-
-
-for element in mylist:
-
-    ma.reconstructDecay('D*+:dpi0'+element+' -> D+:kpipi pi0:'+element, '', path=my_path)
-    ma.matchMCTruth('D*+:dpi0'+element, path=my_path)
-
-    ma.reconstructDecay('D*0:kpi'+element+' -> D0:kpi pi0:'+element, '', path=my_path)
-    ma.matchMCTruth('D*0:kpi'+element, path=my_path)
-
-    ma.reconstructDecay('B-:Dst0pi'+element+' -> D*0:kpi'+element+' pi-:sig', 'Mbc > 5.2 and abs(deltaE) < 0.5', path=my_path)
-    ma.matchMCTruth('B-:Dst0pi'+element, path=my_path)
-
-    ma.reconstructDecay('anti-B0:Dstpi_ch2'+element+' -> D*+:dpi0'+element+' pi-:sig', 'Mbc > 5.2 and abs(deltaE) < 0.5', path=my_path)
-    ma.matchMCTruth('anti-B0:Dstpi_ch2'+element, path=my_path)
-
-    ma.buildRestOfEvent('anti-B0:Dstpi_ch2'+element,path=my_path)
-
-    V_dstpi_ch2 = vu.create_aliases_for_selected(list_of_variables=["isSignal","mcErrors"],
-                                                 decay_string='^anti-B0:Dstpi_ch2'+element+' -> [D*+:dpi0'+element+' -> [D+:kpipi -> K-:sig pi+:sig pi+:sig] pi0:'+element+'] pi-:sig') + \
-                  vu.create_aliases_for_selected(list_of_variables=["InvM","genMotherPDG","isSignal","mcErrors","M"],
-                                                 decay_string='anti-B0:Dstpi_ch2'+element+' -> [^D*+:dpi0'+element+' -> [D+:kpipi -> K-:sig pi+:sig pi+:sig] pi0:'+element+'] pi-:sig') + \
-                  vu.create_aliases_for_selected(list_of_variables=["InvM","isSignal","mcErrors","M","genMotherPDG(0)","genMotherPDG(1)","px","py","pz","pt","genMotherID(1)"],
-                                                 decay_string='anti-B0:Dstpi_ch2'+element+' -> [D*+:dpi0'+element+' -> [^D+:kpipi -> K-:sig pi+:sig pi+:sig] pi0:'+element+'] pi-:sig') + \
-                  vu.create_aliases_for_selected(list_of_variables=vids,
-                                                 decay_string='anti-B0:Dstpi_ch2'+element+' -> [D*+:dpi0'+element+' -> [D+:kpipi -> ^K-:sig ^pi+:sig ^pi+:sig] pi0:'+element+'] pi-:sig') + \
-                  vu.create_aliases_for_selected(list_of_variables=cms_kinematics +["mcPDG","InvM","px","py","pz","pt","p","E","isSignal","genMotherPDG(0)","genMotherPDG(1)","mcE"],
-                                                 decay_string='anti-B0:Dstpi_ch2'+element+' -> [D*+:dpi0'+element+' -> [D+:kpipi -> K-:sig pi+:sig pi+:sig] ^pi0:'+element+'] pi-:sig') + \
-                  vu.create_aliases_for_selected(list_of_variables=vids+["px","py","pz","pt","genMotherPDG(0)","genMotherPDG(1)","mcPDG","genMotherID(0)"],
-                                                 decay_string='anti-B0:Dstpi_ch2'+element+' -> [D*+:dpi0'+element+' -> [D+:kpipi -> K-:sig pi+:sig pi+:sig] pi0:'+element+'] ^pi-:sig')
-    
-
-    ma.variablesToNtuple(decayString='anti-B0:Dstpi_ch2'+element, variables=V_dstpi_ch2 + vextra, filename='output_MC15.root', treename='dstpi_ch2'+element, path=my_path)
-
-# Process the events
-b2.process(my_path)
-
-# print out the summary
-print(b2.statistics)
-
-
diff --git a/topoana.sh b/topoana.sh
new file mode 100644
index 0000000..9d9d970
--- /dev/null
+++ b/topoana.sh
@@ -0,0 +1,64 @@
+hadd MC15ri_mixed_part2.root MC15ri_mixed_part2/sub0*/*.root
+hadd MC15ri_mixed_part3.root MC15ri_mixed_part3/sub0*/*.root
+hadd MC15ri_mixed_part4.root MC15ri_mixed_part4/sub0*/*.root
+hadd MC15ri_mixed_part5.root MC15ri_mixed_part5/sub0*/*.root
+hadd MC15ri_mixed_part6.root MC15ri_mixed_part6/sub0*/*.root
+hadd MC15ri_mixed_part7.root MC15ri_mixed_part7/sub0*/*.root
+hadd MC15ri_mixed_part8.root MC15ri_mixed_part8/sub0*/*.root
+hadd MC15ri_mixed_part9.root MC15ri_mixed_part9/sub0*/*.root
+hadd MC15ri_mixed_part10.root MC15ri_mixed_part10/sub0*/*.root
+hadd MC15ri_mixed_part11.root MC15ri_mixed_part11/sub0*/*.root
+hadd MC15ri_mixed_part12.root MC15ri_mixed_part12/sub0*/*.root
+hadd MC15ri_mixed_part13.root MC15ri_mixed_part13/sub0*/*.root
+hadd MC15ri_mixed_part14.root MC15ri_mixed_part14/sub0*/*.root
+hadd MC15ri_mixed_part15.root MC15ri_mixed_part15/sub0*/*.root
+hadd MC15ri_mixed_part16.root MC15ri_mixed_part16/sub0*/*.root
+
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part2.root -o mixed2Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part3.root -o mixed3Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part4.root -o mixed4Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part5.root -o mixed5Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part6.root -o mixed6Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part7.root -o mixed7Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part8.root -o mixed8Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part9.root -o mixed9Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part10.root -o mixed10Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part11.root -o mixed11Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part12.root -o mixed12Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part13.root -o mixed13Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part14.root -o mixed14Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part15.root -o mixed15Partial
+topoana.exe PartialReco_Dpluspi.card -i MC15ri_mixed_part16.root -o mixed16Partial
+
+rm -f MC15ri_mixed_part2.root
+rm -f MC15ri_mixed_part3.root
+rm -f MC15ri_mixed_part4.root
+rm -f MC15ri_mixed_part5.root
+rm -f MC15ri_mixed_part6.root
+rm -f MC15ri_mixed_part7.root
+rm -f MC15ri_mixed_part8.root
+rm -f MC15ri_mixed_part9.root
+rm -f MC15ri_mixed_part10.root
+rm -f MC15ri_mixed_part11.root
+rm -f MC15ri_mixed_part12.root
+rm -f MC15ri_mixed_part13.root
+rm -f MC15ri_mixed_part14.root
+rm -f MC15ri_mixed_part15.root
+rm -f MC15ri_mixed_part16.root
+
+
+mv mixed2Partial.root MC15ri_mixed_part2.root
+mv mixed3Partial.root MC15ri_mixed_part3.root
+mv mixed4Partial.root MC15ri_mixed_part4.root
+mv mixed5Partial.root MC15ri_mixed_part5.root
+mv mixed6Partial.root MC15ri_mixed_part6.root
+mv mixed7Partial.root MC15ri_mixed_part7.root
+mv mixed8Partial.root MC15ri_mixed_part8.root
+mv mixed9Partial.root MC15ri_mixed_part9.root
+mv mixed10Partial.root MC15ri_mixed_part10.root
+mv mixed11Partial.root MC15ri_mixed_part11.root
+mv mixed12Partial.root MC15ri_mixed_part12.root
+mv mixed13Partial.root MC15ri_mixed_part13.root
+mv mixed14Partial.root MC15ri_mixed_part14.root
+mv mixed15Partial.root MC15ri_mixed_part15.root
+mv mixed16Partial.root MC15ri_mixed_part16.root
-- 
GitLab