]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/PHOS-HTML/src/AliPHOSHit.cxx.html
This commit was generated by cvs2svn to compensate for changes in r799,
[u/mrichter/AliRoot.git] / PHOS / PHOS-HTML / src / AliPHOSHit.cxx.html
CommitLineData
29c81279 1<!DOCTYPE HTML PUBLIC "-// IETF/DTD HTML 2.0// EN">
2<html>
3<!-- -->
4<!-- Author: ROOT team (rootdev@hpsalo.cern.ch) -->
5<!-- -->
6<!-- Date: Thu Mar 9 00:11:49 2000 -->
7<!-- -->
8<head>
9<title>AliPHOSHit - source file</title>
10<link rev=made href="mailto:rootdev@root.cern.ch">
11<meta name="rating" content="General">
12<meta name="objecttype" content="Manual">
13<meta name="keywords" content="software development, oo, object oriented, unix, x11, motif, windows nt, c++, html, rene brun, fons rademakers">
14<meta name="description" content="ROOT - An Object Oriented Framework For Large Scale Data Analysis.">
15</head>
16<body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#551a8b" ALINK="#ff0000" TEXT="#000000">
17<a name="TopOfPage"></a>
18<pre>
19/**************************************************************************
20 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
21 * *
22 * Author: The ALICE Off-line Project. *
23 * Contributors are mentioned in the code where appropriate. *
24 * *
25 * Permission to use, copy, modify and distribute this software and its *
26 * documentation strictly for non-commercial purposes is hereby granted *
27 * without fee, provided that the above copyright notice appears in all *
28 * copies and that both the copyright notice and this permission notice *
29 * appear in the supporting documentation. The authors make no claims *
30 * about the suitability of this software for any purpose. It is *
31 * provided "as is" without express or implied warranty. *
32 **************************************************************************/
33
34/* $Id$ */
35
36<b>//_________________________________________________________________________</b>
37<b>// Hits class for PHOS </b>
38<b>// A hit in PHOS is the sum of all hits in a single crystal</b>
39<b>// </b>
40<b>//*-- Author: Maxime Volkov (RRC KI) &amp; Yves Schutz (SUBATECH)</b>
41
42<b>// --- ROOT system ---</b>
43
44<b>// --- Standard library ---</b>
45#include &lt;cstdio&gt;
46#include &lt;cstring&gt;
47#include &lt;cstdlib&gt;
48#include &lt;strstream&gt;
49
50<b>// --- AliRoot header files ---</b>
51#include "<a href="../AliPHOSHit.h">AliPHOSHit.h</a>"
52#include "AliRun.h"
53#include "AliConst.h"
54
55
56ClassImp(AliPHOSHit)
57
58<b>//____________________________________________________________________________</b>
59<a name="AliPHOSHit:AliPHOSHit"> </a><a href=".././AliPHOSHit.html#AliPHOSHit:AliPHOSHit">AliPHOSHit::AliPHOSHit</a>(<a href="../ListOfTypes.html#Int_t">Int_t</a> primary, <a href="../ListOfTypes.html#Int_t">Int_t</a> id, <a href="../ListOfTypes.html#Float_t">Float_t</a> *hits)
60{
61<b> // ctor</b>
62
63 <a href=".././AliPHOSHit.html#AliPHOSHit:fId">fId</a> = id ;
64 fX = hits[0] ;
65 fY = hits[1] ;
66 fZ = hits[2] ;
67 <a href=".././AliPHOSHit.html#AliPHOSHit:fELOS">fELOS</a> = hits[3] ;
68 <a href=".././AliPHOSHit.html#AliPHOSHit:fPrimary">fPrimary</a> = primary ;
69}
70
71<b>//____________________________________________________________________________</b>
72<a href="../ListOfTypes.html#Bool_t">Bool_t</a> <a href=".././AliPHOSHit.html#AliPHOSHit:operator">AliPHOSHit::operator</a>==(<a href=".././AliPHOSHit.html">AliPHOSHit</a> const &amp;rValue) const
73{
74<b> // Two hits are identical if they have the same Id and originate from the same primary</b>
75
76 <a href="../ListOfTypes.html#Bool_t">Bool_t</a> rv = kFALSE ;
77
78 if ( <a href=".././AliPHOSHit.html#AliPHOSHit:fId">fId</a> == rValue.<a href="#AliPHOSHit:GetId">GetId</a>() &amp;&amp; <a href=".././AliPHOSHit.html#AliPHOSHit:fPrimary">fPrimary</a> == rValue.<a href="#AliPHOSHit:GetPrimary">GetPrimary</a>() )
79 rv = kTRUE;
80
81 return rv;
82}
83
84<b>//____________________________________________________________________________</b>
85<a href=".././AliPHOSHit.html">AliPHOSHit</a> <a href=".././AliPHOSHit.html#AliPHOSHit:operator">AliPHOSHit::operator</a>+(const <a href=".././AliPHOSHit.html">AliPHOSHit</a> &amp;rValue) const
86{
87<b> // Add the energy of the hit</b>
88
89 <a href=".././AliPHOSHit.html">AliPHOSHit</a> added(*this);
90
91 added.fX = rValue.fX ;
92 added.fY = rValue.fY ;
93 added.fZ = rValue.fZ ;
94
95 added.<a href=".././AliPHOSHit.html#AliPHOSHit:fELOS">fELOS</a> += rValue.<a href="#AliPHOSHit:GetEnergy">GetEnergy</a>() ;
96
97 return added;
98
99}
100
101<b>//____________________________________________________________________________</b>
102ostream&amp; operator &lt;&lt; (ostream&amp; out, const <a href=".././AliPHOSHit.html">AliPHOSHit</a>&amp; hit)
103{
104<b> // Print out Id and energy </b>
105
106 out &lt;&lt; "<a href=".././AliPHOSHit.html">AliPHOSHit</a> = " &lt;&lt; hit.<a href="#AliPHOSHit:GetId">GetId</a>() &lt;&lt; " " &lt;&lt; hit.<a href="#AliPHOSHit:GetEnergy">GetEnergy</a>() &lt;&lt; endl ;
107 return out ;
108}
109
110
111
112</pre>
113
114<!--SIGNATURE-->
115<br>
116<address>
117<hr>
118<center>
119<a href="http://root.cern.ch/root/Welcome.html">ROOT page</a> - <a href="../ClassIndex.html">Class index</a> - <a href="#TopOfPage">Top of the page</a><br>
120</center>
121<hr>This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to <a href="mailto:rootdev@root.cern.ch">ROOT support</a>, or contact <a href="mailto:rootdev@root.cern.ch">the developers</a> with any questions or problems regarding ROOT.
122</address>
123</body>
124</html>