- Timestamp:
- Jun 1, 2021, 11:39:05 PM (3 years ago)
- Branches:
- master
- Children:
- 90132e0
- Parents:
- 90345e5
- Location:
- classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesHepMC3Reader.cc
r90345e5 ra26a130 326 326 } 327 327 328 AnalyzeParticle(factory, allParticleOutputArray, 329 stableParticleOutputArray, partonOutputArray); 328 AnalyzeParticle(factory); 330 329 } 331 330 332 331 if(EventReady()) 333 332 { 334 FinalizeParticles(allParticleOutputArray );333 FinalizeParticles(allParticleOutputArray, stableParticleOutputArray, partonOutputArray); 335 334 } 336 335 … … 374 373 { 375 374 Weight *element; 376 vector<double>::const_iterator itWeight ;377 378 for(itWeight = fWeights.begin(); itWeight != fWeights.end(); ++itWeight)375 vector<double>::const_iterator itWeights; 376 377 for(itWeights = fWeights.begin(); itWeights != fWeights.end(); ++itWeights) 379 378 { 380 379 element = static_cast<Weight *>(branch->NewEntry()); 381 380 382 element->Weight = *itWeight ;381 element->Weight = *itWeights; 383 382 } 384 383 } … … 406 405 array = factory->NewArray(); 407 406 position->SetXYZT(0.0, 0.0, 0.0, 0.0); 408 array->Clear();409 407 fVertices.push_back(make_pair(position, array)); 410 408 } … … 432 430 //--------------------------------------------------------------------------- 433 431 434 void DelphesHepMC3Reader::AnalyzeParticle(DelphesFactory *factory, 435 TObjArray *allParticleOutputArray, 432 void DelphesHepMC3Reader::AnalyzeParticle(DelphesFactory *factory) 433 { 434 Candidate *candidate; 435 436 candidate = factory->NewCandidate(); 437 438 candidate->PID = fPID; 439 440 candidate->Status = fParticleStatus; 441 442 candidate->Mass = fMass; 443 444 candidate->Momentum.SetPxPyPzE(fPx, fPy, fPz, fE); 445 446 candidate->D1 = fParticleCode; 447 448 AnalyzeVertex(factory, fOutVertexCode, candidate); 449 } 450 451 //--------------------------------------------------------------------------- 452 453 void DelphesHepMC3Reader::FinalizeParticles(TObjArray *allParticleOutputArray, 436 454 TObjArray *stableParticleOutputArray, 437 455 TObjArray *partonOutputArray) 438 456 { 457 TLorentzVector *position; 458 TObjArray *array; 439 459 Candidate *candidate; 440 460 TParticlePDG *pdgParticle; 441 461 int pdgCode; 442 443 candidate = factory->NewCandidate();444 445 candidate->PID = fPID;446 pdgCode = TMath::Abs(candidate->PID);447 448 candidate->Status = fParticleStatus;449 450 pdgParticle = fPDG->GetParticle(fPID);451 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() / 3.0) : -999;452 candidate->Mass = fMass;453 454 candidate->Momentum.SetPxPyPzE(fPx, fPy, fPz, fE);455 if(fMomentumCoefficient != 1.0)456 {457 candidate->Momentum *= fMomentumCoefficient;458 }459 460 candidate->D1 = fParticleCode;461 462 AnalyzeVertex(factory, fOutVertexCode, candidate);463 464 if(!pdgParticle) return;465 466 if(fParticleStatus == 1)467 {468 stableParticleOutputArray->Add(candidate);469 }470 else if(pdgCode <= 5 || pdgCode == 21 || pdgCode == 15)471 {472 partonOutputArray->Add(candidate);473 }474 }475 476 //---------------------------------------------------------------------------477 478 void DelphesHepMC3Reader::FinalizeParticles(TObjArray *allParticleOutputArray)479 {480 TLorentzVector *position;481 TObjArray *array;482 Candidate *candidate;483 462 map<int, int >::iterator itVertexMap; 484 463 map<int, pair<int, int> >::iterator itMotherMap; … … 500 479 { 501 480 candidate->Position *= fPositionCoefficient; 481 } 482 483 if(fMomentumCoefficient != 1.0) 484 { 485 candidate->Momentum *= fMomentumCoefficient; 502 486 } 503 487 … … 541 525 542 526 ++counter; 527 528 pdgParticle = fPDG->GetParticle(candidate->PID); 529 530 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() / 3.0) : -999; 531 532 if(!pdgParticle) continue; 533 534 pdgCode = TMath::Abs(candidate->PID); 535 536 if(candidate->Status == 1) 537 { 538 stableParticleOutputArray->Add(candidate); 539 } 540 else if(pdgCode <= 5 || pdgCode == 21 || pdgCode == 15) 541 { 542 partonOutputArray->Add(candidate); 543 } 543 544 } 544 545 } -
classes/DelphesHepMC3Reader.h
r90345e5 ra26a130 65 65 void AnalyzeVertex(DelphesFactory *factory, int code, Candidate *candidate = 0); 66 66 67 void AnalyzeParticle(DelphesFactory *factory, 68 TObjArray *allParticleOutputArray, 67 void AnalyzeParticle(DelphesFactory *factory); 68 69 void FinalizeParticles(TObjArray *allParticleOutputArray, 69 70 TObjArray *stableParticleOutputArray, 70 71 TObjArray *partonOutputArray); 71 72 void FinalizeParticles(TObjArray *allParticleOutputArray);73 72 74 73 FILE *fInputFile;
Note:
See TracChangeset
for help on using the changeset viewer.