Fork me on GitHub

Changeset ec37bc3 in git for modules


Ignore:
Timestamp:
Jun 6, 2018, 3:30:22 PM (6 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
b24f05a
Parents:
5b51d33
Message:

fixed ordering in DTF

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/DenseTrackFilter.cc

    r5b51d33 rec37bc3  
    5454
    5555DenseTrackFilter::DenseTrackFilter() :
    56   fItTrackInputArray(0),   fItDenseChargedInputArray(0)
     56  fItTrackInputArray(0)
    5757{
    5858}
     
    116116  fItTrackInputArray = fTrackInputArray->MakeIterator();
    117117
    118   fDenseChargedInputArray = ImportArray(GetString("DenseChargedInputArray", "DenseMergeTracks/tracks"));
    119   fItDenseChargedInputArray = fDenseChargedInputArray->MakeIterator();
    120 
    121118  fTrackOutputArray = ExportArray(GetString("TrackOutputArray", "tracks"));
     119  fChargedHadronOutputArray = ExportArray(GetString("ChargedHadronOutputArray", "chargedHadrons"));
     120  fElectronOutputArray = ExportArray(GetString("ElectronOutputArray", "electrons"));
     121  fMuonOutputArray = ExportArray(GetString("MuonOutputArray", "muons"));
    122122}
    123123
     
    128128  vector< vector< Double_t >* >::iterator itPhiBin;
    129129  if(fItTrackInputArray) delete fItTrackInputArray;
    130   if(fItDenseChargedInputArray) delete fItDenseChargedInputArray;
    131130  for(itPhiBin = fPhiBins.begin(); itPhiBin != fPhiBins.end(); ++itPhiBin)
    132131  {
     
    155154
    156155  // loop over all tracks
    157   fItDenseChargedInputArray->Reset();
     156  fItTrackInputArray->Reset();
    158157  number = -1;
    159   while((track = static_cast<Candidate*>(fItDenseChargedInputArray->Next())))
     158  while((track = static_cast<Candidate*>(fItTrackInputArray->Next())))
    160159  {
    161160    const TLorentzVector &trackPosition = track->Position;
     
    217216    {
    218217      ++fTowerTrackHits;
    219       track = static_cast<Candidate*>(fDenseChargedInputArray->At(number));
     218      track = static_cast<Candidate*>(fTrackInputArray->At(number));
    220219      momentum = track->Momentum;
    221220
     
    244243  Int_t numberOfCandidates;
    245244
    246   numberOfCandidates = fBestTrack->GetCandidates()->GetEntriesFast();
    247 
     245 
     246  cout<<fBestTrack<<endl;
     247 
    248248  // saving track with highest pT that hit the tower
    249   if(fTowerTrackHits > 0 && numberOfCandidates > 1)
    250   {
    251     track = static_cast<Candidate*>(fBestTrack->GetCandidates()->At(numberOfCandidates - 2));
    252     candidate = static_cast<Candidate*>(track->Clone());
    253     pt = candidate->Momentum.Pt();
    254     eta = candidate->Momentum.Eta();
    255     phi = candidate->Momentum.Phi();
    256     eta = gRandom->Gaus(eta, fEtaPhiRes);
    257     phi = gRandom->Gaus(phi, fEtaPhiRes);
    258     candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta));
    259     candidate->AddCandidate(track);
    260     fTrackOutputArray->Add(candidate);
    261   }
    262 }
     249  if(fTowerTrackHits > 0)
     250  {
     251   
     252    numberOfCandidates = fBestTrack->GetCandidates()->GetEntriesFast();
     253    if (numberOfCandidates < 2)
     254       cout<<fBestTrack<<endl;
     255
     256    if (numberOfCandidates > 1)
     257    { 
     258
     259      track = static_cast<Candidate*>(fBestTrack->GetCandidates()->At(numberOfCandidates - 1));
     260      candidate = static_cast<Candidate*>(track->Clone());
     261      pt = candidate->Momentum.Pt();
     262      eta = candidate->Momentum.Eta();
     263      phi = candidate->Momentum.Phi();
     264      eta = gRandom->Gaus(eta, fEtaPhiRes);
     265      phi = gRandom->Gaus(phi, fEtaPhiRes);
     266      candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt*TMath::CosH(eta));
     267      candidate->AddCandidate(track);
     268      fTrackOutputArray->Add(candidate);
     269      switch(TMath::Abs(candidate->PID))
     270      {
     271        case 11:
     272          fElectronOutputArray->Add(candidate);
     273          break;
     274        case 13:
     275          fMuonOutputArray->Add(candidate);
     276          break;
     277        default:
     278          fChargedHadronOutputArray->Add(candidate);
     279      }
     280 
     281    }
     282  }
     283
     284}
  • modules/DenseTrackFilter.h

    r5b51d33 rec37bc3  
    6969
    7070  const TObjArray *fTrackInputArray; //!
    71 
    7271  TObjArray *fTrackOutputArray; //!
    7372
     73  TObjArray *fChargedHadronOutputArray; //!
     74  TObjArray *fElectronOutputArray; //!
     75  TObjArray *fMuonOutputArray; //!
    7476
    75   const TObjArray *fDenseChargedInputArray;
    76   TIterator *fItDenseChargedInputArray;
    77  
    7877  void FillTrack();
    7978  ClassDef(DenseTrackFilter, 1)
Note: See TracChangeset for help on using the changeset viewer.