All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
CLICPfoSelectorAnalysis.h
Go to the documentation of this file.
1 #ifndef CLICPfoSelectorAnalysis_h
2 #define CLICPfoSelectorAnalysis_h 1
3 
4 #include <EVENT/LCRelation.h>
5 #include <EVENT/MCParticle.h>
6 #include <EVENT/ReconstructedParticle.h>
7 #include <UTIL/LCRelationNavigator.h>
8 #include <string>
9 #include "PfoUtilities.h"
10 #include "lcio.h"
11 #include "marlin/Processor.h"
12 
13 #include "TGraph.h"
14 #include "TH1F.h"
15 #include "TTree.h"
16 
17 using namespace lcio;
18 using namespace marlin;
19 
20 using namespace std;
21 
22 /** CLICPfoSelectorAnalysis processor
23  *
24  * Run on the PFO input collection and create:
25  * - a TTree with the PFO variables used in the CLICPfoSelector
26  * - cluster time vs pT graphs for each particle category and region
27  * - PFO energy sum histos for each particle category and region
28  * Possibility to detect if the PFO belongs to signal/overlay
29  * Possibility to check if the track and the cluster belonging to
30  * the same PFO were produced by at least one common MCParticle
31  *
32  * <h4>Input - Prerequisites</h4>
33  * Needs the collection of ReconstructedParticles.
34  * Needs the collection of MCParticles.
35  * Needs the collection of LCRelations - to do the match track/cluster.
36  *
37  * <h4>Output</h4>
38  * A TTree.
39  * Time vs pT graphs.
40  * Energy histos.
41  *
42  */
43 
44 class CLICPfoSelectorAnalysis : public Processor {
45 public:
46 
48  CLICPfoSelectorAnalysis& operator=(const CLICPfoSelectorAnalysis&) = delete;
49 
50  virtual Processor* newProcessor() { return new CLICPfoSelectorAnalysis; }
51 
53 
54  //initializing the variables in the TTree
55  virtual void init();
56 
57  virtual void processRunHeader(LCRunHeader* run);
58 
59  virtual void processEvent(LCEvent* evt);
60 
61  virtual void end();
62 
63  //filling the TTree
64  void fillTree(LCEvent* evt, string collName);
65 
66  //filling the graphs and histos
67  void fillPlots();
68 
69 protected:
70  // Input collection name
71  string colNamePFOs{};
72  string treeName{};
73  float cutCosTheta = 0.975;
74  int minECalHits = 5;
75  int minHcalEndcapHits = 5;
76  float forwardCosThetaForHighEnergyNeutralHadrons = 0.95, forwardHighEnergyNeutralHadronsEnergy = 10.0;
77  bool analyzePhotons = true, analyzeChargedPfos = true, analyzeNeutralHadrons = true;
78  bool analyzeAll = true, analyzeSignal = true, analyzeOverlay = true;
79 
80  int _nRun{};
81  int _nEvt{};
82 
83  //Variables in the TTree
84  TTree* pfo_tree = NULL;
85  int eventNumber = 0, runNumber = 0;
86  int type = 0;
87  double p = 0.0, px = 0.0, py = 0.0, pz = 0.0, pT = 0.0;
88  double costheta = 0.0, energy = 0.0, mass = 0.0, charge = 0.0;
89  int nTracks = 0, nClusters = 0;
90  double clusterTime = 0.0, clusterTimeEcal = 0.0, clusterTimeHcalEndcap = 0.0;
91  int nCaloHits = 0, nEcalHits = 0, nHcalEndCapHits = 0;
92  int trk_clu_sameMCPart = 0, atLeastOneSignal = 0;
93 
94  //List of plots
95  vector<string> particleCategories{};
96  vector<string> generationCategories{};
97  map<string, TGraph*> g_timeVsPt{};
98  map<string, TGraph*> g_timeVsPt_central{};
99  map<string, TGraph*> g_timeVsPt_forward{};
100  TH1F* h_energy_tot{};
101  TH1F* h_energy_tot_signal{};
102  TH1F* h_energy_tot_background{};
103  map<string, TH1F*> h_energy{};
104  map<string, TH1F*> h_energy_central{};
105  map<string, TH1F*> h_energy_forward{};
106  map<string, double> energy_tot{};
107  map<string, double> energy_tot_central{};
108  map<string, double> energy_tot_forward{};
109  float en_min = 0.0, en_max = 500;
110 
111  //MC particles collections
112  string m_inputPhysicsParticleCollection{};
113  string m_recoMCTruthLink{};
114  string m_SiTracksMCTruthLink{};
115  string m_ClusterMCTruthLink{};
116  vector<MCParticle*> physicsParticles{};
117 };
118 
119 #endif
virtual Processor * newProcessor()
CLICPfoSelectorAnalysis processor.