Fork me on GitHub

Changeset 5a69ba1d in git for modules


Ignore:
Timestamp:
Jan 12, 2018, 5:43:01 PM (7 years ago)
Author:
Ulrike Schnoor <schnooru@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
3037765
Parents:
ae061c1 (diff), 1f7223c (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:
5 edited

Legend:

Unmodified
Added
Removed
  • modules/DenseTrackFilter.cc

    rae061c1 r5a69ba1d  
    5454
    5555DenseTrackFilter::DenseTrackFilter() :
    56   fItTrackInputArray(0)
     56  fItTrackInputArray(0),   fItDenseChargedInputArray(0)
    5757{
    5858}
     
    111111
    112112  // Eta x Phi smearing to be applied
    113   fEtaPhiRes = GetDouble("EtaPhiRes", 0.005);
    114 
    115   fTrackInputArray = ImportArray(GetString("TrackInputArray", "ParticlePropagator/tracks"));
     113  fEtaPhiRes = GetDouble("EtaPhiRes", 0.003);
     114
     115  fTrackInputArray = ImportArray(GetString("TrackInputArray", "TrackMergerProp/tracks"));
    116116  fItTrackInputArray = fTrackInputArray->MakeIterator();
     117
     118  fDenseChargedInputArray = ImportArray(GetString("DenseChargedInputArray", "DenseMergeTracks/tracks"));
     119  fItDenseChargedInputArray = fDenseChargedInputArray->MakeIterator();
    117120
    118121  fTrackOutputArray = ExportArray(GetString("TrackOutputArray", "tracks"));
     
    125128  vector< vector< Double_t >* >::iterator itPhiBin;
    126129  if(fItTrackInputArray) delete fItTrackInputArray;
     130  if(fItDenseChargedInputArray) delete fItDenseChargedInputArray;
    127131  for(itPhiBin = fPhiBins.begin(); itPhiBin != fPhiBins.end(); ++itPhiBin)
    128132  {
     
    135139void DenseTrackFilter::Process()
    136140{
    137   Candidate *candidate, *track, *bestTrack, *mother;
     141  Candidate *track;
    138142  TLorentzVector position, momentum;
    139143  Short_t etaBin, phiBin, flags;
    140   Int_t number, towerTrackHits;
     144  Int_t number;
    141145  Long64_t towerHit, towerEtaPhi, hitEtaPhi;
    142 
    143   Double_t pt, ptmax, eta, phi;
     146  Double_t ptmax;
    144147
    145148  vector< Double_t >::iterator itEtaBin;
     
    152155
    153156  // loop over all tracks
    154   fItTrackInputArray->Reset();
     157  fItDenseChargedInputArray->Reset();
    155158  number = -1;
    156   while((track = static_cast<Candidate*>(fItTrackInputArray->Next())))
     159  while((track = static_cast<Candidate*>(fItDenseChargedInputArray->Next())))
    157160  {
    158161    const TLorentzVector &trackPosition = track->Position;
     
    186189  // loop over all hits
    187190  towerEtaPhi = 0;
    188   bestTrack = 0;
    189   fTower = 0;
     191  fBestTrack = 0;
    190192  ptmax = 0.0;
    191   towerTrackHits = 0;
     193  fTowerTrackHits = 0;
    192194
    193195  for(itTowerHits = fTowerHits.begin(); itTowerHits != fTowerHits.end(); ++itTowerHits)
     
    197199    number = (towerHit) & 0x0000000000FFFFFFLL;
    198200    hitEtaPhi = towerHit >> 32;
     201
    199202    if(towerEtaPhi != hitEtaPhi)
    200203    {
    201204      // switch to next tower
    202205      towerEtaPhi = hitEtaPhi;
    203       
     206     
    204207      // saving track with highest pT that hit the tower
    205       if(towerTrackHits > 0)
    206       {
    207          mother = bestTrack;
    208          candidate = static_cast<Candidate*>(bestTrack->Clone());
    209          pt = candidate->Momentum.Pt();
    210          eta = candidate->Momentum.Eta();
    211          phi = candidate->Momentum.Phi();
    212          eta = gRandom->Gaus(eta, fEtaPhiRes);
    213          phi = gRandom->Gaus(phi, fEtaPhiRes);
    214          candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta));
    215          candidate->AddCandidate(mother);
    216          fTrackOutputArray->Add(candidate);
    217       }
     208      FillTrack();
    218209
    219210      ptmax = 0.0;
    220       towerTrackHits = 0;
    221       bestTrack = 0;
     211      fTowerTrackHits = 0;
     212      fBestTrack = 0;
    222213    }
    223214    // check for track hits
     
    225216    if(flags & 1)
    226217    {
    227       ++towerTrackHits;
    228       track = static_cast<Candidate*>(fTrackInputArray->At(number));
     218      ++fTowerTrackHits;
     219      track = static_cast<Candidate*>(fDenseChargedInputArray->At(number));
    229220      momentum = track->Momentum;
    230221
    231222      if (momentum.Pt() > ptmax)
    232223      {
    233         ptmax = momentum.Pt();
    234         bestTrack = track;
     224        ptmax = momentum.Pt();
     225        fBestTrack = track;
    235226      }
    236227      continue;
    237228    }
    238   }
    239 }
     229 
     230  }
     231 
     232  // here fill last tower
     233  FillTrack();
     234 
     235}
     236
     237
     238
     239//------------------------------------------------------------------------------
     240
     241void DenseTrackFilter::FillTrack()
     242{
     243 
     244  Candidate *candidate, *track, *mother, *trackRef, *bestTrackRef;
     245  Double_t pt, eta, phi;
     246  Bool_t matched;
     247 
     248  // saving track with highest pT that hit the tower
     249  if(fTowerTrackHits > 0)
     250  {
     251     bestTrackRef = static_cast<Candidate*>(fBestTrack->GetCandidates()->At(0));
     252
     253     // find corresponding track in properly propagated tracks
     254     fItTrackInputArray->Reset();
     255     matched = kFALSE;
     256     int ntrack = 0;
     257     while((track = static_cast<Candidate*>(fItTrackInputArray->Next())))
     258     {
     259       ntrack++;
     260       trackRef = static_cast<Candidate*>(track->GetCandidates()->At(0));
     261
     262       if (trackRef->GetUniqueID() == bestTrackRef->GetUniqueID())
     263       {
     264         mother = track;
     265         candidate = static_cast<Candidate*>(track->Clone());
     266         pt = candidate->Momentum.Pt();
     267         eta = candidate->Momentum.Eta();
     268         phi = candidate->Momentum.Phi();
     269         eta = gRandom->Gaus(eta, fEtaPhiRes);
     270         phi = gRandom->Gaus(phi, fEtaPhiRes);
     271         candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta));
     272         candidate->AddCandidate(mother);
     273         fTrackOutputArray->Add(candidate);
     274         matched = kTRUE;
     275       }
     276       if (matched) break;
     277     }
     278  }
     279
     280
     281}
  • modules/DenseTrackFilter.h

    rae061c1 r5a69ba1d  
    5353  typedef std::map< Double_t, std::set< Double_t > > TBinMap; //!
    5454
    55   Candidate *fTower;
     55  Candidate *fBestTrack;
     56
     57  Int_t fTowerTrackHits;
    5658
    5759  Double_t fEtaPhiRes;
     
    7072  TObjArray *fTrackOutputArray; //!
    7173
     74
     75  const TObjArray *fDenseChargedInputArray;
     76  TIterator *fItDenseChargedInputArray;
     77 
     78  void FillTrack();
    7279  ClassDef(DenseTrackFilter, 1)
    7380};
  • modules/FastJetFinder.cc

    rae061c1 r5a69ba1d  
    539539      candidate->NSubJetsSoftDropped = softdrop_jet.pieces().size();
    540540
     541      candidate->SoftDroppedJet = candidate->SoftDroppedP4[0];
     542
    541543      for (size_t i = 0; i < subjets.size()  and i < 4; i++)
    542544      {
    543545            if(subjets.at(i).pt() < 0) continue ;
    544546            candidate->SoftDroppedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
     547            if(i==0) candidate->SoftDroppedSubJet1 = candidate->SoftDroppedP4[i+1];
     548            if(i==1) candidate->SoftDroppedSubJet2 = candidate->SoftDroppedP4[i+1];
    545549      }
    546550    }
  • modules/TimeSmearing.cc

    rae061c1 r5a69ba1d  
    108108    tf_smeared = gRandom->Gaus(tf, fTimeResolution);
    109109    ti = ti + tf_smeared - tf;
    110 
     110    tf = tf_smeared;
     111   
    111112    mother = candidate;
    112113    candidate = static_cast<Candidate*>(candidate->Clone());
  • modules/TreeWriter.cc

    rae061c1 r5a69ba1d  
    681681    entry->NSubJetsSoftDropped = candidate->NSubJetsSoftDropped;
    682682
     683    entry->SoftDroppedJet     = candidate->SoftDroppedJet ;
     684    entry->SoftDroppedSubJet1 = candidate->SoftDroppedSubJet1 ;
     685    entry->SoftDroppedSubJet2 = candidate->SoftDroppedSubJet2;
     686
     687
    683688    for(i = 0; i < 5; i++)
    684689    {
Note: See TracChangeset for help on using the changeset viewer.