CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CDPhoton.cxx
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// Package: CleoDChain
4// Module: CDPhoton
5//
6// Description: Implementation of candidate for CDPhotons
7//
8// Implimentation:
9// <Notes on implimentation>
10//
11// Author: Simon Patton
12// Created: Tue Mar 18 13:23:11 EST 1997
13// $Id: CDPhoton.cxx,v 1.3 2010/01/11 08:05:20 zoujh Exp $
14//
15// Revision history
16//
17// $Log: CDPhoton.cxx,v $
18// Revision 1.3 2010/01/11 08:05:20 zoujh
19// Add setIP for vertex correction
20//
21// Revision 1.2 2009/06/22 14:55:48 zoujh
22// See ChangeLog
23//
24// Revision 1.1.1.1 2009/03/03 06:05:56 maqm
25// first import of BesDChain
26//
27// Revision 1.4 2004/03/05 22:01:44 chengp
28// implemented Monte Carlo matching
29//
30// Revision 1.3 2002/02/28 02:17:51 cdj
31// removed unnecessary include of CDTruth.h
32//
33// Revision 1.2 2001/04/25 12:52:13 ajm36
34// plugged memory leak in ctor for pi0's, k shorts, etas
35//
36// Revision 1.1 2001/04/11 13:19:02 urner
37// transition to files with CD prefix. Addition of new files
38//
39// Revision 1.1 2001/03/23 23:05:28 urner
40// added pi0 eta and CDKs decay lists
41//
42// Revision 1.1.1.1 2000/12/18 22:17:25 cdj
43// imported CleoDChain
44//
45// Revision 1.15 1998/05/01 20:30:07 sjp
46// Modified include path for new placement of CO classes
47//
48// Revision 1.14 1998/04/21 05:18:26 sjp
49// Modified to use CDMud
50//
51// Revision 1.13 1998/04/17 18:55:50 sjp
52// Modified to use latest types
53//
54// Revision 1.12 1997/12/23 21:54:26 sjp
55// Modified package to be completely templated
56//
57// Revision 1.11 1997/09/03 14:58:36 sjp
58// Use new report.h and KTKinematicData
59//
60// Revision 1.10 1997/08/29 17:00:37 sjp
61// Modified to handle new Cairn Templated classes
62//
63// Revision 1.9 1997/08/19 20:40:18 sjp
64// Updated to use <package>/<file>.h include structure.
65// (Note: This version of the code has not been compiled)
66//
67// Revision 1.8 1997/01/21 20:30:01 sjp
68// Changed CPP flags and include because of library reorganization
69//
70// Revision 1.7 1996/11/04 16:58:09 sjp
71// Updated to work with new CDCandidate
72//
73// Revision 1.6 1996/07/16 19:05:30 sjp
74// Restructed Libraries
75// Put relative pathnames into all includes
76//
77// Revision 1.5 1996/06/13 18:20:13 sjp
78// Implmented KTKinematicData caching.
79// Added capability to be built from a MCParticle
80//
81// Revision 1.4 1996/06/04 15:00:04 sjp
82// Coverted to use kinematicData opertaion of Shower
83//
84// Revision 1.3 1996/04/06 19:44:07 sjp
85// Changed `true' to `!false'
86//
87// Revision 1.2 1996/04/05 20:07:29 sjp
88// Added matching information
89//
90// Revision 1.1 1995/11/26 23:03:24 sjp
91// New Classes to handle Showers and CDPhotons.
92
93// system include files
94//#include <iostream>
95
96// user include files
100#include "BesDChain/CDMud.h"
101#include "BesDChain/CDPhoton.h"
102
104
105Hep3Vector CDPhoton::m_IPV(0.0, 0.0, 0.0);
106
107//------ Constructor -----
108// constructor using VisibleEvidence
109//
111 CDCandidate( CDMud< VisibleEvidence >::get( aVisible ) ) ,
112 m_visibleEvidence( aVisible )
113{
114}
115
116//------ Constructor -----
117// copy constructor
118//
119CDPhoton::CDPhoton( const CDPhoton& aOtherCDPhoton ) :
120 CDCandidate( aOtherCDPhoton ) ,
121 m_visibleEvidence( aOtherCDPhoton.m_visibleEvidence )
122{
123}
124
125
126//------ Destructor -----
127//
129{
130}
131
132
133//------ buildFromCDPhoton -----
134// return `true' as CDPhoton is made up from VisibleEvidence
135//
137{
138 return ( 0 != m_visibleEvidence ) ;
139}
140
141
142//------ photon -----
143// return NavShower for this CDPhoton
144//
146{
147 return m_visibleEvidence ;
148}
149
150//------ defaultKinematicData -----
151// create the kinematicData for this CDCandidate
152//
154{
155 RecEmcShower* emcShower = (const_cast<VisibleEvidence*>(m_visibleEvidence))->emcShower();
156
157 double eraw = emcShower->energy();
158
159 //double phi = emcShower->phi();
160 //double the = emcShower->theta();
161
162 Hep3Vector EmcV( emcShower->x(), emcShower->y(), emcShower->z() );
163 Hep3Vector PhotonV = EmcV - m_IPV;
164
165 double phi = PhotonV.phi();
166 double the = PhotonV.theta();
167
168 double px = eraw*sin(the)*cos(phi);
169 double py = eraw*sin(the)*sin(phi);
170 double pz = eraw*cos(the);
171
172 KinematicData* tmp = new KinematicData();
173
174 tmp->setP4( HepLorentzVector(px, py, pz, eraw) );
175
176 return tmp;
177}
178
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
Definition: CDMud.h:45
virtual const EvtRecTrack * photon() const
Definition: CDPhoton.cxx:145
virtual bool builtFromCDPhoton() const
Definition: CDPhoton.cxx:136
CDPhoton(const VisibleEvidence *aVisible)
Definition: CDPhoton.cxx:110
virtual DecayChain::KinematicData * defaultKinematicData() const
Definition: CDPhoton.cxx:153
virtual ~CDPhoton()
Definition: CDPhoton.cxx:128
void setP4(const HepLorentzVector &aMomentum)
double x() const
Definition: DstEmcShower.h:35
double z() const
Definition: DstEmcShower.h:37
double energy() const
Definition: DstEmcShower.h:45
double y() const
Definition: DstEmcShower.h:36