"MarlinReco"  1.32.0
CheckPlots.h
1 #ifndef CheckPlots_h
2 #define CheckPlots_h 1
3 
4 
5 #include <iostream>
6 #include <string>
7 #include <vector>
8 
9 #include "marlin/Processor.h"
10 #include <marlin/Exceptions.h>
11 #include <marlin/Global.h>
12 
13 #include "lcio.h"
14 
15 #include <EVENT/LCCollection.h>
16 #include <EVENT/MCParticle.h>
17 #include <EVENT/SimTrackerHit.h>
18 #include <EVENT/SimCalorimeterHit.h>
19 #include <EVENT/TrackerHit.h>
20 #include <EVENT/CalorimeterHit.h>
21 #include <EVENT/Track.h>
22 #include <EVENT/ReconstructedParticle.h>
23 #include <UTIL/LCRelationNavigator.h>
24 
25 #include <gear/GEAR.h>
26 #include <gear/BField.h>
27 
28 #include <MarlinUtil.h>
29 
30 #ifdef MARLIN_USE_AIDA
31 #include <marlin/AIDAProcessor.h>
32 #include <AIDA/IHistogramFactory.h>
33 #include <AIDA/ICloud1D.h>
34 #include <AIDA/ICloud2D.h>
35 #endif
36 
37 
38 using namespace lcio ;
39 using namespace marlin ;
40 
41 
70 class CheckPlots : public Processor {
71 
72  public:
73 
74  virtual Processor* newProcessor() { return new CheckPlots ; }
75 
76  CheckPlots() ;
77 
78  virtual void init() ;
79  virtual void processRunHeader( LCRunHeader* run ) ;
80  virtual void processEvent( LCEvent * evt ) ;
81  virtual void check( LCEvent * evt ) ;
82  virtual void end() ;
83 
84 
85  private:
86 
87  int _nRun;
88  int _nEvt;
89 
90  float _bField;
91 
92  int _fillMCGen;
93  float _thetaCut;
94  int _fillMCSim;
95 
96  int _fillSimCaloHit;
97  float _simECut;
98 
99  int _fillCaloHit;
100  float _ECut;
101 
102  int _fillTracks;
103  std::string _colNameTracks;
104  std::string _colNameRelationTrackToMCP;
105 
106  int _fillReconstructedParticles;
107  std::string _colNameReconstructedParticles;
108 
109  int _fillComparisonMCReco;
110  int _nMC;
111  int _nMCCh;
112  int _nMCN;
113  int _nReco;
114  int _nRecoCh;
115  int _nRecoN;
116 
117  double _energyMC;
118  double _energyMCCh;
119  double _energyMCN;
120  double _energyReco;
121  double _energyRecoCh;
122  double _energyRecoN;
123 
124 
125 
126  #ifdef MARLIN_USE_AIDA
127 
128  // MCPs with generator status != 1
129  // numbers per event
130  AIDA::ICloud1D* _cMCNumberSim;
131  AIDA::ICloud1D* _cMCEnergySumSim;
132 
133  AIDA::ICloud1D* _cMCNumberElectronsSim;
134  AIDA::ICloud1D* _cMCNumberMuonsSim;
135  AIDA::ICloud1D* _cMCNumberTausSim;
136  AIDA::ICloud1D* _cMCNumberNusSim;
137 
138  AIDA::ICloud1D* _cMCNumberPiChSim;
139  AIDA::ICloud1D* _cMCNumberKChSim;
140  AIDA::ICloud1D* _cMCNumberProtonsSim;
141  AIDA::ICloud1D* _cMCNumberPi0Sim;
142  AIDA::ICloud1D* _cMCNumberK0lSim;
143  AIDA::ICloud1D* _cMCNumberK0sSim;
144  AIDA::ICloud1D* _cMCNumberNeutronsSim;
145  AIDA::ICloud1D* _cMCNumberGammasSim;
146  AIDA::ICloud1D* _cMCNumberLambda0sSim;
147  AIDA::ICloud1D* _cMCNumberSigma0sSim;
148  AIDA::ICloud1D* _cMCNumberXi0sSim;
149 
150  AIDA::ICloud1D* _cMCNumberRemainingSim;
151 
152 
153 
154 
155  // MCPs with generator status == 1
156  // numbers per event
157  AIDA::ICloud1D* _cMCNumberGen;
158  AIDA::ICloud1D* _cMCEnergySumGen;
159 
160  AIDA::ICloud1D* _cMCNumberHChGen;
161  AIDA::ICloud1D* _cMCNumberH0Gen;
162  AIDA::ICloud1D* _cMCNumberGGen; // all gammas, i.e. gammas and pi0s
163  AIDA::ICloud1D* _cMCFractionHChGen;
164  AIDA::ICloud1D* _cMCFractionH0Gen;
165  AIDA::ICloud1D* _cMCFractionGGen;
166 
167  AIDA::ICloud1D* _cMCNumberElectronsGen;
168  AIDA::ICloud1D* _cMCNumberMuonsGen;
169  AIDA::ICloud1D* _cMCNumberTausGen;
170  AIDA::ICloud1D* _cMCNumberNusGen;
171 
172  AIDA::ICloud1D* _cMCNumberPiChGen;
173  AIDA::ICloud1D* _cMCNumberKChGen;
174  AIDA::ICloud1D* _cMCNumberProtonsGen;
175  AIDA::ICloud1D* _cMCNumberPi0Gen;
176  AIDA::ICloud1D* _cMCNumberK0lGen;
177  AIDA::ICloud1D* _cMCNumberK0sGen;
178  AIDA::ICloud1D* _cMCNumberNeutronsGen;
179  AIDA::ICloud1D* _cMCNumberGammasGen;
180  AIDA::ICloud1D* _cMCNumberLambda0sGen;
181  AIDA::ICloud1D* _cMCNumberSigma0sGen;
182  AIDA::ICloud1D* _cMCNumberXi0sGen;
183 
184  AIDA::ICloud1D* _cMCNumberLostInBeamPipe;
185  AIDA::ICloud1D* _cMCNumberRemainingGen;
186 
187 
188 
189  // MCPs with generator status != 1
190  // numbers per single particle
191  AIDA::ICloud1D* _cMCEnergySim;
192 
193  AIDA::ICloud1D* _cMCEnergyElectronsSim;
194  AIDA::ICloud1D* _cMCEnergyMuonsSim;
195  AIDA::ICloud1D* _cMCEnergyTausSim;
196  AIDA::ICloud1D* _cMCEnergyNusSim;
197 
198  AIDA::ICloud1D* _cMCEnergyPiChSim;
199  AIDA::ICloud1D* _cMCEnergyKChSim;
200  AIDA::ICloud1D* _cMCEnergyProtonsSim;
201  AIDA::ICloud1D* _cMCEnergyPi0Sim;
202  AIDA::ICloud1D* _cMCEnergyK0lSim;
203  AIDA::ICloud1D* _cMCEnergyK0sSim;
204  AIDA::ICloud1D* _cMCEnergyNeutronsSim;
205  AIDA::ICloud1D* _cMCEnergyGammasSim;
206  AIDA::ICloud1D* _cMCEnergyLambda0sSim;
207  AIDA::ICloud1D* _cMCEnergySigma0sSim;
208  AIDA::ICloud1D* _cMCEnergyXi0sSim;
209 
210  AIDA::ICloud1D* _cMCEnergyRemainingSim;
211 
212 
213 
214  // MCPs with generator status == 1
215  // numbers per single particle
216  AIDA::ICloud1D* _cMCEnergyGen;
217 
218  AIDA::ICloud1D* _cMCEnergyHChGen;
219  AIDA::ICloud1D* _cMCEnergyH0Gen;
220  AIDA::ICloud1D* _cMCEnergyGGen; // all gammas, i.e. gammas and pi0s
221  AIDA::ICloud1D* _cMCEnergyFractionHChGen;
222  AIDA::ICloud1D* _cMCEnergyFractionH0Gen;
223  AIDA::ICloud1D* _cMCEnergyFractionGGen;
224 
225  AIDA::ICloud1D* _cMCEnergyElectronsGen;
226  AIDA::ICloud1D* _cMCEnergyMuonsGen;
227  AIDA::ICloud1D* _cMCEnergyTausGen;
228  AIDA::ICloud1D* _cMCEnergyNusGen;
229 
230  AIDA::ICloud1D* _cMCEnergyPiChGen;
231  AIDA::ICloud1D* _cMCEnergyKChGen;
232  AIDA::ICloud1D* _cMCEnergyProtonsGen;
233  AIDA::ICloud1D* _cMCEnergyPi0Gen;
234  AIDA::ICloud1D* _cMCEnergyK0lGen;
235  AIDA::ICloud1D* _cMCEnergyK0sGen;
236  AIDA::ICloud1D* _cMCEnergyNeutronsGen;
237  AIDA::ICloud1D* _cMCEnergyGammasGen;
238  AIDA::ICloud1D* _cMCEnergyLambda0sGen;
239  AIDA::ICloud1D* _cMCEnergySigma0sGen;
240  AIDA::ICloud1D* _cMCEnergyXi0sGen;
241 
242  AIDA::ICloud1D* _cMCEnergyLostInBeamPipe;
243  AIDA::ICloud1D* _cMCEnergyRemainingGen;
244 
245 
246 
247  // SimCalorimeterHit spectra
248  AIDA::ICloud1D* _cNumberSimCaloHits;
249  AIDA::ICloud1D* _cEnergySimCaloHitsSum;
250  AIDA::ICloud1D* _cEnergySimCaloHits;
251 
252  // CalorimeterHit spectra
253  AIDA::ICloud1D* _cNumberCaloHits;
254  AIDA::ICloud1D* _cEnergyCaloHitsSum;
255  AIDA::ICloud1D* _cEnergyCaloHits;
256 
257 
258  // clouds corresponding to the tracks
259  AIDA::ICloud1D* _cNumberTracks;
260  AIDA::ICloud1D* _cNumberTrackerHitsPerTrack;
261  AIDA::ICloud1D* _cMomentumTracks;
262  AIDA::ICloud1D* _cNumberMCParticlesPerTrack;
263 
264 
265  // clouds corresponding to the reconstructed particles
266  AIDA::ICloud1D* _cNumberReconstructedParticles;
267  AIDA::ICloud1D* _cEnergyReconstructedParticles;
268  AIDA::ICloud1D* _cEnergySumReconstructedParticles;
269 
270 
271  // clouds for comparison of MC tree and reconstructed particles
272  AIDA::ICloud2D* _cNumberMCvsNumberReco;
273  AIDA::ICloud2D* _cNumberMCChvsNumberRecoCh;
274  AIDA::ICloud2D* _cNumberMCNvsNumberRecoN;
275  /*
276  AIDA::ICloud2D* _cNumberMCH0vsNumberRecoH0;
277  AIDA::ICloud2D* _cNumberMCGammavsNumberRecoGamma;
278  */
279 
280  AIDA::ICloud2D* _cEnergyMCvsEnergyReco;
281  AIDA::ICloud2D* _cEnergyMCChvsEnergyRecoCh;
282  AIDA::ICloud2D* _cEnergyMCNvsEnergyRecoN;
283 
284  #endif
285 
286 
287 
288  void createClouds();
289 
290  void fillMCGenCheckPlots(LCEvent * evt);
291  void fillMCSimCheckPlots(LCEvent * evt);
292 
293  // void fillSimTrackerHitCheckPlots(LCEvent * evt);
294  void fillSimCaloHitCheckPlots(LCEvent * evt);
295 
296  // void fillTrackerHitCheckPlots(LCEvent * evt);
297  void fillCaloHitCheckPlots(LCEvent * evt);
298 
299  void fillTrackCheckPlots(LCEvent * evt);
300 
301  void fillReconstructedParticlesCheckPlots(LCEvent * evt);
302 
303  void fillComparisonMCRecoPlots();
304 
305 } ;
306 
307 #endif
308 
309 
310 
This processor provides check plots.
Definition: CheckPlots.h:70