Changes between Version 1 and Version 2 of WorkBook/LibraryInterface
- Timestamp:
- Jun 20, 2012, 12:43:31 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WorkBook/LibraryInterface
v1 v2 1 1 {{{ 2 #include "TROOT.h" 3 #include "TApplication.h" 4 5 #include "TObjArray.h" 6 #include "TLorentzVector.h" 7 8 #include "ExRootAnalysis/ExRootFactory.h" 9 #include "ExRootAnalysis/ExRootAnalysis.h" 10 #include "ExRootAnalysis/ExRootCandidate.h" 11 12 void ConvertEvent(ExRootFactory *factory, TObjArray *outputArray); 13 14 int main() 15 { 2 16 // Declaration of variables 3 17 ExRootConfReader *confReader; … … 5 19 ExRootFactory *factory; 6 20 TObjArray *outputArray; 21 22 gROOT->SetBatch(); 23 24 int appargc = 1; 25 char *appargv[] = {appName}; 26 TApplication app(appName, &appargc, appargv); 7 27 8 28 try … … 40 60 return 1; 41 61 } 62 } 63 64 65 void ConvertEvent(ExRootFactory *factory, TObjArray *outputArray) 66 { 67 ExRootCandidate *candidate; 68 TLorentzVector candidateMomentum, candidatePosition; 69 Int_t pid, status; 70 Double_t px, py, pz, e, m; 71 Double_t x, y, z, t; 72 73 while(ReadParticle()) 74 { 75 if(status == 1) 76 { 77 candidate = factory->NewCandidate(); 78 79 candidate->SetType(pid); 80 81 candidateMomentum.SetPxPyPzE(px, py, pz, e); 82 candidate->SetMomentum(candidateMomentum); 83 84 candidatePosition.SetXYZT(x, y, z, t); 85 candidate->SetPosition(candidatePosition); 86 87 outputArray->Add(candidate); 88 } 89 } 90 } 42 91 }}}