Changeset 61dccd3 in git for modules/DualReadoutCalorimeter.cc
- Timestamp:
- Aug 24, 2021, 11:57:44 AM (3 years ago)
- Branches:
- master
- Children:
- 83e77ee
- Parents:
- 1ad8eca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/DualReadoutCalorimeter.cc
r1ad8eca r61dccd3 248 248 number = -1; 249 249 fTowerRmax=0.; 250 251 //cout<<"--------- new event ---------- "<<endl; 252 250 253 while((particle = static_cast<Candidate*>(fItParticleInputArray->Next()))) 251 254 { … … 391 394 fTowerTrackHits = 0; 392 395 fTowerPhotonHits = 0; 396 397 fTowerTime = 0.0; 398 fTowerTimeWeight = 0.0; 393 399 394 400 fECalTowerTrackArray->Clear(); … … 455 461 position = particle->Position; 456 462 463 457 464 // fill current tower 458 465 ecalEnergy = momentum.E() * fECalTowerFractions[number]; … … 462 469 fHCalTowerEnergy += hcalEnergy; 463 470 464 if(ecalEnergy > fTimingEnergyMin && fTower) 465 { 466 if (abs(particle->PID) != 11 || !fElectronsFromTrack) 467 { 468 fTower->ECalEnergyTimePairs.push_back(make_pair<Float_t, Float_t>(ecalEnergy, particle->Position.T())); 469 } 470 } 471 // assume combined timing measurements in ECAL/HCAL sections 472 fTowerTime += (ecalEnergy + hcalEnergy) * position.T(); //sigma_t ~ 1/sqrt(E) 473 fTowerTimeWeight += ecalEnergy + hcalEnergy; 474 //fTowerTime += (hcalEnergy) * position.T(); //sigma_t ~ 1/sqrt(E) 475 //fTowerTimeWeight += hcalEnergy; 476 //fTowerTime += position.T(); //sigma_t ~ 1/sqrt(E) 477 //fTowerTimeWeight += 1; 478 479 //cout<<" tower particle PID, pt, eta, phi, l, tof: "<<particle->PID<<", "<<momentum.E()<<", "<<momentum.Eta()<<", "<<momentum.Phi()<<", "<<position.Vect().Mag()<<", "<<position.T()/2.99792458E2<<endl; 480 //cout<<" tower particle time, weight: "<<fTowerTime/2.99792458E2<<", "<<fTowerTimeWeight<<endl; 471 481 472 482 fTower->AddCandidate(particle); … … 484 494 485 495 Candidate *track, *tower, *mother; 486 Double_t energy, pt, eta, phi, r ;496 Double_t energy, pt, eta, phi, r, time; 487 497 Double_t ecalEnergy, hcalEnergy; 488 498 Double_t ecalNeutralEnergy, hcalNeutralEnergy, neutralEnergy; … … 529 539 hcalEnergy = LogNormal(fHCalTowerEnergy, hcalSigma); 530 540 541 time = (fTowerTimeWeight < 1.0E-09) ? 0.0 : fTowerTime / fTowerTimeWeight; 542 531 543 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy); 532 544 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy); … … 535 547 if(hcalEnergy < fHCalEnergyMin || hcalEnergy < fHCalEnergySignificanceMin*hcalSigma) hcalEnergy = 0.0; 536 548 537 //cout<<"Measured energy: "<<energy<<endl;538 539 549 if(fSmearTowerCenter) 540 550 { … … 550 560 pt = energy / TMath::CosH(eta); 551 561 552 // Time calculation for tower553 fTower->NTimeHits = 0;554 sumWeightedTime = 0.0;555 sumWeight = 0.0;556 557 for(size_t i = 0; i < fTower->ECalEnergyTimePairs.size(); ++i)558 {559 weight = TMath::Power((fTower->ECalEnergyTimePairs[i].first),2);560 sumWeightedTime += weight * fTower->ECalEnergyTimePairs[i].second;561 sumWeight += weight;562 fTower->NTimeHits++;563 }564 565 562 // check whether barrel or endcap tower 566 if ( fTower->Position.Perp() < fTowerRmax&& TMath::Abs(eta) > 0.)563 if ((fTowerRmax - fTower->Position.Perp()) < 1.e-06 && TMath::Abs(eta) > 0.) 567 564 r = fTower->Position.Z()/TMath::SinH(eta); 568 565 else 569 566 r = fTower->Position.Pt(); 570 567 571 if(sumWeight > 0.0) 572 { 573 fTower->Position.SetPtEtaPhiE(r, eta, phi, sumWeightedTime/sumWeight); 574 } 575 else 576 { 577 fTower->Position.SetPtEtaPhiE(r, eta, phi, 999999.9); 578 } 568 fTower->Position.SetPtEtaPhiE(r, eta, phi, time); 569 570 fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 571 fTower->L = fTower->Position.Vect().Mag(); 572 //cout<<" tower pt, eta, phi, l, tof: "<<fTower->Momentum.E()<<", "<<fTower->Momentum.Eta()<<", "<<fTower->Momentum.Phi()<<", "<<fTower->L<<", "<<fTower->Position.T()/2.99792458E2<<endl; 579 573 580 574 fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 581 575 fTower->Eem = ecalEnergy; 582 576 fTower->Ehad = hcalEnergy; 583 577 fTower->Etrk = fTrackEnergy; 584 578 fTower->Edges[0] = fTowerEdges[0]; 585 579 fTower->Edges[1] = fTowerEdges[1]; … … 602 596 neutralSigma = neutralEnergy / TMath::Sqrt(fTrackSigma*fTrackSigma + sigma*sigma); 603 597 604 //cout<<"trackEnergy: "<<fTrackEnergy<<", trackSigma: "<<fTrackSigma<<", Ntracks: "<<fTowerTrackArray->GetEntries()<<endl;605 606 //cout<<"neutralEnergy: "<<neutralEnergy<<", neutralSigma: "<<neutralSigma<<", :fEnergyMin "<<fEnergyMin<<", fEnergySignificanceMin: "<<fEnergySignificanceMin<<endl;607 608 // For now, if neutral excess is significant, simply create neutral EflowPhoton tower and clone each track into eflowtrack !!! -> Creating only photons !! EFlowNeutralHadron collection will be empy!!! TO BE FIXED609 598 if(neutralEnergy > fEnergyMin && neutralSigma > fEnergySignificanceMin) 610 599 { 611 612 //cout<<"significant neutral excess found:"<<endl;613 600 // create new photon tower 614 601 tower = static_cast<Candidate*>(fTower->Clone()); 615 602 pt = neutralEnergy / TMath::CosH(eta); 616 //cout<<"Creating tower with Pt, Eta, Phi, Energy: "<<pt<<","<<eta<<","<<phi<<","<<neutralEnergy<<endl;617 603 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, neutralEnergy); 618 604
Note:
See TracChangeset
for help on using the changeset viewer.