54 #include <TCollection.h>
55 #include <TDirectory.h>
58 #ifdef CEXMC_USE_ROOTQT
60 #include <QApplication>
79 const G4double CexmcHistoBeamMomentumMin( 0.0 *
GeV );
80 const G4double CexmcHistoBeamMomentumMax( 1.0 *
GeV );
81 const G4double CexmcHistoBeamMomentumResolution( 0.5 *
MeV );
82 const G4double CexmcHistoTPResolution( 0.1 *
cm );
83 const G4double CexmcHistoTPSafetyArea( 1.0 *
cm );
84 const G4double CexmcHistoMassResolution( 1.0 *
MeV );
86 const G4double CexmcHistoEnergyResolution( 1.0 *
MeV );
87 const G4double CexmcHistoMissEnergyMin( -0.1 *
GeV );
88 const G4double CexmcHistoMissEnergyMax( 0.2 *
GeV );
89 const G4double CexmcHistoMissEnergyResolution( 0.2 *
MeV );
90 const G4double CexmcHistoAngularResolution( 0.5 );
91 const G4double CexmcHistoAngularCResolution( 0.001 );
92 const G4int CexmcHistoCanvasWidth( 800 );
93 const G4int CexmcHistoCanvasHeight( 600 );
100 CexmcHistoManager * CexmcHistoManager::Instance(
void )
109 void CexmcHistoManager::Destroy(
void )
116 CexmcHistoManager::CexmcHistoManager() : outFile( NULL ),
117 isInitialized( false ), opName(
"" ), nopName(
"" ), opMass( 0. ),
118 nopMass( 0. ), verboseLevel( 0 ),
119 #ifdef CEXMC_USE_ROOTQT
124 for (
int i( 0 ); i < CexmcHistoType_SIZE; ++i )
126 histos.insert( CexmcHistoPair( CexmcHistoType( i ),
127 CexmcHistoVector() ) );
130 messenger =
new CexmcHistoManagerMessenger(
this );
134 CexmcHistoManager::~CexmcHistoManager()
144 #ifdef CEXMC_USE_ROOTQT
151 void CexmcHistoManager::AddHisto(
const CexmcHistoData & data,
160 if ( data.isARHisto )
164 fullName +=
"_arrec";
165 rangeTypeLabel =
"rec";
169 fullName +=
"_arreal";
170 rangeTypeLabel =
"real";
174 switch ( data.triggerType )
178 decorTriggerTypeLabel =
" --tpt--";
179 fullTitle += decorTriggerTypeLabel;
180 triggerTypeLabel =
"tpt";
184 decorTriggerTypeLabel =
" --edt--";
185 fullTitle += decorTriggerTypeLabel;
186 triggerTypeLabel =
"edt";
190 decorTriggerTypeLabel =
" --rt--";
191 fullTitle += decorTriggerTypeLabel;
192 triggerTypeLabel =
"rt";
198 CexmcHistosMap::iterator found( histos.find( data.type ) );
200 if ( found == histos.end() )
203 CexmcHistoVector & histoVector( found->second );
205 if ( data.isARHisto )
211 dirOk = gDirectory->Get( fullName ) != NULL;
214 dirOk = ( gDirectory->mkdir( fullName, fullTitle ) != NULL );
217 gDirectory->cd( fullName );
220 std::ostringstream histoName;
221 std::ostringstream histoTitle;
222 histoName << data.name <<
"_r" << aRange.
index + 1 << rangeTypeLabel <<
223 "_" << triggerTypeLabel;
224 histoTitle << data.title <<
" {range " << aRange.
index + 1 <<
225 rangeTypeLabel <<
" [" << std::fixed <<
226 std::setprecision( 4 ) << aRange.
top <<
", " <<
227 aRange.
bottom <<
")}" << decorTriggerTypeLabel;
228 CreateHisto( histoVector, data.impl, histoName.str(), histoTitle.str(),
234 gDirectory->cd(
".." );
239 CreateHisto( histoVector, data.impl, fullName, fullTitle, data.axes );
244 void CexmcHistoManager::CreateHisto( CexmcHistoVector & histoVector,
246 const G4String & title,
const CexmcHistoAxes & axes )
253 histo =
new TH1F( name, title, axes.at( 0 ).nBins,
254 axes.at( 0 ).nBinsMin, axes.at( 0 ).nBinsMax );
257 histo =
new TH2F( name, title, axes.at( 0 ).nBins,
258 axes.at( 0 ).nBinsMin, axes.at( 0 ).nBinsMax,
259 axes.at( 1 ).nBins, axes.at( 1 ).nBinsMin,
260 axes.at( 1 ).nBinsMax );
263 histo =
new TH3F( name, title, axes.at( 0 ).nBins,
264 axes.at( 0 ).nBinsMin, axes.at( 0 ).nBinsMax,
265 axes.at( 1 ).nBins, axes.at( 1 ).nBinsMin,
266 axes.at( 1 ).nBinsMax, axes.at( 2 ).nBins,
267 axes.at( 2 ).nBinsMin, axes.at( 2 ).nBinsMax );
274 histoVector.push_back( histo );
287 if ( ! physicsManager )
291 GetProductionModel() );
293 if ( ! productionModel )
297 productionModel->GetOutputParticle() );
299 productionModel->GetNucleusOutputParticle() );
301 if ( ! outputParticle || ! nucleusOutputParticle )
304 opName = outputParticle->GetParticleName();
305 nopName = nucleusOutputParticle->GetParticleName();
306 opMass = outputParticle->GetPDGMass();
307 nopMass = nucleusOutputParticle->GetPDGMass();
318 if ( runManager->ProjectIsSaved() )
320 G4String projectsDir( runManager->GetProjectsDir() );
321 G4String resultsFile( projectsDir +
"/" + runManager->GetProjectId() +
323 outFile =
new TFile( resultsFile,
"recreate" );
326 const CexmcSetup * setup( static_cast< const CexmcSetup * >(
327 runManager->GetUserDetectorConstruction() ) );
336 nBinsMinX = CexmcHistoBeamMomentumMin;
337 nBinsMaxX = CexmcHistoBeamMomentumMax;
338 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) /
339 CexmcHistoBeamMomentumResolution );
340 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
341 AddHisto( CexmcHistoData( CexmcMomentumBP_TPT_Histo, Cexmc_TH1F,
false,
342 false,
CexmcTPT,
"mombp",
"Beam momentum at the monitor", axes ) );
343 AddHisto( CexmcHistoData( CexmcMomentumBP_RT_Histo, Cexmc_TH1F,
false,
344 false,
CexmcRT,
"mombp",
"Beam momentum at the monitor", axes ) );
345 if ( verboseLevel > 0 )
347 AddHisto( CexmcHistoData( CexmcMomentumIP_TPT_Histo, Cexmc_TH1F,
false,
348 false,
CexmcTPT,
"momip",
"Momentum of the incident particle",
352 G4Box * box( dynamic_cast< G4Box * >( lVolume->GetSolid() ) );
358 G4double height( box->GetYHalfLength() * 2 );
360 G4double halfHeight( height / 2 + CexmcHistoTPSafetyArea );
362 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
363 nBinsY =
Int_t( halfHeight * 2 / CexmcHistoTPResolution );
365 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
366 axes.push_back( CexmcHistoAxisData( nBinsY, -halfHeight, halfHeight ) );
367 AddHisto( CexmcHistoData( CexmcTPInMonitor_TPT_Histo, Cexmc_TH2F,
false,
368 false,
CexmcTPT,
"tpmon",
"Track points (mon)", axes ) );
371 G4Tubs * tube( dynamic_cast< G4Tubs * >( lVolume->GetSolid() ) );
376 G4double radius( tube->GetOuterRadius() );
377 height = tube->GetZHalfLength() * 2;
378 halfWidth = radius + CexmcHistoTPSafetyArea;
379 halfHeight = height / 2 + CexmcHistoTPSafetyArea;
381 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
382 nBinsY =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
383 Int_t nBinsZ(
Int_t( halfHeight * 2 / CexmcHistoTPResolution ) );
385 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
386 axes.push_back( CexmcHistoAxisData( nBinsY, -halfWidth, halfWidth ) );
387 axes.push_back( CexmcHistoAxisData( nBinsZ, -halfHeight, halfHeight ) );
388 AddHisto( CexmcHistoData( CexmcTPInTarget_TPT_Histo, Cexmc_TH3F,
false,
389 false,
CexmcTPT,
"tptar",
"Track points (tar)", axes ) );
390 AddHisto( CexmcHistoData( CexmcTPInTarget_RT_Histo, Cexmc_TH3F,
false,
391 false,
CexmcRT,
"tptar",
"Track points (tar)", axes ) );
393 title =
"Reconstructed masses (" + nopName +
" vs. " + opName +
")";
394 nBinsMinX = opMass / 2;
395 nBinsMaxX = opMass + opMass / 2;
396 nBinsMinY = nopMass / 2;
397 nBinsMaxY = nopMass + nopMass / 2;
398 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoMassResolution );
399 nBinsY =
Int_t( ( nBinsMaxY - nBinsMinY ) / CexmcHistoMassResolution );
401 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
402 axes.push_back( CexmcHistoAxisData( nBinsY, nBinsMinY, nBinsMaxY ) );
403 AddHisto( CexmcHistoData( CexmcRecMasses_EDT_Histo, Cexmc_TH2F,
false,
404 false,
CexmcEDT,
"recmasses", title, axes ) );
405 AddHisto( CexmcHistoData( CexmcRecMasses_RT_Histo, Cexmc_TH2F,
false,
406 false,
CexmcRT,
"recmasses", title, axes ) );
409 nBinsMaxX = CexmcHistoEnergyMax;
411 nBinsMaxY = CexmcHistoEnergyMax;
412 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoEnergyResolution );
413 nBinsY =
Int_t( ( nBinsMaxY - nBinsMinY ) / CexmcHistoEnergyResolution );
415 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
416 axes.push_back( CexmcHistoAxisData( nBinsY, nBinsMinY, nBinsMaxY ) );
417 AddHisto( CexmcHistoData( CexmcAbsorbedEnergy_EDT_Histo, Cexmc_TH2F,
false,
418 false,
CexmcEDT,
"ae",
"Absorbed energy (rc vs. lc)", axes ) );
419 AddHisto( CexmcHistoData( CexmcAbsorbedEnergy_RT_Histo, Cexmc_TH2F,
false,
420 false,
CexmcRT,
"ae",
"Absorbed energy (rc vs. lc)", axes ) );
422 SetupARHistos( runManager->GetPhysicsManager()->GetProductionModel()->
423 GetAngularRanges() );
431 TIter objs( gDirectory->GetList() );
432 TObject * obj( NULL );
434 while ( ( obj = ( TObject * )objs() ) )
436 TString
name( obj->GetName() );
440 if ( obj->IsFolder() && ( name.Contains( TString(
"_arreal_" ) ) ||
441 name.Contains( TString(
"_arrec_" ) ) ) )
443 gDirectory->cd( name );
444 gDirectory->DeleteAll();
445 gDirectory->cd(
".." );
450 if ( name.Contains( TRegexp(
"_r[0-9]+" ) ) )
452 gDirectory->Remove( obj );
457 for ( CexmcHistosMap::iterator k( histos.begin() ); k != histos.end();
460 if ( k->second.empty() )
463 if ( k->first >= CexmcHistoType_ARReal_START &&
464 k->first <= CexmcHistoType_ARReal_END )
470 for ( CexmcAngularRangeList::const_iterator k( aRanges.begin() );
471 k != aRanges.end(); ++k )
486 title =
"Reconstructed mass of " + opName;
487 nBinsMinX = opMass / 2;
488 nBinsMaxX = opMass + opMass / 2;
489 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoMassResolution );
490 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
491 AddHisto( CexmcHistoData( CexmcRecMassOP_ARReal_RT_Histo, Cexmc_TH1F,
true,
492 false,
CexmcRT,
"recmassop", title, axes ), aRange );
494 title =
"Reconstructed mass of " + nopName;
495 nBinsMinX = nopMass / 2;
496 nBinsMaxX = nopMass + nopMass / 2;
497 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoMassResolution );
499 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
500 AddHisto( CexmcHistoData( CexmcRecMassNOP_ARReal_RT_Histo, Cexmc_TH1F,
true,
501 false,
CexmcRT,
"recmassnop", title, axes ), aRange );
504 const CexmcSetup * setup( static_cast< const CexmcSetup * >(
505 runManager->GetUserDetectorConstruction() ) );
512 G4Box * box( dynamic_cast< G4Box * >( lVolume->GetSolid() ) );
518 G4double height( box->GetYHalfLength() * 2 );
520 G4double halfHeight( height / 2 + CexmcHistoTPSafetyArea );
522 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
523 Int_t nBinsY(
Int_t( halfHeight * 2 / CexmcHistoTPResolution ) );
525 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
526 axes.push_back( CexmcHistoAxisData( nBinsY, -halfHeight, halfHeight ) );
531 AddHisto( CexmcHistoData( CexmcOPDPAtLeftCalorimeter_ARReal_EDT_Histo,
532 Cexmc_TH2F,
true,
false,
CexmcEDT,
"opdpcl",
533 "Gamma position on the surface (lc)", axes ), aRange );
534 AddHisto( CexmcHistoData( CexmcOPDPAtRightCalorimeter_ARReal_EDT_Histo,
535 Cexmc_TH2F,
true,
false,
CexmcEDT,
"opdpcr",
536 "Gamma position on the surface (rc)", axes ), aRange );
537 AddHisto( CexmcHistoData( CexmcOPDPAtLeftCalorimeter_ARReal_RT_Histo,
538 Cexmc_TH2F,
true,
false,
CexmcRT,
"opdpcl",
539 "Gamma position on the surface (lc)", axes ), aRange );
540 AddHisto( CexmcHistoData( CexmcOPDPAtRightCalorimeter_ARReal_RT_Histo,
541 Cexmc_TH2F,
true,
false,
CexmcRT,
"opdpcr",
542 "Gamma position on the surface (rc)", axes ), aRange );
543 AddHisto( CexmcHistoData( CexmcRecOPDPAtLeftCalorimeter_ARReal_EDT_Histo,
544 Cexmc_TH2F,
true,
false,
CexmcEDT,
"recopdpcl",
545 "Reconstructed gamma position on the surface (lc)", axes ), aRange );
546 AddHisto( CexmcHistoData( CexmcRecOPDPAtRightCalorimeter_ARReal_EDT_Histo,
547 Cexmc_TH2F,
true,
false,
CexmcEDT,
"recopdpcr",
548 "Reconstructed gamma position on the surface (rc)", axes ), aRange );
549 AddHisto( CexmcHistoData( CexmcRecOPDPAtLeftCalorimeter_ARReal_RT_Histo,
550 Cexmc_TH2F,
true,
false,
CexmcRT,
"recopdpcl",
551 "Reconstructed gamma position on the surface (lc)", axes ), aRange );
552 AddHisto( CexmcHistoData( CexmcRecOPDPAtRightCalorimeter_ARReal_RT_Histo,
553 Cexmc_TH2F,
true,
false,
CexmcRT,
"recopdpcr",
554 "Reconstructed gamma position on the surface (rc)", axes ), aRange );
557 nBinsMaxX = CexmcHistoEnergyMax;
558 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoEnergyResolution );
560 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
561 AddHisto( CexmcHistoData( CexmcKinEnAtLeftCalorimeter_ARReal_TPT_Histo,
562 Cexmc_TH1F,
true,
false,
CexmcTPT,
"kecl",
563 "Kinetic energy of gamma (lc)", axes ), aRange );
564 AddHisto( CexmcHistoData( CexmcKinEnAtRightCalorimeter_ARReal_TPT_Histo,
565 Cexmc_TH1F,
true,
false,
CexmcTPT,
"kecr",
566 "Kinetic energy of gamma (rc)", axes ), aRange );
567 AddHisto( CexmcHistoData( CexmcKinEnAtLeftCalorimeter_ARReal_RT_Histo,
568 Cexmc_TH1F,
true,
false,
CexmcRT,
"kecl",
569 "Kinetic energy of gamma (lc)", axes ), aRange );
570 AddHisto( CexmcHistoData( CexmcKinEnAtRightCalorimeter_ARReal_RT_Histo,
571 Cexmc_TH1F,
true,
false,
CexmcRT,
"kecr",
572 "Kinetic energy of gamma (rc)", axes ), aRange );
573 AddHisto( CexmcHistoData( CexmcAbsEnInLeftCalorimeter_ARReal_EDT_Histo,
574 Cexmc_TH1F,
true,
false,
CexmcEDT,
"aecl",
575 "Absorbed energy (lc)", axes ), aRange );
576 AddHisto( CexmcHistoData( CexmcAbsEnInRightCalorimeter_ARReal_EDT_Histo,
577 Cexmc_TH1F,
true,
false,
CexmcEDT,
"aecr",
578 "Absorbed energy (rc)", axes ), aRange );
579 AddHisto( CexmcHistoData( CexmcAbsEnInLeftCalorimeter_ARReal_RT_Histo,
580 Cexmc_TH1F,
true,
false,
CexmcRT,
"aecl",
581 "Absorbed energy (lc)", axes ), aRange );
582 AddHisto( CexmcHistoData( CexmcAbsEnInRightCalorimeter_ARReal_RT_Histo,
583 Cexmc_TH1F,
true,
false,
CexmcRT,
"aecr",
584 "Absorbed energy (rc)", axes ), aRange );
586 nBinsMinX = CexmcHistoMissEnergyMin;
587 nBinsMaxX = CexmcHistoMissEnergyMax;
588 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) /
589 CexmcHistoMissEnergyResolution );
591 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
592 AddHisto( CexmcHistoData( CexmcMissEnFromLeftCalorimeter_ARReal_RT_Histo,
593 Cexmc_TH1F,
true,
false,
CexmcRT,
"mecl",
594 "Missing energy (lc)", axes ), aRange );
595 AddHisto( CexmcHistoData( CexmcMissEnFromRightCalorimeter_ARReal_RT_Histo,
596 Cexmc_TH1F,
true,
false,
CexmcRT,
"mecr",
597 "Missing energy (rc)", axes ), aRange );
599 title =
"Kinetic energy of newborn " + opName +
" (lab)";
601 nBinsMaxX = CexmcHistoEnergyMax;
602 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoEnergyResolution );
604 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
605 AddHisto( CexmcHistoData( CexmcKinEnOP_LAB_ARReal_TPT_Histo,
606 Cexmc_TH1F,
true,
false,
CexmcTPT,
"keop_lab", title, axes ), aRange );
607 AddHisto( CexmcHistoData( CexmcKinEnOP_LAB_ARReal_RT_Histo,
608 Cexmc_TH1F,
true,
false,
CexmcRT,
"keop_lab", title, axes ), aRange );
610 title =
"Angle of newborn " + opName +
" (scm)";
613 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoAngularCResolution );
615 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
616 AddHisto( CexmcHistoData( CexmcAngleOP_SCM_ARReal_TPT_Histo,
617 Cexmc_TH1F,
true,
false,
CexmcTPT,
"aop_scm", title, axes ), aRange );
618 AddHisto( CexmcHistoData( CexmcAngleOP_SCM_ARReal_RT_Histo,
619 Cexmc_TH1F,
true,
false,
CexmcRT,
"aop_scm", title, axes ), aRange );
621 title =
"Reconstruced angle of newborn " + opName +
" (scm)";
622 AddHisto( CexmcHistoData( CexmcRecAngleOP_SCM_ARReal_RT_Histo,
623 Cexmc_TH1F,
true,
false,
CexmcRT,
"recaop_scm", title, axes ), aRange );
625 title =
"Real - reconstruced angle of newborn " + opName +
" (scm)";
626 AddHisto( CexmcHistoData( CexmcDiffAngleOP_SCM_ARReal_RT_Histo,
627 Cexmc_TH1F,
true,
false,
CexmcRT,
"diffaop_scm", title, axes ),
632 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoAngularResolution );
634 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
635 AddHisto( CexmcHistoData( CexmcOpenAngle_ARReal_TPT_Histo,
636 Cexmc_TH1F,
true,
false,
CexmcTPT,
"oa",
637 "Open angle between the gammas", axes ), aRange );
638 AddHisto( CexmcHistoData( CexmcOpenAngle_ARReal_RT_Histo,
639 Cexmc_TH1F,
true,
false,
CexmcRT,
"oa",
640 "Open angle between the gammas", axes ), aRange );
641 AddHisto( CexmcHistoData( CexmcRecOpenAngle_ARReal_RT_Histo,
642 Cexmc_TH1F,
true,
false,
CexmcRT,
"recoa",
643 "Reconstructed open angle between the gammas", axes ), aRange );
647 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoAngularResolution );
649 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
650 AddHisto( CexmcHistoData( CexmcDiffOpenAngle_ARReal_RT_Histo,
651 Cexmc_TH1F,
true,
false,
CexmcRT,
"diffoa",
652 "Real - reconstructed open angle between the gammas", axes ), aRange );
655 G4Tubs * tube( dynamic_cast< G4Tubs * >( lVolume->GetSolid() ) );
660 G4double radius( tube->GetOuterRadius() );
661 height = tube->GetZHalfLength() * 2;
662 halfWidth = radius + CexmcHistoTPSafetyArea;
663 halfHeight = height / 2 + CexmcHistoTPSafetyArea;
665 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
666 nBinsY =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
667 Int_t nBinsZ(
Int_t( halfHeight * 2 / CexmcHistoTPResolution ) );
669 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
670 axes.push_back( CexmcHistoAxisData( nBinsY, -halfWidth, halfWidth ) );
671 axes.push_back( CexmcHistoAxisData( nBinsZ, -halfHeight, halfHeight ) );
672 AddHisto( CexmcHistoData( CexmcTPInTarget_ARReal_TPT_Histo, Cexmc_TH3F,
673 true,
false,
CexmcTPT,
"tptar",
"Track points (tar)", axes ), aRange );
674 AddHisto( CexmcHistoData( CexmcTPInTarget_ARReal_RT_Histo, Cexmc_TH3F,
675 true,
false,
CexmcRT,
"tptar",
"Track points (tar)", axes ), aRange );
682 CexmcHistosMap::iterator found( histos.find( histoType ) );
683 if ( found == histos.end() || histos[ histoType ].size() <= index )
686 histos[ histoType ][ index ]->Fill( x );
693 CexmcHistosMap::iterator found( histos.find( histoType ) );
694 if ( found == histos.end() || histos[ histoType ].size() <= index )
699 histos[ histoType ][ index ]->Fill( x, y );
706 CexmcHistosMap::iterator found( histos.find( histoType ) );
707 if ( found == histos.end() || histos[ histoType ].size() <= index )
712 TH3 * histo( static_cast< TH3 * >( histos[ histoType ][ index ] ) );
714 histo->Fill( x, y, z );
721 CexmcHistosMap::iterator found( histos.find( histoType ) );
722 if ( found == histos.end() || histos[ histoType ].size() <= index )
727 Double_t curValue( histos[ histoType ][ index ]->GetBinContent(
729 histos[ histoType ][ index ]->SetBinContent( binX, binY,
730 curValue + value /
GeV );
734 void CexmcHistoManager::List(
void )
const
742 TObject * histo( gDirectory->FindObjectAny( value.c_str() ) );
746 G4cout <<
"Histogram '" << value <<
"' was not found" <<
G4endl;
750 histo->Print(
"range" );
754 #ifdef CEXMC_USE_ROOTQT
756 void CexmcHistoManager::Draw(
const G4String & histoName,
761 if ( ! runManager->AreLiveHistogramsEnabled() )
763 G4cout <<
"Live histograms option is disabled" <<
G4endl;
767 TObject * histo( gDirectory->FindObjectAny( histoName ) );
771 G4cout <<
"Histogram '" << histoName <<
"' was not found" <<
G4endl;
778 QFont defaultAppFont( QApplication::font() );
779 rootCanvas =
new CexmcHistoWidget;
780 QApplication::setFont( defaultAppFont );
781 rootCanvas->resize( CexmcHistoCanvasWidth, CexmcHistoCanvasHeight );
782 rootCanvas->GetCanvas()->cd();
785 histo->Draw( histoDrawOptions );
787 rootCanvas->GetCanvas()->Update();
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetRunManager()
std::vector< CexmcAngularRange > CexmcAngularRangeList
static MCTruthManager * instance
G4bool isInitialized()
Check if the generator is initialized.
void Add(G4int Elements, T *To, T *A1, T *A2=NULL)
Add two arrays together.
void Print(G4Element &ele)