Fork me on GitHub

Changeset d1678fd in git for modules


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

Location:
modules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • modules/Calorimeter.cc

    r9cc5aeb rd1678fd  
    450450
    451451    fTower->AddCandidate(particle);
     452    fTower->Position = position;
    452453  }
    453454
     
    461462{
    462463  Candidate *track, *tower, *mother;
    463   Double_t energy, pt, eta, phi;
     464  Double_t energy, pt, eta, phi, r;
    464465  Double_t ecalEnergy, hcalEnergy;
    465466  Double_t ecalNeutralEnergy, hcalNeutralEnergy;
     
    511512  for(size_t i = 0; i < fTower->ECalEnergyTimePairs.size(); ++i)
    512513  {
    513     weight = TMath::Sqrt(fTower->ECalEnergyTimePairs[i].first);
     514    weight = TMath::Power((fTower->ECalEnergyTimePairs[i].first),2);
    514515    sumWeightedTime += weight * fTower->ECalEnergyTimePairs[i].second;
    515516    sumWeight += weight;
     
    517518  }
    518519
     520  r = TMath::Sqrt(fTower->Position.X()*fTower->Position.X()+fTower->Position.Y()*fTower->Position.Y());
     521
    519522  if(sumWeight > 0.0)
    520523  {
    521     fTower->Position.SetPtEtaPhiE(1.0, eta, phi, sumWeightedTime / sumWeight);
     524    fTower->Position.SetPtEtaPhiE(r, eta, phi, sumWeightedTime / sumWeight);
    522525  }
    523526  else
    524527  {
    525     fTower->Position.SetPtEtaPhiE(1.0, eta, phi, 999999.9);
     528    fTower->Position.SetPtEtaPhiE(r, eta, phi, 999999.9);
    526529  }
    527530
  • modules/DualReadoutCalorimeter.cc

    r9cc5aeb rd1678fd  
    466466
    467467    fTower->AddCandidate(particle);
     468    fTower->Position = position;
    468469  }
    469470
     
    478479
    479480  Candidate *track, *tower, *mother;
    480   Double_t energy, pt, eta, phi;
     481  Double_t energy, pt, eta, phi, r;
    481482  Double_t ecalEnergy, hcalEnergy;
    482483  Double_t ecalNeutralEnergy, hcalNeutralEnergy, neutralEnergy;
     
    494495  if(!fTower) return;
    495496
    496 
    497   //if (fHCalTowerEnergy < 30 && fECalTowerEnergy < 30) return;
    498   //cout<<"----------- New tower ---------"<<endl;
    499 
    500 
    501   // here we change behaviour w.r.t to standard calorimeter. Start with worse case scenario. If fHCalTowerEnergy > 0, assume total energy smeared by HCAL resolution.
    502   // For example, if overlapping charged pions and photons take hadronic resolution as combined measurement
    503 
    504   // if no hadronic fraction at all, then use ECAL resolution
    505 
    506   //cout<<"fECalTowerEnergy: "<<fECalTowerEnergy<<", fHCalTowerEnergy: "<<fHCalTowerEnergy<<", Eta: "<<fTowerEta<<endl;
    507497
    508498  // if no hadronic energy, use ECAL resolution
     
    562552  for(size_t i = 0; i < fTower->ECalEnergyTimePairs.size(); ++i)
    563553  {
    564     weight = TMath::Sqrt(fTower->ECalEnergyTimePairs[i].first);
     554    weight = TMath::Power((fTower->ECalEnergyTimePairs[i].first),2);
    565555    sumWeightedTime += weight * fTower->ECalEnergyTimePairs[i].second;
    566556    sumWeight += weight;
     
    568558  }
    569559
     560  r = TMath::Sqrt(fTower->Position.X()*fTower->Position.X()+fTower->Position.Y()*fTower->Position.Y());
     561
    570562  if(sumWeight > 0.0)
    571563  {
    572     fTower->Position.SetPtEtaPhiE(1.0, eta, phi, sumWeightedTime/sumWeight);
     564    fTower->Position.SetPtEtaPhiE(r, eta, phi, sumWeightedTime/sumWeight);
    573565  }
    574566  else
    575567  {
    576     fTower->Position.SetPtEtaPhiE(1.0, eta, phi, 999999.9);
     568    fTower->Position.SetPtEtaPhiE(r, eta, phi, 999999.9);
    577569  }
    578570
  • 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.