44 #ifndef CEXMC_HISTO_MANAGER_HH
45 #define CEXMC_HISTO_MANAGER_HH
52 #include <G4String.hh>
58 #ifdef CEXMC_USE_ROOTQT
64 class CexmcHistoManagerMessenger;
69 CexmcMomentumBP_TPT_Histo,
70 CexmcMomentumBP_RT_Histo,
71 CexmcMomentumIP_TPT_Histo,
72 CexmcTPInMonitor_TPT_Histo,
73 CexmcTPInTarget_TPT_Histo,
74 CexmcTPInTarget_RT_Histo,
75 CexmcRecMasses_EDT_Histo,
76 CexmcRecMasses_RT_Histo,
77 CexmcAbsorbedEnergy_EDT_Histo,
78 CexmcAbsorbedEnergy_RT_Histo,
79 CexmcHistoType_ARReal_START,
80 CexmcRecMassOP_ARReal_RT_Histo = CexmcHistoType_ARReal_START,
81 CexmcRecMassNOP_ARReal_RT_Histo,
82 CexmcOPDPAtLeftCalorimeter_ARReal_EDT_Histo,
83 CexmcOPDPAtRightCalorimeter_ARReal_EDT_Histo,
84 CexmcOPDPAtLeftCalorimeter_ARReal_RT_Histo,
85 CexmcOPDPAtRightCalorimeter_ARReal_RT_Histo,
86 CexmcRecOPDPAtLeftCalorimeter_ARReal_EDT_Histo,
87 CexmcRecOPDPAtRightCalorimeter_ARReal_EDT_Histo,
88 CexmcRecOPDPAtLeftCalorimeter_ARReal_RT_Histo,
89 CexmcRecOPDPAtRightCalorimeter_ARReal_RT_Histo,
90 CexmcKinEnAtLeftCalorimeter_ARReal_TPT_Histo,
91 CexmcKinEnAtRightCalorimeter_ARReal_TPT_Histo,
92 CexmcKinEnAtLeftCalorimeter_ARReal_RT_Histo,
93 CexmcKinEnAtRightCalorimeter_ARReal_RT_Histo,
94 CexmcAbsEnInLeftCalorimeter_ARReal_EDT_Histo,
95 CexmcAbsEnInRightCalorimeter_ARReal_EDT_Histo,
96 CexmcAbsEnInLeftCalorimeter_ARReal_RT_Histo,
97 CexmcAbsEnInRightCalorimeter_ARReal_RT_Histo,
98 CexmcMissEnFromLeftCalorimeter_ARReal_RT_Histo,
99 CexmcMissEnFromRightCalorimeter_ARReal_RT_Histo,
100 CexmcKinEnOP_LAB_ARReal_TPT_Histo,
101 CexmcKinEnOP_LAB_ARReal_RT_Histo,
102 CexmcAngleOP_SCM_ARReal_TPT_Histo,
103 CexmcAngleOP_SCM_ARReal_RT_Histo,
104 CexmcRecAngleOP_SCM_ARReal_RT_Histo,
105 CexmcDiffAngleOP_SCM_ARReal_RT_Histo,
106 CexmcOpenAngle_ARReal_TPT_Histo,
107 CexmcOpenAngle_ARReal_RT_Histo,
108 CexmcRecOpenAngle_ARReal_RT_Histo,
109 CexmcDiffOpenAngle_ARReal_RT_Histo,
110 CexmcTPInTarget_ARReal_TPT_Histo,
111 CexmcTPInTarget_ARReal_RT_Histo,
112 CexmcHistoType_ARReal_END = CexmcTPInTarget_ARReal_RT_Histo,
117 class CexmcHistoManager
120 typedef std::vector< TH1 * > CexmcHistoVector;
122 typedef std::map< CexmcHistoType, CexmcHistoVector > CexmcHistosMap;
124 typedef CexmcHistosMap::value_type CexmcHistoPair;
126 struct CexmcHistoAxisData
128 CexmcHistoAxisData() : nBins( 0 ), nBinsMin( 0 ), nBinsMax( 0 )
133 nBins( nBins_ ), nBinsMin( nBinsMin_ ), nBinsMax( nBinsMax_ )
143 typedef std::vector< CexmcHistoAxisData > CexmcHistoAxes;
152 struct CexmcHistoData
155 type( CexmcHistoType_SIZE ), impl( Cexmc_TH1F ),
159 CexmcHistoData( CexmcHistoType type_, CexmcHistoImpl impl_,
160 bool isARHisto_,
bool isARRec_,
163 const CexmcHistoAxes & axes_ ) :
164 type( type_ ), impl( impl_ ), isARHisto( isARHisto_ ),
165 isARRec( isARRec_ ), triggerType( triggerType_ ),
name( name_ ),
166 title( title_ ), axes( axes_ )
187 static CexmcHistoManager * Instance(
void );
189 static void Destroy(
void );
194 ~CexmcHistoManager();
203 void Add( CexmcHistoType histoType,
unsigned int index,
206 void Add( CexmcHistoType histoType,
unsigned int index,
G4double x,
209 void Add( CexmcHistoType histoType,
unsigned int index,
G4double x,
212 void Add( CexmcHistoType histoType,
unsigned int index,
G4int binX,
215 void List(
void )
const;
219 #ifdef CEXMC_USE_ROOTQT
221 const G4String & histoDrawOptions =
"" );
225 void AddHistoMenu(
const G4String & handle,
226 const G4String & label =
"Histograms" );
238 G4int GetVerboseLevel(
void )
const;
241 void AddHisto(
const CexmcHistoData &
data,
244 void CreateHisto( CexmcHistoVector & histoVector,
247 const CexmcHistoAxes & axes );
249 #ifdef CEXMC_USE_ROOTQT
258 TDirectoryFile * outFile;
261 CexmcHistosMap histos;
275 #ifdef CEXMC_USE_ROOTQT
277 TQtWidget * rootCanvas;
279 G4bool areLiveHistogramsEnabled;
281 G4bool isHistoMenuInitialized;
295 CexmcHistoManagerMessenger * messenger;
298 static CexmcHistoManager *
instance;
302 inline void CexmcHistoManager::SetVerboseLevel(
G4int value )
304 verboseLevel =
value;
308 inline G4int CexmcHistoManager::GetVerboseLevel(
void )
const
313 #ifdef CEXMC_USE_ROOTQT
315 inline void CexmcHistoManager::AddHistoMenu(
const G4String & handle,
318 histoMenuHandle = handle;
319 histoMenuLabel = label;
323 inline void CexmcHistoManager::SetDrawOptions1D(
const G4String &
value )
325 drawOptions1D =
value;
329 inline void CexmcHistoManager::SetDrawOptions2D(
const G4String &
value )
331 drawOptions2D =
value;
335 inline void CexmcHistoManager::SetDrawOptions3D(
const G4String &
value )
337 drawOptions3D =
value;
339 #endif //CEXMC_USE_ROOTQT