54 #include <TCollection.h>
55 #include <TDirectory.h>
58 #ifdef CEXMC_USE_ROOTQT
60 #include <QApplication>
78 const G4double CexmcHistoBeamMomentumMin( 0.0 *
GeV );
79 const G4double CexmcHistoBeamMomentumMax( 1.0 *
GeV );
80 const G4double CexmcHistoBeamMomentumResolution( 0.5 *
MeV );
81 const G4double CexmcHistoTPResolution( 0.1 *
cm );
82 const G4double CexmcHistoTPSafetyArea( 1.0 *
cm );
83 const G4double CexmcHistoMassResolution( 1.0 *
MeV );
85 const G4double CexmcHistoEnergyResolution( 1.0 *
MeV );
86 const G4double CexmcHistoMissEnergyMin( -0.1 *
GeV );
87 const G4double CexmcHistoMissEnergyMax( 0.2 *
GeV );
88 const G4double CexmcHistoMissEnergyResolution( 0.2 *
MeV );
89 const G4double CexmcHistoAngularResolution( 0.5 );
90 const G4double CexmcHistoAngularCResolution( 0.001 );
91 const G4int CexmcHistoCanvasWidth( 800 );
92 const G4int CexmcHistoCanvasHeight( 600 );
96 CexmcHistoManager * CexmcHistoManager::instance( NULL );
99 CexmcHistoManager * CexmcHistoManager::Instance(
void )
101 if ( instance == NULL )
102 instance =
new CexmcHistoManager;
108 void CexmcHistoManager::Destroy(
void )
115 CexmcHistoManager::CexmcHistoManager() :
outFile( NULL ),
116 isInitialized( false ), opName(
"" ), nopName(
"" ), opMass( 0. ),
117 nopMass( 0. ), verboseLevel( 0 ),
118 #ifdef CEXMC_USE_ROOTQT
123 for (
int i( 0 ); i < CexmcHistoType_SIZE; ++i )
125 histos.insert( CexmcHistoPair( CexmcHistoType( i ),
126 CexmcHistoVector() ) );
129 messenger =
new CexmcHistoManagerMessenger(
this );
133 CexmcHistoManager::~CexmcHistoManager()
143 #ifdef CEXMC_USE_ROOTQT
150 void CexmcHistoManager::AddHisto(
const CexmcHistoData &
data,
159 if ( data.isARHisto )
163 fullName +=
"_arrec";
164 rangeTypeLabel =
"rec";
168 fullName +=
"_arreal";
169 rangeTypeLabel =
"real";
173 switch ( data.triggerType )
177 decorTriggerTypeLabel =
" --tpt--";
178 fullTitle += decorTriggerTypeLabel;
179 triggerTypeLabel =
"tpt";
183 decorTriggerTypeLabel =
" --edt--";
184 fullTitle += decorTriggerTypeLabel;
185 triggerTypeLabel =
"edt";
189 decorTriggerTypeLabel =
" --rt--";
190 fullTitle += decorTriggerTypeLabel;
191 triggerTypeLabel =
"rt";
197 CexmcHistosMap::iterator found( histos.find( data.type ) );
199 if ( found == histos.end() )
202 CexmcHistoVector & histoVector( found->second );
204 if ( data.isARHisto )
210 dirOk = gDirectory->Get( fullName ) != NULL;
213 dirOk = ( gDirectory->mkdir( fullName, fullTitle ) != NULL );
216 gDirectory->cd( fullName );
219 std::ostringstream histoName;
220 std::ostringstream histoTitle;
221 histoName << data.name <<
"_r" << aRange.
index + 1 << rangeTypeLabel <<
222 "_" << triggerTypeLabel;
223 histoTitle << data.title <<
" {range " << aRange.
index + 1 <<
224 rangeTypeLabel <<
" [" << std::fixed <<
225 std::setprecision( 4 ) << aRange.
top <<
", " <<
226 aRange.
bottom <<
")}" << decorTriggerTypeLabel;
227 CreateHisto( histoVector, data.impl, histoName.str(), histoTitle.str(),
233 gDirectory->cd(
".." );
238 CreateHisto( histoVector, data.impl, fullName, fullTitle, data.axes );
243 void CexmcHistoManager::CreateHisto( CexmcHistoVector & histoVector,
252 histo =
new TH1F( name, title, axes.at( 0 ).nBins,
253 axes.at( 0 ).nBinsMin, axes.at( 0 ).nBinsMax );
256 histo =
new TH2F( name, title, axes.at( 0 ).nBins,
257 axes.at( 0 ).nBinsMin, axes.at( 0 ).nBinsMax,
258 axes.at( 1 ).nBins, axes.at( 1 ).nBinsMin,
259 axes.at( 1 ).nBinsMax );
262 histo =
new TH3F( name, title, axes.at( 0 ).nBins,
263 axes.at( 0 ).nBinsMin, axes.at( 0 ).nBinsMax,
264 axes.at( 1 ).nBins, axes.at( 1 ).nBinsMin,
265 axes.at( 1 ).nBinsMax, axes.at( 2 ).nBins,
266 axes.at( 2 ).nBinsMin, axes.at( 2 ).nBinsMax );
273 histoVector.push_back( histo );
286 if ( ! physicsManager )
290 GetProductionModel() );
292 if ( ! productionModel )
296 productionModel->GetOutputParticle() );
298 productionModel->GetNucleusOutputParticle() );
300 if ( ! outputParticle || ! nucleusOutputParticle )
303 opName = outputParticle->GetParticleName();
304 nopName = nucleusOutputParticle->GetParticleName();
305 opMass = outputParticle->GetPDGMass();
306 nopMass = nucleusOutputParticle->GetPDGMass();
317 if ( runManager->ProjectIsSaved() )
319 G4String projectsDir( runManager->GetProjectsDir() );
320 G4String resultsFile( projectsDir +
"/" + runManager->GetProjectId() +
322 outFile =
new TFile( resultsFile,
"recreate" );
325 const CexmcSetup * setup( static_cast< const CexmcSetup * >(
326 runManager->GetUserDetectorConstruction() ) );
335 nBinsMinX = CexmcHistoBeamMomentumMin;
336 nBinsMaxX = CexmcHistoBeamMomentumMax;
337 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) /
338 CexmcHistoBeamMomentumResolution );
339 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
340 AddHisto( CexmcHistoData( CexmcMomentumBP_TPT_Histo, Cexmc_TH1F,
false,
341 false,
CexmcTPT,
"mombp",
"Beam momentum at the monitor", axes ) );
342 AddHisto( CexmcHistoData( CexmcMomentumBP_RT_Histo, Cexmc_TH1F,
false,
343 false,
CexmcRT,
"mombp",
"Beam momentum at the monitor", axes ) );
344 if ( verboseLevel > 0 )
346 AddHisto( CexmcHistoData( CexmcMomentumIP_TPT_Histo, Cexmc_TH1F,
false,
347 false,
CexmcTPT,
"momip",
"Momentum of the incident particle",
351 G4Box *
box( dynamic_cast< G4Box * >( lVolume->GetSolid() ) );
359 G4double halfHeight( height / 2 + CexmcHistoTPSafetyArea );
361 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
362 nBinsY =
Int_t( halfHeight * 2 / CexmcHistoTPResolution );
364 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
365 axes.push_back( CexmcHistoAxisData( nBinsY, -halfHeight, halfHeight ) );
366 AddHisto( CexmcHistoData( CexmcTPInMonitor_TPT_Histo, Cexmc_TH2F,
false,
367 false,
CexmcTPT,
"tpmon",
"Track points (mon)", axes ) );
370 G4Tubs * tube( dynamic_cast< G4Tubs * >( lVolume->GetSolid() ) );
375 G4double radius( tube->GetOuterRadius() );
376 height = tube->GetZHalfLength() * 2;
377 halfWidth = radius + CexmcHistoTPSafetyArea;
378 halfHeight = height / 2 + CexmcHistoTPSafetyArea;
380 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
381 nBinsY =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
382 Int_t nBinsZ(
Int_t( halfHeight * 2 / CexmcHistoTPResolution ) );
384 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
385 axes.push_back( CexmcHistoAxisData( nBinsY, -halfWidth, halfWidth ) );
386 axes.push_back( CexmcHistoAxisData( nBinsZ, -halfHeight, halfHeight ) );
387 AddHisto( CexmcHistoData( CexmcTPInTarget_TPT_Histo, Cexmc_TH3F,
false,
388 false,
CexmcTPT,
"tptar",
"Track points (tar)", axes ) );
389 AddHisto( CexmcHistoData( CexmcTPInTarget_RT_Histo, Cexmc_TH3F,
false,
390 false,
CexmcRT,
"tptar",
"Track points (tar)", axes ) );
392 title =
"Reconstructed masses (" + nopName +
" vs. " + opName +
")";
393 nBinsMinX = opMass / 2;
394 nBinsMaxX = opMass + opMass / 2;
395 nBinsMinY = nopMass / 2;
396 nBinsMaxY = nopMass + nopMass / 2;
397 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoMassResolution );
398 nBinsY =
Int_t( ( nBinsMaxY - nBinsMinY ) / CexmcHistoMassResolution );
400 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
401 axes.push_back( CexmcHistoAxisData( nBinsY, nBinsMinY, nBinsMaxY ) );
402 AddHisto( CexmcHistoData( CexmcRecMasses_EDT_Histo, Cexmc_TH2F,
false,
403 false,
CexmcEDT,
"recmasses", title, axes ) );
404 AddHisto( CexmcHistoData( CexmcRecMasses_RT_Histo, Cexmc_TH2F,
false,
405 false,
CexmcRT,
"recmasses", title, axes ) );
408 nBinsMaxX = CexmcHistoEnergyMax;
410 nBinsMaxY = CexmcHistoEnergyMax;
411 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoEnergyResolution );
412 nBinsY =
Int_t( ( nBinsMaxY - nBinsMinY ) / CexmcHistoEnergyResolution );
414 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
415 axes.push_back( CexmcHistoAxisData( nBinsY, nBinsMinY, nBinsMaxY ) );
416 AddHisto( CexmcHistoData( CexmcAbsorbedEnergy_EDT_Histo, Cexmc_TH2F,
false,
417 false,
CexmcEDT,
"ae",
"Absorbed energy (rc vs. lc)", axes ) );
418 AddHisto( CexmcHistoData( CexmcAbsorbedEnergy_RT_Histo, Cexmc_TH2F,
false,
419 false,
CexmcRT,
"ae",
"Absorbed energy (rc vs. lc)", axes ) );
421 SetupARHistos( runManager->GetPhysicsManager()->GetProductionModel()->
422 GetAngularRanges() );
430 TIter objs( gDirectory->GetList() );
431 TObject * obj( NULL );
433 while ( ( obj = ( TObject * )objs() ) )
435 TString
name( obj->GetName() );
439 if ( obj->IsFolder() && ( name.Contains( TString(
"_arreal_" ) ) ||
440 name.Contains( TString(
"_arrec_" ) ) ) )
442 gDirectory->cd( name );
443 gDirectory->DeleteAll();
444 gDirectory->cd(
".." );
449 if ( name.Contains( TRegexp(
"_r[0-9]+" ) ) )
451 gDirectory->Remove( obj );
456 for ( CexmcHistosMap::iterator k( histos.begin() ); k != histos.end();
459 if ( k->second.empty() )
462 if ( k->first >= CexmcHistoType_ARReal_START &&
463 k->first <= CexmcHistoType_ARReal_END )
469 for ( CexmcAngularRangeList::const_iterator k( aRanges.begin() );
470 k != aRanges.end(); ++k )
485 title =
"Reconstructed mass of " + opName;
486 nBinsMinX = opMass / 2;
487 nBinsMaxX = opMass + opMass / 2;
488 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoMassResolution );
489 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
490 AddHisto( CexmcHistoData( CexmcRecMassOP_ARReal_RT_Histo, Cexmc_TH1F,
true,
491 false,
CexmcRT,
"recmassop", title, axes ), aRange );
493 title =
"Reconstructed mass of " + nopName;
494 nBinsMinX = nopMass / 2;
495 nBinsMaxX = nopMass + nopMass / 2;
496 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoMassResolution );
498 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
499 AddHisto( CexmcHistoData( CexmcRecMassNOP_ARReal_RT_Histo, Cexmc_TH1F,
true,
500 false,
CexmcRT,
"recmassnop", title, axes ), aRange );
503 const CexmcSetup * setup( static_cast< const CexmcSetup * >(
504 runManager->GetUserDetectorConstruction() ) );
511 G4Box *
box( dynamic_cast< G4Box * >( lVolume->GetSolid() ) );
519 G4double halfHeight( height / 2 + CexmcHistoTPSafetyArea );
521 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
522 Int_t nBinsY(
Int_t( halfHeight * 2 / CexmcHistoTPResolution ) );
524 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
525 axes.push_back( CexmcHistoAxisData( nBinsY, -halfHeight, halfHeight ) );
530 AddHisto( CexmcHistoData( CexmcOPDPAtLeftCalorimeter_ARReal_EDT_Histo,
531 Cexmc_TH2F,
true,
false,
CexmcEDT,
"opdpcl",
532 "Gamma position on the surface (lc)", axes ), aRange );
533 AddHisto( CexmcHistoData( CexmcOPDPAtRightCalorimeter_ARReal_EDT_Histo,
534 Cexmc_TH2F,
true,
false,
CexmcEDT,
"opdpcr",
535 "Gamma position on the surface (rc)", axes ), aRange );
536 AddHisto( CexmcHistoData( CexmcOPDPAtLeftCalorimeter_ARReal_RT_Histo,
537 Cexmc_TH2F,
true,
false,
CexmcRT,
"opdpcl",
538 "Gamma position on the surface (lc)", axes ), aRange );
539 AddHisto( CexmcHistoData( CexmcOPDPAtRightCalorimeter_ARReal_RT_Histo,
540 Cexmc_TH2F,
true,
false,
CexmcRT,
"opdpcr",
541 "Gamma position on the surface (rc)", axes ), aRange );
542 AddHisto( CexmcHistoData( CexmcRecOPDPAtLeftCalorimeter_ARReal_EDT_Histo,
543 Cexmc_TH2F,
true,
false,
CexmcEDT,
"recopdpcl",
544 "Reconstructed gamma position on the surface (lc)", axes ), aRange );
545 AddHisto( CexmcHistoData( CexmcRecOPDPAtRightCalorimeter_ARReal_EDT_Histo,
546 Cexmc_TH2F,
true,
false,
CexmcEDT,
"recopdpcr",
547 "Reconstructed gamma position on the surface (rc)", axes ), aRange );
548 AddHisto( CexmcHistoData( CexmcRecOPDPAtLeftCalorimeter_ARReal_RT_Histo,
549 Cexmc_TH2F,
true,
false,
CexmcRT,
"recopdpcl",
550 "Reconstructed gamma position on the surface (lc)", axes ), aRange );
551 AddHisto( CexmcHistoData( CexmcRecOPDPAtRightCalorimeter_ARReal_RT_Histo,
552 Cexmc_TH2F,
true,
false,
CexmcRT,
"recopdpcr",
553 "Reconstructed gamma position on the surface (rc)", axes ), aRange );
556 nBinsMaxX = CexmcHistoEnergyMax;
557 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoEnergyResolution );
559 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
560 AddHisto( CexmcHistoData( CexmcKinEnAtLeftCalorimeter_ARReal_TPT_Histo,
561 Cexmc_TH1F,
true,
false,
CexmcTPT,
"kecl",
562 "Kinetic energy of gamma (lc)", axes ), aRange );
563 AddHisto( CexmcHistoData( CexmcKinEnAtRightCalorimeter_ARReal_TPT_Histo,
564 Cexmc_TH1F,
true,
false,
CexmcTPT,
"kecr",
565 "Kinetic energy of gamma (rc)", axes ), aRange );
566 AddHisto( CexmcHistoData( CexmcKinEnAtLeftCalorimeter_ARReal_RT_Histo,
567 Cexmc_TH1F,
true,
false,
CexmcRT,
"kecl",
568 "Kinetic energy of gamma (lc)", axes ), aRange );
569 AddHisto( CexmcHistoData( CexmcKinEnAtRightCalorimeter_ARReal_RT_Histo,
570 Cexmc_TH1F,
true,
false,
CexmcRT,
"kecr",
571 "Kinetic energy of gamma (rc)", axes ), aRange );
572 AddHisto( CexmcHistoData( CexmcAbsEnInLeftCalorimeter_ARReal_EDT_Histo,
573 Cexmc_TH1F,
true,
false,
CexmcEDT,
"aecl",
574 "Absorbed energy (lc)", axes ), aRange );
575 AddHisto( CexmcHistoData( CexmcAbsEnInRightCalorimeter_ARReal_EDT_Histo,
576 Cexmc_TH1F,
true,
false,
CexmcEDT,
"aecr",
577 "Absorbed energy (rc)", axes ), aRange );
578 AddHisto( CexmcHistoData( CexmcAbsEnInLeftCalorimeter_ARReal_RT_Histo,
579 Cexmc_TH1F,
true,
false,
CexmcRT,
"aecl",
580 "Absorbed energy (lc)", axes ), aRange );
581 AddHisto( CexmcHistoData( CexmcAbsEnInRightCalorimeter_ARReal_RT_Histo,
582 Cexmc_TH1F,
true,
false,
CexmcRT,
"aecr",
583 "Absorbed energy (rc)", axes ), aRange );
585 nBinsMinX = CexmcHistoMissEnergyMin;
586 nBinsMaxX = CexmcHistoMissEnergyMax;
587 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) /
588 CexmcHistoMissEnergyResolution );
590 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
591 AddHisto( CexmcHistoData( CexmcMissEnFromLeftCalorimeter_ARReal_RT_Histo,
592 Cexmc_TH1F,
true,
false,
CexmcRT,
"mecl",
593 "Missing energy (lc)", axes ), aRange );
594 AddHisto( CexmcHistoData( CexmcMissEnFromRightCalorimeter_ARReal_RT_Histo,
595 Cexmc_TH1F,
true,
false,
CexmcRT,
"mecr",
596 "Missing energy (rc)", axes ), aRange );
598 title =
"Kinetic energy of newborn " + opName +
" (lab)";
600 nBinsMaxX = CexmcHistoEnergyMax;
601 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoEnergyResolution );
603 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
604 AddHisto( CexmcHistoData( CexmcKinEnOP_LAB_ARReal_TPT_Histo,
605 Cexmc_TH1F,
true,
false,
CexmcTPT,
"keop_lab", title, axes ), aRange );
606 AddHisto( CexmcHistoData( CexmcKinEnOP_LAB_ARReal_RT_Histo,
607 Cexmc_TH1F,
true,
false,
CexmcRT,
"keop_lab", title, axes ), aRange );
609 title =
"Angle of newborn " + opName +
" (scm)";
612 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoAngularCResolution );
614 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
615 AddHisto( CexmcHistoData( CexmcAngleOP_SCM_ARReal_TPT_Histo,
616 Cexmc_TH1F,
true,
false,
CexmcTPT,
"aop_scm", title, axes ), aRange );
617 AddHisto( CexmcHistoData( CexmcAngleOP_SCM_ARReal_RT_Histo,
618 Cexmc_TH1F,
true,
false,
CexmcRT,
"aop_scm", title, axes ), aRange );
620 title =
"Reconstruced angle of newborn " + opName +
" (scm)";
621 AddHisto( CexmcHistoData( CexmcRecAngleOP_SCM_ARReal_RT_Histo,
622 Cexmc_TH1F,
true,
false,
CexmcRT,
"recaop_scm", title, axes ), aRange );
624 title =
"Real - reconstruced angle of newborn " + opName +
" (scm)";
625 AddHisto( CexmcHistoData( CexmcDiffAngleOP_SCM_ARReal_RT_Histo,
626 Cexmc_TH1F,
true,
false,
CexmcRT,
"diffaop_scm", title, axes ),
631 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoAngularResolution );
633 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
634 AddHisto( CexmcHistoData( CexmcOpenAngle_ARReal_TPT_Histo,
635 Cexmc_TH1F,
true,
false,
CexmcTPT,
"oa",
636 "Open angle between the gammas", axes ), aRange );
637 AddHisto( CexmcHistoData( CexmcOpenAngle_ARReal_RT_Histo,
638 Cexmc_TH1F,
true,
false,
CexmcRT,
"oa",
639 "Open angle between the gammas", axes ), aRange );
640 AddHisto( CexmcHistoData( CexmcRecOpenAngle_ARReal_RT_Histo,
641 Cexmc_TH1F,
true,
false,
CexmcRT,
"recoa",
642 "Reconstructed open angle between the gammas", axes ), aRange );
646 nBinsX =
Int_t( ( nBinsMaxX - nBinsMinX ) / CexmcHistoAngularResolution );
648 axes.push_back( CexmcHistoAxisData( nBinsX, nBinsMinX, nBinsMaxX ) );
649 AddHisto( CexmcHistoData( CexmcDiffOpenAngle_ARReal_RT_Histo,
650 Cexmc_TH1F,
true,
false,
CexmcRT,
"diffoa",
651 "Real - reconstructed open angle between the gammas", axes ), aRange );
654 G4Tubs * tube( dynamic_cast< G4Tubs * >( lVolume->GetSolid() ) );
659 G4double radius( tube->GetOuterRadius() );
660 height = tube->GetZHalfLength() * 2;
661 halfWidth = radius + CexmcHistoTPSafetyArea;
662 halfHeight = height / 2 + CexmcHistoTPSafetyArea;
664 nBinsX =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
665 nBinsY =
Int_t( halfWidth * 2 / CexmcHistoTPResolution );
666 Int_t nBinsZ(
Int_t( halfHeight * 2 / CexmcHistoTPResolution ) );
668 axes.push_back( CexmcHistoAxisData( nBinsX, -halfWidth, halfWidth ) );
669 axes.push_back( CexmcHistoAxisData( nBinsY, -halfWidth, halfWidth ) );
670 axes.push_back( CexmcHistoAxisData( nBinsZ, -halfHeight, halfHeight ) );
671 AddHisto( CexmcHistoData( CexmcTPInTarget_ARReal_TPT_Histo, Cexmc_TH3F,
672 true,
false,
CexmcTPT,
"tptar",
"Track points (tar)", axes ), aRange );
673 AddHisto( CexmcHistoData( CexmcTPInTarget_ARReal_RT_Histo, Cexmc_TH3F,
674 true,
false,
CexmcRT,
"tptar",
"Track points (tar)", axes ), aRange );
681 CexmcHistosMap::iterator found( histos.find( histoType ) );
682 if ( found == histos.end() || histos[ histoType ].size() <=
index )
685 histos[ histoType ][
index ]->Fill( x );
692 CexmcHistosMap::iterator found( histos.find( histoType ) );
693 if ( found == histos.end() || histos[ histoType ].size() <=
index )
698 histos[ histoType ][
index ]->Fill( x, y );
705 CexmcHistosMap::iterator found( histos.find( histoType ) );
706 if ( found == histos.end() || histos[ histoType ].size() <=
index )
711 TH3 * histo( static_cast< TH3 * >( histos[ histoType ][ index ] ) );
713 histo->Fill( x, y, z );
720 CexmcHistosMap::iterator found( histos.find( histoType ) );
721 if ( found == histos.end() || histos[ histoType ].size() <=
index )
726 Double_t curValue( histos[ histoType ][ index ]->GetBinContent(
728 histos[ histoType ][
index ]->SetBinContent( binX, binY,
729 curValue + value /
GeV );
733 void CexmcHistoManager::List(
void )
const
741 TObject * histo( gDirectory->FindObjectAny( value.c_str() ) );
745 G4cout <<
"Histogram '" << value <<
"' was not found" <<
G4endl;
749 histo->Print(
"range" );
753 #ifdef CEXMC_USE_ROOTQT
760 if ( ! runManager->AreLiveHistogramsEnabled() )
762 G4cout <<
"Live histograms option is disabled" <<
G4endl;
766 TObject * histo( gDirectory->FindObjectAny( histoName ) );
770 G4cout <<
"Histogram '" << histoName <<
"' was not found" <<
G4endl;
777 QFont defaultAppFont( QApplication::font() );
778 rootCanvas =
new CexmcHistoWidget;
779 QApplication::setFont( defaultAppFont );
780 rootCanvas->resize( CexmcHistoCanvasWidth, CexmcHistoCanvasHeight );
781 rootCanvas->GetCanvas()->cd();
784 histo->Draw( histoDrawOptions );
786 rootCanvas->GetCanvas()->Update();
double GetXHalfLength() const
double GetYHalfLength() const
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetRunManager()
subroutine title(NA, NB, NCA, NCB)
std::vector< CexmcAngularRange > CexmcAngularRangeList
const XML_Char int const XML_Char * value
const XML_Char const XML_Char * data
void Add(G4int Elements, T *To, T *A1, T *A2=NULL)
void Print(G4Element &ele)