[64a5c3f] | 1 | /** \class BeamSpotFilter
|
---|
| 2 | *
|
---|
| 3 | * Extracts beam spot
|
---|
| 4 | *
|
---|
| 5 | * \author Michele Selvaggi
|
---|
| 6 | *
|
---|
| 7 | */
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | #include "modules/BeamSpotFilter.h"
|
---|
| 11 |
|
---|
| 12 | #include "classes/DelphesClasses.h"
|
---|
| 13 | #include "classes/DelphesFactory.h"
|
---|
| 14 | #include "classes/DelphesFormula.h"
|
---|
| 15 |
|
---|
| 16 | #include "ExRootAnalysis/ExRootResult.h"
|
---|
| 17 | #include "ExRootAnalysis/ExRootFilter.h"
|
---|
| 18 | #include "ExRootAnalysis/ExRootClassifier.h"
|
---|
| 19 |
|
---|
| 20 | #include "TMath.h"
|
---|
| 21 | #include "TString.h"
|
---|
| 22 | #include "TFormula.h"
|
---|
| 23 | #include "TRandom3.h"
|
---|
| 24 | #include "TObjArray.h"
|
---|
| 25 | #include "TDatabasePDG.h"
|
---|
| 26 | #include "TLorentzVector.h"
|
---|
| 27 |
|
---|
| 28 | #include <algorithm>
|
---|
| 29 | #include <stdexcept>
|
---|
| 30 | #include <iostream>
|
---|
| 31 | #include <sstream>
|
---|
| 32 |
|
---|
| 33 | using namespace std;
|
---|
| 34 |
|
---|
| 35 | //------------------------------------------------------------------------------
|
---|
| 36 |
|
---|
| 37 | BeamSpotFilter::BeamSpotFilter() :
|
---|
| 38 | fItInputArray(0)
|
---|
| 39 | {
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | //------------------------------------------------------------------------------
|
---|
| 43 |
|
---|
| 44 | BeamSpotFilter::~BeamSpotFilter()
|
---|
| 45 | {
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | //------------------------------------------------------------------------------
|
---|
| 49 |
|
---|
| 50 | void BeamSpotFilter::Init()
|
---|
| 51 | {
|
---|
| 52 |
|
---|
| 53 | // import input array
|
---|
| 54 | fInputArray = ImportArray(GetString("InputArray", "Delphes/allParticles"));
|
---|
| 55 | fItInputArray = fInputArray->MakeIterator();
|
---|
| 56 |
|
---|
| 57 | // create output array
|
---|
| 58 |
|
---|
| 59 | fOutputArray = ExportArray(GetString("OutputArray", "filteredParticles"));
|
---|
| 60 | }
|
---|
| 61 |
|
---|
| 62 | //------------------------------------------------------------------------------
|
---|
| 63 |
|
---|
| 64 | void BeamSpotFilter::Finish()
|
---|
| 65 | {
|
---|
| 66 | if(fItInputArray) delete fItInputArray;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | //------------------------------------------------------------------------------
|
---|
| 70 |
|
---|
| 71 | void BeamSpotFilter::Process()
|
---|
| 72 | {
|
---|
| 73 | Candidate *candidate;
|
---|
| 74 | Bool_t passed = false;
|
---|
| 75 |
|
---|
| 76 | fItInputArray->Reset();
|
---|
| 77 | while((candidate = static_cast<Candidate*>(fItInputArray->Next())) && !passed)
|
---|
| 78 | {
|
---|
| 79 | if(candidate->IsPU == 0) passed = true;
|
---|
| 80 | fOutputArray->Add(candidate);
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 |
|
---|