Fork me on GitHub

Changeset 4d753a1 in git


Ignore:
Timestamp:
Dec 19, 2014, 11:43:21 PM (10 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
2b900b8
Parents:
764f12a0
Message:

remove unneeded variables and fix formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/ImpactParameterSmearing.cc

    r764f12a0 r4d753a1  
    2424 *
    2525 */
    26  
     26
    2727
    2828#include "modules/ImpactParameterSmearing.h"
     
    4444#include "TLorentzVector.h"
    4545
    46 #include <algorithm> 
     46#include <algorithm>
    4747#include <stdexcept>
    4848#include <iostream>
     
    9696{
    9797  Candidate *candidate, *particle, *mother;
    98   Double_t xd, yd, zd, dxy, dz, sx, sy, sz, ddxy, ddz;
    99   Double_t pt, eta, px, py, ang_mom;
    100 
    101  // cout<<"New event"<<endl;
     98  Double_t xd, yd, zd, dxy, sx, sy, sz, ddxy;
     99  Double_t pt, eta, px, py;
    102100
    103101  fItInputArray->Reset();
    104102  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
    105103  {
    106  
    107     //take momentum before smearing (otherwise apply double smearing on dxy)
     104
     105    // take momentum before smearing (otherwise apply double smearing on dxy)
    108106    particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
    109  
     107
    110108    const TLorentzVector &candidateMomentum = particle->Momentum;
    111     //  const TLorentzVector &candidateMomentum = candidate->Momentum;
    112    
     109
    113110    eta = candidateMomentum.Eta();
    114111    pt = candidateMomentum.Pt();
    115112    px = candidateMomentum.Px();
    116113    py = candidateMomentum.Py();
    117      
     114
    118115    // calculate coordinates of closest approach to track circle in transverse plane xd, yd, zd
    119116    xd =  candidate->Xd;
    120117    yd =  candidate->Yd;
    121118    zd =  candidate->Zd;
    122    
    123     // calculate smeared values   
    124     sx = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    125     sy = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    126     sz = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    127      
     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
    128125    xd += sx;
    129126    yd += sy;
    130     zd += sz;
    131      
    132     // calculate impact paramater (after-smearing)
    133     ang_mom = (xd*py - yd*px);
    134     dxy = ang_mom/pt;
    135     dz = zd;
    136  
    137     ddxy = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    138     ddz = gRandom->Gaus(0,fFormula->Eval(pt, eta));
    139  
    140     //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
    141135    mother = candidate;
    142    
     136
    143137    candidate = static_cast<Candidate*>(candidate->Clone());
    144138    candidate->Xd = xd;
    145139    candidate->Yd = yd;
    146140    candidate->Zd = zd;
    147    
     141
    148142    candidate->Dxy = dxy;
    149143    candidate->SDxy = ddxy;
    150      
     144
    151145    candidate->AddCandidate(mother);
    152146    fOutputArray->Add(candidate);
Note: See TracChangeset for help on using the changeset viewer.