Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

H1K0Event2.C

Go to the documentation of this file.
00001 
00002 // Class H1K0Event2
00003 //
00004 // Author: Benno List, Jenny Boehme
00005 // Last update: $Date: 2005/01/12 10:11:44 $
00006 //          by: $Author: blist $
00007 // 
00008 // Description: class to generate and fit K0S decays
00009 //               
00011 #include "jbltools/kinfit/H1K0Event2.h"
00012 
00013 #include "jbltools/kinfit/JetFitObject.h"
00014 #include "jbltools/kinfit/MassConstraint.h"
00015 #include "jbltools/kinfit/cernlib.h"
00016 #include "jbltools/kinfit/NeutralParticleTrack.h"
00017 #include "jbltools/kinfit/ChargedParticleTrack.h"
00018 #include "jbltools/kinfit/ThreeVector.h"
00019 #include "jbltools/kinfit/FourVector.h"
00020 #include "jbltools/kinfit/TTVertexConstraint.h"
00021 #include "jbltools/kinfit/VertexConstraint.h"
00022 #include "jbltools/kinfit/VertexFitObject.h"
00023 #include "jbltools/kinfit/TrackMomentumConstraint.h"
00024 
00025 #include "jbltools/kinfit/H1Tracks.h"
00026 
00027 #include <iostream>              // - cout
00028 using std::cout;
00029 using std::endl;
00030 #include <cmath>  
00031 using std::pow;            
00032 using std::atan;            
00033 using std::exp;            
00034 using std::sin;            
00035 using std::cos;            
00036 using std::log;            
00037 using std::abs;            
00038 
00039 // constructor: 
00040 H1K0Event2::H1K0Event2(H1Tracks& nt_, int t1, int t2)
00041 : nt (nt_)
00042  {
00043   for (int i = 0; i < NFV; ++i) fv[i] = 0;
00044   for (int i = 0; i < NTFO; ++i) rectrack[i] = 0;
00045   
00046   rectrack[1] = new ChargedParticleTrack ("pi1", nt.Par+5*t1, nt.Cov+15*t1, 0.13957);
00047   rectrack[2] = new ChargedParticleTrack ("pi2", nt.Par+5*t2, nt.Cov+15*t2, 0.13957);
00048   
00049   ThreeVector nominalvertex;
00050   ThreeVector k0recmom = (rectrack[1]->getMomentum (0) + rectrack[2]->getMomentum (0)).getThreeVector();
00051   rectrack[0] = new NeutralParticleTrack ("K0 rec", nominalvertex, k0recmom, 0.497648);
00052 };
00053 
00054 //destructor: 
00055 H1K0Event2::~H1K0Event2() {
00056   for (int i = 0; i < NFV; ++i) delete fv[i];
00057   for (int i = 0; i < NTFO; ++i) {
00058     delete rectrack[i];
00059   }  
00060 };
00061 
00062 
00063 // fit it!
00064 int H1K0Event2::fitEvent (BaseFitter& fitter){
00065   
00066   fitter.addFitObject (rectrack[0]);
00067   fitter.addFitObject (rectrack[1]);
00068   fitter.addFitObject (rectrack[2]);
00069 
00070   k0decvertex = new VertexFitObject ("K0dec", 0, 0, 0);
00071   fitter.addFitObject (k0decvertex);
00072   
00073   rectrack[0]->fixVertexParam (0);
00074   k0decvertex->addTrack (rectrack[0], true, false);
00075   k0decvertex->addTrack (rectrack[1], false, true);
00076   k0decvertex->addTrack (rectrack[2], false, true);
00077   
00078   k0decvertex->addConstraints (fitter, VertexFitObject::VXYZ|VertexFitObject::PXYZ);
00079   
00080   k0decvertex->initForFit();
00081   
00082   double prob = fitter.fit();
00083   
00084 //   std::cout << "  Fit prob: " << prob << std::endl;
00085 //   std::cout << "  Fitted vertex: " << *k0decvertex << std::endl;
00086      
00087    return fitter.getError();
00088 };

Generated on Fri Sep 14 17:38:20 2007 for Kinfit by doxygen 1.3.2