Fork me on GitHub

Changeset f32ea92 in git for modules


Ignore:
Timestamp:
Nov 20, 2015, 2:06:28 PM (9 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
fc4143c
Parents:
8e2bc10 (diff), 715ab7c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:delphes/delphes

Location:
modules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • modules/Isolation.cc

    r8e2bc10 rf32ea92  
    153153  Candidate *candidate, *isolation, *object;
    154154  TObjArray *isolationArray;
    155   Double_t sumCharged, sumNeutral, sumAllParticles, sumChargedPU, sumDBeta, ratioDBeta, sumRhoCorr, ratioRhoCorr;
     155  Double_t sumCharged, sumNeutral, sumAllParticles, sumChargedPU;
     156  Double_t sumDBeta, ratioDBeta, sumRhoCorr, ratioRhoCorr, sum, ratio;
    156157  Int_t counter;
    157158  Double_t eta = 0.0;
     
    188189
    189190    // loop over all input tracks
    190    
     191
    191192    sumNeutral = 0.0;
    192193    sumCharged = 0.0;
    193194    sumChargedPU = 0.0;
    194195    sumAllParticles = 0.0;
    195    
     196
    196197    counter = 0;
    197198    itIsolationArray.Reset();
    198    
     199
    199200    while((isolation = static_cast<Candidate*>(itIsolationArray.Next())))
    200201    {
     
    205206      {
    206207        sumAllParticles += isolationMomentum.Pt();
    207         if(isolation->Charge !=0)
    208         {
    209           sumCharged += isolationMomentum.Pt();
    210           if(isolation->IsRecoPU != 0) sumChargedPU += isolationMomentum.Pt();
    211         }
     208        if(isolation->Charge != 0)
     209        {
     210          if(isolation->IsRecoPU)
     211          {
     212            sumChargedPU += isolationMomentum.Pt();
     213          }
     214          else
     215          {
     216            sumCharged += isolationMomentum.Pt();
     217          }
     218        }
    212219        else
    213         {
    214           sumNeutral += isolationMomentum.Pt();
     220        {
     221          sumNeutral += isolationMomentum.Pt();
    215222        }
    216223        ++counter;
     
    232239    }
    233240
    234      // correct sum for pile-up contamination
    235     sumDBeta = sumCharged + TMath::Max(sumNeutral-0.5*sumChargedPU,0.0);
    236     sumRhoCorr = sumCharged + TMath::Max(sumNeutral-TMath::Max(rho,0.0)*fDeltaRMax*fDeltaRMax*TMath::Pi(),0.0);
     241    // correct sum for pile-up contamination
     242    sumDBeta = sumCharged + TMath::Max(sumNeutral - 0.5*sumChargedPU, 0.0);
     243    sumRhoCorr = sumCharged + TMath::Max(sumNeutral - TMath::Max(rho, 0.0)*fDeltaRMax*fDeltaRMax*TMath::Pi(), 0.0);
    237244    ratioDBeta = sumDBeta/candidateMomentum.Pt();
    238245    ratioRhoCorr = sumRhoCorr/candidateMomentum.Pt();
    239    
     246
    240247    candidate->IsolationVar = ratioDBeta;
    241248    candidate->IsolationVarRhoCorr = ratioRhoCorr;
     
    245252    candidate->SumPt = sumAllParticles;
    246253
    247     if((fUsePTSum && sumRhoCorr > fPTSumMax) || (!fUsePTSum && ratioRhoCorr > fPTRatioMax)) continue;
     254    sum = fRhoInputArray ? sumRhoCorr : sumDBeta;
     255    if(fUsePTSum && sum > fPTSumMax) continue;
     256
     257    ratio = fRhoInputArray ? ratioRhoCorr : ratioDBeta;
     258    if(!fUsePTSum && ratio > fPTRatioMax) continue;
     259
    248260    fOutputArray->Add(candidate);
    249261  }
  • modules/TrackPileUpSubtractor.cc

    r8e2bc10 rf32ea92  
    6767void TrackPileUpSubtractor::Init()
    6868{
    69 // import input array
     69  // import input array
    7070
    7171  fVertexInputArray = ImportArray(GetString("VertexInputArray", "PileUpMerger/vertices"));
    7272  fItVertexInputArray = fVertexInputArray->MakeIterator();
    73  
     73
    7474  fZVertexResolution  = GetDouble("ZVertexResolution", 0.005)*1.0E3;
    7575
    7676  fPTMin = GetDouble("PTMin", 0.);
     77
    7778  // import arrays with output from other modules
    78    
     79
    7980  ExRootConfParam param = GetParam("InputArray");
    8081  Long_t i, size;
     
    119120  Double_t z, zvtx=0;
    120121
    121  
     122
    122123  // find z position of primary vertex
    123  
     124
    124125  fItVertexInputArray->Reset();
    125126  while((candidate = static_cast<Candidate*>(fItVertexInputArray->Next())))
     
    127128    if(!candidate->IsPU)
    128129    {
    129     zvtx = candidate->Position.Z();
    130     // break;
     130      zvtx = candidate->Position.Z();
     131      // break;
    131132    }
    132133  }
     
    144145      particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
    145146      z = particle->Position.Z();
    146      
     147
    147148      // apply pile-up subtraction
    148149      // assume perfect pile-up subtraction for tracks outside fZVertexResolution
    149      
    150       if(candidate->IsPU && TMath::Abs(z-zvtx) > fZVertexResolution) candidate->IsRecoPU = 1;
    151       else
     150
     151      if(candidate->IsPU && TMath::Abs(z-zvtx) > fZVertexResolution)
    152152      {
    153          candidate->IsRecoPU = 0;
    154          if( candidate->Momentum.Pt() > fPTMin) array->Add(candidate);
     153        candidate->IsRecoPU = 1;
     154      }
     155      else
     156      {
     157        candidate->IsRecoPU = 0;
     158        if(candidate->Momentum.Pt() > fPTMin) array->Add(candidate);
    155159      }
    156160    }
  • modules/TrackPileUpSubtractor.h

    r8e2bc10 rf32ea92  
    5050  Double_t fZVertexResolution;
    5151
    52   Double_t fPTMin; 
     52  Double_t fPTMin;
    5353
    5454  std::map< TIterator *, TObjArray * > fInputMap; //!
Note: See TracChangeset for help on using the changeset viewer.