Fork me on GitHub

Changeset 5eda6767 in git


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

Location:
modules
Files:
6 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)
  • modules/Calorimeter.h

    rd1678fd r5eda6767  
    6060  Double_t fTimingEnergyMin;
    6161  Bool_t fElectronsFromTrack;
     62  Double_t fTowerRmax;
    6263
    6364  Int_t fTowerTrackHits, fTowerPhotonHits;
  • 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)
  • modules/DualReadoutCalorimeter.h

    rd1678fd r5eda6767  
    6060  Double_t fECalTrackEnergy, fHCalTrackEnergy;
    6161  Double_t fTrackEnergy;
     62  Double_t fTowerRmax;
    6263
    6364  Double_t fTimingEnergyMin;
  • 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);
  • modules/SimpleCalorimeter.h

    rd1678fd r5eda6767  
    6262  Double_t fTrackTime;
    6363
     64  Double_t fTowerRmax;
     65
    6466  Double_t fTowerTimeWeight;
    6567  Double_t fTrackTimeWeight;
Note: See TracChangeset for help on using the changeset viewer.