Fork me on GitHub

source: git/modules/BeamSpotFilter.cc@ f84b626

Last change on this file since f84b626 was 341014c, checked in by Pavel Demin <pavel-demin@…>, 6 years ago

apply .clang-format to all .h, .cc and .cpp files

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