StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TpcMapUtilities.cxx
1 // $Id: TpcMapUtilities.cxx,v 1.2 2006/05/20 03:17:21 genevb Exp $
3 //
4 // Author: M.L. Miller, Yale
5 //
7 //
8 // Description: TPC sector gains map utilities
9 //
11 //
12 // $Log: TpcMapUtilities.cxx,v $
13 // Revision 1.2 2006/05/20 03:17:21 genevb
14 // Changed MapKey to MapQAKey to make it unique for QA
15 //
16 // Revision 1.1 2000/08/09 18:57:44 lansdell
17 // improvements in TPC gains code reduces CPU time per event by factor of 2
18 //
19 //
21 
22 #include "TpcMapUtilities.h"
23 
24 //Equality defined by same sector and padrow
25 bool HitMapQAKey::operator==(const HitMapQAKey& key2) const
26 {
27  if (this->sector==key2.sector && this->padrow==key2.padrow)
28  {return true;}
29  else {return false;}
30 }
31 
32 //Return true if key2 < key1. Order first by sector, then by padrow.
33 bool MapQAKeyLessThan::operator() (const HitMapQAKey& key1, const HitMapQAKey& key2) const
34 {
35  bool val = false;
36  if (key1.sector > key2.sector) {val = false;}
37  if (key1.sector < key2.sector) {val = true;}
38  if (key1.sector == key2.sector) {
39  if (key1.padrow > key2.padrow) {val = false;}
40  if (key1.padrow < key2.padrow) {val = true;}
41  if (key1.padrow == key2.padrow) {val = false;}
42  }
43  return val;
44 }
45 
46 //---------------------------------------
47 PadrowLocation::PadrowLocation() {};
48 
49 PadrowLocation::PadrowLocation(const StThreeVectorD& out, const StThreeVectorD& cent, const StThreeVectorD& in)
50 {
51  m_TopPoint = out;
52  m_MidPoint = cent;
53  m_BotPoint = in;
54 }
55 
56 PadrowLocation::~PadrowLocation() {};
57 
58 const StThreeVectorD& PadrowLocation::outsidePoint() const { return m_TopPoint;}
59 const StThreeVectorD& PadrowLocation::centerPoint() const { return m_MidPoint;}
60 const StThreeVectorD& PadrowLocation::insidePoint() const { return m_BotPoint;}
61 
62 void PadrowLocation::print() const
63 {
64  cout<<m_TopPoint<<"\t"<<m_MidPoint<<"\t"<<m_BotPoint<<endl;
65  return;
66 }
67