#..Analysis.tcl # Main tcl file for B --> Jpsi pi+ pi- K workbook tutorial #====================== SETUP =============================== #..General setup needed in all jobs sourceFoundFile ErrLogger/ErrLog.tcl sourceFoundFile FrameScripts/FwkCfgVar.tcl sourceFoundFile FrameScripts/talkto.tcl #-------------- FwkCfgVars needed to control this job --------------------- set ProdTclOnly true #..allowed values of BetaMiniReadPersistence are "Kan", "Bdb" FwkCfgVar BetaMiniReadPersistence Kan #..allowed values of levelOfDetail are "micro", "cache", "extend" or "refit" FwkCfgVar levelOfDetail "cache" #..allowed values of ConfigPatch are "Run2" or "MC". FwkCfgVar ConfigPatch "MC" #..Filter on tag bits by default FwkCfgVar FilterOnTag "true" #..Print Frequency FwkCfgVar PrintFreq 1000 #..Ntuple type and name FwkCfgVar BetaMiniTuple "root" FwkCfgVar histFileName "Tutorial.root" #..Number of Events defaults to 0 (run on full tcl file) FwkCfgVar NEvents 0 #------------------- General physics sequences ------------------------ #..set to 'trace' to get info on a configuration problem ErrLoggingLevel warning #..btaMiniPhysics is the basic physics sequences; sourceFoundFile BetaMiniUser/btaMiniPhysics.tcl #====================== COMPOSITION =============================== #..Use SimpleComposition to make the candidates of interest # For convenience, we will call the pi+pi- a "rho0", and the # Jpsi pi+ pi- a "Psi2S", even though the actual mass regions # will be much larger than the nominal particles. #..Create Analysis sequence and append it to the path. # All the composition modules get added to this sequence. Everything # will be done in SimpleComposition execept for Brem recovery, which # is in CompostionSequences/CompPsiInitSequence sequence create AnalysisSequence path append Everything AnalysisSequence sourceFoundFile CompositionSequences/CompPsiInitSequence.tcl sequence append AnalysisSequence CompPsiInitSequence #------------------ Jpsi Lists -------------------------------------- #..Start from the existing lists defined in SmpJPsiProdSequence.tcl # TODO: sublist for GTL #..The electron list requires brem-recovered PidLHElectrons (=eLHBremLH) # on both legs, while the muon list uses muNNVeryLoose on both legs. # Combine these to make the list from which we will store the # non-constrained Jpsi mass mod clone SmpMergerDefiner JpsiForNtuple seq append AnalysisSequence JpsiForNtuple talkto JpsiForNtuple { inputListNames set JPsiLHEE inputListNames set JPsiNNVeryLooseMuMu } #..Now mass constrain the lists for making the B candidates. We can # do with a small mass window as well. mod clone SmpRefitterDefiner JpsiForComposition seq append AnalysisSequence JpsiForComposition talkto JpsiForComposition { unrefinedListName set JpsiForNtuple fittingAlgorithm set "Cascade" fitConstraints set "Geo" fitConstraints set "Mass" preFitSelectors set "Mass 2.8:3.4" postFitSelectors set "Mass 2.9:3.3" } #------------------ pi+pi- Lists -------------------------------------- #..We will call the pi+ pi- a rho0 as a way of storing it in the ntuple. # Again, we start from an existing list. #..Requiring PID at an early stage speeds up the code and reduces # ntuple size. mod clone SmpRefinerDefiner PiPlusPiMinusPID seq append AnalysisSequence PiPlusPiMinusPID talkto PiPlusPiMinusPID { decayMode set "rho0 -> pi+ pi-" unrefinedListName set PiPlusPiMinusAll daughterListNames set "piLHVeryLoose" daughterListNames set "piLHVeryLoose" fittingAlgorithm set "Cascade" fitConstraints set "Geo" postFitSelectors set "ProbChiSq 0.001:" } #..We are going to want these tracks to be GoodTracksVeryLoose at least. mod clone SmpSubListerDefiner PseudoRho0 seq append AnalysisSequence PseudoRho0 talkto PseudoRho0 { unrefinedListName set PiPlusPiMinusPID daughterListNames set "GoodTracksVeryLoose" daughterListNames set "GoodTracksVeryLoose" } # TODO: apply mass cut #------------------ Jpsi pi+pi- Lists -------------------------------------- #..We will call the Jpsi pi+ pi- combination a "Psi2S" as a convenience # for storing in the ntuple. Note that we don't want to constraint # these candidates to the PDG Psi2S mass, since they aren't necessarily # real psi2s mesons. #..Mass range is just kinematics of B decay. mod clone SmpMakerDefiner PseudoPsi2S seq append AnalysisSequence PseudoPsi2S talkto PseudoPsi2S { decayMode set "psi(2S) -> J/psi rho0" daughterListNames set "JpsiForComposition" daughterListNames set "PseudoRho0" fittingAlgorithm set "Cascade" fitConstraints set "Geo" preFitSelectors set "Mass 0:5.1" postFitSelectors set "Mass 0:5.0" postFitSelectors set "ProbChiSq 0.001:" } #------------------ Charged Kaon List -------------------------------------- #..Require our kaons to also be GoodTracksLoose mod clone SmpSubListerDefiner KLHVeryLooseGTL seq append AnalysisSequence KLHVeryLooseGTL talkto KLHVeryLooseGTL { unrefinedListName set KLHVeryLoose isCloneOfListName set GoodTracksLoose } #------------------ Ks Lists -------------------------------------- #..Start from KsLoose, defined in SmpKsProdSequence.tcl. # Note that KsLoose uses TreeFitter, which implicitly applies # a Geo constraint (and so is not listed explictly). # Many people have opinions on the correct way to define Ks lists. #..Add a flight significance (with respect to beam spot) and vertex quality # cut to clean up list. This is just the KsTight list, which is commented # out in SmpKsProdSequence. Save UsrData to adjust cuts in ntuple. mod clone SmpSubListerDefiner MyKsTight seq append AnalysisSequence MyKsTight talkto MyKsTight { unrefinedListName set KsLoose selectors set "FlightSignificance 3:" selectors set "ProbChiSq 0.001:" createUsrData set true } #..It is probably worth constraining the Ks to PDG mass. mod clone SmpRefitterDefiner MyKsTightMass seq append AnalysisSequence MyKsTightMass talkto MyKsTightMass { decayMode set "K_S0 -> pi+ pi-" unrefinedListName set "MyKsTight" fittingAlgorithm set "TreeFitter" fitConstraints set "Geo" fitConstraints set "Mass" } #------------------------ All final state particles ------------------- #..This list is used for calculating event shapes on combined B list mod clone SmpMergerDefiner myFinalStateList seq append AnalysisSequence myFinalStateList talkto myFinalStateList { inputListNames set "ChargedTracks" inputListNames set "CalorNeutral" } #------------------------ B+ --------------------------------------- #..Put the pieces together to make B+ --> "Psi2S" K+ mod clone SmpMakerDefiner BchtoPsi2SKch seq append AnalysisSequence BchtoPsi2SKch talkto BchtoPsi2SKch { decayMode set "B+ -> psi(2S) K+" daughterListNames set "PseudoPsi2S" daughterListNames set "KLHVeryLooseGTL" fittingAlgorithm set "Cascade" fitConstraints set "Geo" preFitSelectors set "DeltaE -0.20:0.20" preFitSelectors set "Mes 5.19:5.30" postFitSelectors set "ProbChiSq 0.001:" postFitSelectors set "DeltaE -0.12:0.12" postFitSelectors set "Mes 5.20:5.30" } #------------------------ B0 --------------------------------------- #..Put the pieces together to make B0 --> "Psi2S" Ks mod clone SmpMakerDefiner B0toPsi2SKs seq append AnalysisSequence B0toPsi2SKs talkto B0toPsi2SKs { decayMode set "B0 -> psi(2S) K_S0" daughterListNames set "PseudoPsi2S" daughterListNames set "MyKsTightMass" fittingAlgorithm set "Cascade" fitConstraints set "Geo" preFitSelectors set "DeltaE -0.20:0.20" preFitSelectors set "Mes 5.19:5.30" postFitSelectors set "ProbChiSq 0.001:" postFitSelectors set "DeltaE -0.12:0.12" postFitSelectors set "Mes 5.20:5.30" } #----------------------- Combined B List ------------------------------ #..B --> "Psi2s"K mod clone SmpMergerDefiner BtoPsi2SK seq append AnalysisSequence BtoPsi2SK talkto BtoPsi2SK { inputListNames set BchtoPsi2SKch inputListNames set B0toPsi2SKs } #..Refit Merged list to get UsrData. This could be done in a better way mod clone SmpRefitterDefiner MyB seq append AnalysisSequence MyB talkto MyB { unrefinedListName set "BtoPsi2SK" fittingAlgorithm set "TreeFitter" fitConstraints set "Geo" postFitSelectors set "ProbChiSq" postFitSelectors set "DeltaE" postFitSelectors set "Mes" postFitSelectors set "CmsCosTheta" evtFinalStateListName set "myFinalStateList" postFitSelectors set "CosThrust" postFitSelectors set "CosSpher" createUsrData set true } #====================== NTUPLE DUMPING ============================ #..Use BtuTupleMaker to write out ntuples for SimpleComposition job path append Everything BtuTupleMaker talkto BtuTupleMaker { #-------------------- Event Information --------------------------- eventBlockContents set "EventID CMp4 BeamSpot" eventTagsInt set "nTracks" eventTagsFloat set "R2All xPrimaryVtx yPrimaryVtx zPrimaryVtx" writeEveryEvent set false #-------------------- MC truth info ------------------------------- fillMC set true mcBlockContents set "Mass CMMomentum Momentum Vertex" #-------------------- B Mesons ------------------------------------ #..Now the particle blocks, starting with B's listToDump set MyB ntpBlockConfigs set "B- B 2 50" ntpBlockConfigs set "B0 B 2 50" ntpBlockContents set "B: Mass Momentum CMMomentum Vertex VtxChi2 UsrData(MyB)" #-------------------- Other daughter resonances ------------------------ ntpBlockConfigs set "psi(2S) psi2s 2 50" ntpBlockContents set "psi2s: Mass Momentum Vertex VtxChi2" ntpBlockConfigs set "J/psi Jpsi 2 50" ntpBlockContents set "Jpsi: Mass Momentum Vertex VtxChi2" ntpAuxListContents set "Jpsi: JpsiForNtuple : Unc : Mass" ntpBlockConfigs set "K_S0 Ks 2 50" ntpBlockContents set "Ks: Mass Momentum Vertex VtxChi2" ntpAuxListContents set "Ks: MyKsTight : Unc : Mass UsrData(MyKsTight)" ntpBlockConfigs set "rho0 rho 2 50" ntpBlockContents set "rho: Mass Momentum Vertex VtxChi2" #-------------------- Single Particles ------------------------ ntpBlockConfigs set "K+ K 0 50" ntpBlockContents set "K: MCIdx Momentum PIDWeight(KLHVeryLoose,KLHLoose,KLHTight)" ntpBlockConfigs set "pi+ pi 0 50" ntpBlockContents set "pi: MCIdx Momentum PIDWeight(piLHVeryLoose,piLHLoose,piLHTight)" ntpBlockConfigs set "mu+ mu 0 50" ntpBlockContents set "mu: MCIdx Momentum PIDWeight(muNNVeryLoose,muNNLoose)" #..Note that electrons can have as many as 4 daughters due to brem reco ntpBlockConfigs set "e+ e 4 50" ntpBlockContents set "e: MCIdx Momentum PIDWeight(PidLHElectrons)" #..Want to save all CalorNeutrals in the gamma block ntpBlockConfigs set "gamma gamma 0 60" ntpBlockContents set "gamma: MCIdx Momentum" gamExtraContents set EMC fillAllCandsInList set "gamma CalorNeutral" #..TRK block. Save all of them as well. fillAllCandsInList set "TRK ChargedTracks" ntpBlockToTrk set "K pi mu e" trkExtraContents set "BitMap:pSelectorsMap,KSelectorsMap,piSelectorsMap,muSelectorsMap,eSelectorsMap,TracksMap" trkExtraContents set HOTS trkExtraContents set Eff:ave ntpBlockContents set "TRK: Doca DocaXY" } #====================== RUN TIME SETTINGS ============================ #--------------- Turn on PID weights ------------------------------- pidCfg_dataset ascii pidCfg_mode weight * #--------------- Turn on Neutral corrections ------------------------- if { $ConfigPatch=="MC" } { talkto EmcNeutCorrLoader { isData set false runNo set 1 } } #--------------------- Filter on Tag --------------------------------- #..Use $FilterOnTag to disable tag filtering if desired. module clone TagFilterByName TagJpsill module talk TagJpsill orList set JpsiELoose orList set JpsiMuLoose assertIfMissing set true exit if { $FilterOnTag=="true" } { sequence append BetaMiniReadSequence -a KanEventUpdateTag TagJpsill } mod talk EvtCounter printFreq set $PrintFreq exit path list if { $NEvents>=0 } { ev beg -nev $NEvents exit }