17 #include "StEEmcSmdCluster.h"
21 #include "StEvent/StEmcCluster.h"
55 void StEEmcSmdCluster::print(Option_t *opts)
const
57 const Char_t *names[]={
"u",
"v"};
58 std::cout <<
"smd cluster plane=" << names[plane()] << std::endl;
59 std::cout <<
"key = " <<
key() << std::endl;
60 std::cout <<
"energy= " << energy() << std::endl;
61 std::cout <<
"mean = " << mean() << std::endl;
62 if ( TString(opts).Contains(
"all") ) {
63 for ( UInt_t ii=0;ii<
mStrips.size();ii++ )
66 std::cout <<
" w=" <<
mWeights[ii] << std::endl;
72 void StEEmcSmdCluster::printLine(Bool_t endline)
const
79 if ( endline ) std::cout << std::endl;
83 void StEEmcSmdCluster::copy( TH1F *h )
const
85 for ( UInt_t ii=0;ii<
mStrips.size();ii++ )
90 void StEEmcSmdCluster::add(
const StEEmcStripVec_t &strips)
92 for ( UInt_t ii=0;ii<strips.size();ii++ ) add( strips[ii] );
96 void StEEmcSmdCluster::add(
const StEEmcStrip &strip, Float_t weight)
108 Float_t energy = strip.
energy() * weight;
119 mNumberOfElements=
mSize;
133 Int_t iuv=(
mStrips[0].plane()==1 );
149 for ( Int_t i=0; i<numberOfStrips(); i++ ) {
159 Float_t StEEmcSmdCluster::energy(Int_t nmax, Option_t *opts)
const
163 if ( TString(opts).Contains(
"seed") )
171 Int_t min=(Int_t)(mymean-(Float_t)nmax);
172 Int_t max=(Int_t)(mymean+(Float_t)nmax);
176 for ( UInt_t i=0;i<
mStrips.size();i++ )
187 Float_t StEEmcSmdCluster::sigma(Int_t nmax, Option_t *opts)
const
191 if ( TString(opts).Contains(
"seed") )
199 Int_t min=(Int_t)(mymean-(Float_t)nmax);
200 Int_t max=(Int_t)(mymean+(Float_t)nmax);
202 std::cout <<
"mymean=" << mymean << std::endl;
203 std::cout <<
"min =" << min << std::endl;
204 std::cout <<
"max =" << max << std::endl;
210 for ( UInt_t i=0;i<
mStrips.size();i++ )
213 std::cout << i <<
" " << s.
index() << std::endl;
223 sig=TMath::Sqrt( x2sum/esum - (xsum/esum)*(xsum/esum) );
Int_t mRight
index of next strip to the right
Float_t mEnergy
Energy of this SMD cluster.
void name(const Char_t *n)
Set the name for this element.
Int_t mLeft
index of next strip to the left
void index(Int_t i)
Sets the index for this SMD strip, 0..287.
Float_t mMean
Mean and sigma computed after each strip is added.
std::vector< Float_t > mWeights
Vector of strip weights.
Int_t key()
Return a unique key assigned by the cluster maker.
Float_t mSumX2W
Running sums to calculate mean, sigma of cluster.
StEEmcStripVec_t mStrips
Vector of strips belonging to this SMD cluster.
A base class for representing clusters of EEMC smd strips.
StEmcCluster * mEmcCluster
POinter to EMC cluster.
Int_t mSize
Kludge so that root will store number of smd strips.
StEEmcTowerVec_t mMatchedTowers
Vector of hit towers above this SMD cluster.
void plane(Int_t p)
Sets the plane for this SMD strip, 0=U, 1=V.
void sector(Int_t s)
Sets the sector for this SMD strip.
void energy(Float_t e)
Set the energy (adc-ped+0.5)/gain for this element.
StEEmcStrip & strip(Int_t s)
Returns the specified smd strip w/in the cluster.
Base class for describing an endcap SMD strip.
Float_t mSumXW
Running sums to calculate mean, sigma of cluster.