StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcFgtHit.cc
1 /***************************************************************************
2  *
3  * $Id: StMcFgtHit.cc,v 2.6 2011/10/17 00:24:00 fisyak Exp $
4  * $Log: StMcFgtHit.cc,v $
5  * Revision 2.6 2011/10/17 00:24:00 fisyak
6  * Add time of flight for hits
7  *
8  * Revision 2.5 2009/10/13 19:14:27 perev
9  * Wei-Ming update
10  *
11  * Revision 2.4 2005/11/22 21:44:51 fisyak
12  * Add compress Print for McEvent, add Ssd collections
13  *
14  * Revision 2.3 2005/09/29 01:01:10 calderon
15  * Fixed bugs in printing event and hit information.
16  * Format operator<< for various classes.
17  *
18  * Revision 2.2 2005/07/19 20:07:34 calderon
19  * Addition of default constructor, including base class StMcHit constructor.
20  * Bracket calls to StMemoryPool inside #ifdef.
21  *
22  * Revision 2.1 2005/04/18 20:11:33 calderon
23  * Addition of Fgt and Fst files. Modified other files to accomodate changes.
24  *
25  *
26  **************************************************************************/
27 #include "StMcFgtHit.hh"
28 
29 static const char rcsid[] = "$Id: StMcFgtHit.cc,v 2.6 2011/10/17 00:24:00 fisyak Exp $";
30 
31 ClassImp(StMcFgtHit)
32 
33 ostream& operator<<(ostream& os, const StMcFgtHit& h)
34 {
35  os << "StMcFgtHit" << endl;
36  os << *((StMcHit *) &h);
37  os << "Layer : " << h.layer() << endl;
38  os << "Quad : " << h.quad() << endl;
39  return os;
40 }
41 
42 ULong_t
43 StMcFgtHit::layer() const
44 {
45  ULong_t iLayer; // layer = disk in StFgtGeom
46 
47  // volumeId encoded in UPGR16
48  Int_t numbv1 = volumeId()/1000000;
49  Int_t numbv2 = (volumeId()/10000)%100;
50  if(numbv2 != 0) iLayer = (ULong_t) numbv1 - 1;
51  else iLayer = 8;
52  return iLayer;
53 }
54 
55 ULong_t
56 StMcFgtHit::quad() const
57 {
58  ULong_t iQuad;
59 
60  // volumeId encoded in UPGR16
61  Int_t numbv1 = volumeId()/1000000;
62  Int_t numbv2 = (volumeId()/10000)%100;
63  if(numbv2 != 0) iQuad = (ULong_t) (numbv2 - 1);
64  else iQuad = (ULong_t) (numbv1 - 1);
65 
66  return iQuad;
67 }
68 //________________________________________________________________________________
69 void StMcFgtHit::Print(Option_t *option) const {
70  cout << "FgtHit\t";
71  StMcHit::Print();
72  cout << "\tLayer: " << layer()
73  << "\tQuad: " << quad() << endl;;
74 }