Fork me on GitHub

Ignore:
Timestamp:
Dec 21, 2014, 4:03:35 PM (10 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
d77b51d
Parents:
7f12612 (diff), e5767b57 (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 remote-tracking branch 'upstream/master'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/ImpactParameterSmearing.cc

    r7f12612 rd870fc5  
    22 *  Delphes: a framework for fast simulation of a generic collider experiment
    33 *  Copyright (C) 2012-2014  Universite catholique de Louvain (UCL), Belgium
    4  * 
     4 *
    55 *  This program is free software: you can redistribute it and/or modify
    66 *  it under the terms of the GNU General Public License as published by
    77 *  the Free Software Foundation, either version 3 of the License, or
    88 *  (at your option) any later version.
    9  * 
     9 *
    1010 *  This program is distributed in the hope that it will be useful,
    1111 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1212 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1313 *  GNU General Public License for more details.
    14  * 
     14 *
    1515 *  You should have received a copy of the GNU General Public License
    1616 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    2121 *  Performs transverse impact parameter smearing.
    2222 *
    23  *  $Date: 2014-16-03 14:57:44 +0100   
    24  *
    25  *
    2623 *  \author M. Selvaggi - UCL, Louvain-la-Neuve
    2724 *
    2825 */
    29  
     26
    3027
    3128#include "modules/ImpactParameterSmearing.h"
     
    4744#include "TLorentzVector.h"
    4845
    49 #include <algorithm> 
     46#include <algorithm>
    5047#include <stdexcept>
    5148#include <iostream>
     
    9996{
    10097  Candidate *candidate, *particle, *mother;
    101   Double_t xd, yd, zd, dxy, dz, sx, sy, sz, ddxy, ddz;
    102   Double_t pt, eta, px, py, ang_mom;
    103 
    104  // cout<<"New event"<<endl;
     98  Double_t xd, yd, zd, dxy, sx, sy, sz, ddxy;
     99  Double_t pt, eta, px, py;
    105100
    106101  fItInputArray->Reset();
    107102  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
    108103  {
    109  
    110     //take momentum before smearing (otherwise apply double smearing on dxy)
     104
     105    // take momentum before smearing (otherwise apply double smearing on dxy)
    111106    particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
    112  
     107
    113108    const TLorentzVector &candidateMomentum = particle->Momentum;
    114     //  const TLorentzVector &candidateMomentum = candidate->Momentum;
    115    
     109
    116110    eta = candidateMomentum.Eta();
    117111    pt = candidateMomentum.Pt();
    118112    px = candidateMomentum.Px();
    119113    py = candidateMomentum.Py();
    120      
     114
    121115    // calculate coordinates of closest approach to track circle in transverse plane xd, yd, zd
    122116    xd =  candidate->Xd;
    123117    yd =  candidate->Yd;
    124118    zd =  candidate->Zd;
    125    
    126     // calculate smeared values   
    127     sx = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    128     sy = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    129     sz = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    130      
     119
     120    // calculate smeared values
     121    sx = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
     122    sy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
     123    sz = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
     124
    131125    xd += sx;
    132126    yd += sy;
    133     zd += sz;
    134      
    135     // calculate impact paramater (after-smearing)
    136     ang_mom = (xd*py - yd*px);
    137     dxy = ang_mom/pt;
    138     dz = zd;
    139  
    140     ddxy = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    141     ddz = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    142  
    143     //fill smeared values in candidate
     127    zd += sz;
     128
     129    // calculate impact parameter (after-smearing)
     130    dxy = (xd*py - yd*px)/pt;
     131
     132    ddxy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta));
     133
     134    // fill smeared values in candidate
    144135    mother = candidate;
    145    
     136
    146137    candidate = static_cast<Candidate*>(candidate->Clone());
    147138    candidate->Xd = xd;
    148139    candidate->Yd = yd;
    149140    candidate->Zd = zd;
    150    
     141
    151142    candidate->Dxy = dxy;
    152143    candidate->SDxy = ddxy;
    153      
     144
    154145    candidate->AddCandidate(mother);
    155146    fOutputArray->Add(candidate);
Note: See TracChangeset for help on using the changeset viewer.