All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
CheckPlots.cc
Go to the documentation of this file.
1 #include "CheckPlots.h"
2 
3 
4 using namespace lcio ;
5 using namespace marlin ;
6 
7 
8 
9 
11 
12 
13 
14 CheckPlots::CheckPlots() : Processor("CheckPlots") {
15 
16  _nMC = 0;
17  _nMCCh = 0;
18  _nMCN = 0;
19  _nReco = 0;
20  _nRecoCh = 0;
21  _nRecoN = 0;
22 
23  _energyMC = 0.0;
24  _energyMCCh = 0.0;
25  _energyMCN = 0.0;
26  _energyReco = 0.0;
27  _energyRecoCh = 0.0;
28  _energyRecoN = 0.0;
29 
30 
31  _description = "produces Check Plots" ;
32 
33 
34 
35  registerProcessorParameter("FillMCGen","fill clouds for MC particles generated at IP",
36  _fillMCGen,
37  (int)1);
38 
39  registerProcessorParameter("FillMCSim","fill clouds for MC particles created during simulation",
40  _fillMCSim,
41  (int)0);
42 
43 
44  registerProcessorParameter("FillSimCaloHit","fill clouds for SimCalorimeter hits",
46  (int)1);
47  registerProcessorParameter("SimECut","energy cut for filling clouds for SimCalorimeter hits",
48  _simECut,
49  (float)0.0001);
50 
51 
52  registerProcessorParameter("FillCaloHit","fill clouds for Calorimeter hits",
54  (int)1);
55 
56  registerProcessorParameter("ECut","energy cut for filling clouds for Calorimeter hits",
57  _ECut,
58  (float)0.0001);
59 
60  registerProcessorParameter("ThetaCut","Polar angle cut, given in rad. Particles with a smaller polar angle will be treated as 'lost in the beam pipe'",
61  _thetaCut,
62  (float)0.1);
63 
64 
65  registerProcessorParameter("FillTracks","fill clouds for tracks",
67  (int)1);
68 
69  registerProcessorParameter("ColNameTracks" ,
70  "name of the Track collection" ,
72  std::string("Tracks") );
73 
74  registerProcessorParameter( "ColNameRelationTrackToMCP" ,
75  "name of the LC Relation collection between Tracks and MC particles" ,
77  std::string("TrueTrackToMCP") );
78 
79 
80  registerProcessorParameter("FillReconstructedParticles","fill clouds for ReconstructedParticles",
82  (int)1);
83 
84  registerProcessorParameter("ColNameReconstructedParticles" ,
85  "name of the ReconstructedParticles collection" ,
87  std::string("ReconstructedParticles") );
88 
89 
90  registerProcessorParameter("Fill","fill clouds for comparison of MC tree and reconstructed particles",
92  (int)1);
93 
94 }
95 
96 
97 
98 
100 
101  // printParameters();
102 
103  _bField = Global::GEAR->getBField().at( gear::Vector3D( 0., 0., 0.) ).z();
104 
105  createClouds();
106 
107  _nRun = -1;
108  _nEvt = 0;
109 
110 
111 }
112 
113 
114 
115 void CheckPlots::processRunHeader( LCRunHeader* run) {
116 
117  _nRun++ ;
118  _nEvt = 0;
119 
120 }
121 
122 
123 
124 
125 void CheckPlots::processEvent( LCEvent * evt ) {
126 
127 
128  static bool firstEvent = true;
129 
130  if(firstEvent) std::cout << "Check Plot processor called for first event" << std::endl;
131 
132 
135 
136  // fillSimTrackerHitCheckPlots(evt);
138 
139  // fillTrackerHitCheckPlots(evt);
141 
143 
145 
147 
148 
149  _nEvt ++;
150  firstEvent = false;
151 
152 }
153 
154 
155 
156 
157 void CheckPlots::check( LCEvent * evt ) {
158 
159 }
160 
161 
162 
163 
165 
166 
167 }
168 
169 
170 
171 
173 
174  if (_fillMCSim) {
175 
176  // numbers per event
177  _cMCNumberSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberSim", "number of all MC particles per event (generator status != 1)", -1 );
178  _cMCEnergySumSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergySumSim", "MC particle energy sum per event (generator status != 1)", -1 );
179 
180  _cMCNumberElectronsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberElectronsSim", "number of the e+/- per event (generator status != 1)", -1 );
181  _cMCNumberMuonsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberMuonsSim", "number of the mu+/- per event (generator status != 1)", -1 );
182  _cMCNumberTausSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberTausSim", "number of the tau+/- per event (generator status != 1)", -1 );
183  _cMCNumberNusSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberNusSim", "number of neutrinos per event (generator status != 1)", -1 );
184 
185  _cMCNumberPiChSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberPiChSim", "number of Pi+/- per event (generator status != 1)", -1 );
186  _cMCNumberKChSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberKChSim", "number of K+/- per event (generator status != 1)", -1 );
187  _cMCNumberProtonsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberProtonsSim", "number of protons per event (generator status != 1)", -1 );
188  _cMCNumberPi0Sim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberPi0Sim", "number of Pi0 per event (generator status != 1)", -1 );
189  _cMCNumberK0lSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberK0lSim", "number of K0l per event (generator status != 1)", -1 );
190  _cMCNumberK0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberK0sSim", "number of K0s per event (generator status != 1)", -1 );
191  _cMCNumberNeutronsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberNeutronsSim", "number of neutrons per event (generator status != 1)", -1 );
192  _cMCNumberGammasSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberGammasSim", "number of gammas per event (generator status != 1)", -1 );
193  _cMCNumberLambda0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberLambda0sSim", "number of Lambda0s per event (generator status != 1)", -1 );
194  _cMCNumberSigma0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberSigma0sSim", "number of Sigma0s per event (generator status != 1)", -1 );
195  _cMCNumberXi0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberXi0sSim", "number of Xi0s per event (generator status != 1)", -1 );
196 
197  _cMCNumberRemainingSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberRemainingSim", "number of the remaining particles per event (generator status != 1)", -1 );
198 
199  }
200 
201 
202  if (_fillMCGen) {
203 
204  _cMCNumberGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberGen", "number of all MC particles per event (generator status == 1)", -1 );
205  _cMCEnergySumGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergySumGen", "MC particle energy sum per event (generator status == 1)", -1 );
206 
207  _cMCNumberHChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberHChGen", "number of charged particles/hadrons (generator status == 1)", -1 );
208  _cMCNumberH0Gen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberH0Gen", "number of neutral particles/hadrons (generator status == 1)", -1 );
209  _cMCNumberGGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberGGen", "number of gammas and pi0s (generator status == 1)", -1 );
210  _cMCFractionHChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCFractionHChGen", "fraction of charged particles/hadrons (generator status == 1)", -1 );
211  _cMCFractionH0Gen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCFractionH0Gen", "fraction of neutral particles/hadrons (generator status == 1)", -1 );
212  _cMCFractionGGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCFractionGGen", "fraction of gammas and pi0s (generator status == 1)", -1 );
213 
214  _cMCNumberElectronsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberElectronsGen", "number of the e+/- per event (generator status == 1)", -1 );
215  _cMCNumberMuonsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberMuonsGen", "number of the mu+/- per event (generator status == 1)", -1 );
216  _cMCNumberTausGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberTausGen", "number of the tau+/- per event (generator status == 1)", -1 );
217  _cMCNumberNusGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberNusGen", "number of neutrinos per event (generator status == 1)", -1 );
218 
219  _cMCNumberPiChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberPiChGen", "number of Pi+/- per event (generator status == 1)", -1 );
220  _cMCNumberKChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberKChGen", "number of K+/- per event (generator status == 1)", -1 );
221  _cMCNumberProtonsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberProtonsGen", "number of protons per event (generator status == 1)", -1 );
222  _cMCNumberPi0Gen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberPi0Gen", "number of Pi0 per event (generator status == 1)", -1 );
223  _cMCNumberK0lGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberK0lGen", "number of K0l per event (generator status == 1)", -1 );
224  _cMCNumberK0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberK0sGen", "number of K0s per event (generator status == 1)", -1 );
225  _cMCNumberNeutronsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberNeutronsGen", "number of neutrons per event (generator status == 1)", -1 );
226  _cMCNumberGammasGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberGammasGen", "number of gammas per event (generator status == 1)", -1 );
227  _cMCNumberLambda0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberLambda0sGen", "number of Lambda0s per event (generator status == 1)", -1 );
228  _cMCNumberSigma0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberSigma0sSim", "number of Sigma0s per event (generator status == 1)", -1 );
229  _cMCNumberXi0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberXi0sSim", "number of Xi0s per event (generator status == 1)", -1 );
230 
231 
232  _cMCNumberLostInBeamPipe = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberLostInBeamPipe", "number of particles lost in beam pipe (generator status == 1)", -1 );
233  _cMCNumberRemainingGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCNumberRemainingGen", "number of the remaining particles per event (generator status == 1)", -1 );
234 
235  }
236 
237 
238  if (_fillMCSim) {
239 
240  // numbers per single particle
241  _cMCEnergySim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergySim", "energy spectrum of all MC particles in one event (generator status != 1)", -1 );
242  _cMCEnergyElectronsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyElectronsSim", "energy spectrum of the e+/- in one event (generator status != 1)", -1 );
243  _cMCEnergyMuonsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyMuonsSim", "energy spectrum of the mu+/- in one event (generator status != 1)", -1 );
244  _cMCEnergyTausSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyTausSim", "energy spectrum of the tau+/- in one event (generator status != 1)", -1 );
245  _cMCEnergyNusSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyNusSim", "energy spectrum of the neutrinos in one event (generator status != 1)", -1 );
246 
247  _cMCEnergyPiChSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyPiChSim", "energy spectrum of Pi+/- in one event (generator status != 1)", -1 );
248  _cMCEnergyKChSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyKChSim", "energy spectrum of K+/- in one event (generator status != 1)", -1 );
249  _cMCEnergyProtonsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyProtonsSim", "energy spectrum of protons in one event (generator status != 1)", -1 );
250  _cMCEnergyPi0Sim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyPi0Sim", "energy spectrum of Pi0 in one event (generator status != 1)", -1 );
251  _cMCEnergyK0lSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyK0lSim", "energy spectrum of K0l in one event (generator status != 1)", -1 );
252  _cMCEnergyK0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyK0sSim", "energy spectrum of K0s in one event (generator status != 1)", -1 );
253  _cMCEnergyNeutronsSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyNeutronsSim", "energy spectrum of neutrons in one event (generator status != 1)", -1 );
254  _cMCEnergyGammasSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyGammasSim", "energy spectrum of gammas in one event (generator status != 1)", -1 );
255  _cMCEnergyLambda0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyLambda0sSim", "energy spectrum of Lambda0s in one event (generator status != 1)", -1 );
256  _cMCEnergySigma0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergySigma0sSim", "energy spectrum of Sigma0s in one event (generator status != 1)", -1 );
257  _cMCEnergyXi0sSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyXi0sSim", "energy spectrum of Xi0s in one event (generator status != 1)", -1 );
258 
259  _cMCEnergyRemainingSim = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyRemainingSim", "energy spectrum of the remaining particles in one event (generator status != 1)", -1 );
260 
261  }
262 
263 
264 
265  if (_fillMCGen) {
266 
267  _cMCEnergyGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyGen", "energy spectrum of all MC particles in one event (generator status == 1)", -1 );
268 
269  _cMCEnergyHChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyHChGen", "energy of charged particles/hadrons (generator status == 1)", -1 );
270  _cMCEnergyH0Gen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyH0Gen", "energy of neutral particles/hadrons (generator status == 1)", -1 );
271  _cMCEnergyGGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyGGen", "energy of gammas and pi0s (generator status == 1)", -1 );
272  _cMCEnergyFractionHChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyFractionHChGen", "energy fraction of charged particles/hadrons (generator status == 1)", -1 );
273  _cMCEnergyFractionH0Gen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyFractionH0Gen", "energy fraction of neutral particles/hadrons (generator status == 1)", -1 );
274  _cMCEnergyFractionGGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyFractionGGen", "energy fraction of gammas and pi0s (generator status == 1)", -1 );
275 
276 
277 
278  _cMCEnergyElectronsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyElectronsGen", "energy spectrum of the e+/- in one event (generator status == 1)", -1 );
279  _cMCEnergyMuonsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyMuonsGen", "energy spectrum of the mu+/- in one event (generator status == 1)", -1 );
280  _cMCEnergyTausGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyTausGen", "energy spectrum of the tau+/- in one event (generator status == 1)", -1 );
281  _cMCEnergyNusGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyNusGen", "energy spectrum of the neutrinos in one event (generator status == 1)", -1 );
282 
283  _cMCEnergyPiChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyPiChGen", "energy spectrum of Pi+/- in one event (generator status == 1)", -1 );
284  _cMCEnergyKChGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyKChGen", "energy spectrum of K+/- in one event (generator status == 1)", -1 );
285  _cMCEnergyProtonsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyProtonsGen", "energy spectrum of protons in one event (generator status == 1)", -1 );
286  _cMCEnergyPi0Gen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyPi0Gen", "energy spectrum of Pi0 in one event (generator status == 1)", -1 );
287  _cMCEnergyK0lGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyK0lGen", "energy spectrum of K0l in one event (generator status == 1)", -1 );
288  _cMCEnergyK0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyK0sGen", "energy spectrum of K0s in one event (generator status == 1)", -1 );
289  _cMCEnergyNeutronsGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyNeutronsGen", "energy spectrum of neutrons in one event (generator status == 1)", -1 );
290  _cMCEnergyGammasGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyGammasGen", "energy spectrum of gammas in one event (generator status == 1)", -1 );
291  _cMCEnergyLambda0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyLambda0sGen", "energy spectrum of Lambda0s in one event (generator status == 1)", -1 );
292  _cMCEnergySigma0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergySigma0sGen", "energy spectrum of Sigma0s in one event (generator status == 1)", -1 );
293  _cMCEnergyXi0sGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyLambda0sGen", "energy spectrum of Xi0s in one event (generator status == 1)", -1 );
294 
295 
296  _cMCEnergyLostInBeamPipe = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyLostInBeamPipe", "energy of particles lost in beam pipe (generator status == 1)", -1 );
297  _cMCEnergyRemainingGen = AIDAProcessor::histogramFactory(this)->createCloud1D( "MCEnergyRemainingGen", "energy spectrum of the remaining particles in one event (generator status == 1)", -1 );
298 
299  }
300 
301 
302 
303 
304 
305  if (_fillSimCaloHit) {
306 
307  _cNumberSimCaloHits = AIDAProcessor::histogramFactory(this)->createCloud1D( "NumberSimCaloHits", "number of SimCaloHits per event", -1 );
308  _cEnergySimCaloHitsSum = AIDAProcessor::histogramFactory(this)->createCloud1D( "EnergySimCaloHitsSum", "energy sum of the SimCaloHits per event", -1 );
309  _cEnergySimCaloHits = AIDAProcessor::histogramFactory(this)->createCloud1D( "EnergySimCaloHits", "energy spectrum of the SimCaloHits per event", -1 );
310 
311  }
312 
313 
314 
315 
316  if (_fillCaloHit) {
317 
318  _cNumberCaloHits = AIDAProcessor::histogramFactory(this)->createCloud1D( "NumberCaloHits", "number of CaloHits per event", -1 );
319  _cEnergyCaloHitsSum = AIDAProcessor::histogramFactory(this)->createCloud1D( "EnergyCaloHitsSum", "energy sum of the CaloHits per event", -1 );
320  _cEnergyCaloHits = AIDAProcessor::histogramFactory(this)->createCloud1D( "EnergyCaloHits", "energy spectrum of the CaloHits per event", -1 );
321 
322  }
323 
324 
325 
326 
327  if (_fillTracks) {
328 
329  _cNumberTracks = AIDAProcessor::histogramFactory(this)->createCloud1D( "NumberTracks", "number of tracks per event", -1 );
330  _cNumberTrackerHitsPerTrack = AIDAProcessor::histogramFactory(this)->createCloud1D( "NumberTrackerHitsPerTrack", "number of tracker hits per track", -1 );
331  _cMomentumTracks = AIDAProcessor::histogramFactory(this)->createCloud1D( "MomentumTracks", "|p| of tracks", -1 );
332  _cNumberMCParticlesPerTrack = AIDAProcessor::histogramFactory(this)->createCloud1D( "NumberMCParticlesPerTrack", "number of MC particles per track", -1 );
333 
334  }
335 
336 
337 
339 
340  _cNumberReconstructedParticles = AIDAProcessor::histogramFactory(this)->createCloud1D( "NumberReconstructedParticles", "number of reconstructed particles per event", -1 );
341  _cEnergyReconstructedParticles = AIDAProcessor::histogramFactory(this)->createCloud1D( "EnergyReconstructedParticles", "energy spectrum of reconstructed particles", -1 );
342  _cEnergySumReconstructedParticles = AIDAProcessor::histogramFactory(this)->createCloud1D( "EnergySumReconstructedParticles", "energy sum of all reconstructed particles in an event", -1 );
343 
344  }
345 
346 
347 
348  if (_fillComparisonMCReco) {
349 
350  _cNumberMCvsNumberReco = AIDAProcessor::histogramFactory(this)->createCloud2D( "NumberMCvsNumberReco", "number of MC particles vs. number of reconstructed particles" , -1);
351  _cNumberMCChvsNumberRecoCh = AIDAProcessor::histogramFactory(this)->createCloud2D( "NumberMCChvsNumberRecoCh", "number of charged MCparticles vs. number of charged reconstructed particles" , -1);
352  _cNumberMCNvsNumberRecoN = AIDAProcessor::histogramFactory(this)->createCloud2D( "NumberMCNvsNumberRecoN", "number of neutral MCparticles vs. number of neutral reconstructed particles" , -1);
353 
354  _cEnergyMCvsEnergyReco = AIDAProcessor::histogramFactory(this)->createCloud2D( "EnergyMCvsEnergyReco", "energy of MC particles vs. energy of reconstructed particles" , -1);
355  _cEnergyMCChvsEnergyRecoCh = AIDAProcessor::histogramFactory(this)->createCloud2D( "EnergyMCChvsEnergyRecoCh", "energy of charged MC particles vs. energy of charged reconstructed particles" , -1);
356  _cEnergyMCNvsEnergyRecoN = AIDAProcessor::histogramFactory(this)->createCloud2D( "EnergyMCNvsEnergyRecoN", "energy of neutral MC particles vs. energy of neutral reconstructed particles" , -1);
357 
358 
359  }
360 
361 
362 }
363 
364 
365 
366 
368 
369 
370  if (_fillMCGen) {
371 
372  unsigned int NMCGen = 0;
373 
374  unsigned int NMCHChGen = 0;
375  unsigned int NMCH0Gen = 0;
376  unsigned int NMCGGen = 0;
377 
378  unsigned int NMCElectronsGen = 0;
379  unsigned int NMCMuonsGen = 0;
380  unsigned int NMCTausGen = 0;
381  unsigned int NMCNusGen = 0;
382 
383  unsigned int NMCPiChGen = 0;
384  unsigned int NMCKChGen = 0;
385  unsigned int NMCProtonsGen = 0;
386  unsigned int NMCPi0Gen = 0;
387  unsigned int NMCK0lGen = 0;
388  unsigned int NMCK0sGen = 0;
389  unsigned int NMCNeutronsGen = 0;
390  unsigned int NMCGammasGen = 0;
391  unsigned int NMCLambda0sGen = 0;
392  unsigned int NMCSigma0sGen = 0;
393  unsigned int NMCXi0sGen = 0;
394 
395  unsigned int NMCLostInBeamPipe = 0;
396  unsigned int NMCRemainingGen = 0;
397 
398  double energyGen = 0.0;
399  double energyMCHChGen = 0.0;
400  double energyMCH0Gen = 0.0;
401  double energyMCGGen = 0.0;
402  double energyLostInBeamPipe = 0.0;
403 
404 
405  try {
406 
407  const std::vector< std::string >* strVec = evt->getCollectionNames() ;
408  std::vector< std::string >::const_iterator name ;
409 
410  for( name = strVec->begin() ; name != strVec->end() ; name++) {
411 
412  LCCollection* col = evt->getCollection( *name ) ;
413 
414  if ( col->getTypeName() == LCIO::MCPARTICLE ) {
415 
416  int nMCP = col->getNumberOfElements();
417 
418  for(int i = 0; i < nMCP ; ++i){
419 
420  MCParticle* mcp = dynamic_cast<MCParticle*>( col->getElementAt( i ) ) ;
421 
422  const double* p = mcp->getMomentum();
423  float e = mcp->getEnergy();
424 
425  if ( mcp->getGeneratorStatus() == 1 ) {
426 
427  double pt = hypot(p[0],p[1]);
428  double theta = atan2(pt,p[2]);
429 
430  if ( fabs(theta) > _thetaCut ) {
431 
432  ++NMCGen;
433  energyGen += e;
434 
435  #ifdef MARLIN_USE_AIDA
436  _cMCEnergyGen->fill(e);
437  #endif
438 
439 
440  switch (abs(mcp->getPDG())) {
441 
442  case 11 : {
443  ++NMCElectronsGen;
444 
445  #ifdef MARLIN_USE_AIDA
446  _cMCEnergyElectronsGen->fill(e);
447  #endif
448 
449  ++NMCHChGen;
450  energyMCHChGen += e;
451  break;
452  }
453  case 13 : {
454  ++NMCMuonsGen;
455 
456  #ifdef MARLIN_USE_AIDA
457  _cMCEnergyMuonsGen->fill(e);
458  #endif
459 
460  ++NMCHChGen;
461  energyMCHChGen += e;
462  break;
463  }
464  case 15 : {
465  ++NMCTausGen;
466 
467  #ifdef MARLIN_USE_AIDA
468  _cMCEnergyTausGen->fill(e);
469  #endif
470 
471  ++NMCHChGen;
472  energyMCHChGen += e;
473  break;
474  }
475  case 12 : {
476  ++NMCNusGen;
477 
478  #ifdef MARLIN_USE_AIDA
479  _cMCEnergyNusGen->fill(e);
480  #endif
481  break;
482  }
483  case 14 : {
484  ++NMCNusGen;
485 
486  #ifdef MARLIN_USE_AIDA
487  _cMCEnergyNusGen->fill(e);
488  #endif
489  break;
490  }
491  case 16 : {
492  ++NMCNusGen;
493 
494  #ifdef MARLIN_USE_AIDA
495  _cMCEnergyNusGen->fill(e);
496  #endif
497  break;
498  }
499 
500  case 211 : {
501  ++NMCPiChGen;
502 
503  #ifdef MARLIN_USE_AIDA
504  _cMCEnergyPiChGen->fill(e);
505  #endif
506 
507  ++NMCHChGen;
508  energyMCHChGen += e;
509  break;
510  }
511  case 321 : {
512  ++NMCKChGen;
513 
514  #ifdef MARLIN_USE_AIDA
515  _cMCEnergyKChGen->fill(e);
516  #endif
517 
518  ++NMCHChGen;
519  energyMCHChGen += e;
520  break;
521  }
522  case 2212 : {
523  ++NMCProtonsGen;
524 
525  #ifdef MARLIN_USE_AIDA
526  _cMCEnergyProtonsGen->fill(e);
527  #endif
528 
529  ++NMCHChGen;
530  energyMCHChGen += e;
531  break;
532  }
533  case 111 : {
534  ++NMCPi0Gen;
535  ++NMCGGen;
536  energyMCGGen += e;
537 
538  #ifdef MARLIN_USE_AIDA
539  _cMCEnergyPi0Gen->fill(e);
540  #endif
541  break;
542  }
543  case 130 : {
544  ++NMCK0lGen;
545 
546  #ifdef MARLIN_USE_AIDA
547  _cMCEnergyK0lGen->fill(e);
548  #endif
549 
550  ++NMCH0Gen;
551  energyMCH0Gen += e;
552  break;
553  }
554  case 310 : {
555  ++NMCK0sGen;
556 
557  #ifdef MARLIN_USE_AIDA
558  _cMCEnergyK0sGen->fill(e);
559  #endif
560 
561  ++NMCHChGen;
562  energyMCHChGen += e;
563  break;
564  }
565  case 2112 : {
566  ++NMCNeutronsGen;
567 
568  #ifdef MARLIN_USE_AIDA
569  _cMCEnergyNeutronsGen->fill(e);
570  #endif
571 
572  ++NMCH0Gen;
573  energyMCH0Gen += e;
574  break;
575  }
576  case 22 : {
577  ++NMCGammasGen;
578  ++NMCGGen;
579  energyMCGGen += e;
580 
581  #ifdef MARLIN_USE_AIDA
582  _cMCEnergyGammasGen->fill(e);
583  #endif
584  break;
585  }
586  case 3122 : {
587  ++NMCLambda0sGen;
588 
589  #ifdef MARLIN_USE_AIDA
590  _cMCEnergyLambda0sGen->fill(e);
591  #endif
592 
593  ++NMCHChGen;
594  energyMCHChGen += e;
595  break;
596  }
597  case 3212 : {
598  ++NMCSigma0sGen;
599 
600  #ifdef MARLIN_USE_AIDA
601  _cMCEnergySigma0sGen->fill(e);
602  #endif
603 
604  ++NMCHChGen;
605  energyMCHChGen += e;
606  break;
607  }
608  case 3322 : {
609  ++NMCXi0sGen;
610 
611  #ifdef MARLIN_USE_AIDA
612  _cMCEnergyXi0sGen->fill(e);
613  #endif
614 
615  ++NMCHChGen;
616  energyMCHChGen += e;
617  break;
618  }
619 
620  default : {
621 
622  // debug
623  std::cout << "default case for for MCP (generator status == 1)" << mcp->getPDG() << std::endl;
624 
625  ++NMCRemainingGen;
626 
627  #ifdef MARLIN_USE_AIDA
628  _cMCEnergyRemainingGen->fill(e);
629  #endif
630 
631  ++NMCHChGen;
632  energyMCHChGen += e;
633  break;
634  }
635 
636  } // end of switch
637 
638  }
639  else { // in beam pipe
640 
641  ++NMCGen;
642  energyGen += e;
643 
644  ++NMCLostInBeamPipe;
645  energyLostInBeamPipe += e;
646 
647  }
648 
649  }
650 
651  }
652 
653  }
654 
655  }
656 
657  }
658  catch(DataNotAvailableException &e){
659  std::cout << "MC particle collection not available in Check Plot processor" << std::endl ;
660  };
661 
662 
663  #ifdef MARLIN_USE_AIDA
664  _cMCNumberGen -> fill(NMCGen);
665  _cMCNumberElectronsGen -> fill(NMCElectronsGen);
666  _cMCNumberMuonsGen -> fill(NMCMuonsGen);
667  _cMCNumberTausGen -> fill(NMCTausGen);
668  _cMCNumberNusGen -> fill(NMCNusGen);
669 
670  _cMCNumberHChGen -> fill(NMCHChGen);
671  _cMCNumberH0Gen -> fill(NMCH0Gen);
672  _cMCNumberGGen -> fill(NMCGGen);
673  _cMCFractionHChGen -> fill(double(NMCHChGen)/double(NMCGen));
674  _cMCFractionH0Gen -> fill(double(NMCH0Gen)/double(NMCGen));
675  _cMCFractionGGen -> fill(double(NMCGGen)/double(NMCGen));
676  _cMCEnergyHChGen -> fill(energyMCHChGen);
677  _cMCEnergyH0Gen -> fill(energyMCH0Gen);
678  _cMCEnergyGGen -> fill(energyMCGGen);
679  _cMCEnergyFractionHChGen -> fill(energyMCHChGen/energyGen);
680  _cMCEnergyFractionH0Gen -> fill(energyMCH0Gen/energyGen);
681  _cMCEnergyFractionGGen -> fill(energyMCGGen/energyGen);
682 
683  _cMCNumberPiChGen -> fill(NMCPiChGen);
684  _cMCNumberKChGen -> fill(NMCKChGen);
685  _cMCNumberProtonsGen -> fill(NMCProtonsGen);
686  _cMCNumberPi0Gen -> fill(NMCPi0Gen);
687  _cMCNumberK0lGen -> fill(NMCK0lGen);
688  _cMCNumberK0sGen -> fill(NMCK0sGen);
689  _cMCNumberNeutronsGen -> fill(NMCNeutronsGen);
690  _cMCNumberGammasGen -> fill(NMCGammasGen);
691  _cMCNumberLambda0sGen -> fill(NMCLambda0sGen);
692  _cMCNumberSigma0sGen -> fill(NMCSigma0sGen);
693  _cMCNumberXi0sGen -> fill(NMCXi0sGen);
694 
695  _cMCNumberLostInBeamPipe -> fill(NMCLostInBeamPipe);
696  _cMCEnergyLostInBeamPipe -> fill(energyLostInBeamPipe);
697 
698  _cMCNumberRemainingGen -> fill(NMCRemainingGen);
699 
700  _cMCEnergySumGen -> fill(energyGen);
701  #endif
702 
703 
704  _nMC = NMCGen - NMCLostInBeamPipe;
705  _nMCCh = NMCElectronsGen + NMCMuonsGen + NMCTausGen + NMCHChGen;
706  _nMCN = NMCH0Gen + NMCGGen;
707 
708  _energyMC = energyGen - energyLostInBeamPipe;
709  _energyMCCh = energyMCHChGen;
710  _energyMCN = energyMCH0Gen + energyMCGGen;
711 
712  }
713 
714 }
715 
716 
717 
718 
719 
720 
721 
722 
723 
725 
726 
727  if (_fillMCSim) {
728 
729  unsigned int NMCSim = 0;
730 
731  unsigned int NMCElectronsSim = 0;
732  unsigned int NMCMuonsSim = 0;
733  unsigned int NMCTausSim = 0;
734  unsigned int NMCNusSim = 0;
735 
736  unsigned int NMCPiChSim = 0;
737  unsigned int NMCKChSim = 0;
738  unsigned int NMCProtonsSim = 0;
739  unsigned int NMCPi0Sim = 0;
740  unsigned int NMCK0lSim = 0;
741  unsigned int NMCK0sSim = 0;
742  unsigned int NMCNeutronsSim = 0;
743  unsigned int NMCGammasSim = 0;
744  unsigned int NMCLambda0sSim = 0;
745  unsigned int NMCSigma0sSim = 0;
746  unsigned int NMCXi0sSim = 0;
747 
748  unsigned int NMCRemainingSim = 0;
749 
750  double energySim = 0.0;
751 
752 
753  try {
754 
755  const std::vector< std::string >* strVec = evt->getCollectionNames() ;
756  std::vector< std::string >::const_iterator name ;
757 
758  for( name = strVec->begin() ; name != strVec->end() ; name++) {
759 
760  LCCollection* col = evt->getCollection( *name ) ;
761 
762  if ( col->getTypeName() == LCIO::MCPARTICLE ) {
763 
764  int nMCP = col->getNumberOfElements();
765 
766  for(int i = 0; i < nMCP ; ++i){
767 
768  MCParticle* mcp = dynamic_cast<MCParticle*>( col->getElementAt( i ) ) ;
769 
770  float e = mcp->getEnergy();
771 
772  if (mcp->getGeneratorStatus() != 1 ) {
773 
774  ++NMCSim;
775  energySim += e;
776 
777  #ifdef MARLIN_USE_AIDA
778  _cMCEnergySim->fill(e);
779  #endif
780 
781 
782  switch (abs(mcp->getPDG())) {
783 
784  case 11 : {
785  ++NMCElectronsSim;
786 
787  #ifdef MARLIN_USE_AIDA
788  _cMCEnergyElectronsSim->fill(e);
789  #endif
790  break;
791  }
792  case 13 : {
793  ++NMCMuonsSim;
794 
795  #ifdef MARLIN_USE_AIDA
796  _cMCEnergyMuonsSim->fill(e);
797  #endif
798  break;
799  }
800  case 15 : {
801  ++NMCTausSim;
802 
803  #ifdef MARLIN_USE_AIDA
804  _cMCEnergyTausSim->fill(e);
805  #endif
806  break;
807  }
808 
809  case 12 : {
810  ++NMCNusSim;
811 
812  #ifdef MARLIN_USE_AIDA
813  _cMCEnergyNusSim->fill(e);
814  #endif
815  break;
816  }
817  case 14 : {
818  ++NMCNusSim;
819 
820  #ifdef MARLIN_USE_AIDA
821  _cMCEnergyNusSim->fill(e);
822  #endif
823  break;
824  }
825  case 16 : {
826  ++NMCNusSim;
827 
828  #ifdef MARLIN_USE_AIDA
829  _cMCEnergyNusSim->fill(e);
830  #endif
831  break;
832  }
833 
834  case 211 : {
835  ++NMCPiChSim;
836 
837  #ifdef MARLIN_USE_AIDA
838  _cMCEnergyPiChSim->fill(e);
839  #endif
840  break;
841  }
842  case 321 : {
843  ++NMCKChSim;
844 
845  #ifdef MARLIN_USE_AIDA
846  _cMCEnergyKChSim->fill(e);
847  #endif
848  break;
849  }
850  case 2212 : {
851  ++NMCProtonsSim;
852 
853  #ifdef MARLIN_USE_AIDA
854  _cMCEnergyProtonsSim->fill(e);
855  #endif
856  break;
857  }
858  case 111 : {
859  ++NMCPi0Sim;
860 
861  #ifdef MARLIN_USE_AIDA
862  _cMCEnergyPi0Sim->fill(e);
863  #endif
864  break;
865  }
866  case 130 : {
867  ++NMCK0lSim;
868 
869  #ifdef MARLIN_USE_AIDA
870  _cMCEnergyK0lSim->fill(e);
871  #endif
872  break;
873  }
874  case 310 : {
875  ++NMCK0sSim;
876 
877  #ifdef MARLIN_USE_AIDA
878  _cMCEnergyK0sSim->fill(e);
879  #endif
880  break;
881  }
882  case 2112 : {
883  ++NMCNeutronsSim;
884 
885  #ifdef MARLIN_USE_AIDA
886  _cMCEnergyNeutronsSim->fill(e);
887  #endif
888  break;
889  }
890  case 22 : {
891  ++NMCGammasSim;
892 
893  #ifdef MARLIN_USE_AIDA
894  _cMCEnergyGammasSim->fill(e);
895  #endif
896  break;
897  }
898  case 3122 : {
899  ++NMCLambda0sSim;
900 
901  #ifdef MARLIN_USE_AIDA
902  _cMCEnergyLambda0sSim->fill(e);
903  #endif
904  break;
905  }
906  case 3212 : {
907  ++NMCSigma0sSim;
908 
909  #ifdef MARLIN_USE_AIDA
910  _cMCEnergySigma0sSim->fill(e);
911  #endif
912  break;
913  }
914  case 3322 : {
915  ++NMCXi0sSim;
916 
917  #ifdef MARLIN_USE_AIDA
918  _cMCEnergyXi0sSim->fill(e);
919  #endif
920  break;
921  }
922 
923  default : {
924 
925  // debug
926  std::cout << "default case for for MCP (generator status != 1)" << mcp->getPDG() << std::endl;
927 
928  ++NMCRemainingSim;
929 
930  #ifdef MARLIN_USE_AIDA
931  _cMCEnergyRemainingSim->fill(e);
932  #endif
933  break;
934  }
935 
936  } // end of switch
937 
938  }
939 
940  }
941 
942  }
943 
944  }
945 
946  }
947  catch(DataNotAvailableException &e){
948  std::cout << "MC particle collection not available in Check Plot processor" << std::endl ;
949  };
950 
951 
952  #ifdef MARLIN_USE_AIDA
953  _cMCNumberSim -> fill(NMCSim);
954  _cMCNumberElectronsSim -> fill(NMCElectronsSim);
955  _cMCNumberMuonsSim -> fill(NMCMuonsSim);
956  _cMCNumberTausSim -> fill(NMCTausSim);
957  _cMCNumberNusSim -> fill(NMCNusSim);
958 
959  _cMCNumberPiChSim -> fill(NMCPiChSim);
960  _cMCNumberKChSim -> fill(NMCKChSim);
961  _cMCNumberProtonsSim -> fill(NMCProtonsSim);
962  _cMCNumberPi0Sim -> fill(NMCPi0Sim);
963  _cMCNumberK0lSim -> fill(NMCK0lSim);
964  _cMCNumberK0sSim -> fill(NMCK0sSim);
965  _cMCNumberNeutronsSim -> fill(NMCNeutronsSim);
966  _cMCNumberGammasSim -> fill(NMCGammasSim);
967  _cMCNumberLambda0sSim -> fill(NMCLambda0sSim);
968  _cMCNumberSigma0sSim -> fill(NMCSigma0sSim);
969  _cMCNumberXi0sSim -> fill(NMCXi0sSim);
970 
971  _cMCNumberRemainingSim -> fill(NMCRemainingSim);
972 
973  _cMCEnergySumSim -> fill(energySim);
974  #endif
975 
976 
977 
978  }
979 
980 }
981 
982 
983 
984 
986 
987 
988  if (_fillSimCaloHit) {
989 
990  try {
991 
992  int numberSimHits = 0;
993  float energySimSum = 0.0;
994 
995 
996  const std::vector< std::string >* strVec = evt->getCollectionNames() ;
997  std::vector< std::string >::const_iterator name ;
998 
999  for( name = strVec->begin() ; name != strVec->end() ; name++) {
1000 
1001  LCCollection* col = evt->getCollection( *name ) ;
1002 
1003  if ( col->getTypeName() == LCIO::SIMCALORIMETERHIT ) {
1004 
1005  if( col != 0 ){
1006 
1007  int nSimHits = col->getNumberOfElements();
1008 
1009  numberSimHits += nSimHits;
1010 
1011  for(int i = 0; i < nSimHits; ++i){
1012 
1013  SimCalorimeterHit* SimCaloHit = dynamic_cast<SimCalorimeterHit*>(col->getElementAt(i));
1014 
1015  float simEnergy = SimCaloHit->getEnergy();
1016 
1017  if (simEnergy > _simECut) {
1018 
1019  #ifdef MARLIN_USE_AIDA
1020  _cEnergySimCaloHits->fill(simEnergy);
1021  #endif
1022 
1023  energySimSum += simEnergy;
1024  }
1025 
1026  }
1027 
1028  }
1029 
1030  }
1031 
1032  }
1033 
1034  #ifdef MARLIN_USE_AIDA
1035  _cNumberSimCaloHits->fill(numberSimHits);
1036  _cEnergySimCaloHitsSum->fill(energySimSum);
1037  #endif
1038 
1039  }
1040  catch(DataNotAvailableException &e){std::cout << "SimCalorimeterHit collection not available in Check Plot processor" << std::endl; };
1041 
1042  }
1043 
1044 }
1045 
1046 
1047 
1048 
1050 
1051 
1052  if (_fillCaloHit) {
1053 
1054  try {
1055 
1056  int numberHits = 0;
1057  float energySum = 0.0;
1058 
1059 
1060  const std::vector< std::string >* strVec = evt->getCollectionNames() ;
1061  std::vector< std::string >::const_iterator name ;
1062 
1063  for( name = strVec->begin() ; name != strVec->end() ; name++) {
1064 
1065  LCCollection* col = evt->getCollection( *name ) ;
1066 
1067  if ( col->getTypeName() == LCIO::CALORIMETERHIT ) {
1068 
1069  if( col != 0 ){
1070 
1071  int nHits = col->getNumberOfElements();
1072 
1073  numberHits += nHits;
1074 
1075  for(int i = 0; i < nHits; ++i){
1076 
1077  CalorimeterHit* CaloHit = dynamic_cast<CalorimeterHit*>(col->getElementAt(i));
1078 
1079  float Energy = CaloHit->getEnergy();
1080 
1081  if (Energy > _ECut) {
1082 
1083  #ifdef MARLIN_USE_AIDA
1084  _cEnergyCaloHits->fill(Energy);
1085  #endif
1086 
1087  energySum += Energy;
1088  }
1089 
1090  }
1091 
1092  }
1093 
1094  }
1095 
1096  }
1097 
1098  #ifdef MARLIN_USE_AIDA
1099  _cNumberCaloHits->fill(numberHits);
1100  _cEnergyCaloHitsSum->fill(energySum);
1101  #endif
1102 
1103 
1104 
1105 
1106  // cDifferenceEnergyCaloSumAndMCEnergy->fill(energySum-SEMC);
1107 
1108 
1109 
1110 
1111 
1112  }
1113  catch(DataNotAvailableException &e){std::cout << "CalorimeterHit collection not available in Check Plot processor" << std::endl; };
1114 
1115  }
1116 
1117 }
1118 
1119 
1120 
1121 
1122 void CheckPlots::fillTrackCheckPlots(LCEvent * evt) {
1123 
1124 
1125  if (_fillTracks) {
1126 
1127  try {
1128 
1129  std::vector< std::string >::const_iterator iter;
1130  const std::vector< std::string >* ColNames = evt->getCollectionNames();
1131 
1132  for( iter = ColNames->begin() ; iter != ColNames->end() ; iter++) {
1133 
1134  LCCollection* col = evt->getCollection( *iter ) ;
1135 
1136  if ( (col->getTypeName() == LCIO::TRACK) && (*iter == _colNameTracks) ) {
1137 
1138  int nTracks = col->getNumberOfElements();
1139 
1140  #ifdef MARLIN_USE_AIDA
1141  _cNumberTracks->fill(nTracks);
1142  #endif
1143 
1144  for(int j=0; j<nTracks; ++j){
1145 
1146  Track* track = dynamic_cast<Track*>(col->getElementAt(j));
1147 
1148  int nTrackerHits = track->getTrackerHits().size();
1149 
1150  #ifdef MARLIN_USE_AIDA
1151  _cNumberTrackerHitsPerTrack->fill(nTrackerHits);
1152  #endif
1153 
1154  const double absP = MarlinUtil::getAbsMomentum(track,_bField);
1155 
1156  #ifdef MARLIN_USE_AIDA
1157  _cMomentumTracks->fill(absP);
1158  #endif
1159 
1160  try {
1161 
1162  LCCollection* LCRcolTracks = evt->getCollection(_colNameRelationTrackToMCP);
1163 
1164  LCRelationNavigator* navTracks = new LCRelationNavigator(LCRcolTracks);
1165  const LCObjectVec& relMCParticlesToTrack = navTracks->getRelatedToObjects(track);
1166 
1167  int nOfRelatedMCParticles = relMCParticlesToTrack.size();
1168 
1169  #ifdef MARLIN_USE_AIDA
1170  _cNumberMCParticlesPerTrack->fill(nOfRelatedMCParticles);
1171  #endif
1172 
1173  }
1174  catch(DataNotAvailableException &e){std::cout << "no valid LCRelation between track and MC particle in event " << _nEvt << std::endl; };
1175 
1176  }
1177 
1178  }
1179 
1180  }
1181 
1182  }
1183  catch(DataNotAvailableException &e){std::cout << "no valid track collection available in event " << _nEvt << std::endl; };
1184  }
1185 
1186 }
1187 
1188 
1189 
1190 
1192 
1193 
1195 
1196  int nReco = 0;
1197  int nRecoCh = 0;
1198  int nRecoN = 0;
1199 
1200  double energyReco = 0.0;
1201  double energyRecoCh = 0.0;
1202  double energyRecoN = 0.0;
1203 
1204 
1205  try {
1206 
1207  int nReconstructedParticles = 0;
1208  double energySumReconstructedParticles = 0.0;
1209 
1210  std::vector< std::string >::const_iterator iter;
1211  const std::vector< std::string >* ColNames = evt->getCollectionNames();
1212 
1213  for( iter = ColNames->begin() ; iter != ColNames->end() ; iter++) {
1214 
1215  LCCollection* col = evt->getCollection( *iter ) ;
1216 
1217  if ( (col->getTypeName() == LCIO::RECONSTRUCTEDPARTICLE) && (*iter == _colNameReconstructedParticles) ) {
1218 
1219  nReconstructedParticles += col->getNumberOfElements();
1220 
1221  for(int j=0; j<nReconstructedParticles; ++j){
1222 
1223  ReconstructedParticle* recoParticle = dynamic_cast<ReconstructedParticle*>(col->getElementAt(j));
1224 
1225  double energyReconstructedParticle = recoParticle->getEnergy();
1226 
1227  energySumReconstructedParticles += energyReconstructedParticle;
1228 
1229  #ifdef MARLIN_USE_AIDA
1230  _cEnergyReconstructedParticles->fill(energyReconstructedParticle);
1231  #endif
1232 
1233 
1234  if ( (recoParticle->getTracks().size()) > 0 ) {
1235 
1236  ++nRecoCh;
1237  energyRecoCh += energyReconstructedParticle;
1238 
1239  }
1240  else {
1241 
1242  ++nRecoN;
1243  energyRecoN += energyReconstructedParticle;
1244 
1245  }
1246 
1247  }
1248 
1249  }
1250 
1251  }
1252 
1253  #ifdef MARLIN_USE_AIDA
1254  _cNumberReconstructedParticles->fill(nReconstructedParticles);
1255  _cEnergySumReconstructedParticles->fill(energySumReconstructedParticles);
1256  #endif
1257 
1258  nReco = nReconstructedParticles;
1259  energyReco = energySumReconstructedParticles;
1260 
1261  }
1262  catch(DataNotAvailableException &e){std::cout << "no valid reconstructed particle collection available in event " << _nEvt << std::endl; };
1263 
1264 
1265  _nReco = nReco;
1266  _nRecoCh = nRecoCh;
1267  _nRecoN = nRecoN;
1268 
1269  _energyReco = energyReco;
1270  _energyRecoCh = energyRecoCh;
1271  _energyRecoN = energyRecoN;
1272 
1273  }
1274 
1275 }
1276 
1277 
1278 
1279 
1281 
1282  if (_fillComparisonMCReco) {
1283 
1285 
1286  _cNumberMCvsNumberReco->fill(_nMC,_nReco);
1287  _cNumberMCChvsNumberRecoCh->fill(_nMCCh,_nRecoCh);
1288  _cNumberMCNvsNumberRecoN->fill(_nMCN,_nRecoN);
1289 
1290  _cEnergyMCvsEnergyReco->fill(_energyMC,_energyReco);
1291  _cEnergyMCChvsEnergyRecoCh->fill(_energyMCCh,_energyRecoCh);
1292  _cEnergyMCNvsEnergyRecoN->fill(_energyMCN,_energyRecoN);
1293 
1294  }
1295 
1296  }
1297 
1298 }
int _fillSimCaloHit
Definition: CheckPlots.h:96
double _energyRecoCh
Definition: CheckPlots.h:121
int _fillComparisonMCReco
Definition: CheckPlots.h:109
double _energyMCN
Definition: CheckPlots.h:119
CheckPlots aCheckPlots
Definition: CheckPlots.cc:10
float _ECut
Definition: CheckPlots.h:100
CLHEP::Hep3Vector Vector3D
void fillCaloHitCheckPlots(LCEvent *evt)
Definition: CheckPlots.cc:1049
void fillMCGenCheckPlots(LCEvent *evt)
Definition: CheckPlots.cc:367
double _energyRecoN
Definition: CheckPlots.h:122
int _fillMCGen
Definition: CheckPlots.h:92
float _simECut
Definition: CheckPlots.h:97
double _energyReco
Definition: CheckPlots.h:120
void fillMCSimCheckPlots(LCEvent *evt)
Definition: CheckPlots.cc:724
virtual void init()
Definition: CheckPlots.cc:99
void fillTrackCheckPlots(LCEvent *evt)
Definition: CheckPlots.cc:1122
float _thetaCut
Definition: CheckPlots.h:93
double _energyMC
Definition: CheckPlots.h:117
This processor provides check plots.
Definition: CheckPlots.h:70
virtual void processEvent(LCEvent *evt)
Definition: CheckPlots.cc:125
virtual void processRunHeader(LCRunHeader *run)
Definition: CheckPlots.cc:115
Real hypot(const Real &a, const Real &b)
int _fillCaloHit
Definition: CheckPlots.h:99
void fillReconstructedParticlesCheckPlots(LCEvent *evt)
Definition: CheckPlots.cc:1191
float _bField
Definition: CheckPlots.h:90
std::string _colNameReconstructedParticles
Definition: CheckPlots.h:107
double _energyMCCh
Definition: CheckPlots.h:118
void fillSimCaloHitCheckPlots(LCEvent *evt)
Definition: CheckPlots.cc:985
int _fillTracks
Definition: CheckPlots.h:102
int _fillReconstructedParticles
Definition: CheckPlots.h:106
int _nRecoCh
Definition: CheckPlots.h:114
std::string _colNameRelationTrackToMCP
Definition: CheckPlots.h:104
void createClouds()
Definition: CheckPlots.cc:172
virtual void check(LCEvent *evt)
Definition: CheckPlots.cc:157
void fillComparisonMCRecoPlots()
Definition: CheckPlots.cc:1280
static const float e
virtual void end()
Definition: CheckPlots.cc:164
int _fillMCSim
Definition: CheckPlots.h:94
std::string _colNameTracks
Definition: CheckPlots.h:103