FairRoot/PandaRoot
RhoTotalMomentum.cxx
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: RhoTotalMomentum.cc,v 1.1 1997/15/24 10:05:13
4 //
5 // Description:
6 // Class RhoTotalMomentum - a simple object to calculate the total
7 // 4 momentum in an event. More
8 // sophisticated algorithms can be added
9 // later.
10 //
11 // Environment:
12 // Software developed for the BaBar Detector at the SLAC B-Factory.
13 //
14 // Author List:
15 // Paul Harrison Original author
16 //
17 // Copyright Information:
18 // Copyright (C) 1997 Hedgehog Concepts
19 //
20 // ROOT Version by Marcel Kunze, RUB
21 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring)
22 //------------------------------------------------------------------------
23 
25 #include <assert.h>
26 #include <math.h>
27 #include "RhoBase/RhoCandList.h"
29 #include "TLorentzVector.h"
30 #include "RhoBase/RhoCandidate.h"
31 #include "RhoBase/RhoEventInfo.h"
32 
34 
35 TBuffer& operator>> ( TBuffer& buf, RhoTotalMomentum *&obj )
36 {
37  obj = ( RhoTotalMomentum* ) buf.ReadObject ( RhoTotalMomentum::Class() );
38  return buf;
39 }
40 
41 #include <iostream>
42 using namespace std;
43 
45  const RhoEventInfo& evtinfo )
46 {
47 
48  TLorentzVector tot4mom = TLorentzVector ( 0,0,0,0 );
49  const RhoCandidate* trkptr;
50 
51  RhoCandListIterator iter ( list );
52 
53  // loop over all the RhoCandidates
54  while ( ( trkptr = iter.Next() ) ) {
55  // Calculate total 4-momentum. More-sophisticated algorithms can
56  // be substituted later.
57  tot4mom += trkptr->P4();
58  }
59 
60  _total4Momentum = tot4mom; // set data member
61  _total4MomentumCms = _total4Momentum; //intermediate step
62  TVector3 cms = evtinfo.CmFrame().BoostVector();
63  _total4MomentumCms.Boost ( - ( cms ) ); //do boost
64 
65  _missing4Momentum = evtinfo.CmFrame()-tot4mom; // set data member
66  _missing4MomentumCms = _missing4Momentum; //intermediate step
67  _missing4MomentumCms.Boost ( - ( cms ) ); //do boost
68 }
69 
71 
RhoTotalMomentum *& obj
const TLorentzVector & CmFrame() const
Definition: RhoEventInfo.h:53
RhoTotalMomentum(RhoCandList &, const RhoEventInfo &)
TLorentzVector P4() const
Definition: RhoCandidate.h:195
return buf
ClassImp(RhoTotalMomentum) TBuffer &operator>>(TBuffer &buf
virtual ~RhoTotalMomentum()