Changes between Version 6 and Version 7 of WorkBook/ModuleSystem
- Timestamp:
- Nov 13, 2012, 5:39:21 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WorkBook/ModuleSystem
v6 v7 17 17 #define ExampleModule_h 18 18 19 #include " ExRootAnalysis/ExRootModule.h"19 #include "classes/DelphesModule.h" 20 20 21 21 #include <deque> 22 22 23 23 class TObjArray; 24 class TFormula;24 class DelphesFormula; 25 25 26 class ExampleModule: public ExRootModule26 class ExampleModule: public DelphesModule 27 27 { 28 28 public: … … 42 42 std::deque <Double_t> fArrayParam; 43 43 44 TFormula *fFormula; //!44 DelphesFormula *fFormula; //! 45 45 46 46 TIterator *fItInputArray; //! … … 62 62 #include "modules/ExampleModule.h" 63 63 64 #include "classes/DelphesClasses.h" 65 #include "classes/DelphesFactory.h" 66 #include "classes/DelphesFormula.h" 67 64 68 #include "ExRootAnalysis/ExRootResult.h" 65 #include "ExRootAnalysis/ExRootClasses.h"66 67 69 #include "ExRootAnalysis/ExRootFilter.h" 68 70 #include "ExRootAnalysis/ExRootClassifier.h" 69 71 70 #include "ExRootAnalysis/ExRootFactory.h"71 #include "ExRootAnalysis/ExRootCandidate.h"72 73 72 #include "TMath.h" 74 #include "TRandom.h"75 73 #include "TString.h" 76 74 #include "TFormula.h" 75 #include "TRandom3.h" 76 #include "TObjArray.h" 77 #include "TDatabasePDG.h" 77 78 #include "TLorentzVector.h" 78 #include "TDatabasePDG.h"79 #include "TClonesArray.h"80 79 80 #include <algorithm> 81 #include <stdexcept> 81 82 #include <iostream> 82 #include <stdexcept>83 83 #include <sstream> 84 #include <deque>85 84 86 85 using namespace std; … … 91 90 fFormula(0), fItInputArray(0) 92 91 { 93 fFormula = new TFormula;92 fFormula = new DelphesFormula; 94 93 } 95 94 … … 143 142 void ExampleModule::Process() 144 143 { 145 ExRootCandidate *candidate;144 Candidate *candidate; 146 145 TLorentzVector candidatePosition, candidateMomentum; 147 146 148 147 // loop over all input candidates 149 148 fItInputArray->Reset(); 150 while((candidate = static_cast< ExRootCandidate*>(fItInputArray->Next())))149 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 151 150 { 152 candidatePosition = candidate-> GetPosition();153 candidateMomentum = candidate-> GetMomentum();151 candidatePosition = candidate->Position; 152 candidateMomentum = candidate->Momentum; 154 153 155 154 // apply an efficency formula 156 if(gRandom->Uniform() < fFormula->Eval(candidatePosition.Eta(), candidateMomentum.Pt()))155 if(gRandom->Uniform() <= fFormula->Eval(candidateMomentum.Pt(), candidatePosition.Eta())) 157 156 { 158 157 fOutputArray->Add(candidate);