5 using namespace marlin ;
31 _description =
"produces Check Plots" ;
35 registerProcessorParameter(
"FillMCGen",
"fill clouds for MC particles generated at IP",
39 registerProcessorParameter(
"FillMCSim",
"fill clouds for MC particles created during simulation",
44 registerProcessorParameter(
"FillSimCaloHit",
"fill clouds for SimCalorimeter hits",
47 registerProcessorParameter(
"SimECut",
"energy cut for filling clouds for SimCalorimeter hits",
52 registerProcessorParameter(
"FillCaloHit",
"fill clouds for Calorimeter hits",
56 registerProcessorParameter(
"ECut",
"energy cut for filling clouds for Calorimeter hits",
60 registerProcessorParameter(
"ThetaCut",
"Polar angle cut, given in rad. Particles with a smaller polar angle will be treated as 'lost in the beam pipe'",
65 registerProcessorParameter(
"FillTracks",
"fill clouds for tracks",
69 registerProcessorParameter(
"ColNameTracks" ,
70 "name of the Track collection" ,
72 std::string(
"Tracks") );
74 registerProcessorParameter(
"ColNameRelationTrackToMCP" ,
75 "name of the LC Relation collection between Tracks and MC particles" ,
77 std::string(
"TrueTrackToMCP") );
80 registerProcessorParameter(
"FillReconstructedParticles",
"fill clouds for ReconstructedParticles",
84 registerProcessorParameter(
"ColNameReconstructedParticles" ,
85 "name of the ReconstructedParticles collection" ,
87 std::string(
"ReconstructedParticles") );
90 registerProcessorParameter(
"Fill",
"fill clouds for comparison of MC tree and reconstructed particles",
128 static bool firstEvent =
true;
130 if(firstEvent) std::cout <<
"Check Plot processor called for first event" << std::endl;
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 );
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 );
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 );
197 _cMCNumberRemainingSim = AIDAProcessor::histogramFactory(
this)->createCloud1D(
"MCNumberRemainingSim",
"number of the remaining particles per event (generator status != 1)", -1 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
259 _cMCEnergyRemainingSim = AIDAProcessor::histogramFactory(
this)->createCloud1D(
"MCEnergyRemainingSim",
"energy spectrum of the remaining particles in one event (generator status != 1)", -1 );
267 _cMCEnergyGen = AIDAProcessor::histogramFactory(
this)->createCloud1D(
"MCEnergyGen",
"energy spectrum of all MC particles in one event (generator status == 1)", -1 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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);
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);
372 unsigned int NMCGen = 0;
374 unsigned int NMCHChGen = 0;
375 unsigned int NMCH0Gen = 0;
376 unsigned int NMCGGen = 0;
378 unsigned int NMCElectronsGen = 0;
379 unsigned int NMCMuonsGen = 0;
380 unsigned int NMCTausGen = 0;
381 unsigned int NMCNusGen = 0;
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;
395 unsigned int NMCLostInBeamPipe = 0;
396 unsigned int NMCRemainingGen = 0;
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;
407 const std::vector< std::string >* strVec = evt->getCollectionNames() ;
408 std::vector< std::string >::const_iterator name ;
410 for( name = strVec->begin() ; name != strVec->end() ; name++) {
412 LCCollection* col = evt->getCollection( *name ) ;
414 if ( col->getTypeName() == LCIO::MCPARTICLE ) {
416 int nMCP = col->getNumberOfElements();
418 for(
int i = 0; i < nMCP ; ++i){
420 MCParticle* mcp =
dynamic_cast<MCParticle*
>( col->getElementAt( i ) ) ;
422 const double* p = mcp->getMomentum();
423 float e = mcp->getEnergy();
425 if ( mcp->getGeneratorStatus() == 1 ) {
427 double pt =
hypot(p[0],p[1]);
428 double theta = atan2(pt,p[2]);
435 #ifdef MARLIN_USE_AIDA
436 _cMCEnergyGen->fill(e);
440 switch (abs(mcp->getPDG())) {
445 #ifdef MARLIN_USE_AIDA
446 _cMCEnergyElectronsGen->fill(e);
456 #ifdef MARLIN_USE_AIDA
457 _cMCEnergyMuonsGen->fill(e);
467 #ifdef MARLIN_USE_AIDA
468 _cMCEnergyTausGen->fill(e);
478 #ifdef MARLIN_USE_AIDA
479 _cMCEnergyNusGen->fill(e);
486 #ifdef MARLIN_USE_AIDA
487 _cMCEnergyNusGen->fill(e);
494 #ifdef MARLIN_USE_AIDA
495 _cMCEnergyNusGen->fill(e);
503 #ifdef MARLIN_USE_AIDA
504 _cMCEnergyPiChGen->fill(e);
514 #ifdef MARLIN_USE_AIDA
515 _cMCEnergyKChGen->fill(e);
525 #ifdef MARLIN_USE_AIDA
526 _cMCEnergyProtonsGen->fill(e);
538 #ifdef MARLIN_USE_AIDA
539 _cMCEnergyPi0Gen->fill(e);
546 #ifdef MARLIN_USE_AIDA
547 _cMCEnergyK0lGen->fill(e);
557 #ifdef MARLIN_USE_AIDA
558 _cMCEnergyK0sGen->fill(e);
568 #ifdef MARLIN_USE_AIDA
569 _cMCEnergyNeutronsGen->fill(e);
581 #ifdef MARLIN_USE_AIDA
582 _cMCEnergyGammasGen->fill(e);
589 #ifdef MARLIN_USE_AIDA
590 _cMCEnergyLambda0sGen->fill(e);
600 #ifdef MARLIN_USE_AIDA
601 _cMCEnergySigma0sGen->fill(e);
611 #ifdef MARLIN_USE_AIDA
612 _cMCEnergyXi0sGen->fill(e);
623 std::cout <<
"default case for for MCP (generator status == 1)" << mcp->getPDG() << std::endl;
627 #ifdef MARLIN_USE_AIDA
628 _cMCEnergyRemainingGen->fill(e);
645 energyLostInBeamPipe +=
e;
658 catch(DataNotAvailableException &
e){
659 std::cout <<
"MC particle collection not available in Check Plot processor" << std::endl ;
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);
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);
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);
695 _cMCNumberLostInBeamPipe -> fill(NMCLostInBeamPipe);
696 _cMCEnergyLostInBeamPipe -> fill(energyLostInBeamPipe);
698 _cMCNumberRemainingGen -> fill(NMCRemainingGen);
700 _cMCEnergySumGen -> fill(energyGen);
704 _nMC = NMCGen - NMCLostInBeamPipe;
705 _nMCCh = NMCElectronsGen + NMCMuonsGen + NMCTausGen + NMCHChGen;
706 _nMCN = NMCH0Gen + NMCGGen;
708 _energyMC = energyGen - energyLostInBeamPipe;
729 unsigned int NMCSim = 0;
731 unsigned int NMCElectronsSim = 0;
732 unsigned int NMCMuonsSim = 0;
733 unsigned int NMCTausSim = 0;
734 unsigned int NMCNusSim = 0;
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;
748 unsigned int NMCRemainingSim = 0;
750 double energySim = 0.0;
755 const std::vector< std::string >* strVec = evt->getCollectionNames() ;
756 std::vector< std::string >::const_iterator name ;
758 for( name = strVec->begin() ; name != strVec->end() ; name++) {
760 LCCollection* col = evt->getCollection( *name ) ;
762 if ( col->getTypeName() == LCIO::MCPARTICLE ) {
764 int nMCP = col->getNumberOfElements();
766 for(
int i = 0; i < nMCP ; ++i){
768 MCParticle* mcp =
dynamic_cast<MCParticle*
>( col->getElementAt( i ) ) ;
770 float e = mcp->getEnergy();
772 if (mcp->getGeneratorStatus() != 1 ) {
777 #ifdef MARLIN_USE_AIDA
778 _cMCEnergySim->fill(e);
782 switch (abs(mcp->getPDG())) {
787 #ifdef MARLIN_USE_AIDA
788 _cMCEnergyElectronsSim->fill(e);
795 #ifdef MARLIN_USE_AIDA
796 _cMCEnergyMuonsSim->fill(e);
803 #ifdef MARLIN_USE_AIDA
804 _cMCEnergyTausSim->fill(e);
812 #ifdef MARLIN_USE_AIDA
813 _cMCEnergyNusSim->fill(e);
820 #ifdef MARLIN_USE_AIDA
821 _cMCEnergyNusSim->fill(e);
828 #ifdef MARLIN_USE_AIDA
829 _cMCEnergyNusSim->fill(e);
837 #ifdef MARLIN_USE_AIDA
838 _cMCEnergyPiChSim->fill(e);
845 #ifdef MARLIN_USE_AIDA
846 _cMCEnergyKChSim->fill(e);
853 #ifdef MARLIN_USE_AIDA
854 _cMCEnergyProtonsSim->fill(e);
861 #ifdef MARLIN_USE_AIDA
862 _cMCEnergyPi0Sim->fill(e);
869 #ifdef MARLIN_USE_AIDA
870 _cMCEnergyK0lSim->fill(e);
877 #ifdef MARLIN_USE_AIDA
878 _cMCEnergyK0sSim->fill(e);
885 #ifdef MARLIN_USE_AIDA
886 _cMCEnergyNeutronsSim->fill(e);
893 #ifdef MARLIN_USE_AIDA
894 _cMCEnergyGammasSim->fill(e);
901 #ifdef MARLIN_USE_AIDA
902 _cMCEnergyLambda0sSim->fill(e);
909 #ifdef MARLIN_USE_AIDA
910 _cMCEnergySigma0sSim->fill(e);
917 #ifdef MARLIN_USE_AIDA
918 _cMCEnergyXi0sSim->fill(e);
926 std::cout <<
"default case for for MCP (generator status != 1)" << mcp->getPDG() << std::endl;
930 #ifdef MARLIN_USE_AIDA
931 _cMCEnergyRemainingSim->fill(e);
947 catch(DataNotAvailableException &
e){
948 std::cout <<
"MC particle collection not available in Check Plot processor" << std::endl ;
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);
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);
971 _cMCNumberRemainingSim -> fill(NMCRemainingSim);
973 _cMCEnergySumSim -> fill(energySim);
992 int numberSimHits = 0;
993 float energySimSum = 0.0;
996 const std::vector< std::string >* strVec = evt->getCollectionNames() ;
997 std::vector< std::string >::const_iterator name ;
999 for( name = strVec->begin() ; name != strVec->end() ; name++) {
1001 LCCollection* col = evt->getCollection( *name ) ;
1003 if ( col->getTypeName() == LCIO::SIMCALORIMETERHIT ) {
1007 int nSimHits = col->getNumberOfElements();
1009 numberSimHits += nSimHits;
1011 for(
int i = 0; i < nSimHits; ++i){
1013 SimCalorimeterHit* SimCaloHit =
dynamic_cast<SimCalorimeterHit*
>(col->getElementAt(i));
1015 float simEnergy = SimCaloHit->getEnergy();
1019 #ifdef MARLIN_USE_AIDA
1020 _cEnergySimCaloHits->fill(simEnergy);
1023 energySimSum += simEnergy;
1034 #ifdef MARLIN_USE_AIDA
1035 _cNumberSimCaloHits->fill(numberSimHits);
1036 _cEnergySimCaloHitsSum->fill(energySimSum);
1040 catch(DataNotAvailableException &
e){std::cout <<
"SimCalorimeterHit collection not available in Check Plot processor" << std::endl; };
1057 float energySum = 0.0;
1060 const std::vector< std::string >* strVec = evt->getCollectionNames() ;
1061 std::vector< std::string >::const_iterator name ;
1063 for( name = strVec->begin() ; name != strVec->end() ; name++) {
1065 LCCollection* col = evt->getCollection( *name ) ;
1067 if ( col->getTypeName() == LCIO::CALORIMETERHIT ) {
1071 int nHits = col->getNumberOfElements();
1073 numberHits += nHits;
1075 for(
int i = 0; i < nHits; ++i){
1077 CalorimeterHit* CaloHit =
dynamic_cast<CalorimeterHit*
>(col->getElementAt(i));
1079 float Energy = CaloHit->getEnergy();
1081 if (Energy >
_ECut) {
1083 #ifdef MARLIN_USE_AIDA
1084 _cEnergyCaloHits->fill(Energy);
1087 energySum += Energy;
1098 #ifdef MARLIN_USE_AIDA
1099 _cNumberCaloHits->fill(numberHits);
1100 _cEnergyCaloHitsSum->fill(energySum);
1113 catch(DataNotAvailableException &
e){std::cout <<
"CalorimeterHit collection not available in Check Plot processor" << std::endl; };
1129 std::vector< std::string >::const_iterator iter;
1130 const std::vector< std::string >* ColNames = evt->getCollectionNames();
1132 for( iter = ColNames->begin() ; iter != ColNames->end() ; iter++) {
1134 LCCollection* col = evt->getCollection( *iter ) ;
1136 if ( (col->getTypeName() == LCIO::TRACK) && (*iter ==
_colNameTracks) ) {
1138 int nTracks = col->getNumberOfElements();
1140 #ifdef MARLIN_USE_AIDA
1141 _cNumberTracks->fill(nTracks);
1144 for(
int j=0; j<nTracks; ++j){
1146 Track* track =
dynamic_cast<Track*
>(col->getElementAt(j));
1148 int nTrackerHits = track->getTrackerHits().size();
1150 #ifdef MARLIN_USE_AIDA
1151 _cNumberTrackerHitsPerTrack->fill(nTrackerHits);
1154 const double absP = MarlinUtil::getAbsMomentum(track,
_bField);
1156 #ifdef MARLIN_USE_AIDA
1157 _cMomentumTracks->fill(absP);
1164 LCRelationNavigator* navTracks =
new LCRelationNavigator(LCRcolTracks);
1165 const LCObjectVec& relMCParticlesToTrack = navTracks->getRelatedToObjects(track);
1167 int nOfRelatedMCParticles = relMCParticlesToTrack.size();
1169 #ifdef MARLIN_USE_AIDA
1170 _cNumberMCParticlesPerTrack->fill(nOfRelatedMCParticles);
1174 catch(DataNotAvailableException &
e){std::cout <<
"no valid LCRelation between track and MC particle in event " <<
_nEvt << std::endl; };
1183 catch(DataNotAvailableException &
e){std::cout <<
"no valid track collection available in event " <<
_nEvt << std::endl; };
1200 double energyReco = 0.0;
1201 double energyRecoCh = 0.0;
1202 double energyRecoN = 0.0;
1207 int nReconstructedParticles = 0;
1208 double energySumReconstructedParticles = 0.0;
1210 std::vector< std::string >::const_iterator iter;
1211 const std::vector< std::string >* ColNames = evt->getCollectionNames();
1213 for( iter = ColNames->begin() ; iter != ColNames->end() ; iter++) {
1215 LCCollection* col = evt->getCollection( *iter ) ;
1219 nReconstructedParticles += col->getNumberOfElements();
1221 for(
int j=0; j<nReconstructedParticles; ++j){
1223 ReconstructedParticle* recoParticle =
dynamic_cast<ReconstructedParticle*
>(col->getElementAt(j));
1225 double energyReconstructedParticle = recoParticle->getEnergy();
1227 energySumReconstructedParticles += energyReconstructedParticle;
1229 #ifdef MARLIN_USE_AIDA
1230 _cEnergyReconstructedParticles->fill(energyReconstructedParticle);
1234 if ( (recoParticle->getTracks().size()) > 0 ) {
1237 energyRecoCh += energyReconstructedParticle;
1243 energyRecoN += energyReconstructedParticle;
1253 #ifdef MARLIN_USE_AIDA
1254 _cNumberReconstructedParticles->fill(nReconstructedParticles);
1255 _cEnergySumReconstructedParticles->fill(energySumReconstructedParticles);
1258 nReco = nReconstructedParticles;
1259 energyReco = energySumReconstructedParticles;
1262 catch(DataNotAvailableException &
e){std::cout <<
"no valid reconstructed particle collection available in event " <<
_nEvt << std::endl; };
int _fillComparisonMCReco
CLHEP::Hep3Vector Vector3D
void fillCaloHitCheckPlots(LCEvent *evt)
void fillMCGenCheckPlots(LCEvent *evt)
void fillMCSimCheckPlots(LCEvent *evt)
void fillTrackCheckPlots(LCEvent *evt)
This processor provides check plots.
virtual void processEvent(LCEvent *evt)
virtual void processRunHeader(LCRunHeader *run)
Real hypot(const Real &a, const Real &b)
void fillReconstructedParticlesCheckPlots(LCEvent *evt)
std::string _colNameReconstructedParticles
void fillSimCaloHitCheckPlots(LCEvent *evt)
int _fillReconstructedParticles
std::string _colNameRelationTrackToMCP
virtual void check(LCEvent *evt)
void fillComparisonMCRecoPlots()
std::string _colNameTracks