Fork me on GitHub

Changeset 5eda6767 in git for modules/Calorimeter.cc


Ignore:
Timestamp:
Mar 18, 2021, 6:28:10 PM (4 years ago)
Author:
Michele Selvaggi <michele@…>
Branches:
master
Children:
cb80e6f
Parents:
d1678fd
Message:

fix calo tower position

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Calorimeter.cc

    rd1678fd r5eda6767  
    231231  fItParticleInputArray->Reset();
    232232  number = -1;
     233  fTowerRmax=0.;
    233234  while((particle = static_cast<Candidate *>(fItParticleInputArray->Next())))
    234235  {
    235236    const TLorentzVector &particlePosition = particle->Position;
    236237    ++number;
     238
     239    // compute maximum radius (needed in FinalizeTower to assess whether barrel or endcap tower)
     240    if (particlePosition.Perp() > fTowerRmax)
     241      fTowerRmax=particlePosition.Perp();
    237242
    238243    pdgCode = TMath::Abs(particle->PID);
     
    518523  }
    519524
    520   r = TMath::Sqrt(fTower->Position.X()*fTower->Position.X()+fTower->Position.Y()*fTower->Position.Y());
     525  // check whether barrel or endcap tower
     526  if (fTower->Position.Perp() < fTowerRmax && TMath::Abs(eta) > 0.)
     527    r = fTower->Position.Z()/TMath::SinH(eta);
     528  else
     529    r = fTower->Position.Pt();
    521530
    522531  if(sumWeight > 0.0)
Note: See TracChangeset for help on using the changeset viewer.