Fork me on GitHub

Changeset d612dec in git for classes


Ignore:
Timestamp:
Dec 9, 2021, 7:52:15 AM (3 years ago)
Author:
christinaw97 <christina.wang@…>
Children:
29b722a
Parents:
a5af1df (diff), 0c0c9af (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 branch 'master' of github.com:Christinaw97/delphes into HEAD

Location:
classes
Files:
2 added
11 edited
2 moved

Legend:

Unmodified
Added
Removed
  • classes/CMakeLists.txt

    ra5af1df rd612dec  
    99list(REMOVE_ITEM headers ${CMAKE_CURRENT_SOURCE_DIR}/ClassesLinkDef.h)
    1010
    11 DELPHES_GENERATE_DICTIONARY(ClassesDict
     11# the macro invocation for ROOT6 ensures that the headers are relocatable
     12if (NOT ${ROOT_VERSION} VERSION_LESS "6.0.0")
     13  DELPHES_GENERATE_DICTIONARY(ClassesDict
     14    classes/DelphesModule.h
     15    classes/DelphesFactory.h
     16    classes/SortableObject.h
     17    classes/DelphesClasses.h
     18    LINKDEF ClassesLinkDef.h
     19  )
     20else()
     21  # for ROOT5 the above fails, keep the following as workaround
     22  DELPHES_GENERATE_DICTIONARY(ClassesDict
    1223  ${CMAKE_CURRENT_SOURCE_DIR}/DelphesModule.h
    1324  ${CMAKE_CURRENT_SOURCE_DIR}/DelphesFactory.h
    1425  ${CMAKE_CURRENT_SOURCE_DIR}/SortableObject.h
    1526  ${CMAKE_CURRENT_SOURCE_DIR}/DelphesClasses.h
    16   LINKDEF ClassesLinkDef.h
    17 )
     27    LINKDEF ClassesLinkDef.h
     28  )
     29endif()
    1830
    1931add_library(classes OBJECT ${sources} ClassesDict.cxx)
  • classes/ClassesLinkDef.h

    ra5af1df rd612dec  
    6262#pragma link C++ class Track+;
    6363#pragma link C++ class Tower+;
     64#pragma link C++ class ParticleFlowCandidate+;
    6465#pragma link C++ class HectorHit+;
    6566
  • classes/DelphesClasses.cc

    ra5af1df rd612dec  
    2828
    2929#include "classes/DelphesClasses.h"
    30 
    3130#include "classes/DelphesFactory.h"
    3231#include "classes/SortableObject.h"
     
    4039CompBase *Track::fgCompare = CompPT<Track>::Instance();
    4140CompBase *Tower::fgCompare = CompE<Tower>::Instance();
     41CompBase *ParticleFlowCandidate::fgCompare = CompE<ParticleFlowCandidate>::Instance();
    4242CompBase *HectorHit::fgCompare = CompE<HectorHit>::Instance();
    4343CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance();
     
    104104{
    105105  TLorentzVector vec;
    106   vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
    107   return vec;
    108 }
     106  vec.SetPtEtaPhiM(PT, Eta, Phi, Mass);
     107  return vec;
     108}
     109
     110//------------------------------------------------------------------------------
     111
     112TMatrixDSym Track::CovarianceMatrix() const
     113{
     114  TMatrixDSym Cv;
     115  Cv.ResizeTo(5, 5);
     116
     117  // convert diagonal term to original units
     118  Cv(0, 0)=TMath::Power(ErrorD0, 2.);
     119  Cv(1, 1)=TMath::Power(ErrorPhi, 2.);
     120  Cv(2, 2)=TMath::Power(ErrorC, 2.);
     121  Cv(3, 3)=TMath::Power(ErrorDZ, 2.);
     122  Cv(4, 4)=TMath::Power(ErrorCtgTheta, 2.);
     123
     124  // off diagonal terms
     125  Cv(0, 1)=ErrorD0Phi;
     126  Cv(0, 2)=ErrorD0C;
     127  Cv(0, 3)=ErrorD0DZ;
     128  Cv(0, 4)=ErrorD0CtgTheta;
     129  Cv(1, 2)=ErrorPhiC;
     130  Cv(1, 3)=ErrorPhiDZ;
     131  Cv(1, 4)=ErrorPhiCtgTheta;
     132  Cv(2, 3)=ErrorCDZ;
     133  Cv(2, 4)=ErrorCCtgTheta;
     134  Cv(3, 4)=ErrorDZCtgTheta;
     135
     136  Cv(1, 0)=Cv(0, 1);
     137  Cv(2, 0)=Cv(0, 2);
     138  Cv(3, 0)=Cv(0, 3);
     139  Cv(4, 0)=Cv(0, 4);
     140  Cv(2, 1)=Cv(1, 2);
     141  Cv(3, 1)=Cv(1, 3);
     142  Cv(4, 1)=Cv(1, 4);
     143  Cv(3, 2)=Cv(2, 3);
     144  Cv(4, 2)=Cv(2, 4);
     145  Cv(4, 3)=Cv(3, 4);
     146
     147  return Cv;
     148}
     149
    109150
    110151//------------------------------------------------------------------------------
     
    115156  vec.SetPtEtaPhiM(ET, Eta, Phi, 0.0);
    116157  return vec;
     158}
     159
     160//------------------------------------------------------------------------------
     161
     162TLorentzVector ParticleFlowCandidate::P4() const
     163{
     164  TLorentzVector vec;
     165  vec.SetPtEtaPhiM(PT, Eta, Phi, Mass);
     166  return vec;
     167}
     168
     169//------------------------------------------------------------------------------
     170
     171TMatrixDSym ParticleFlowCandidate::CovarianceMatrix() const
     172{
     173  TMatrixDSym Cv;
     174  Cv.ResizeTo(5, 5);
     175
     176  // convert diagonal term to original units
     177  Cv(0, 0)=TMath::Power(ErrorD0, 2.);
     178  Cv(1, 1)=TMath::Power(ErrorPhi, 2.);
     179  Cv(2, 2)=TMath::Power(ErrorC, 2.);
     180  Cv(3, 3)=TMath::Power(ErrorDZ, 2.);
     181  Cv(4, 4)=TMath::Power(ErrorCtgTheta, 2.);
     182
     183  // off diagonal terms
     184  Cv(0, 1)=ErrorD0Phi;
     185  Cv(0, 2)=ErrorD0C;
     186  Cv(0, 3)=ErrorD0DZ;
     187  Cv(0, 4)=ErrorD0CtgTheta;
     188  Cv(1, 2)=ErrorPhiC;
     189  Cv(1, 3)=ErrorPhiDZ;
     190  Cv(1, 4)=ErrorPhiCtgTheta;
     191  Cv(2, 3)=ErrorCDZ;
     192  Cv(2, 4)=ErrorCCtgTheta;
     193  Cv(3, 4)=ErrorDZCtgTheta;
     194
     195  Cv(1, 0)=Cv(0, 1);
     196  Cv(2, 0)=Cv(0, 2);
     197  Cv(3, 0)=Cv(0, 3);
     198  Cv(4, 0)=Cv(0, 4);
     199  Cv(2, 1)=Cv(1, 2);
     200  Cv(3, 1)=Cv(1, 3);
     201  Cv(4, 1)=Cv(1, 4);
     202  Cv(3, 2)=Cv(2, 3);
     203  Cv(4, 2)=Cv(2, 4);
     204  Cv(4, 3)=Cv(3, 4);
     205
     206  return Cv;
    117207}
    118208
     
    125215  Flavor(0), FlavorAlgo(0), FlavorPhys(0),
    126216  BTag(0), BTagAlgo(0), BTagPhys(0),
    127   TauTag(0), TauWeight(0.0), Eem(0.0), Ehad(0.0),
     217  TauTag(0), TauWeight(0.0), Eem(0.0), Ehad(0.0), Etrk(0.0),
    128218  DeltaEta(0.0), DeltaPhi(0.0),
    129219  Momentum(0.0, 0.0, 0.0, 0.0),
     
    133223  PositionError(0.0, 0.0, 0.0, 0.0),
    134224  Area(0.0, 0.0, 0.0, 0.0),
     225  TrackCovariance(5),
    135226  L(0),
    136227  D0(0), ErrorD0(0),
    137228  DZ(0), ErrorDZ(0),
    138229  P(0), ErrorP(0),
     230  C(0), ErrorC(0),
    139231  PT(0), ErrorPT(0),
    140232  CtgTheta(0), ErrorCtgTheta(0),
    141233  Phi(0), ErrorPhi(0),
    142234  Xd(0), Yd(0), Zd(0),
     235  Nclusters(0.0),
     236  dNdx(0.0),
    143237  TrackResolution(0),
    144238  NCharged(0),
    145239  NNeutrals(0),
     240  NeutralEnergyFraction(0),  // charged energy fraction
     241  ChargedEnergyFraction(0),  // neutral energy fraction
    146242  Beta(0),
    147243  BetaStar(0),
     
    163259  ExclYmerge45(0),
    164260  ExclYmerge56(0),
     261  ParticleDensity(0),
    165262  fFactory(0),
    166263  fArray(0)
     
    284381  object.Eem = Eem;
    285382  object.Ehad = Ehad;
     383  object.Etrk = Etrk;
    286384  object.Edges[0] = Edges[0];
    287385  object.Edges[1] = Edges[1];
     
    304402  object.P = P;
    305403  object.ErrorP = ErrorP;
     404  object.C = C;
     405  object.ErrorC = ErrorC;
    306406  object.PT = PT;
    307407  object.ErrorPT = ErrorPT;
     
    313413  object.Yd = Yd;
    314414  object.Zd = Zd;
     415  object.Nclusters = Nclusters;
     416  object.dNdx = dNdx;
    315417  object.TrackResolution = TrackResolution;
    316418  object.NCharged = NCharged;
    317419  object.NNeutrals = NNeutrals;
     420  object.NeutralEnergyFraction = NeutralEnergyFraction;
     421  object.ChargedEnergyFraction = ChargedEnergyFraction;
    318422  object.Beta = Beta;
    319423  object.BetaStar = BetaStar;
     
    366470  object.SoftDroppedSubJet1 = SoftDroppedSubJet1;
    367471  object.SoftDroppedSubJet2 = SoftDroppedSubJet2;
    368 
     472  object.TrackCovariance = TrackCovariance;
    369473  object.fFactory = fFactory;
    370474  object.fArray = 0;
     
    413517  Eem = 0.0;
    414518  Ehad = 0.0;
     519  Etrk = 0.0;
    415520  Edges[0] = 0.0;
    416521  Edges[1] = 0.0;
     
    424529  DecayPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);
    425530  Area.SetXYZT(0.0, 0.0, 0.0, 0.0);
     531  TrackCovariance.Zero();
    426532  L = 0.0;
    427533  ErrorT = 0.0;
     
    432538  P = 0.0;
    433539  ErrorP = 0.0;
     540  C = 0.0;
     541  ErrorC = 0.0;
    434542  PT = 0.0;
    435543  ErrorPT = 0.0;
     
    441549  Yd = 0.0;
    442550  Zd = 0.0;
     551  Nclusters = 0.0;
     552  dNdx = 0.0;
    443553  TrackResolution = 0.0;
    444554  NCharged = 0;
  • classes/DelphesClasses.h

    ra5af1df rd612dec  
    3333
    3434#include "TLorentzVector.h"
     35#include "TMatrixDSym.h"
    3536#include "TObject.h"
    3637#include "TRef.h"
     
    150151  Float_t Eta; // particle pseudorapidity
    151152  Float_t Phi; // particle azimuthal angle
    152 
    153153  Float_t Rapidity; // particle rapidity
    154   Float_t CtgTheta; // particle cotangent of theta
    155 
    156   Float_t D0; // particle transverse impact parameter
    157   Float_t DZ; // particle longitudinal impact parameter
    158154
    159155  Float_t T; // particle vertex position (t component) | hepevt.vhep[number][3]
     
    394390  Int_t NCharged; // number of charged constituents
    395391  Int_t NNeutrals; // number of neutral constituents
     392
     393  Float_t NeutralEnergyFraction;  // charged energy fraction
     394  Float_t ChargedEnergyFraction;  // neutral energy fraction
     395
    396396  Float_t Beta; // (sum pt of charged pile-up constituents)/(sum pt of charged constituents)
    397397  Float_t BetaStar; // (sum pt of charged constituents coming from hard interaction)/(sum pt of charged constituents)
     
    445445  Float_t Phi; // track azimuthal angle
    446446  Float_t CtgTheta; // track cotangent of theta
     447  Float_t C; // track curvature inverse
     448  Float_t Mass; // particle mass
    447449
    448450  Float_t EtaOuter; // track pseudorapidity at the tracker edge
     
    466468  Float_t D0; // track transverse impact parameter
    467469  Float_t DZ; // track longitudinal impact parameter
     470  Float_t Nclusters; // Number of ionization clusters
     471  Float_t dNdx; // Number of ionization clusters
    468472
    469473  Float_t ErrorP; // track momentum error
     
    475479  Float_t ErrorD0; // track transverse impact parameter error
    476480  Float_t ErrorDZ; // track longitudinal impact parameter error
     481  Float_t ErrorC; // track curvature error
     482
     483  // track covariance off-diagonal terms
     484  Float_t ErrorD0Phi;
     485  Float_t ErrorD0C;
     486  Float_t ErrorD0DZ;
     487  Float_t ErrorD0CtgTheta;
     488  Float_t ErrorPhiC;
     489  Float_t ErrorPhiDZ;
     490  Float_t ErrorPhiCtgTheta ;
     491  Float_t ErrorCDZ;
     492  Float_t ErrorCCtgTheta;
     493  Float_t ErrorDZCtgTheta;
    477494
    478495  TRef Particle; // reference to generated particle
     
    484501
    485502  TLorentzVector P4() const;
     503  TMatrixDSym CovarianceMatrix() const;
    486504
    487505  ClassDef(Track, 3)
     
    504522  Float_t Eem; // calorimeter tower electromagnetic energy
    505523  Float_t Ehad; // calorimeter tower hadronic energy
     524  Float_t Etrk; // total charged energy hitting tower
    506525
    507526  Float_t Edges[4]; // calorimeter tower edges
     
    514533  TLorentzVector P4() const;
    515534
    516   ClassDef(Tower, 2)
     535  ClassDef(Tower, 3)
     536};
     537
     538//---------------------------------------------------------------------------
     539
     540class ParticleFlowCandidate: public SortableObject
     541{
     542
     543public:
     544  Int_t PID; // HEP ID number
     545
     546  Int_t Charge; // track charge
     547
     548  Float_t E; // reconstructed energy [GeV]
     549  Float_t P; // track momentum
     550  Float_t PT; // track transverse momentum
     551  Float_t Eta; // track pseudorapidity
     552  Float_t Phi; // track azimuthal angle
     553  Float_t CtgTheta; // track cotangent of theta
     554  Float_t C; // track curvature inverse
     555  Float_t Mass; // particle mass
     556
     557  Float_t EtaOuter; // track pseudorapidity at the tracker edge
     558  Float_t PhiOuter; // track azimuthal angle at the tracker edge
     559
     560  Float_t T; // track vertex position (t component)
     561  Float_t X; // track vertex position (x component)
     562  Float_t Y; // track vertex position (y component)
     563  Float_t Z; // track vertex position (z component)
     564
     565  Float_t TOuter; // track position (t component) at the tracker edge
     566  Float_t XOuter; // track position (x component) at the tracker edge
     567  Float_t YOuter; // track position (y component) at the tracker edge
     568  Float_t ZOuter; // track position (z component) at the tracker edge
     569
     570  Float_t Xd; // X coordinate of point of closest approach to vertex
     571  Float_t Yd; // Y coordinate of point of closest approach to vertex
     572  Float_t Zd; // Z coordinate of point of closest approach to vertex
     573
     574  Float_t L; // track path length
     575  Float_t D0; // track transverse impact parameter
     576  Float_t DZ; // track longitudinal impact parameter
     577  Float_t Nclusters; // Number of ionization clusters
     578  Float_t dNdx; // Number of ionization clusters
     579
     580  Float_t ErrorP; // track momentum error
     581  Float_t ErrorPT; // track transverse momentum error
     582  Float_t ErrorPhi; // track azimuthal angle error
     583  Float_t ErrorCtgTheta; // track cotangent of theta error
     584
     585  Float_t ErrorT; // time measurement error
     586  Float_t ErrorD0; // track transverse impact parameter error
     587  Float_t ErrorDZ; // track longitudinal impact parameter error
     588  Float_t ErrorC; // track curvature error
     589
     590  // track covariance off-diagonal terms
     591  Float_t ErrorD0Phi;
     592  Float_t ErrorD0C;
     593  Float_t ErrorD0DZ;
     594  Float_t ErrorD0CtgTheta;
     595  Float_t ErrorPhiC;
     596  Float_t ErrorPhiDZ;
     597  Float_t ErrorPhiCtgTheta ;
     598  Float_t ErrorCDZ;
     599  Float_t ErrorCCtgTheta;
     600  Float_t ErrorDZCtgTheta;
     601
     602  Int_t VertexIndex; // reference to vertex
     603
     604  static CompBase *fgCompare; //!
     605  const CompBase *GetCompare() const { return fgCompare; }
     606
     607  TLorentzVector P4() const;
     608  TMatrixDSym CovarianceMatrix() const;
     609
     610  Int_t NTimeHits; // number of hits contributing to time measurement
     611
     612  Float_t Eem; // calorimeter tower electromagnetic energy
     613  Float_t Ehad; // calorimeter tower hadronic energy
     614  Float_t Etrk; // total charged energy hitting tower
     615
     616  Float_t Edges[4]; // calorimeter tower edges
     617
     618  TRefArray Particles; // references to generated particles
     619
     620  ClassDef(ParticleFlowCandidate, 3)
     621
    517622};
    518623
     
    610715  Float_t Eem;
    611716  Float_t Ehad;
     717  Float_t Etrk;
    612718
    613719  Float_t Edges[4];
     
    618724
    619725  Float_t L; // path length
     726  Float_t DZ;
     727  Float_t ErrorDZ;
    620728  Float_t ErrorT; // path length
    621729  Float_t D0;
    622730  Float_t ErrorD0;
    623   Float_t DZ;
    624   Float_t ErrorDZ;
     731  Float_t C;
     732  Float_t ErrorC;
    625733  Float_t P;
    626734  Float_t ErrorP;
     
    632740  Float_t ErrorPhi;
    633741
     742  Float_t Nclusters; // Number of ionization clusters
     743  Float_t dNdx; // Number of ionization clusters per unit length
     744
    634745  Float_t Xd;
    635746  Float_t Yd;
     
    649760  Float_t PTD;
    650761  Float_t FracPt[5];
     762  Float_t NeutralEnergyFraction;  // charged energy fraction
     763  Float_t ChargedEnergyFraction;  // neutral energy fraction
     764
    651765
    652766  // Timing information
     
    663777  Float_t SumPtChargedPU;
    664778  Float_t SumPt;
     779
     780  // ACTS compliant 6x6 track covariance (D0, phi, Curvature, dz, ctg(theta))
     781
     782  TMatrixDSym TrackCovariance;
    665783
    666784  // vertex variables
     
    698816  Double_t ExclYmerge56;
    699817
     818  // event characteristics variables
     819  Double_t ParticleDensity; // particle multiplicity density in the proximity of the particle
     820
    700821  static CompBase *fgCompare; //!
    701822  const CompBase *GetCompare() const { return fgCompare; }
  • classes/DelphesFormula.cc

    ra5af1df rd612dec  
    1818
    1919#include "classes/DelphesFormula.h"
     20#include "classes/DelphesClasses.h"
    2021
    2122#include "TString.h"
     
    6364  buffer.ReplaceAll("dz", "[1]");
    6465  buffer.ReplaceAll("ctgTheta", "[2]");
     66  buffer.ReplaceAll("radius", "[3]");
     67  buffer.ReplaceAll("density", "[4]");
    6568
    6669#if ROOT_VERSION_CODE < ROOT_VERSION(6, 3, 0)
     
    7780//------------------------------------------------------------------------------
    7881
    79 Double_t DelphesFormula::Eval(Double_t pt, Double_t eta, Double_t phi,
    80   Double_t energy, Double_t d0, Double_t dz,
    81   Double_t ctgTheta)
     82Double_t DelphesFormula::Eval(Double_t pt, Double_t eta, Double_t phi, Double_t energy, Candidate *candidate)
    8283{
     84
     85  Double_t d0 = 0., dz = 0., ctgTheta = 0., radius = 0., density = 0.;
     86  if (candidate) {
     87    d0 = candidate->D0;
     88    dz = candidate->DZ;
     89    ctgTheta = candidate->CtgTheta;
     90    radius = candidate->Position.Pt();
     91    density = candidate->ParticleDensity;
     92  }
     93   
    8394  Double_t x[4] = {pt, eta, phi, energy};
    84   Double_t params[3] = {d0, dz, ctgTheta};
     95  Double_t params[5] = {d0, dz, ctgTheta, radius, density};
    8596  return EvalPar(x, params);
    8697}
  • classes/DelphesFormula.h

    ra5af1df rd612dec  
    2222#include "TFormula.h"
    2323
     24class Candidate;
     25
    2426class DelphesFormula: public TFormula
    2527{
     
    3335  Int_t Compile(const char *expression);
    3436
    35   Double_t Eval(Double_t pt, Double_t eta = 0, Double_t phi = 0,
    36     Double_t energy = 0, Double_t d0 = 0, Double_t dz = 0,
    37     Double_t ctgTheta = 0);
     37  Double_t Eval(Double_t pt, Double_t eta = 0, Double_t phi = 0, Double_t energy = 0, Candidate *candidate = nullptr);
    3838};
    3939
  • classes/DelphesHepMC2Reader.cc

    ra5af1df rd612dec  
    1717 */
    1818
    19 /** \class DelphesHepMCReader
     19/** \class DelphesHepMC2Reader
    2020 *
    2121 *  Reads HepMC file
     
    2525 */
    2626
    27 #include "classes/DelphesHepMCReader.h"
     27#include "classes/DelphesHepMC2Reader.h"
    2828
    2929#include <iostream>
     
    5454//---------------------------------------------------------------------------
    5555
    56 DelphesHepMCReader::DelphesHepMCReader() :
     56DelphesHepMC2Reader::DelphesHepMC2Reader() :
    5757  fInputFile(0), fBuffer(0), fPDG(0),
    5858  fVertexCounter(-1), fInCounter(-1), fOutCounter(-1),
     
    6666//---------------------------------------------------------------------------
    6767
    68 DelphesHepMCReader::~DelphesHepMCReader()
     68DelphesHepMC2Reader::~DelphesHepMC2Reader()
    6969{
    7070  if(fBuffer) delete[] fBuffer;
     
    7373//---------------------------------------------------------------------------
    7474
    75 void DelphesHepMCReader::SetInputFile(FILE *inputFile)
     75void DelphesHepMC2Reader::SetInputFile(FILE *inputFile)
    7676{
    7777  fInputFile = inputFile;
     
    8080//---------------------------------------------------------------------------
    8181
    82 void DelphesHepMCReader::Clear()
     82void DelphesHepMC2Reader::Clear()
    8383{
    8484  fStateSize = 0;
     
    9898//---------------------------------------------------------------------------
    9999
    100 bool DelphesHepMCReader::EventReady()
     100bool DelphesHepMC2Reader::EventReady()
    101101{
    102102  return (fVertexCounter == 0) && (fInCounter == 0) && (fOutCounter == 0);
     
    105105//---------------------------------------------------------------------------
    106106
    107 bool DelphesHepMCReader::ReadBlock(DelphesFactory *factory,
     107bool DelphesHepMC2Reader::ReadBlock(DelphesFactory *factory,
    108108  TObjArray *allParticleOutputArray,
    109109  TObjArray *stableParticleOutputArray,
     
    202202    }
    203203  }
    204 
    205204  else if(key == 'C')
    206205  {
    207206    rc = bufferStream.ReadDbl(fCrossSection)
    208207      && bufferStream.ReadDbl(fCrossSectionError);
    209   }
    210 
     208
     209    if(!rc)
     210    {
     211      cerr << "** ERROR: "
     212           << "invalid cross section format" << endl;
     213      return kFALSE;
     214    }
     215  }
    211216  else if(key == 'F')
    212217  {
     
    317322//---------------------------------------------------------------------------
    318323
    319 void DelphesHepMCReader::AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber,
     324void DelphesHepMC2Reader::AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber,
    320325  TStopwatch *readStopWatch, TStopwatch *procStopWatch)
    321326{
     
    348353//---------------------------------------------------------------------------
    349354
    350 void DelphesHepMCReader::AnalyzeWeight(ExRootTreeBranch *branch)
     355void DelphesHepMC2Reader::AnalyzeWeight(ExRootTreeBranch *branch)
    351356{
    352357  Weight *element;
     
    363368//---------------------------------------------------------------------------
    364369
    365 void DelphesHepMCReader::AnalyzeParticle(DelphesFactory *factory,
     370void DelphesHepMC2Reader::AnalyzeParticle(DelphesFactory *factory,
    366371  TObjArray *allParticleOutputArray,
    367372  TObjArray *stableParticleOutputArray,
     
    430435//---------------------------------------------------------------------------
    431436
    432 void DelphesHepMCReader::FinalizeParticles(TObjArray *allParticleOutputArray)
     437void DelphesHepMC2Reader::FinalizeParticles(TObjArray *allParticleOutputArray)
    433438{
    434439  Candidate *candidate;
  • classes/DelphesHepMC2Reader.h

    ra5af1df rd612dec  
    1717 */
    1818
    19 #ifndef DelphesHepMCReader_h
    20 #define DelphesHepMCReader_h
     19#ifndef DelphesHepMC2Reader_h
     20#define DelphesHepMC2Reader_h
    2121
    22 /** \class DelphesHepMCReader
     22/** \class DelphesHepMC2Reader
    2323 *
    2424 *  Reads HepMC file
     
    3939class DelphesFactory;
    4040
    41 class DelphesHepMCReader
     41class DelphesHepMC2Reader
    4242{
    4343public:
    44   DelphesHepMCReader();
    45   ~DelphesHepMCReader();
     44  DelphesHepMC2Reader();
     45  ~DelphesHepMC2Reader();
    4646
    4747  void SetInputFile(FILE *inputFile);
     
    102102};
    103103
    104 #endif // DelphesHepMCReader_h
     104#endif // DelphesHepMC2Reader_h
  • classes/DelphesModule.cc

    ra5af1df rd612dec  
    130130//------------------------------------------------------------------------------
    131131
     132void DelphesModule::AddInfo(const char *name, Double_t value)
     133{
     134  stringstream message;
     135  if(!fTreeWriter)
     136  {
     137    fTreeWriter = static_cast<ExRootTreeWriter *>(GetObject("TreeWriter", ExRootTreeWriter::Class()));
     138    if(!fTreeWriter)
     139    {
     140      message << "can't access access tree writer";
     141      throw runtime_error(message.str());
     142    }
     143  }
     144  fTreeWriter->AddInfo(name, value);
     145}
     146
     147//------------------------------------------------------------------------------
     148
    132149ExRootResult *DelphesModule::GetPlots()
    133150{
  • classes/DelphesModule.h

    ra5af1df rd612dec  
    5555
    5656  ExRootTreeBranch *NewBranch(const char *name, TClass *cl);
     57  void AddInfo(const char *name, Double_t value);
    5758
    5859  ExRootResult *GetPlots();
  • classes/DelphesStream.cc

    ra5af1df rd612dec  
    106106
    107107//------------------------------------------------------------------------------
     108
     109bool DelphesStream::FindChr(int value)
     110{
     111  char *position;
     112  bool result = false;
     113
     114  position = strchr(fBuffer, value);
     115
     116  if(position)
     117  {
     118    result = true;
     119    fBuffer = position + 1;
     120  }
     121
     122  return result;
     123}
     124
     125//------------------------------------------------------------------------------
     126
     127bool DelphesStream::FindStr(const char *value)
     128{
     129  char *position;
     130  bool result = false;
     131
     132  position = strstr(fBuffer, value);
     133
     134  if(position)
     135  {
     136    result = true;
     137    fBuffer = position + strlen(value);
     138  }
     139
     140  return result;
     141}
     142
     143//------------------------------------------------------------------------------
  • classes/DelphesStream.h

    ra5af1df rd612dec  
    3535  bool ReadDbl(double &value);
    3636  bool ReadInt(int &value);
     37  bool FindChr(int value);
     38  bool FindStr(const char *value);
    3739
    3840private:
  • classes/DelphesTF2.cc

    ra5af1df rd612dec  
    3232{
    3333
    34 #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 3, 0)
     34#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 22, 7)
     35  fFormula = std::unique_ptr<TFormula>(new TFormula());
     36#elif ROOT_VERSION_CODE >= ROOT_VERSION(6, 3, 0)
    3537  fFormula = new TFormula();
    3638#endif
Note: See TracChangeset for help on using the changeset viewer.