MINT2
D_hhhh.cpp
Go to the documentation of this file.
1 /*
2  * MintGenerator.cpp
3  *
4  * Created on: May 11, 2011
5  * Author: mcoombes
6  */
7 //Local
8 #include "Mint/D_hhhh.h"
9 
10 //C++
11 #include <iostream>
12 
13 //ROOT
14 //#include "TRandom3.h"
15 #include "TRandom.h"
16 #include "TVector3.h"
17 
18 //MINT
19 #include "Mint/SignalGenerator.h"
21 
22 using namespace std;
23 using namespace MINT;
24 
25 
26 
27 MintGen::MintGen()
28 {
29  // TODO Auto-generated constructor stub
30 }
31 
32 MintGen::~MintGen()
33 {
34  // TODO Auto-generated destructor stub
35 }
36 
37 
38 void MintGen::SetInputTextFile(std::string inputFile)
39 {
40  m_inputFileName = inputFile;
41 }
42 
43 
44 std::vector<double> MintGen::getDaughterMom(IDalitzEvent* dE, int daughter)
45 {
46  std::vector<double> DaughterMom;
47  DaughterMom.push_back(dE->p(daughter).T()/1000);
48  DaughterMom.push_back(dE->p(daughter).X()/1000);
49  DaughterMom.push_back(dE->p(daughter).Y()/1000);
50  DaughterMom.push_back(dE->p(daughter).Z()/1000);
51 
52  return DaughterMom;
53 }
54 
55 
56 void MintGen::Initalize(const std::vector<int> &patternVec, TRandom* rnd)
57 {
58  m_swap = false;
59  std::cout <<"m_inputFileName " << m_inputFileName << std::endl;
60  NamedParameterBase::setDefaultInputFile(m_inputFileName);
61 
62 
63  NamedParameter<int> RandomSeed("RandomSeed", 0);
64  std::cout << " Random Seed " << RandomSeed << std::endl;
65 
66 
67  NamedParameter<double> integPrecision("IntegPrecision", 1.e-4);
68  NamedParameter<std::string> integMethod("IntegMethod"
69  , (std::string)"efficient");
70 
71 
72  NamedParameter<int> EventPattern("Event Pattern", 421, -321, 211, -211, 211); // takes Pdg_id (421 is D0)
73  std::vector<int> TextEvtpattern = EventPattern.getVector();
74 // DalitzEventPattern pdg_text(TextEvtpattern);
75  DalitzEventPattern pdg(patternVec);
76 // DalitzEventPattern pdg(EventPattern.getVector());
77 
78  // some initialisation
79 // TRandom3 ranLux;
80 // ranLux.SetSeed((int)RandomSeed);
81  std::cout << " got event pattern: " << pdg << std::endl;
82 
83  if (patternVec[0] < 0)
84  {
85  m_swap = true;
86  cout << "Mother Particle " <<patternVec[0] << std::endl;
87  pdg = pdg.makeCPConjugate();
88  }
89 
90  std::cout << " got event pattern: " << pdg << std::endl;
91 
92 
93 // std::cout << " Text input event pattern: " << pdg_text << std::endl;
94 
95  m_sg = new SignalGenerator(pdg, rnd);
96 }
97 
98 std::vector<std::vector<double> > MintGen::DecayEventRFVec()
99 {
100  MINT::counted_ptr<IDalitzEvent> newEvt = m_sg->newEvent();
101 
102 
103  IDalitzEvent* dE = newEvt.get();
104 
105  std::vector<std::vector<double> > daughters;
106 
107  // Loop over 4 daughters
108  // Start at 1 as 0 is the mother particles
109  for (int i = 1; i < 5; i++)
110  {
111  std::vector<double> DaughterMom = this->getDaughterMom(dE,i);
112  daughters.push_back(DaughterMom);
113  }
114  return daughters;
115 }
virtual const TLorentzVector & p(unsigned int i) const =0
const std::vector< T > & getVector() const
DalitzEventPattern makeCPConjugate() const
X * get() const
Definition: counted_ptr.h:123