Fork me on GitHub

Changeset 0d5f77c in git


Ignore:
Timestamp:
Jul 23, 2013, 2:00:42 AM (11 years ago)
Author:
pavel <pavel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
3079350
Parents:
9c6410e
Message:

fix Eem and Ehad

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Calorimeter.cc

    r9c6410e r0d5f77c  
    431431  Double_t energy, pt, eta, phi;
    432432  Double_t ecalEnergy, hcalEnergy;
    433   TIterator *itTowerTrackArray, *itTowerArray;
     433  TIterator *itTowerTrackArray;
    434434
    435435  if(!fTower) return;
     
    492492    {
    493493      itTowerTrackArray = fItTowerTrackArray;
    494       itTowerArray = 0;
    495       energy = 0.0;
    496494    }
    497495    else if(fTowerECalHits == fTowerECalTrackHits)
    498496    {
    499497      itTowerTrackArray = fItTowerECalTrackArray;
    500       itTowerArray = fItTowerHCalArray;
    501       energy = hcalEnergy;
     498
     499      if(hcalEnergy > 0.0)
     500      {
     501        DelphesFactory *factory = GetFactory();
     502
     503        // create new tower
     504        tower = factory->NewCandidate();
     505
     506        fItTowerHCalArray->Reset();
     507        while((particle = static_cast<Candidate*>(fItTowerHCalArray->Next())))
     508        {
     509          tower->AddCandidate(particle);
     510        }
     511
     512        pt = hcalEnergy / TMath::CosH(eta);
     513
     514        tower->Position.SetPtEtaPhiE(1.0, eta, phi, 0.0);
     515        tower->Momentum.SetPtEtaPhiE(pt, eta, phi, hcalEnergy);
     516        tower->Eem = 0.0;
     517        tower->Ehad = hcalEnergy;
     518
     519        tower->Edges[0] = fTowerEdges[0];
     520        tower->Edges[1] = fTowerEdges[1];
     521        tower->Edges[2] = fTowerEdges[2];
     522        tower->Edges[3] = fTowerEdges[3];
     523
     524        fEFlowTowerOutputArray->Add(tower);
     525      }
    502526    }
    503527    else if(fTowerHCalHits == fTowerHCalTrackHits)
    504528    {
    505529      itTowerTrackArray = fItTowerHCalTrackArray;
    506       itTowerArray = fItTowerECalArray;
    507       energy = ecalEnergy;
     530
     531      if(ecalEnergy > 0.0)
     532      {
     533        DelphesFactory *factory = GetFactory();
     534
     535        // create new tower
     536        tower = factory->NewCandidate();
     537
     538        fItTowerECalArray->Reset();
     539        while((particle = static_cast<Candidate*>(fItTowerECalArray->Next())))
     540        {
     541          tower->AddCandidate(particle);
     542        }
     543
     544        pt = ecalEnergy / TMath::CosH(eta);
     545
     546        tower->Position.SetPtEtaPhiE(1.0, eta, phi, 0.0);
     547        tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalEnergy);
     548        tower->Eem = ecalEnergy;
     549        tower->Ehad = 0.0;
     550
     551        tower->Edges[0] = fTowerEdges[0];
     552        tower->Edges[1] = fTowerEdges[1];
     553        tower->Edges[2] = fTowerEdges[2];
     554        tower->Edges[3] = fTowerEdges[3];
     555
     556        fEFlowTowerOutputArray->Add(tower);
     557      }
    508558    }
    509559    else
    510560    {
    511561      itTowerTrackArray = 0;
    512       itTowerArray = 0;
    513       energy = 0.0;
    514562      fEFlowTowerOutputArray->Add(fTower);
    515563    }
     
    523571      }
    524572    }
    525 
    526     if(itTowerArray && energy > 0.0)
    527     {
    528       DelphesFactory *factory = GetFactory();
    529 
    530       // create new tower
    531       tower = factory->NewCandidate();
    532 
    533       itTowerArray->Reset();
    534       while((particle = static_cast<Candidate*>(itTowerArray->Next())))
    535       {
    536         tower->AddCandidate(particle);
    537       }
    538 
    539       pt = energy / TMath::CosH(eta);
    540 
    541       tower->Position.SetPtEtaPhiE(1.0, eta, phi, 0.0);
    542       tower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy);
    543       tower->Eem = energy;
    544       tower->Ehad = 0.0;
    545 
    546       tower->Edges[0] = fTowerEdges[0];
    547       tower->Edges[1] = fTowerEdges[1];
    548       tower->Edges[2] = fTowerEdges[2];
    549       tower->Edges[3] = fTowerEdges[3];
    550 
    551       fEFlowTowerOutputArray->Add(tower);
    552     }
    553573  }
    554574  else if(energy > 0.0)
Note: See TracChangeset for help on using the changeset viewer.