StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmc2ParticleCandidate.cxx
1 /*
2  * Created by S. Gliske, May 2012
3  *
4  * Description: see header.
5  *
6  */
7 
8 #include "StRoot/StEEmcPool/./EEmcTreeContainers/EEmc2ParticleCandidate.h"
9 
10 #include <cmath>
11 #include <iostream>
12 using std::cerr;
13 using std::endl;
14 
15 EEmc2ParticleCandidate_t::EEmc2ParticleCandidate_t( const EEmcParticleCandidate_t& childA, const EEmcParticleCandidate_t& childB ){
16  const EEmcParticleCandidate_t* child1 = &childA;
17  const EEmcParticleCandidate_t* child2 = &childB;
18 
19  // sort by higher energy
20  if( child1->E < child2->E ){
21  child1 = &childB;
22  child2 = &childA;
23  };
24 
25  PID = 2000;
26  hitIdx1 = child1->hitIdx1;
27  hitIdx2 = child2->hitIdx1;
28 
29  E = child1->E + child2->E;
30  Z = E ? ( child1->E - child2->E ) / E : 0;
31  position = ( child1->position + child2->position ) * 0.5;
32  momentum = ( child1->momentum + child2->momentum );
33  D = ( child1->position - child2->position ).Mag(); // assume same Z pos
34 
35  PT = momentum.Perp();
36  M = E*E - momentum.Mag2();
37  M = ( M > 0 ? sqrt(M) : -sqrt(-M) );
38 };
39 
40 ClassImp( EEmc2ParticleCandidate_t );
41 
42 /*
43  * $Id: EEmc2ParticleCandidate.cxx,v 1.1 2012/11/26 19:04:29 sgliske Exp $
44  * $Log: EEmc2ParticleCandidate.cxx,v $
45  * Revision 1.1 2012/11/26 19:04:29 sgliske
46  * moved from offline/users/sgliske/StRoot/StEEmcPool/EEmcTreeContainers to StRoot/StEEmcPool/EEmcTreeContainers
47  *
48  *
49  */