Changeset 250 in Idarraga
- Timestamp:
- Nov 11, 2011, 4:36:29 PM (13 years ago)
- Location:
- allpix
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
allpix/allpix.cc
r193 r250 140 140 TString dataset = "AllPix"; 141 141 TString tempdir = ""; 142 AllPixRunAction * run_action = new AllPixRunAction(dataset, tempdir, 142 TString outputFilePrefix = detector->GetOutputFilePrefix(); 143 AllPixRunAction * run_action = new AllPixRunAction(outputFilePrefix, dataset, tempdir, 143 144 "lciobridge_allpix.txt", 144 145 "lciobridge_allpix_dut.txt"); // dataset … … 242 243 // G4int nDigitizers = event_action->GetNumberOfDigitizers(); 243 244 for( detItr = geoMap->begin() ; detItr != geoMap->end() ; detItr++) { 244 WriteToNtuple::GetInstance("", "", (int)geoMap->size(), (*detItr).first)->closeNtuple();245 WriteToNtuple::GetInstance("", "", "", (int)geoMap->size(), (*detItr).first)->closeNtuple(); 245 246 } 246 247 -
allpix/src/AllPixDetectorConstruction.cc
r230 r250 711 711 } 712 712 713 /** 714 * Someone get's informed throught the messenger about the prefix for the output file. 715 */ 716 void AllPixDetectorConstruction::SetOutputFilePrefix(G4String val){ 717 m_outputFilePrefix = val; 718 } 719 713 720 #include "G4FieldManager.hh" 714 721 #include "G4TransportationManager.hh" … … 756 763 757 764 } 765 -
allpix/src/AllPixDetectorMessenger.cc
r226 r250 54 54 m_detDir->SetGuidance("detector control"); 55 55 56 m_configDir = new G4UIdirectory("/allpix/config/"); 57 m_configDir->SetGuidance("allpix configuration"); 58 56 59 m_detDir = new G4UIdirectory("/allpix/extras/"); 57 60 m_detDir->SetGuidance("extras"); … … 119 122 m_ClockCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 120 123 124 ////////////////////////// 125 // Config 126 127 m_outputPrefix = new G4UIcmdWithAString("/allpix/config/setOutputPrefixWithPath", this); 128 m_outputPrefix->SetGuidance("Set output file prefix (path can be included). If no path is specified, the file will be written to ./"); 129 m_outputPrefix->SetParameterName("OutputPrefix", false); 130 m_outputPrefix->SetDefaultValue("allpixoutput"); 131 m_outputPrefix->AvailableForStates(G4State_PreInit, G4State_Idle); 121 132 122 133 ////////////////////////// … … 195 206 delete m_worldMaterial; 196 207 208 delete m_outputPrefix; 209 197 210 delete m_detDir; 198 211 delete m_allpixDir; … … 297 310 } 298 311 312 if( command == m_outputPrefix ) 313 { 314 G4cout << "Setting up output file prefix " << newValue << G4endl; 315 m_AllPixDetector->SetOutputFilePrefix( newValue ); 316 } 299 317 300 318 -
allpix/src/AllPixRun.cc
r226 r250 29 29 * This constructor is called once per run 30 30 */ 31 AllPixRun::AllPixRun(TString dataset, TString tempDir){31 AllPixRun::AllPixRun(TString ofp, TString dataset, TString tempDir){ 32 32 33 33 // Call for an instance to write. Need to know how … … 42 42 43 43 // digit collection info 44 m_outputFilePrefix = ofp; 44 45 m_datasetDigits = dataset; 45 46 m_datasetDigits += "_det_"; … … 183 184 //cout << " AllPixRun::FillFramesNtuple " << m_frames[i]->GetDetectorId() << endl; 184 185 185 WriteToNtuple::GetInstance(m_ datasetDigits,186 WriteToNtuple::GetInstance(m_outputFilePrefix, m_datasetDigits, 186 187 m_tempdir, 187 188 m_nOfDetectors, -
allpix/src/AllPixRunAction.cc
r193 r250 51 51 52 52 // this constructor is called only once in the whole program 53 AllPixRunAction::AllPixRunAction(TString ds, TString td, TString lciofn, TString lciofn_dut)53 AllPixRunAction::AllPixRunAction(TString ofp, TString ds, TString td, TString lciofn, TString lciofn_dut) 54 54 { 55 55 56 m_outputFilePrefix = ofp; 56 57 m_dataset = ds; 57 58 m_tempdir = td; … … 81 82 G4Run * AllPixRunAction::GenerateRun(){ 82 83 83 m_AllPixRun = new AllPixRun(m_dataset, m_tempdir); // keep this pointer84 m_AllPixRun = new AllPixRun(m_outputFilePrefix, m_dataset, m_tempdir); // keep this pointer 84 85 m_AllPixRun->SetLCIOBridgeFileDsc(m_lciobridge_f, m_lciobridge_dut_f); 85 86 -
allpix/src/AllPix_Frames_WriteToEntuple.cc
r57 r250 15 15 static Int_t * indexToDetectorIdMap = 0; 16 16 17 WriteToNtuple::WriteToNtuple(TString dataSet, TString tempScratchDir, Int_t detID, TString openmode /* default "RECREATE" */){17 WriteToNtuple::WriteToNtuple(TString prefix, TString dataSet, TString tempScratchDir, Int_t detID, TString openmode /* default "RECREATE" */){ 18 18 19 19 m_MPXDataSetNumber = dataSet; … … 27 27 } 28 28 29 m_ntupleFileName += "MPXNtuple_"+m_MPXDataSetNumber; 29 if(prefix.Length() > 0){ 30 m_ntupleFileName += prefix; 31 m_ntupleFileName += "_"; 32 m_ntupleFileName += m_MPXDataSetNumber; 33 } else { 34 m_ntupleFileName += "MPXNtuple_"+m_MPXDataSetNumber; 35 } 30 36 m_ntupleFileName += ".root"; 31 37 … … 51 57 * 52 58 */ 53 WriteToNtuple * WriteToNtuple::GetInstance(TString dataset, TString tempdir, Int_t nOfDetectors, Int_t detID, TString openmode /* RECREATE */) {59 WriteToNtuple * WriteToNtuple::GetInstance(TString prefix, TString dataset, TString tempdir, Int_t nOfDetectors, Int_t detID, TString openmode /* RECREATE */) { 54 60 55 61 TString tempDataset = dataset; … … 71 77 tempDataset += (*detItr).first; // append detector id 72 78 73 instance[cntr] = new WriteToNtuple( tempDataset, tempdir, (*detItr).first, openmode);79 instance[cntr] = new WriteToNtuple(prefix, tempDataset, tempdir, (*detItr).first, openmode); 74 80 indexToDetectorIdMap[cntr] = (*detItr).first; 75 81
Note: See TracChangeset
for help on using the changeset viewer.