Newer
Older
// 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);
// Correct track energy depositions for the impact coordinate.
for (UInt_t ip=0; ip<fNLayers; ip++) {
// Coordinate correction factors for positive and negative sides,
// different for double PMT counters in the 1-st two layes and for
// single PMT counters in the rear two layers.
Float_t corpos = 1.;
Float_t corneg = 1.;
if (ip < fNegCols) {
corpos = Ycor(Ytr,0);
corneg = Ycor(Ytr,1);
}
else {
corpos = Ycor(Ytr);
corneg = 0.;
}
Etrk += clEplane(cluster,ip,0) * corpos;
Etrk += clEplane(cluster,ip,1) * corneg;
} //over planes
} //mclust>=0
//Debug output.
if (fdbg_tracks_cal) {
cout << "---------------------------------------------------------------\n";
cout << "Debug output from THcShower::GetShEnergy for "
<< GetApparatus()->GetName() << endl;
cout << " Track at the calorimeter: X = " << Xtr << " Y = " << Ytr;
if (mclust >= 0)
cout << ", matched cluster #" << mclust << "." << endl;
else
cout << ", no matched cluster found." << endl;
cout << " Coordinate corrected track energy = " << Etrk << "." << endl;
cout << "---------------------------------------------------------------\n";
}
return Etrk;
}
Simon Zhamkochyan
committed
//_____________________________________________________________________________
Int_t THcShower::FineProcess( TClonesArray& tracks )
{
// Shower energy assignment to the spectrometer tracks.
Simon Zhamkochyan
committed
//
Int_t Ntracks = tracks.GetLast()+1; // Number of reconstructed tracks
for (Int_t itrk=0; itrk<Ntracks; itrk++) {
THaTrack* theTrack = static_cast<THaTrack*>( tracks[itrk] );
fEtrack = GetShEnergy(theTrack);
if (fHasArray) fEtrack += fArray->GetShEnergy(theTrack);
theTrack->SetEnergy(fEtrack);
if (fdbg_tracks_cal) {
cout << "---------------------------------------------------------------\n";
cout << "Debug output from THcShower::FineProcess for "
<< GetApparatus()->GetName() << endl;
cout << " Number of tracks = " << Ntracks << endl;
for (Int_t itrk=0; itrk<Ntracks; itrk++) {
THaTrack* theTrack = static_cast<THaTrack*>( tracks[itrk] );
cout << " Track " << itrk << ": "
<< " X = " << theTrack->GetX()
<< " Y = " << theTrack->GetY()
<< " Theta = " << theTrack->GetTheta()
<< " Phi = " << theTrack->GetPhi()
<< " Energy = " << theTrack->GetEnergy() << endl;
}
cout << "---------------------------------------------------------------\n";
}
Simon Zhamkochyan
committed
return 0;
}
Double_t THcShower::GetNormETot( ){
return fEtotNorm;
Simon Zhamkochyan
committed
ClassImp(THcShower)
////////////////////////////////////////////////////////////////////////////////