Fork me on GitHub

Changeset ec37bc3 in git


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

fixed ordering in DTF

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cards/CMS_PhaseII/CMS_PhaseII_200PU_v03.tcl

    r5b51d33 rec37bc3  
     1set RandomSeed 123
     2set MaxEvents 10
     3
     4########################################
    15#
    26#  Main authors: Michele Selvaggi (CERN)
     
    1519  PileUpMerger
    1620  ParticlePropagator
     21  TrackMergerProp
     22
     23  DenseProp
     24  DenseMergeTracks
     25  DenseTrackFilter
    1726
    1827  ChargedHadronTrackingEfficiency
     
    2433  MuonMomentumSmearing
    2534
    26   DenseProp
    27   DenseMergeTracks
    28   TrackMergerProp
    2935  TrackMerger
    3036
    3137  ECal
    3238  HCal
     39
     40  MuonFilter
    3341
    3442  PhotonEnergySmearing
     
    182190
    183191
     192##############
     193# Track merger
     194##############
     195
     196module Merger TrackMergerProp {
     197# add InputArray InputArray
     198  add InputArray ParticlePropagator/chargedHadrons
     199  add InputArray ParticlePropagator/electrons
     200  add InputArray ParticlePropagator/muons
     201  set OutputArray tracks
     202}
     203
     204
     205#################################
     206# Dense Track propagation
     207#################################
     208
     209module ParticlePropagator DenseProp {
     210
     211  set InputArray TrackMergerProp/tracks
     212
     213  set OutputArray stableParticles
     214  set NeutralOutputArray neutralParticles
     215  set ChargedHadronOutputArray chargedHadrons
     216  set ElectronOutputArray electrons
     217  set MuonOutputArray muons
     218
     219  # radius of the first pixel layer
     220  set Radius 0.3
     221  set RadiusMax 1.29
     222  # half-length of the magnetic field coverage, in m
     223  set HalfLength 0.7
     224  set HalfLengthMax 3.0
     225
     226  # magnetic field
     227  set Bz 3.8
     228}
     229
     230
     231####################
     232# Dense Track merger
     233###################
     234
     235module Merger DenseMergeTracks {
     236# add InputArray InputArray
     237  add InputArray DenseProp/chargedHadrons
     238  add InputArray DenseProp/electrons
     239  add InputArray DenseProp/muons
     240  set OutputArray tracks
     241}
     242
     243######################
     244#   Dense Track Filter
     245######################
     246
     247module DenseTrackFilter DenseTrackFilter {
     248  set TrackInputArray DenseMergeTracks/tracks
     249  set TrackOutputArray tracks
     250
     251  set ChargedHadronOutputArray chargedHadrons
     252  set ElectronOutputArray electrons
     253  set MuonOutputArray muons
     254
     255  set EtaPhiRes 0.003
     256  set EtaMax 4.0
     257
     258  set pi [expr {acos(-1)}]
     259
     260  set nbins_phi [expr {$pi/$EtaPhiRes} ]
     261  set nbins_phi [expr {int($nbins_phi)} ]
     262
     263  set PhiBins {}
     264  for {set i -$nbins_phi} {$i <= $nbins_phi} {incr i} {
     265    add PhiBins [expr {$i * $pi/$nbins_phi}]
     266  }
     267
     268  set nbins_eta [expr {$EtaMax/$EtaPhiRes} ]
     269  set nbins_eta [expr {int($nbins_eta)} ]
     270
     271  for {set i -$nbins_eta} {$i <= $nbins_eta} {incr i} {
     272    set eta [expr {$i * $EtaPhiRes}]
     273    add EtaPhiBins $eta $PhiBins
     274  }
     275
     276}
     277
    184278
    185279
     
    190284module Efficiency ChargedHadronTrackingEfficiency {
    191285  ## particles after propagation
    192   set InputArray  ParticlePropagator/chargedHadrons
     286  set InputArray  DenseTrackFilter/chargedHadrons
    193287  set OutputArray chargedHadrons
    194288  # tracking efficiency formula for charged hadrons
     
    211305
    212306module Efficiency ElectronTrackingEfficiency {
    213   set InputArray  ParticlePropagator/electrons
     307  set InputArray  DenseTrackFilter/electrons
    214308  set OutputArray electrons
    215309  # tracking efficiency formula for electrons
     
    234328
    235329module Efficiency MuonTrackingEfficiency {
    236   set InputArray ParticlePropagator/muons
     330  set InputArray DenseTrackFilter/muons
    237331  set OutputArray muons
    238332  # tracking efficiency formula for muons
     
    351445}
    352446
     447
     448##############
     449# Track merger
     450##############
     451
     452module Merger TrackMerger {
     453# add InputArray InputArray
     454  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
     455  add InputArray ElectronEnergySmearing/electrons
     456  add InputArray MuonMomentumSmearing/muons
     457  set OutputArray tracks
     458}
     459
    353460#################################
    354461# Energy resolution for electrons
     
    390497}
    391498
    392 ##############
    393 # Track merger
    394 ##############
    395 
    396 module Merger TrackMergerProp {
    397 # add InputArray InputArray
    398   add InputArray ChargedHadronMomentumSmearing/chargedHadrons
    399   add InputArray ElectronEnergySmearing/electrons
    400   add InputArray MuonMomentumSmearing/muons
    401   set OutputArray tracks
    402 }
    403 
    404 
    405 #################################
    406 # Dense Track propagation
    407 #################################
    408 
    409 module ParticlePropagator DenseProp {
    410   set InputArray PileUpMerger/stableParticles
    411 
    412   set OutputArray stableParticles
    413   set NeutralOutputArray neutralParticles
    414   set ChargedHadronOutputArray chargedHadrons
    415   set ElectronOutputArray electrons
    416   set MuonOutputArray muons
    417 
    418   # radius of the first pixel layer
    419   set Radius 0.3
    420   set RadiusMax 1.29
    421   # half-length of the magnetic field coverage, in m
    422   set HalfLength 0.7
    423   set HalfLengthMax 3.0
    424 
    425   # magnetic field
    426   set Bz 3.8
    427 }
    428 
    429 ####################
    430 # Dense Track merger
    431 ###################
    432 
    433 module Merger DenseMergeTracks {
    434 # add InputArray InputArray
    435   add InputArray DenseProp/chargedHadrons
    436   add InputArray DenseProp/electrons
    437   add InputArray DenseProp/muons
    438   set OutputArray tracks
    439 }
    440 
    441 ######################
    442 #   Dense Track Filter
    443 ######################
    444 
    445 module DenseTrackFilter TrackMerger {
    446   set TrackInputArray TrackMergerProp/tracks
    447   set DenseChargedInputArray DenseMergeTracks/tracks
    448 
    449   set TrackOutputArray tracks
    450 
    451   set EtaPhiRes 0.003
    452   set EtaMax 4.0
    453 
    454   set pi [expr {acos(-1)}]
    455 
    456   set nbins_phi [expr {$pi/$EtaPhiRes} ]
    457   set nbins_phi [expr {int($nbins_phi)} ]
    458 
    459   set PhiBins {}
    460   for {set i -$nbins_phi} {$i <= $nbins_phi} {incr i} {
    461     add PhiBins [expr {$i * $pi/$nbins_phi}]
    462   }
    463 
    464   set nbins_eta [expr {$EtaMax/$EtaPhiRes} ]
    465   set nbins_eta [expr {int($nbins_eta)} ]
    466 
    467   for {set i -$nbins_eta} {$i <= $nbins_eta} {incr i} {
    468     set eta [expr {$i * $EtaPhiRes}]
    469     add EtaPhiBins $eta $PhiBins
    470   }
    471 
    472 }
     499
    473500
    474501
     
    694721}
    695722
     723#################
     724# Muon filter
     725#################
     726
     727module PdgCodeFilter MuonFilter {
     728  set InputArray HCal/eflowTracks
     729  set OutputArray muons
     730  set Invert true
     731  add PdgCode {13}
     732  add PdgCode {-13}
     733}
     734
    696735
    697736##########################
     
    703742  add InputArray HCal/eflowTracks eflowTracks
    704743  add InputArray ElectronFilter/electrons electrons
    705   add InputArray MuonMomentumSmearing/muons muons
     744  add InputArray MuonFilter/muons muons
    706745
    707746  set VertexInputArray PileUpMerger/vertices
     
    11611200
    11621201module Cloner MuonCloner {
    1163   set InputArray MuonMomentumSmearing/muons
     1202  set InputArray MuonFilter/muons
    11641203  set OutputArray muons
    11651204}
     
    21682207
    21692208module Isolation MuonIsolation {
    2170   set CandidateInputArray MuonMomentumSmearing/muons
     2209  set CandidateInputArray MuonFilter/muons
    21712210
    21722211  # isolation collection
     
    40834122  add Branch GenMissingET/momentum GenMissingET MissingET
    40844123
     4124  add Branch TrackMerger/tracks TrackMerger Track
     4125  add Branch HCal/eflowTracks EFlowTrack Track
    40854126#  add Branch HCal/eflowTracks EFlowTrack Track
    40864127#  add Branch ECal/eflowPhotons EFlowPhoton Tower
  • 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.