Fork me on GitHub

Changeset 9c6410e in git for modules


Ignore:
Timestamp:
Jul 23, 2013, 1:14:48 AM (11 years ago)
Author:
pavel <pavel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
0d5f77c
Parents:
703d39c
Message:

reorganize new energy flow cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Calorimeter.cc

    r703d39c r9c6410e  
    431431  Double_t energy, pt, eta, phi;
    432432  Double_t ecalEnergy, hcalEnergy;
    433   TIterator *iterator;
     433  TIterator *itTowerTrackArray, *itTowerArray;
    434434
    435435  if(!fTower) return;
     
    486486  }
    487487  else if(fTowerTrackAllHits > 0 &&
    488           fTowerECalHits + fTowerHCalHits == fTowerAllHits &&
    489           (fTowerECalHits == fTowerECalTrackHits || fTowerHCalHits == fTowerHCalTrackHits))
    490   {
    491     if(fTowerECalHits == fTowerECalTrackHits)
    492     {
    493       fItTowerECalTrackArray->Reset();
    494       while((track = static_cast<Candidate*>(fItTowerECalTrackArray->Next())))
     488          fTowerECalHits + fTowerHCalHits == fTowerAllHits)
     489  {
     490    if(fTowerECalHits == fTowerECalTrackHits &&
     491       fTowerHCalHits == fTowerHCalTrackHits)
     492    {
     493      itTowerTrackArray = fItTowerTrackArray;
     494      itTowerArray = 0;
     495      energy = 0.0;
     496    }
     497    else if(fTowerECalHits == fTowerECalTrackHits)
     498    {
     499      itTowerTrackArray = fItTowerECalTrackArray;
     500      itTowerArray = fItTowerHCalArray;
     501      energy = hcalEnergy;
     502    }
     503    else if(fTowerHCalHits == fTowerHCalTrackHits)
     504    {
     505      itTowerTrackArray = fItTowerHCalTrackArray;
     506      itTowerArray = fItTowerECalArray;
     507      energy = ecalEnergy;
     508    }
     509    else
     510    {
     511      itTowerTrackArray = 0;
     512      itTowerArray = 0;
     513      energy = 0.0;
     514      fEFlowTowerOutputArray->Add(fTower);
     515    }
     516
     517    if(itTowerTrackArray)
     518    {
     519      itTowerTrackArray->Reset();
     520      while((track = static_cast<Candidate*>(itTowerTrackArray->Next())))
    495521      {
    496522        fEFlowTrackOutputArray->Add(track);
    497523      }
    498       energy = hcalEnergy;
    499       iterator = fItTowerHCalArray;
    500     }
    501 
    502     if(fTowerHCalHits == fTowerHCalTrackHits)
    503     {
    504       fItTowerHCalTrackArray->Reset();
    505       while((track = static_cast<Candidate*>(fItTowerHCalTrackArray->Next())))
    506       {
    507         fEFlowTrackOutputArray->Add(track);
    508       }
    509       energy = ecalEnergy;
    510       iterator = fItTowerECalArray;
    511     }
    512 
    513     if(fTowerECalHits == fTowerECalTrackHits &&
    514        fTowerHCalHits == fTowerHCalTrackHits)
    515     {
    516       energy = 0.0;
    517       iterator = 0;
    518     }
    519 
    520     if(energy > 0.0 && iterator)
     524    }
     525
     526    if(itTowerArray && energy > 0.0)
    521527    {
    522528      DelphesFactory *factory = GetFactory();
     
    525531      tower = factory->NewCandidate();
    526532
    527       iterator->Reset();
    528       while((particle = static_cast<Candidate*>(iterator->Next())))
     533      itTowerArray->Reset();
     534      while((particle = static_cast<Candidate*>(itTowerArray->Next())))
    529535      {
    530536        tower->AddCandidate(particle);
Note: See TracChangeset for help on using the changeset viewer.