Fork me on GitHub

Changes between Version 23 and Version 24 of WorkBook/LibraryInterface


Ignore:
Timestamp:
Jun 22, 2012, 12:44:54 AM (12 years ago)
Author:
Pavel Demin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WorkBook/LibraryInterface

    v23 v24  
    3434== Simplified example ==
    3535
    36 {{{ReadEvent()}}} and {{{ReadParticle()}}} should be implemented by the library's user.
     36{{{ReadEvent}}}, {{{ReadParticle}}}, {{{ConvertInput}}} and {{{ConvertOutput}}} functions should be implemented by the library's user.
    3737
    3838{{{
     
    5555
    5656void ConvertOutput(ExRootAnalysis *modularDelphes);
     57
     58bool ReadEvent() { return true; }
     59
     60bool ReadParticle() { return true; }
    5761
    5862int main()
     
    8084    modularDelphes = new ExRootAnalysis("Delphes");
    8185    modularDelphes->SetConfReader(confReader);
    82     modularDelphes->SetTreeWriter(treeWriter);
    8386   
    8487    factory = modularDelphes->GetFactory();
     
    115118  TLorentzVector candidateMomentum, candidatePosition;
    116119  Int_t pid, status;
    117   Double_t px, py, pz, e, m; 
     120  Double_t px, py, pz, e, m;
    118121  Double_t x, y, z, t; 
    119122
     
    146149void ConvertOutput(ExRootAnalysis *modularDelphes)
    147150{
    148   TObjArray *arrayJets = modularDelphes->ImportArray("FastJetFinder/jets");
     151  const TObjArray *arrayJets = modularDelphes->ImportArray("FastJetFinder/jets");
    149152  TIter iteratorJets(arrayJets);
    150153  ExRootCandidate *candidate;
    151154
    152   iteratorJets->Reset();
    153   while((candidate = static_cast<ExRootCandidate*>(iteratorJets->Next())))
     155  iteratorJets.Reset();
     156  while((candidate = static_cast<ExRootCandidate*>(iteratorJets.Next())))
    154157  {
    155158    const TLorentzVector &momentum = candidate->GetMomentum();