StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcHit.cxx
1 
9 #include "StEEmcHit.h"
10 
11 void StEEmcHit_t::setNumUsedTowers( UInt_t n ){
12  mUsedTowerIndices.Set( n );
13  mUsedTowerWeights.Set( n );
14 };
15 
16 void StEEmcHit_t::addUsedTower( Int_t localIndex, Short_t towIndex, Float_t weight ){
17  if( localIndex <= mUsedTowerIndices.GetSize() && localIndex <= mUsedTowerWeights.GetSize() && localIndex > -1 ){
18  mUsedTowerIndices[ localIndex ] = towIndex;
19  mUsedTowerWeights[ localIndex ] = weight;
20  };
21 };
22 
23 void StEEmcHit_t::setUsedTowers( std::vector< Short_t >& usedIndices, std::vector< Float_t >& weights ){
24  UInt_t n = usedIndices.size();
25  UInt_t n2 = weights.size();
26 
27  // if different sizes, just copy as many as both are valid
28  if( n2 < n )
29  n = n2;
30 
31  mUsedTowerIndices.Set( n );
32  mUsedTowerWeights.Set( n );
33 
34 
35  for( UInt_t i = 0; i<n; ++i ){
36  mUsedTowerIndices[ i ] = usedIndices[i];
37  mUsedTowerWeights[ i ] = weights[i];
38  };
39 };
40 
41 
42 std::ostream &operator<<( std::ostream &out, const StEEmcHit_t &hit ){
43  out << *static_cast< const StSimpleHit_t* >( &hit ) << ", sec = ";
44  out << hit.getSector() << ", u ";
45  out << hit.getClusIDu() << ' ';
46  out << hit.getEnergyU() << ' ';
47  out << hit.getWeightU() << ", v ";
48  out << hit.getClusIDv() << ' ';
49  out << hit.getEnergyV() << ' ';
50  out << hit.getWeightV() << ", tow ";
51  out << hit.getTowerIdx() << ", ttest ";
52  out << hit.getTtest2();
53 
54  return out;
55 };
56 
57 ClassImp(StEEmcHit_t);
58 
59 /*
60  * $Id: StEEmcHit.cxx,v 1.1 2012/11/26 19:05:54 sgliske Exp $
61  * $Log: StEEmcHit.cxx,v $
62  * Revision 1.1 2012/11/26 19:05:54 sgliske
63  * moved from offline/users/sgliske/StRoot/StEEmcPool/StEEmcHitMaker to StRoot/StEEmcPool/StEEmcHitMaker
64  *
65  *
66  */
The class.
Definition: StEEmcHit.h:37
TArrayS mUsedTowerIndices
just a flag whether to keep in vector
Definition: StEEmcHit.h:101