Changes between Version 16 and Version 17 of WorkBook/LibraryInterface
- Timestamp:
- Jun 22, 2012, 12:15:38 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WorkBook/LibraryInterface
v16 v17 56 56 ExRootAnalysis *modularDelphes; 57 57 ExRootFactory *factory; 58 TObjArray *outputArray; 58 TObjArray *particleOutputArray; 59 TObjArray *partonOutputArray; 59 60 60 61 gROOT->SetBatch(); … … 76 77 77 78 factory = modularDelphes->GetFactory(); 78 outputArray = modularDelphes->ExportArray("candidates"); 79 particleOutputArray = modularDelphes->ExportArray("particles"); 80 partonOutputArray = modularDelphes->ExportArray("partons"); 79 81 80 82 modularDelphes->InitTask(); … … 84 86 { 85 87 modularDelphes->Clear(); 86 Convert Event(factory, outputArray);88 ConvertInput(factory, particleOutputArray, partonOutputArray); 87 89 modularDelphes->ProcessTask(); 88 ReadResults(modularDelphes);90 ConvertOutput(modularDelphes); 89 91 } 90 92 … … 102 104 } 103 105 104 105 void ConvertEvent(ExRootFactory *factory, TObjArray *outputArray) 106 void ConvertInput(ExRootFactory *factory, TObjArray *particleOutputArray, TObjArray *partonOutputArray) 106 107 { 107 108 ExRootCandidate *candidate; … … 110 111 Double_t px, py, pz, e, m; 111 112 Double_t x, y, z, t; 112 113 113 114 while(ReadParticle()) 114 115 { 115 if(status == 1 )116 if(status == 1 || status == 2) 116 117 { 117 118 candidate = factory->NewCandidate(); 118 119 119 120 candidate->SetType(pid); 120 121 121 122 candidateMomentum.SetPxPyPzE(px, py, pz, e); 122 123 candidate->SetMomentum(candidateMomentum); 123 124 124 125 candidatePosition.SetXYZT(x, y, z, t); 125 126 candidate->SetPosition(candidatePosition); 126 127 outputArray->Add(candidate); 127 128 if(status == 1) 129 { 130 particleOutputArray->Add(candidate); 131 } 132 else if(status == 2) 133 { 134 partonOutputArray->Add(candidate); 135 } 128 136 } 129 137 } 130 138 } 131 139 132 void ReadResults(ExRootAnalysis *modularDelphes)140 void ConvertOutput(ExRootAnalysis *modularDelphes) 133 141 { 134 142 TObjArray *arrayJets = modularDelphes->ImportArray("FastJetFinder/jets");