AmpTools a modular library to enable amplitude analysis Matthew Shepherd Indiana University May 4, 2019 Joint GlueX and PANDA Workshop Ashburn, VA
Motivation • Needed a general framework to handle amplitude analysis for CLEO-c, BES III, and GlueX M. R. Shepherd GlueX/PANDA Workshop 2 May 4, 2019
Motivation • Needed a general framework to handle amplitude analysis for CLEO-c, BES III, and GlueX • Feature rich • free parameters in amplitudes • multi-channel/multi-experiment fits; external constraints • Wanted to stimulate exploration of different phenomenological models • make data analysis accessible to theory colleagues • Separate physics from computing • allows one to focus of physics M. R. Shepherd GlueX/PANDA Workshop 2 May 4, 2019
Motivation • Needed a general framework to handle amplitude analysis for CLEO-c, BES III, and GlueX • Feature rich • free parameters in amplitudes • multi-channel/multi-experiment fits; external constraints • Wanted to stimulate exploration of different phenomenological models • make data analysis accessible to theory colleagues • Separate physics from computing • allows one to focus of physics • Development driven by physics and practical needs rather than the desire to produce a one- size-fits-all software package (like ROOT) M. R. Shepherd GlueX/PANDA Workshop 2 May 4, 2019
Ancient History and Acknowledgements On Feb 1, 2006, at 11:08 PM, Ryan Mitchell wrote: Package has been Hi, codeveloped with Another keyfile is attached. Ryan Mitchell To fix parameters this version uses an "x" instead of "*". (Indiana U.) Names in {} are added, which can come before or after the amplitude is specified (but all before the ";"). M. R. Shepherd GlueX/PANDA Workshop 3 May 4, 2019
Ancient History and Acknowledgements On Feb 1, 2006, at 11:08 PM, Ryan Mitchell wrote: Package has been Hi, codeveloped with Another keyfile is attached. Ryan Mitchell To fix parameters this version uses an "x" instead of "*". (Indiana U.) Names in {} are added, which can come before or after the amplitude is specified (but all before the ";"). On May 27, 2009, at 4:51 PM, Hrayr Matevosyan <hmatevosyan@gmail.com> wrote: Data structure optimization Hi Guys, and initial GPU The GPU code now works with the fitter in both single and double implementation in CUDA by precision. I want to have a walk-through the changes before I commit Hrayr Matevosyan anything to CVS, but I attach the output of the runs over 1.8 mil points with CPU and GPU. CPU takes ~ 2.7 sec for each fit iteration, where (now at U. Adelaide) GPU in double precision ~ 0.006 sec. M. R. Shepherd GlueX/PANDA Workshop 3 May 4, 2019
Design Goals and Implementation M. R. Shepherd GlueX/PANDA Workshop 4 May 4, 2019
AmpTools Design Goals • Separate physics from computing • The “user” provides: • an algorithm (C++ class) to unpack four-vectors from a file • algorithms (C++ classes) to compute various physics amplitudes from four-vectors • a recipe (text file) for assembling the amplitudes into an intensity M. R. Shepherd GlueX/PANDA Workshop 5 May 4, 2019
AmpTools Design Goals • Separate physics from computing • The “user” provides: • an algorithm (C++ class) to unpack four-vectors from a file • algorithms (C++ classes) to compute various physics amplitudes from four-vectors • a recipe (text file) for assembling the amplitudes into an intensity • AmpTools provides: • a general framework that makes no assumptions about experiment or physics model (other than quantum mechanics) • a set of core libraries optimized for unbinned likelihood fitting and parallel processing • MPI parallelization was always a part of design: knew eventual problem size would exceed RAM on one machine • GPU acceleration used (with or without) MPI to further accelerate computation on a single node • modular code that can also be used for MC generation and displaying fit results • a standard format for writing data I/O and amplitude calculation methods M. R. Shepherd GlueX/PANDA Workshop 5 May 4, 2019
Underlying Assumptions • Use an unbinned maximum-likelihood fit with with a likelihood for each data set with N events written as: N L ( θ ) = e − µ µ N Y P ( x i ; θ ) , N ! i =1 M. R. Shepherd GlueX/PANDA Workshop 6 May 4, 2019
Underlying Assumptions • Use an unbinned maximum-likelihood fit with with a likelihood for each data set with N events written as: N L ( θ ) = e − µ µ N Y P ( x i ; θ ) , N ! i =1 • A PDF that is constructed from an intensity and an acceptance function: Z P ( x ; θ ) = 1 µ = I ( x ; θ ) η ( x ) d x , µ I ( x ; θ ) η ( x ) . M. R. Shepherd GlueX/PANDA Workshop 6 May 4, 2019
Underlying Assumptions • Use an unbinned maximum-likelihood fit with with a likelihood for each data set with N events written as: N L ( θ ) = e − µ µ N Y P ( x i ; θ ) , N ! i =1 • A PDF that is constructed from an intensity and an acceptance function: Z P ( x ; θ ) = 1 µ = I ( x ; θ ) η ( x ) d x , µ I ( x ; θ ) η ( x ) . • And (as of now) and intensity that is formulated as a combinations of coherent and incoherent sums of scalable, factorizable amplitudes n σ , α 2 � � � � Y X X A σ , α ( x ) = a σ , α , γ ( x ) , I ( x ) = s σ , α V σ , α A σ , α ( x ) � � � � � � σ α γ =1 M. R. Shepherd GlueX/PANDA Workshop 6 May 4, 2019
Random Implementation Notes • Fit parameters, V , are complex and expressed using real and imaginary parts • Symmetrization for identical particles is handled by the framework (necessary if one wants to factorize amplitudes) • The likelihood values for each data set are summed together in multi-channel or multi-experiment fits • Background subtraction is implemented by subtracting likelihood contribution using a background sample whose sum of weights is equal to the expected background • Minimization is done with MINUIT; many common MINUIT configuration functions are implemented in the interface • AmpTools itself is collection of libraries; the user must provide: • library with code to read data and compute amplitude factors • executables to do fits, generate MC, … M. R. Shepherd GlueX/PANDA Workshop 7 May 4, 2019
Example DataReader DalitzDataReader::DalitzDataReader( const vector< string >& args ) : UserDataReader< DalitzDataReader >(args), m_eventCounter( 0 ){ • Inherits from: DataReader assert(args.size() == 1); string inFileName(args[0]); • string inTreeName("nt"); Arguments to constructor are a vector TH1::AddDirectory( kFALSE ); strings that come from the configuration gSystem->Load( "libTree" ); file ifstream fileexists( inFileName.c_str() ); if (fileexists){ • m_inFile = new TFile( inFileName.c_str() ); The getEvent() method provides four- m_inTree = static_cast<TTree*>( m_inFile->Get( inTreeName.c_str() ) ); vectors in a specific order } else{ cout << "DalitzDataReader WARNING: Cannot find file... " << inFileName << endl; m_inFile = NULL; m_inTree = NULL; Kinematics* } DalitzDataReader::getEvent(){ if (m_inTree){ if( m_eventCounter < numEvents() ){ m_inTree->SetBranchAddress( "EnP1", &m_EnP1 ); m_inTree->GetEntry( m_eventCounter++ ); m_inTree->SetBranchAddress( "PxP1", &m_PxP1 ); m_inTree->SetBranchAddress( "PyP1", &m_PyP1 ); vector< TLorentzVector > particleList; m_inTree->SetBranchAddress( "PzP1", &m_PzP1 ); particleList.push_back( TLorentzVector( m_PxP1, m_PyP1, m_PzP1, m_EnP1 ) ); particleList.push_back( TLorentzVector( m_PxP2, m_PyP2, m_PzP2, m_EnP2 ) ); m_inTree->SetBranchAddress( "EnP2", &m_EnP2 ); particleList.push_back( TLorentzVector( m_PxP3, m_PyP3, m_PzP3, m_EnP3 ) ); m_inTree->SetBranchAddress( "PxP2", &m_PxP2 ); m_inTree->SetBranchAddress( "PyP2", &m_PyP2 ); return new Kinematics( particleList, m_weight ); m_inTree->SetBranchAddress( "PzP2", &m_PzP2 ); } m_inTree->SetBranchAddress( "EnP3", &m_EnP3 ); m_inTree->SetBranchAddress( "PxP3", &m_PxP3 ); else{ m_inTree->SetBranchAddress( "PyP3", &m_PyP3 ); return NULL; m_inTree->SetBranchAddress( "PzP3", &m_PzP3 ); } m_inTree->SetBranchAddress( "weight", &m_weight ); } } } M. R. Shepherd GlueX/PANDA Workshop 8 May 4, 2019
Recommend
More recommend