Fork me on GitHub

Changeset e999d62 in git


Ignore:
Timestamp:
Dec 5, 2017, 8:45:56 PM (7 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
8562e4e
Parents:
6d1fff5
Message:

subtract merged tracks from existing trk coll

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/DenseTrackFilter.cc

    r6d1fff5 re999d62  
    5454
    5555DenseTrackFilter::DenseTrackFilter() :
    56   fItTrackInputArray(0)
     56  fItTrackInputArray(0),   fItDenseChargedInputArray(0)
    5757{
    5858}
     
    113113  fEtaPhiRes = GetDouble("EtaPhiRes", 0.005);
    114114
    115   fTrackInputArray = ImportArray(GetString("TrackInputArray", "ParticlePropagator/tracks"));
     115  fTrackInputArray = ImportArray(GetString("TrackInputArray", "TrackMerger/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 *candidate, *track, *bestTrack, *mother, *trackRef, *bestTrackRef;
    138142  TLorentzVector position, momentum;
    139143  Short_t etaBin, phiBin, flags;
     
    142146
    143147  Double_t pt, ptmax, eta, phi;
     148  Bool_t matched;
    144149
    145150  vector< Double_t >::iterator itEtaBin;
     
    152157
    153158  // loop over all tracks
    154   fItTrackInputArray->Reset();
     159  fItDenseChargedInputArray->Reset();
    155160  number = -1;
    156   while((track = static_cast<Candidate*>(fItTrackInputArray->Next())))
     161  while((track = static_cast<Candidate*>(fItDenseChargedInputArray->Next())))
    157162  {
    158163    const TLorentzVector &trackPosition = track->Position;
     
    205210      if(towerTrackHits > 0)
    206211      {
    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);
     212         bestTrackRef = static_cast<Candidate*>(bestTrack->GetCandidates()->At(0));
     213         
     214         // find corresponding track in properly propagated tracks
     215         
     216         
     217         fItTrackInputArray->Reset();
     218         matched = kFALSE;
     219         int ntrack = 0;
     220         while((track = static_cast<Candidate*>(fItTrackInputArray->Next())))
     221         {
     222           ntrack++;
     223           trackRef = static_cast<Candidate*>(track->GetCandidates()->At(0));
     224           if (trackRef->GetUniqueID() == bestTrackRef->GetUniqueID())
     225           {
     226             mother = track;
     227             candidate = static_cast<Candidate*>(track->Clone());
     228             pt = candidate->Momentum.Pt();
     229             eta = candidate->Momentum.Eta();
     230             phi = candidate->Momentum.Phi();
     231             eta = gRandom->Gaus(eta, fEtaPhiRes);
     232             phi = gRandom->Gaus(phi, fEtaPhiRes);
     233             candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta));
     234             candidate->AddCandidate(mother);
     235             fTrackOutputArray->Add(candidate);
     236             matched = kTRUE;
     237           }
     238           if (matched) break;
     239         }
     240         
     241         // find track
    217242      }
    218243
     
    226251    {
    227252      ++towerTrackHits;
    228       track = static_cast<Candidate*>(fTrackInputArray->At(number));
     253      track = static_cast<Candidate*>(fDenseChargedInputArray->At(number));
    229254      momentum = track->Momentum;
    230255
     
    237262    }
    238263  }
    239 }
     264 
     265}
  • modules/DenseTrackFilter.h

    r6d1fff5 re999d62  
    7070  TObjArray *fTrackOutputArray; //!
    7171
     72
     73  const TObjArray *fDenseChargedInputArray;
     74  TIterator *fItDenseChargedInputArray;
     75
    7276  ClassDef(DenseTrackFilter, 1)
    7377};
Note: See TracChangeset for help on using the changeset viewer.