Skip to content
Snippets Groups Projects
THcShower.cxx 32 KiB
Newer Older
  • Learn to ignore specific revisions
  •   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
    
    
    
        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;
    
      //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";
      }
    
    //_____________________________________________________________________________
    Int_t THcShower::FineProcess( TClonesArray& tracks )
    {
    
    
      // Shower energy assignment to the spectrometer tracks.
    
      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);
    
      }       //over tracks
    
    Zafar's avatar
    Zafar committed
    
    
      //Debug output.
    
    Zafar's avatar
    Zafar committed
    
    
      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";
      }
    
    Double_t THcShower::GetNormETot( ){
      return fEtotNorm;
    } 
    
    
    ClassImp(THcShower)
    ////////////////////////////////////////////////////////////////////////////////