StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcFtpcHit.cc
1 /***************************************************************************
2  *
3  * $Id: StMcFtpcHit.cc,v 2.15 2011/10/17 00:24:00 fisyak Exp $
4  * $Log: StMcFtpcHit.cc,v $
5  * Revision 2.15 2011/10/17 00:24:00 fisyak
6  * Add time of flight for hits
7  *
8  * Revision 2.14 2005/11/22 21:44:51 fisyak
9  * Add compress Print for McEvent, add Ssd collections
10  *
11  * Revision 2.13 2005/09/29 01:01:10 calderon
12  * Fixed bugs in printing event and hit information.
13  * Format operator<< for various classes.
14  *
15  * Revision 2.12 2005/09/28 21:30:14 fisyak
16  * Persistent StMcEvent
17  *
18  * Revision 2.11 2005/01/27 23:40:47 calderon
19  * Adding persistency to StMcEvent as a step for Virtual MonteCarlo.
20  *
21  * Revision 2.10 2003/12/02 21:22:03 calderon
22  * remove unnecessary #include "StMcTrack.hh"
23  *
24  * Revision 2.9 2003/10/08 21:21:31 calderon
25  * Added backward compatibility for plane(), in case of volumeId < 1000.
26  * The sector() will return a dummy value of 99999 in this case.
27  *
28  * Revision 2.8 2003/10/08 20:17:55 calderon
29  * -using <iostream>, std::cout, std::ostream.
30  * -changes in FTPC volume Id.
31  * o Causes changes in decoding of plane().
32  * o sector() is added.
33  * o print volumeId and sector() in the operator<<.
34  *
35  * Revision 2.7 2000/06/06 02:58:41 calderon
36  * Introduction of Calorimeter classes. Modified several classes
37  * accordingly.
38  *
39  * Revision 2.6 2000/05/05 15:25:43 calderon
40  * Reduced dependencies and made constructors more efficient
41  *
42  * Revision 2.5 2000/04/18 00:55:14 calderon
43  * added printout of local momentum to operator<<
44  *
45  * Revision 2.4 2000/04/17 23:01:15 calderon
46  * Added local momentum to hits as per Lee's request
47  *
48  * Revision 2.3 1999/12/14 07:04:49 calderon
49  * Numbering scheme as per SVT request.
50  *
51  * Revision 2.2 1999/12/03 00:51:52 calderon
52  * Tested with new StMcEventMaker. Added messages for
53  * diagnostics.
54  *
55  * Revision 2.1 1999/11/19 19:06:32 calderon
56  * Recommit after redoing the files.
57  *
58  * Revision 2.0 1999/11/17 02:12:16 calderon
59  * Completely revised for new StEvent
60  *
61  * Revision 1.3 1999/09/23 21:25:50 calderon
62  * Added Log & Id
63  * Modified includes according to Yuri
64  *
65  *
66  **************************************************************************/
67 #include "StThreeVectorF.hh"
68 
69 #include "StMcFtpcHit.hh"
70 
71 static const char rcsid[] = "$Id: StMcFtpcHit.cc,v 2.15 2011/10/17 00:24:00 fisyak Exp $";
72 
73 ClassImp(StMcFtpcHit);
74 
75 ostream& operator<<(ostream& os, const StMcFtpcHit& h)
76 {
77  os << "FtpcHit" << endl;
78  os << *((StMcHit *) &h);
79  os << "Plane : " << h.plane() << endl;
80  os << "Sector : " << h.sector() << endl;;
81  return os;
82 }
83 
84 ULong_t
85 StMcFtpcHit::plane() const
86 {
87  if (mVolumeId<1000) return (mVolumeId/100 - 1)*10 + (mVolumeId)%100; // for backward compatibility
88 
89  //new encoding from Maria: 1st (west) or 2nd (east) FTPC * 1000 + plane * 100 + sector
90  //volume_id = 101? to 110? are the first FTPC (1-10 in StEvent), last digit is sector (below)
91  //volume_id = 201? to 210? are the second FTPC (11-20 in StEvent), last digit is sector (below)
92  return (mVolumeId/1000 - 1)*10 + (mVolumeId/10)%100;
93 }
94 
95 ULong_t
96 StMcFtpcHit::sector() const
97 {
98  if (mVolumeId < 1000) return 99999; // for backward compatibility
99  //volume_id = 1??1 to 1??6 are the sectors in the first FTPC (1-6 in StEvent)
100  //volume_id = 2??1 to 2??6 are the sectors in the second FTPC (1-6 in StEvent)
101  return mVolumeId%10;
102 }
103 //________________________________________________________________________________
104 void StMcFtpcHit::Print(Option_t *option) const {
105  cout << "FtpcHit\t";
106  StMcHit::Print();
107  cout << "\tPlane:" << plane()
108  << " Sector:" << sector();
109 }