Fork me on GitHub

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/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
Note: See TracChangeset for help on using the changeset viewer.