Skip to content
Snippets Groups Projects
Commit c543140a authored by Vardan Tadevosyan's avatar Vardan Tadevosyan
Browse files

Add tracking in THcShowerArray.

parent b25add04
No related branches found
No related tags found
No related merge requests found
......@@ -1069,6 +1069,7 @@ Int_t THcShower::FineProcess( TClonesArray& tracks )
THaTrack* theTrack = static_cast<THaTrack*>( tracks[itrk] );
Float_t energy = GetShEnergy(theTrack);
if (fHasArray) energy += fArray->GetShEnergy(theTrack);
theTrack->SetEnergy(energy);
} //over tracks
......
......@@ -531,6 +531,55 @@ Int_t THcShowerArray::MatchCluster(THaTrack* Track,
return mclust;
}
//_____________________________________________________________________________
Float_t THcShowerArray::GetShEnergy(THaTrack* Track) {
// Get total energy deposited in the Array cluster matched to the given
// spectrometer Track.
// Track coordinates at the front of Array, initialize out of acceptance.
Double_t Xtr = -100.;
Double_t Ytr = -100.;
// Associate a cluster to the track.
Int_t mclust = MatchCluster(Track, Xtr, Ytr);
// Coordinate corrected total energy deposition in the cluster.
Float_t Etrk = 0.;
if (mclust >= 0) { // if there is a matched cluster
// Get matched cluster.
THcShowerCluster* cluster = *(fClusterList->begin()+mclust);
// No coordinate correction for now.
Etrk = clE(cluster);
} //mclust>=0
//Debug output.
THcShower* fParent = (THcShower*) GetParent();
if (fParent->fdbg_tracks_cal) {
cout << "---------------------------------------------------------------\n";
cout << "Debug output from THcShowerArray::GetShEnergy for "
<< GetName() << endl;
cout << " Track at Array: X = " << Xtr << " Y = " << Ytr;
if (mclust >= 0)
cout << ", matched cluster #" << mclust << "." << endl;
else
cout << ", no matched cluster found." << endl;
cout << " Track's Array energy = " << Etrk << "." << endl;
cout << "---------------------------------------------------------------\n";
}
return Etrk;
}
//_____________________________________________________________________________
Int_t THcShowerArray::FineProcess( TClonesArray& tracks )
{
......
......@@ -52,6 +52,11 @@ public:
// Cluster to track association method.
Int_t MatchCluster(THaTrack*, Double_t&, Double_t&);
// Get total energy deposited in the cluster matched to the given
// spectrometer Track.
Float_t GetShEnergy(THaTrack*);
// Double_t fSpacing; not used
TClonesArray* fParentHitList;
......@@ -125,7 +130,7 @@ protected:
Double_t fEarray; // Total Energy deposition in the array.
Int_t fNhits; // Total number of hits
Int_t fNclust; // Number of clusters
Int_t fNclust; // Number of clusters
Int_t fNtracks; // Number of shower tracks, i.e. number of
// cluster-to-track association
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment