Fork me on GitHub

Changeset d1678fd in git for modules/SimpleCalorimeter.cc


Ignore:
Timestamp:
Mar 17, 2021, 5:07:53 PM (4 years ago)
Author:
michele <michele.selvaggi@…>
Branches:
master
Children:
5eda6767
Parents:
9cc5aeb
Message:

fix weighted time and tower position in calorimeter modules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/SimpleCalorimeter.cc

    r9cc5aeb rd1678fd  
    394394    fTowerEnergy += energy;
    395395
    396     fTowerTime += energy * position.T();
    397     fTowerTimeWeight += energy;
     396    fTowerTime += energy * energy * position.T(); //sigma_t ~ 1/E
     397    fTowerTimeWeight += energy * energy;
    398398
    399399    fTower->AddCandidate(particle);
     400    fTower->Position = position;
     401
    400402  }
    401403
     
    409411{
    410412  Candidate *tower, *track, *mother;
    411   Double_t energy, neutralEnergy, pt, eta, phi;
     413  Double_t energy, neutralEnergy, pt, eta, phi, r;
    412414  Double_t sigma, neutralSigma;
    413415  Double_t time;
     
    442444
    443445  pt = energy / TMath::CosH(eta);
    444 
    445   fTower->Position.SetPtEtaPhiE(1.0, eta, phi, time);
     446  r = TMath::Sqrt(fTower->Position.X()*fTower->Position.X()+fTower->Position.Y()*fTower->Position.Y());
     447 
     448  fTower->Position.SetPtEtaPhiE(r, eta, phi, time);
    446449  fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy);
    447450
Note: See TracChangeset for help on using the changeset viewer.