1 #include "StEmcPreCluster.h"
2 #include "StEventTypes.h"
14 mGeom = StEmcGeom::instance(detector);
18 Int_t nh = cluster.
nHits();
19 for(Int_t i = 0;i<nh;i++)
23 mGeom = StEmcGeom::instance(mDetector);
28 StPtrVecEmcRawHit& hits=cluster->hit();
29 for(Int_t i=0;i<(Int_t)hits.size();i++)
31 mDetector = (Int_t)(hits[0]->
detector()-kBarrelEmcTowerId+1);
32 mMatchingId = cluster->GetUniqueID();
33 mGeom = StEmcGeom::instance(mDetector);
36 StEmcPreCluster::~StEmcPreCluster()
38 mHits.Clear(
"nodelete");
42 if(!mHits.FindObject(hit))
47 if(mHits.FindObject(hit))
53 mHits.Remove(mHits.At(hitId));
69 Bool_t firstHit =
true;
70 for(Int_t i = 0;i<nH;i++)
75 m=(Int_t)hit->module();
80 mGeom->getEta(m,e, E);
81 mGeom->getPhi(m,s, P);
91 P = StEmcMath::getPhiPlusMinusPi(P);
101 mSigmaEta = mSigmaEta/mEnergy - mEta*mEta;
105 mSigmaEta = sqrt(mSigmaEta);
108 mSigmaPhi = mSigmaPhi/mEnergy - mPhi*mPhi;
112 mSigmaPhi = sqrt(mSigmaPhi);
116 mPhi = StEmcMath::getPhiPlusMinusPi(mPhi);
126 Int_t nH = cluster->
nHits();
127 for(Int_t i = 0;i<nH;i++)
135 StPtrVecEmcRawHit& hits=cluster->hit();
136 if(mDetector!=(Int_t)(hits[0]->
detector()-kBarrelEmcTowerId+1))
138 for(Int_t i=0;i<(Int_t)hits.size();i++)
148 Int_t nH = cluster->
nHits();
149 for(Int_t i = 0;i<nH;i++)
157 StPtrVecEmcRawHit& hits=cluster->hit();
158 if(mDetector!=(Int_t)(hits[0]->
detector()-kBarrelEmcTowerId+1))
160 for(Int_t i=0;i<(Int_t)hits.size();i++)
170 TList *above =
new TList();
173 Bool_t hasBelow = kFALSE;
174 for(Int_t i=0;i<nH;i++)
179 m=(Int_t)hit->module();
181 mGeom->getEta(m,e, E);
188 if(hasBelow && above->GetSize()>0)
191 Int_t na = above->GetSize();
192 for(Int_t i = 0;i<na;i++)
210 TList *above =
new TList();
213 Bool_t hasBelow = kFALSE;
214 for(Int_t i=0;i<nH;i++)
219 m=(Int_t)hit->module();
220 s=abs((Int_t)hit->sub());
221 mGeom->getPhi(m,s, P);
223 P = StEmcMath::getPhiPlusMinusPi(P);
230 if(hasBelow && above->GetSize()>0)
233 Int_t na = above->GetSize();
234 for(Int_t i = 0;i<na;i++)
252 for(Int_t i = 0;i<nH;i++)
253 cluster->addHit(
getHit(i));
255 cluster->setEta(mEta);
256 cluster->setPhi(mPhi);
257 cluster->setSigmaEta(mSigmaEta);
258 cluster->setSigmaPhi(mSigmaPhi);
259 cluster->setEnergy(mEnergy);
260 cluster->SetUniqueID(mMatchingId);
StEmcPreCluster * splitInEta(Float_t)
split the cluster in the eta coordinate. Returns a pointer of the splitted cluster. The spllited cluster is not added to any collection
Int_t detector() const
returns the detector number
Int_t matchingId() const
returns the matching id with other detectors. 0 means no matching
Float_t energy() const
returns the energy of the cluster
void subtractCluster(StEmcPreCluster *)
subtract another cluster to this one.
void addHit(StEmcRawHit *)
add a hit to the cluster
Int_t nHits() const
returns the number of hits in the cluster
StEmcPreCluster * splitInPhi(Float_t)
split the cluster in the phi coordinate. Returns a pointer of the splitted cluster. The spllited cluster is not added to any collection
void removeHit(StEmcRawHit *)
removes a hit from the cluster
StEmcCluster * makeStCluster()
creates an StEmcCluster from the information in this pre cluster
void update()
updates cluster information. Calculates eta,phi, ernergy, etc from the hits added to the cluster ...
void addCluster(StEmcPreCluster *)
add another cluster to this one. Does not delete the added cluster
StEmcRawHit * getHit(Int_t i)
gets a pointer to a hit in the cluster
Float_t phi() const
returns the phi position of the cluster