BOSS 8.0.0
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
97#include "BesDChain/CDPhoton.h"
98#include "BesDChain/CDMud.h"
99#include "BesDChain/util/KinematicData.h"
100#include "EmcRecEventModel/RecEmcShower.h"
101#include "EvtRecEvent/EvtRecTrack.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 ) ), m_visibleEvidence( aVisible ) {}
112
113//------ Constructor -----
114// copy constructor
115//
116CDPhoton::CDPhoton( const CDPhoton& aOtherCDPhoton )
117 : CDCandidate( aOtherCDPhoton ), m_visibleEvidence( aOtherCDPhoton.m_visibleEvidence ) {}
118
119//------ Destructor -----
120//
122
123//------ buildFromCDPhoton -----
124// return `true' as CDPhoton is made up from VisibleEvidence
125//
126bool CDPhoton::builtFromCDPhoton() const { return ( 0 != m_visibleEvidence ); }
127
128//------ photon -----
129// return NavShower for this CDPhoton
130//
131const EvtRecTrack* CDPhoton::photon() const { return m_visibleEvidence; }
132
133//------ defaultKinematicData -----
134// create the kinematicData for this CDCandidate
135//
137 RecEmcShower* emcShower = ( const_cast<VisibleEvidence*>( m_visibleEvidence ) )->emcShower();
138
139 double eraw = emcShower->energy();
140
141 // double phi = emcShower->phi();
142 // double the = emcShower->theta();
143
144 Hep3Vector EmcV( emcShower->x(), emcShower->y(), emcShower->z() );
145 Hep3Vector PhotonV = EmcV - m_IPV;
146
147 double phi = PhotonV.phi();
148 double the = PhotonV.theta();
149
150 double px = eraw * sin( the ) * cos( phi );
151 double py = eraw * sin( the ) * sin( phi );
152 double pz = eraw * cos( the );
153
154 KinematicData* tmp = new KinematicData();
155
156 tmp->setP4( HepLorentzVector( px, py, pz, eraw ) );
157
158 return tmp;
159}
CDCandidate(const CDCandidate &aOtherCDCandidate)
virtual const EvtRecTrack * photon() const
Definition CDPhoton.cxx:131
virtual bool builtFromCDPhoton() const
Definition CDPhoton.cxx:126
CDPhoton(const VisibleEvidence *aVisible)
Definition CDPhoton.cxx:110
virtual DecayChain::KinematicData * defaultKinematicData() const
Definition CDPhoton.cxx:136
virtual ~CDPhoton()
Definition CDPhoton.cxx:121
void setP4(const HepLorentzVector &aMomentum)