Fork me on GitHub

Changeset 5eda6767 in git for modules/SimpleCalorimeter.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/SimpleCalorimeter.cc

    rd1678fd r5eda6767  
    208208  fItParticleInputArray->Reset();
    209209  number = -1;
     210  fTowerRmax=0.;
    210211  while((particle = static_cast<Candidate *>(fItParticleInputArray->Next())))
    211212  {
    212213    const TLorentzVector &particlePosition = particle->Position;
    213214    ++number;
     215
     216    // compute maximum radius (needed in FinalizeTower to assess whether barrel or endcap tower)
     217    if (particlePosition.Perp() > fTowerRmax)
     218      fTowerRmax=particlePosition.Perp();
    214219
    215220    pdgCode = TMath::Abs(particle->PID);
     
    444449
    445450  pt = energy / TMath::CosH(eta);
    446   r = TMath::Sqrt(fTower->Position.X()*fTower->Position.X()+fTower->Position.Y()*fTower->Position.Y());
    447  
     451
     452  // check whether barrel or endcap tower
     453  if (fTower->Position.Perp() < fTowerRmax && TMath::Abs(eta) > 0.)
     454    r = fTower->Position.Z()/TMath::SinH(eta);
     455  else
     456    r = fTower->Position.Pt();
     457
    448458  fTower->Position.SetPtEtaPhiE(r, eta, phi, time);
    449459  fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy);
Note: See TracChangeset for help on using the changeset viewer.