Fork me on GitHub

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/DualReadoutCalorimeter.cc

    rd1678fd r5eda6767  
    247247  fItParticleInputArray->Reset();
    248248  number = -1;
     249  fTowerRmax=0.;
    249250  while((particle = static_cast<Candidate*>(fItParticleInputArray->Next())))
    250251  {
    251252    const TLorentzVector &particlePosition = particle->Position;
    252253    ++number;
     254
     255    // compute maximum radius (needed in FinalizeTower to assess whether barrel or endcap tower)
     256    if (particlePosition.Perp() > fTowerRmax)
     257      fTowerRmax=particlePosition.Perp();
    253258
    254259    pdgCode = TMath::Abs(particle->PID);
     
    558563  }
    559564
    560   r = TMath::Sqrt(fTower->Position.X()*fTower->Position.X()+fTower->Position.Y()*fTower->Position.Y());
     565  // check whether barrel or endcap tower
     566  if (fTower->Position.Perp() < fTowerRmax && TMath::Abs(eta) > 0.)
     567    r = fTower->Position.Z()/TMath::SinH(eta);
     568  else
     569    r = fTower->Position.Pt();
    561570
    562571  if(sumWeight > 0.0)
Note: See TracChangeset for help on using the changeset viewer.