Fork me on GitHub

Changes in / [fb98f40:6e3d5f4] in git


Ignore:
Files:
8 added
10 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rfb98f40 r6e3d5f4  
    316316        modules/EnergySmearing.h \
    317317        modules/MomentumSmearing.h \
     318        modules/TrackSmearing.h \
    318319        modules/ImpactParameterSmearing.h \
    319320        modules/TimeSmearing.h \
     
    338339        modules/StatusPidFilter.h \
    339340        modules/PdgCodeFilter.h \
     341        modules/BeamSpotFilter.h \
    340342        modules/Cloner.h \
    341343        modules/Weighter.h \
     
    343345        modules/JetFlavorAssociation.h \
    344346        modules/JetFakeParticle.h \
     347        modules/VertexSorter.h \
     348        modules/VertexFinder.h \
    345349        modules/ExampleModule.h
    346350ModulesDict$(PcmSuf): \
     
    546550        classes/DelphesFactory.h \
    547551        classes/DelphesFormula.h
     552tmp/modules/BeamSpotFilter.$(ObjSuf): \
     553        modules/BeamSpotFilter.$(SrcSuf) \
     554        modules/BeamSpotFilter.h \
     555        classes/DelphesClasses.h \
     556        classes/DelphesFactory.h \
     557        classes/DelphesFormula.h \
     558        external/ExRootAnalysis/ExRootResult.h \
     559        external/ExRootAnalysis/ExRootFilter.h \
     560        external/ExRootAnalysis/ExRootClassifier.h
    548561tmp/modules/Calorimeter.$(ObjSuf): \
    549562        modules/Calorimeter.$(SrcSuf) \
     
    836849        external/ExRootAnalysis/ExRootFilter.h \
    837850        external/ExRootAnalysis/ExRootClassifier.h
     851tmp/modules/TrackSmearing.$(ObjSuf): \
     852        modules/TrackSmearing.$(SrcSuf) \
     853        modules/TrackSmearing.h \
     854        classes/DelphesClasses.h \
     855        classes/DelphesFactory.h \
     856        classes/DelphesFormula.h \
     857        external/ExRootAnalysis/ExRootResult.h \
     858        external/ExRootAnalysis/ExRootFilter.h \
     859        external/ExRootAnalysis/ExRootClassifier.h
    838860tmp/modules/TreeWriter.$(ObjSuf): \
    839861        modules/TreeWriter.$(SrcSuf) \
     
    852874        classes/DelphesFactory.h \
    853875        classes/DelphesFormula.h \
     876        external/ExRootAnalysis/ExRootResult.h \
     877        external/ExRootAnalysis/ExRootFilter.h \
     878        external/ExRootAnalysis/ExRootClassifier.h
     879tmp/modules/VertexFinder.$(ObjSuf): \
     880        modules/VertexFinder.$(SrcSuf) \
     881        modules/VertexFinder.h \
     882        classes/DelphesClasses.h \
     883        classes/DelphesFactory.h \
     884        classes/DelphesFormula.h \
     885        classes/DelphesPileUpReader.h \
     886        external/ExRootAnalysis/ExRootResult.h \
     887        external/ExRootAnalysis/ExRootFilter.h \
     888        external/ExRootAnalysis/ExRootClassifier.h
     889tmp/modules/VertexSorter.$(ObjSuf): \
     890        modules/VertexSorter.$(SrcSuf) \
     891        modules/VertexSorter.h \
     892        classes/DelphesClasses.h \
     893        classes/DelphesFactory.h \
     894        classes/DelphesFormula.h \
     895        classes/DelphesPileUpReader.h \
    854896        external/ExRootAnalysis/ExRootResult.h \
    855897        external/ExRootAnalysis/ExRootFilter.h \
     
    915957        tmp/modules/AngularSmearing.$(ObjSuf) \
    916958        tmp/modules/BTagging.$(ObjSuf) \
     959        tmp/modules/BeamSpotFilter.$(ObjSuf) \
    917960        tmp/modules/Calorimeter.$(ObjSuf) \
    918961        tmp/modules/Cloner.$(ObjSuf) \
     
    946989        tmp/modules/TrackCountingTauTagging.$(ObjSuf) \
    947990        tmp/modules/TrackPileUpSubtractor.$(ObjSuf) \
     991        tmp/modules/TrackSmearing.$(ObjSuf) \
    948992        tmp/modules/TreeWriter.$(ObjSuf) \
    949993        tmp/modules/UniqueObjectFinder.$(ObjSuf) \
     994        tmp/modules/VertexFinder.$(ObjSuf) \
     995        tmp/modules/VertexSorter.$(ObjSuf) \
    950996        tmp/modules/Weighter.$(ObjSuf)
    951997
     
    15451591        tmp/external/tcl/tclVar.$(ObjSuf)
    15461592
     1593modules/TrackSmearing.h: \
     1594        classes/DelphesModule.h
     1595        @touch $@
     1596
    15471597external/fastjet/ClusterSequence.hh: \
    15481598        external/fastjet/PseudoJet.hh \
     
    18011851        @touch $@
    18021852
     1853modules/VertexSorter.h: \
     1854        classes/DelphesModule.h \
     1855        classes/DelphesClasses.h
     1856        @touch $@
     1857
    18031858modules/Delphes.h: \
    18041859        classes/DelphesModule.h
     1860        @touch $@
     1861
     1862modules/VertexFinder.h: \
     1863        classes/DelphesModule.h \
     1864        classes/DelphesClasses.h
    18051865        @touch $@
    18061866
     
    19772037
    19782038modules/FastJetFinder.h: \
     2039        classes/DelphesModule.h
     2040        @touch $@
     2041
     2042modules/BeamSpotFilter.h: \
    19792043        classes/DelphesModule.h
    19802044        @touch $@
  • classes/DelphesClasses.cc

    rfb98f40 r6e3d5f4  
    121121  Charge(0), Mass(0.0),
    122122  IsPU(0), IsRecoPU(0), IsConstituent(0), IsFromConversion(0),
     123  ClusterIndex(-1), ClusterNDF(0), ClusterSigma(0), SumPT2(0), BTVSumPT2(0), GenDeltaZ(0), GenSumPT2(0),
    123124  Flavor(0), FlavorAlgo(0), FlavorPhys(0),
    124125  BTag(0), BTagAlgo(0), BTagPhys(0),
     
    127128  Momentum(0.0, 0.0, 0.0, 0.0),
    128129  Position(0.0, 0.0, 0.0, 0.0),
     130  PositionError(0.0, 0.0, 0.0, 0.0),
     131  InitialPosition(0.0, 0.0, 0.0, 0.0),
    129132  Area(0.0, 0.0, 0.0, 0.0),
    130   Dxy(0), SDxy(0), Xd(0), Yd(0), Zd(0),
     133  L(0),
     134  D0(0), ErrorD0(0),
     135  DZ(0), ErrorDZ(0),
     136  P(0),  ErrorP(0),
     137  PT(0), ErrorPT(0),
     138  CtgTheta(0), ErrorCtgTheta(0),
     139  Phi(0), ErrorPhi(0), 
     140  Xd(0), Yd(0), Zd(0),
    131141  TrackResolution(0),
    132142  NCharged(0),
     
    245255  object.IsConstituent = IsConstituent;
    246256  object.IsFromConversion = IsFromConversion;
     257  object.ClusterIndex = ClusterIndex;
     258  object.ClusterNDF = ClusterNDF;
     259  object.ClusterSigma = ClusterSigma;
     260  object.SumPT2 = SumPT2;
     261  object.BTVSumPT2 = BTVSumPT2;
     262  object.GenDeltaZ = GenDeltaZ;
     263  object.GenSumPT2 = GenSumPT2;
    247264  object.Flavor = Flavor;
    248265  object.FlavorAlgo = FlavorAlgo;
     
    262279  object.Momentum = Momentum;
    263280  object.Position = Position;
     281  object.InitialPosition = InitialPosition;
     282  object.PositionError = PositionError;
    264283  object.Area = Area;
    265   object.Dxy = Dxy;
    266   object.SDxy = SDxy;
     284  object.L = L;
     285  object.D0 = D0;
     286  object.ErrorD0 = ErrorD0;
     287  object.DZ = DZ;
     288  object.ErrorDZ = ErrorDZ;
     289  object.P = P;
     290  object.ErrorP = ErrorP;
     291  object.PT = PT;
     292  object.ErrorPT = ErrorPT;
     293  object.CtgTheta = CtgTheta ;
     294  object.ErrorCtgTheta = ErrorCtgTheta;
     295  object.Phi = Phi;
     296  object.ErrorPhi = ErrorPhi; 
    267297  object.Xd = Xd;
    268298  object.Yd = Yd;
     
    363393  Momentum.SetXYZT(0.0, 0.0, 0.0, 0.0);
    364394  Position.SetXYZT(0.0, 0.0, 0.0, 0.0);
     395  InitialPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);
    365396  Area.SetXYZT(0.0, 0.0, 0.0, 0.0);
    366   Dxy = 0.0;
    367   SDxy = 0.0;
     397  L = 0.0;
     398  D0 = 0.0; 
     399  ErrorD0 = 0.0;
     400  DZ = 0.0;
     401  ErrorDZ = 0.0;
     402  P =0.0;
     403  ErrorP =0.0;
     404  PT = 0.0;
     405  ErrorPT = 0.0;
     406  CtgTheta = 0.0;
     407  ErrorCtgTheta = 0.0;
     408  Phi = 0.0;
     409  ErrorPhi = 0.0;
    368410  Xd = 0.0;
    369411  Yd = 0.0;
  • classes/DelphesClasses.h

    rfb98f40 r6e3d5f4  
    147147  Float_t Pz; // particle momentum vector (z component) | hepevt.phep[number][2]
    148148
    149   Float_t PT; // particle transverse momentum
     149  Float_t D0;
     150  Float_t DZ;
     151  Float_t P;
     152  Float_t PT;
     153  Float_t CtgTheta;
     154  Float_t Phi;
    150155  Float_t Eta; // particle pseudorapidity
    151   Float_t Phi; // particle azimuthal angle
    152 
    153156  Float_t Rapidity; // particle rapidity
    154157
     
    175178  Float_t Y; // vertex position (y component)
    176179  Float_t Z; // vertex position (z component)
    177 
    178   ClassDef(Vertex, 1)
     180 
     181  Double_t ErrorX;
     182  Double_t ErrorY;
     183  Double_t ErrorZ;
     184
     185  Int_t Index;
     186  Int_t NDF;
     187  Double_t Sigma;
     188  Double_t SumPT2;
     189  Double_t BTVSumPT2;
     190  Double_t GenDeltaZ;
     191  Double_t GenSumPT2;
     192
     193  ClassDef(Vertex, 2)
    179194};
    180195
     
    397412  Int_t Charge; // track charge
    398413
    399   Float_t PT; // track transverse momentum
    400 
    401414  Float_t Eta; // track pseudorapidity
    402   Float_t Phi; // track azimuthal angle
    403 
     415 
    404416  Float_t EtaOuter; // track pseudorapidity at the tracker edge
    405417  Float_t PhiOuter; // track azimuthal angle at the tracker edge
     
    415427  Float_t TOuter; // track position (z component) at the tracker edge
    416428
    417   Float_t Dxy;     // track signed transverse impact parameter
    418   Float_t SDxy;    // signed error on the track signed transverse impact parameter
     429  Float_t L; // track path length
     430   
     431  Float_t D0;     // track signed transverse impact parameter
     432  Float_t ErrorD0;    // signed error on the track signed transverse impact parameter
     433 
     434  Float_t DZ; // track transverse momentum
     435  Float_t ErrorDZ; // track transverse momentum error
     436 
     437  Float_t P; // track transverse momentum
     438  Float_t ErrorP; // track transverse momentum error
     439 
     440  Float_t PT; // track transverse momentum
     441  Float_t ErrorPT; // track transverse momentum error
     442 
     443  Float_t CtgTheta; // track transverse momentum
     444  Float_t ErrorCtgTheta; // track transverse momentum error
     445 
     446  Float_t Phi; // track azimuthal angle
     447  Float_t ErrorPhi; // track azimuthal angle
     448 
    419449  Float_t Xd;      // X coordinate of point of closest approach to vertex
    420450  Float_t Yd;      // Y coordinate of point of closest approach to vertex
     
    423453  TRef Particle; // reference to generated particle
    424454
     455  Int_t VertexIndex; // reference to vertex
     456 
    425457  static CompBase *fgCompare; //!
    426458  const CompBase *GetCompare() const { return fgCompare; }
     
    526558  Float_t DeltaPhi;
    527559
    528   TLorentzVector Momentum, Position, Area;
    529 
    530   Float_t Dxy;
    531   Float_t SDxy;
     560  TLorentzVector Momentum, Position, InitialPosition, PositionError, Area;
     561
     562  Float_t L; // path length
     563  Float_t D0;
     564  Float_t ErrorD0;
     565  Float_t DZ;
     566  Float_t ErrorDZ;
     567  Float_t P;
     568  Float_t ErrorP;
     569  Float_t PT;
     570  Float_t ErrorPT;
     571  Float_t CtgTheta;
     572  Float_t ErrorCtgTheta;
     573  Float_t Phi;
     574  Float_t ErrorPhi;
     575
    532576  Float_t Xd;
    533577  Float_t Yd;
     
    562606  Float_t SumPt;
    563607
     608  // vertex variables
     609 
     610  Int_t ClusterIndex;
     611  Int_t ClusterNDF;
     612  Double_t ClusterSigma;
     613  Double_t SumPT2;
     614  Double_t BTVSumPT2;
     615  Double_t GenDeltaZ;
     616  Double_t GenSumPT2;
     617
    564618  // N-subjettiness variables
    565619
  • modules/ImpactParameterSmearing.cc

    rfb98f40 r6e3d5f4  
    9696{
    9797  Candidate *candidate, *particle, *mother;
    98   Double_t xd, yd, zd, dxy, sx, sy, sz, ddxy;
     98  Double_t xd, yd, zd, d0, sx, sy, sz, dd0;
    9999  Double_t pt, eta, px, py, phi, e;
    100100
     
    103103  {
    104104
    105     // take momentum before smearing (otherwise apply double smearing on dxy)
     105    // take momentum before smearing (otherwise apply double smearing on d0)
    106106    particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
    107107
     
    131131
    132132    // calculate impact parameter (after-smearing)
    133     dxy = (xd*py - yd*px)/pt;
     133    d0 = (xd*py - yd*px)/pt;
    134134
    135     ddxy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));
     135    dd0 = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));
    136136
    137137    // fill smeared values in candidate
     
    143143    candidate->Zd = zd;
    144144
    145     candidate->Dxy = dxy;
    146     candidate->SDxy = ddxy;
     145    candidate->D0 = d0;
     146    candidate->ErrorD0 = dd0;
    147147
    148148    candidate->AddCandidate(mother);
  • modules/ModulesLinkDef.h

    rfb98f40 r6e3d5f4  
    3535#include "modules/EnergySmearing.h"
    3636#include "modules/MomentumSmearing.h"
     37#include "modules/TrackSmearing.h"
    3738#include "modules/ImpactParameterSmearing.h"
    3839#include "modules/TimeSmearing.h"
     
    5758#include "modules/StatusPidFilter.h"
    5859#include "modules/PdgCodeFilter.h"
     60#include "modules/BeamSpotFilter.h"
    5961#include "modules/Cloner.h"
    6062#include "modules/Weighter.h"
     
    6264#include "modules/JetFlavorAssociation.h"
    6365#include "modules/JetFakeParticle.h"
     66#include "modules/VertexSorter.h"
     67#include "modules/VertexFinder.h"
    6468#include "modules/ExampleModule.h"
    6569
     
    7983#pragma link C++ class EnergySmearing+;
    8084#pragma link C++ class MomentumSmearing+;
     85#pragma link C++ class TrackSmearing+;
    8186#pragma link C++ class ImpactParameterSmearing+;
    8287#pragma link C++ class TimeSmearing+;
     
    101106#pragma link C++ class StatusPidFilter+;
    102107#pragma link C++ class PdgCodeFilter+;
     108#pragma link C++ class BeamSpotFilter+;
    103109#pragma link C++ class Cloner+;
    104110#pragma link C++ class Weighter+;
     
    106112#pragma link C++ class JetFlavorAssociation+;
    107113#pragma link C++ class JetFakeParticle+;
     114#pragma link C++ class VertexSorter+;
     115#pragma link C++ class VertexFinder+;
    108116#pragma link C++ class ExampleModule+;
    109117
  • modules/ParticlePropagator.cc

    rfb98f40 r6e3d5f4  
    6767}
    6868
     69
    6970//------------------------------------------------------------------------------
    7071
     
    9192  fItInputArray = fInputArray->MakeIterator();
    9293
     94  // import beamspot
     95  try
     96  {
     97    fBeamSpotInputArray = ImportArray(GetString("BeamSpotInputArray", "BeamSpotFilter/beamSpotParticle"));
     98  }
     99  catch(runtime_error &e)
     100  {
     101    fBeamSpotInputArray = 0;
     102  } 
    93103  // create output arrays
    94104
     
    111121{
    112122  Candidate *candidate, *mother;
    113   TLorentzVector candidatePosition, candidateMomentum;
     123  TLorentzVector candidatePosition, candidateMomentum, beamSpotPosition;
    114124  Double_t px, py, pz, pt, pt2, e, q;
    115125  Double_t x, y, z, t, r, phi;
     
    120130  Double_t tmp, discr, discr2;
    121131  Double_t delta, gammam, omega, asinrho;
    122   Double_t rcu, rc2, dxy, xd, yd, zd;
    123 
     132  Double_t rcu, rc2, xd, yd, zd;
     133  Double_t l, d0, dz, p, ctgTheta, phip, etap, alpha;
     134  Double_t bsx, bsy, bsz;
     135         
    124136  const Double_t c_light = 2.99792458E8;
    125 
     137 
     138  if (!fBeamSpotInputArray || fBeamSpotInputArray->GetSize () == 0)
     139    beamSpotPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);
     140  else
     141  {
     142    Candidate &beamSpotCandidate = *((Candidate *) fBeamSpotInputArray->At(0));
     143    beamSpotPosition = beamSpotCandidate.Position;
     144  }
     145 
    126146  fItInputArray->Reset();
    127147  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
     
    132152    y = candidatePosition.Y()*1.0E-3;
    133153    z = candidatePosition.Z()*1.0E-3;
     154   
     155    bsx = beamSpotPosition.X()*1.0E-3;
     156    bsy = beamSpotPosition.Y()*1.0E-3;
     157    bsz = beamSpotPosition.Z()*1.0E-3;
     158   
    134159    q = candidate->Charge;
    135160
     
    181206      y_t = y + py*t;
    182207      z_t = z + pz*t;
     208     
     209      l = TMath::Sqrt( (x_t - x)*(x_t - x) + (y_t - y)*(y_t - y) + (z_t - z)*(z_t - z));
    183210
    184211      mother = candidate;
    185212      candidate = static_cast<Candidate*>(candidate->Clone());
    186213
     214      candidate->InitialPosition = candidatePosition;
    187215      candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*e*1.0E3);
    188 
     216      candidate->L = l*1.0E3;
     217   
    189218      candidate->Momentum = candidateMomentum;
    190219      candidate->AddCandidate(mother);
     
    238267      yd = (rc2 > 0.0) ? yd / rc2 : -999;
    239268      zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt;
    240 
    241       // calculate impact paramater
    242       dxy = (xd*py - yd*px)/pt;
    243 
     269     
     270      // use perigee momentum rather than original particle
     271      // momentum, since the orignal particle momentum isn't known
     272     
     273      px = TMath::Sign(1.0,r) * pt * (-y_c / r_c);
     274      py = TMath::Sign(1.0,r) * pt * (x_c / r_c);
     275      etap = candidateMomentum.Eta();
     276      phip = TMath::ATan2(py, px);
     277       
     278      candidateMomentum.SetPtEtaPhiE(pt, etap, phip, candidateMomentum.E());
     279     
     280      // calculate additional track parameters (correct for beamspot position)
     281       
     282      d0        = (  (x - bsx) * py - (y - bsy) * px) / pt;
     283      dz        = z - ((x - bsx) * px + (y - bsy) * py) / pt * (pz / pt);
     284      p         = candidateMomentum.P();
     285      ctgTheta  = 1.0 / TMath::Tan (candidateMomentum.Theta ());
     286         
    244287      // 3. time evaluation t = TMath::Min(t_r, t_z)
    245288      //    t_r : time to exit from the sides
     
    287330      r_t = TMath::Hypot(x_t, y_t);
    288331
     332     
     333      // compute path length for an helix
     334     
     335      alpha = pz*1.0E9 / c_light / gammam;
     336      l = t * TMath::Sqrt(alpha*alpha + r*r*omega*omega);
     337         
    289338      if(r_t > 0.0)
    290339      {
     340       
     341        // store these variables before cloning
     342           
     343        candidate->D0 = d0*1.0E3;
     344        candidate->DZ = dz*1.0E3;
     345        candidate->P  = p;
     346        candidate->PT = pt;
     347        candidate->CtgTheta = ctgTheta;
     348        candidate->Phi = phip;
     349     
    291350        mother = candidate;
    292351        candidate = static_cast<Candidate*>(candidate->Clone());
    293352
     353        candidate->InitialPosition = candidatePosition;
    294354        candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*c_light*1.0E3);
    295355
    296356        candidate->Momentum = candidateMomentum;
    297         candidate->Dxy = dxy*1.0E3;
    298         candidate->Xd = xd*1.0E3;
     357       
     358            candidate->L  =  l*1.0E3;
     359       
     360            candidate->Xd = xd*1.0E3;
    299361        candidate->Yd = yd*1.0E3;
    300362        candidate->Zd = zd*1.0E3;
  • modules/ParticlePropagator.h

    rfb98f40 r6e3d5f4  
    3535class TClonesArray;
    3636class TIterator;
     37class TLorentzVector;
    3738
    3839class ParticlePropagator: public DelphesModule
     
    5556
    5657  const TObjArray *fInputArray; //!
     58  const TObjArray *fBeamSpotInputArray; //!
    5759
    5860  TObjArray *fOutputArray; //!
  • modules/PileUpMerger.cc

    rfb98f40 r6e3d5f4  
    115115  TDatabasePDG *pdg = TDatabasePDG::Instance();
    116116  TParticlePDG *pdgParticle;
    117   Int_t pid;
     117  Int_t pid, nch, nvtx = -1;
    118118  Float_t x, y, z, t, vx, vy;
    119   Float_t px, py, pz, e;
    120   Double_t dz, dphi, dt;
     119  Float_t px, py, pz, e, pt;
     120  Double_t dz, dphi, dt, sumpt2;
    121121  Int_t numberOfEvents, event, numberOfParticles;
    122122  Long64_t allEntries, entry;
     
    137137  vy = 0.0;
    138138  numberOfParticles = fInputArray->GetEntriesFast();
     139  nch = 0;
     140  sumpt2 = 0.0;
     141   
    139142  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
    140143  {
     
    143146    z = candidate->Position.Z();
    144147    t = candidate->Position.T();
     148    pt = candidate->Momentum.Pt();
    145149    candidate->Position.SetZ(z + dz);
    146150    candidate->Position.SetT(t + dt);
    147151    fParticleOutputArray->Add(candidate);
     152 
     153    if(TMath::Abs(candidate->Charge) >  1.0E-9)
     154    {
     155      nch++;   
     156      sumpt2 += pt*pt;
     157    } 
    148158  }
    149159
     
    154164  }
    155165
     166  nvtx++;
    156167  factory = GetFactory();
    157168
    158169  vertex = factory->NewCandidate();
    159170  vertex->Position.SetXYZT(vx, vy, dz, dt);
     171  vertex->ClusterIndex = nvtx;
     172  vertex->ClusterNDF = nch;
     173  vertex->SumPT2 = sumpt2;
     174  vertex->GenSumPT2 = sumpt2; 
     175 
    160176  fVertexOutputArray->Add(vertex);
    161177
     
    170186      numberOfEvents = gRandom->Integer(2*fMeanPileUp + 1);
    171187      break;
     188    case 2:
     189      numberOfEvents = fMeanPileUp;
     190      break;   
    172191    default:
    173192      numberOfEvents = gRandom->Poisson(fMeanPileUp);
     
    198217    vx = 0.0;
    199218    vy = 0.0;
     219   
    200220    numberOfParticles = 0;
     221    sumpt2 = 0.0;
     222   
    201223    while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e))
    202224    {
     
    224246      vx += candidate->Position.X();
    225247      vy += candidate->Position.Y();
     248     
    226249      ++numberOfParticles;
    227 
     250      if(TMath::Abs(candidate->Charge) >  1.0E-9)
     251      {
     252        nch++;   
     253        sumpt2 += pt*pt;
     254      }
     255       
    228256      fParticleOutputArray->Add(candidate);
    229257    }
     
    234262      vy /= numberOfParticles;
    235263    }
     264   
     265    nvtx++;
    236266
    237267    vertex = factory->NewCandidate();
    238268    vertex->Position.SetXYZT(vx, vy, dz, dt);
     269   
     270    vertex->ClusterIndex = nvtx;
     271    vertex->ClusterNDF = nch;
     272    vertex->SumPT2 = sumpt2;
     273    vertex->GenSumPT2 = sumpt2;
     274   
    239275    vertex->IsPU = 1;
    240276
    241277    fVertexOutputArray->Add(vertex);
    242   }
    243 }
    244 
    245 //------------------------------------------------------------------------------
     278   
     279  }
     280}
     281
     282//------------------------------------------------------------------------------
  • modules/TrackCountingBTagging.cc

    rfb98f40 r6e3d5f4  
    9696
    9797  Double_t jpx, jpy;
    98   Double_t dr, tpx, tpy, tpt;
    99   Double_t xd, yd, dxy, ddxy, ip, sip;
     98  Double_t dr, tpt;
     99  Double_t xd, yd, d0, dd0, ip, sip;
    100100
    101101  Int_t sign;
     
    117117    {
    118118      const TLorentzVector &trkMomentum = track->Momentum;
    119 
     119     
    120120      dr = jetMomentum.DeltaR(trkMomentum);
    121 
    122121      tpt = trkMomentum.Pt();
    123       tpx = trkMomentum.Px();
    124       tpy = trkMomentum.Py();
    125 
    126122      xd = track->Xd;
    127123      yd = track->Yd;
    128       dxy = TMath::Hypot(xd, yd);
    129       ddxy = track->SDxy;
     124      d0 = TMath::Hypot(xd, yd);
     125      dd0 = track->ErrorD0;
    130126
    131127      if(tpt < fPtMin) continue;
    132128      if(dr > fDeltaR) continue;
    133       if(dxy > fIPmax) continue;
     129      if(d0 > fIPmax) continue;
    134130
    135131      sign = (jpx*xd + jpy*yd > 0.0) ? 1 : -1;
    136132
    137       ip = sign*dxy;
    138       sip = ip / TMath::Abs(ddxy);
     133      ip = sign*d0;
     134      sip = ip / TMath::Abs(dd0);
    139135
    140136      if(sip > fSigMin) count++;
  • modules/TreeWriter.cc

    rfb98f40 r6e3d5f4  
    215215    entry->Pz = momentum.Pz();
    216216
     217    entry->D0            = candidate->D0;
     218    entry->DZ            = candidate->DZ;
     219    entry->P             = candidate->P;
     220    entry->PT            = candidate->PT;
     221    entry->CtgTheta      = candidate->CtgTheta;
     222    entry->Phi           = candidate->Phi;
     223
    217224    entry->Eta = eta;
    218225    entry->Phi = momentum.Phi();
     
    237244
    238245  const Double_t c_light = 2.99792458E8;
    239 
     246 
     247  Double_t x, y, z, t, xError, yError, zError, sigma, sumPT2, btvSumPT2, genDeltaZ, genSumPT2;
     248  UInt_t index, ndf;
     249 
    240250  // loop over all vertices
    241251  iterator.Reset();
    242252  while((candidate = static_cast<Candidate*>(iterator.Next())))
    243253  {
    244     const TLorentzVector &position = candidate->Position;
     254   
     255    index = candidate->ClusterIndex;
     256    ndf = candidate->ClusterNDF;
     257    sigma = candidate->ClusterSigma;
     258    sumPT2 = candidate->SumPT2;
     259    btvSumPT2 = candidate->BTVSumPT2;
     260    genDeltaZ = candidate->GenDeltaZ;
     261    genSumPT2 = candidate->GenSumPT2;
     262
     263    x = candidate->Position.X ();
     264    y = candidate->Position.Y ();
     265    z = candidate->Position.Z ();
     266    t = candidate->Position.T()*1.0E-3/c_light;
     267 
     268    xError = candidate->PositionError.X ();
     269    yError = candidate->PositionError.Y ();
     270    zError = candidate->PositionError.Z ();
    245271
    246272    entry = static_cast<Vertex*>(branch->NewEntry());
    247273
    248     entry->X = position.X();
    249     entry->Y = position.Y();
    250     entry->Z = position.Z();
    251     entry->T = position.T()*1.0E-3/c_light;
    252   }
    253 }
     274    entry->Index = index;
     275    entry->NDF = ndf;
     276    entry->Sigma = sigma;
     277    entry->SumPT2 = sumPT2;
     278    entry->BTVSumPT2 = btvSumPT2;
     279    entry->GenDeltaZ = genDeltaZ;
     280    entry->GenSumPT2 = genSumPT2;
     281 
     282    entry->X = x;
     283    entry->Y = y;
     284    entry->Z = z;
     285    entry->T = t;
     286   
     287    entry->ErrorX = xError;
     288    entry->ErrorY = yError;
     289    entry->ErrorZ = zError;
     290  }
     291}
     292
    254293
    255294//------------------------------------------------------------------------------
     
    291330    entry->ZOuter = position.Z();
    292331    entry->TOuter = position.T()*1.0E-3/c_light;
    293 
    294     entry->Dxy = candidate->Dxy;
    295     entry->SDxy = candidate->SDxy ;
     332 
     333    entry->L = candidate->L;
     334 
     335    entry->D0            = candidate->D0;
     336    entry->ErrorD0       = candidate->ErrorD0;
     337    entry->DZ            = candidate->DZ;
     338    entry->ErrorDZ       = candidate->ErrorDZ;
     339    entry->P             = candidate->P;
     340    entry->ErrorP        = candidate->ErrorP;
     341    entry->PT            = candidate->PT;
     342    entry->ErrorPT       = candidate->ErrorPT;
     343    entry->CtgTheta      = candidate->CtgTheta;
     344    entry->ErrorCtgTheta = candidate->ErrorCtgTheta;
     345    entry->Phi           = candidate->Phi;
     346    entry->ErrorPhi      = candidate->ErrorPhi;
     347   
    296348    entry->Xd = candidate->Xd;
    297349    entry->Yd = candidate->Yd;
     
    307359
    308360    entry->Eta = eta;
    309     entry->Phi = momentum.Phi();
    310     entry->PT = pt;
    311 
     361   
    312362    particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
    313363    const TLorentzVector &initialPosition = particle->Position;
     
    319369
    320370    entry->Particle = particle;
     371
     372    entry->VertexIndex = candidate->ClusterIndex;
     373
    321374  }
    322375}
Note: See TracChangeset for help on using the changeset viewer.