diff --git a/.gitignore b/.gitignore index 2fd88b1a05035f53b5cbd7ab5acc2b348dee4fb9..77704c4573b8d57556b942a58de29ee3d799caec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *~ +*.sw? ROOTfiles ROOTfiles/* ROOTfiles.old/* diff --git a/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C b/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C index 538496a0810db7a52d16eaa213ff5baf323701fd..212d61978d4c1d6e7eb12abf955b861062d4d6b1 100644 --- a/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C +++ b/SCRIPTS/COIN/PRODUCTION/replay_production_coin.C @@ -16,7 +16,12 @@ void replay_production_coin (Int_t RunNumber = 0, Int_t MaxEvent = 0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + //const char* RunFileNamePattern = "raw/coin_all_%05d.dat"; const char* ROOTFileNamePattern = "ROOTfiles/coin_replay_production_%d_%d.root"; @@ -151,9 +156,7 @@ void replay_production_coin (Int_t RunNumber = 0, Int_t MaxEvent = 0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Set to read in Hall C run database parameters run->SetRunParamClass("THcRunParameters"); diff --git a/SCRIPTS/HMS/PRODUCTION/replay_production_hms.C b/SCRIPTS/HMS/PRODUCTION/replay_production_hms.C index dc44af6c828bb33610ab195ae1aed957f54d6ce8..e7fcca26e6b658d1d866f8772a11f419fd97860c 100644 --- a/SCRIPTS/HMS/PRODUCTION/replay_production_hms.C +++ b/SCRIPTS/HMS/PRODUCTION/replay_production_hms.C @@ -16,7 +16,12 @@ void replay_production_hms(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hms_replay_production_%d_%d.root"; //Load Global parameters @@ -98,9 +103,7 @@ void replay_production_hms(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Set to read in Hall C run database parameters run->SetRunParamClass("THcRunParameters"); diff --git a/SCRIPTS/HMS/RASTER/replay_hms_raster_simple.C b/SCRIPTS/HMS/RASTER/replay_hms_raster_simple.C index e897a0f9bbc11f20d2a9c6e99d4751f0ea0b8784..cddad69ac0d381b504bc79732547bd2583fa2ee7 100644 --- a/SCRIPTS/HMS/RASTER/replay_hms_raster_simple.C +++ b/SCRIPTS/HMS/RASTER/replay_hms_raster_simple.C @@ -16,7 +16,12 @@ void replay_hms_raster_simple(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hms_raster_simple_%d_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -57,9 +62,7 @@ void replay_hms_raster_simple(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/HMS/SCALERS/replay_hms_scalers.C b/SCRIPTS/HMS/SCALERS/replay_hms_scalers.C index 7efb4ec55147f3bbfb6b5d322e9d7fc365785d49..d6edd5ffe61f00e3bf39bfe09861216f9cdc66b9 100644 --- a/SCRIPTS/HMS/SCALERS/replay_hms_scalers.C +++ b/SCRIPTS/HMS/SCALERS/replay_hms_scalers.C @@ -16,7 +16,12 @@ void replay_hms_scalers(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hms_replay_scalers_%d_%d.root"; // Load global parameters @@ -66,9 +71,7 @@ void replay_hms_scalers(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/HMS/STACK/replay_hms.C b/SCRIPTS/HMS/STACK/replay_hms.C index 8219c289ba3580914ac7b4096fd4af9e66035bdb..0209addd4ca75d91fb9176885485cf6be3fbec5f 100644 --- a/SCRIPTS/HMS/STACK/replay_hms.C +++ b/SCRIPTS/HMS/STACK/replay_hms.C @@ -16,7 +16,12 @@ void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hms_replay_%d_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -80,9 +85,7 @@ void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/HMS/TEST_STANDS/replay_hcal_test_stand.C b/SCRIPTS/HMS/TEST_STANDS/replay_hcal_test_stand.C index 2795dffd4c1850d08452e06b991b90b24f827d79..940b1db5849c9f3ea066b1d8575710af6805f8e1 100644 --- a/SCRIPTS/HMS/TEST_STANDS/replay_hcal_test_stand.C +++ b/SCRIPTS/HMS/TEST_STANDS/replay_hcal_test_stand.C @@ -16,7 +16,12 @@ void replay_hcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hcal_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -58,9 +63,7 @@ void replay_hcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/HMS/TEST_STANDS/replay_hcer_test_stand.C b/SCRIPTS/HMS/TEST_STANDS/replay_hcer_test_stand.C index 28e4fc9aadf3d239a1b9c9acd27074921a093216..fb68058eb86492ce7d050faa40656812b84d6b7d 100644 --- a/SCRIPTS/HMS/TEST_STANDS/replay_hcer_test_stand.C +++ b/SCRIPTS/HMS/TEST_STANDS/replay_hcer_test_stand.C @@ -16,7 +16,12 @@ void replay_hcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hcer_replay_%d.root"; // Add variables to global list. @@ -68,9 +73,7 @@ void replay_hcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/HMS/TEST_STANDS/replay_hdc_test_stand.C b/SCRIPTS/HMS/TEST_STANDS/replay_hdc_test_stand.C index 3ffd686599417edbbd4bd8a22d490991692ac027..57f3b28c0e3ceb8accee96e4f915879f3e4a547e 100644 --- a/SCRIPTS/HMS/TEST_STANDS/replay_hdc_test_stand.C +++ b/SCRIPTS/HMS/TEST_STANDS/replay_hdc_test_stand.C @@ -16,7 +16,12 @@ void replay_hdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hdc_replay_%d.root"; // Add variables to global list. @@ -70,9 +75,7 @@ void replay_hdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/HMS/TEST_STANDS/replay_hhodo_test_stand.C b/SCRIPTS/HMS/TEST_STANDS/replay_hhodo_test_stand.C index c202cfd229a6187682b89e6161acab8304cd4a08..6f54f58bdc4f6b2b28b6e246ec4be76f3a777ba6 100644 --- a/SCRIPTS/HMS/TEST_STANDS/replay_hhodo_test_stand.C +++ b/SCRIPTS/HMS/TEST_STANDS/replay_hhodo_test_stand.C @@ -16,7 +16,12 @@ void replay_hhodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/hhodo_replay_%d.root"; // Add variables to global list. @@ -68,9 +73,7 @@ void replay_hhodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/HMS/TEST_STANDS/replay_htrig_test_stand.C b/SCRIPTS/HMS/TEST_STANDS/replay_htrig_test_stand.C index b535387c24e2a1bc2994a8edf5e6bd3baec7ffc2..b077d59935b65d6466d31a7a28c7655ce1a3028f 100644 --- a/SCRIPTS/HMS/TEST_STANDS/replay_htrig_test_stand.C +++ b/SCRIPTS/HMS/TEST_STANDS/replay_htrig_test_stand.C @@ -16,7 +16,12 @@ void replay_htrig_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/hms_all_%05d.dat"; + const char* RunFileNamePattern = "hms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/htrig_replay_%d.root"; // Add variables to global list. @@ -60,9 +65,7 @@ void replay_htrig_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/EXAMPLES/replay_workshop_example.C b/SCRIPTS/SHMS/EXAMPLES/replay_workshop_example.C index 6cc389b4be42424381d1fc86ee6360e8ac658d5d..f4ec1dc8416a05b299c55e457beba82e1db74e6b 100644 --- a/SCRIPTS/SHMS/EXAMPLES/replay_workshop_example.C +++ b/SCRIPTS/SHMS/EXAMPLES/replay_workshop_example.C @@ -15,7 +15,12 @@ void replay_workshop_example(Int_t RunNumber=0, Int_t MaxEvent=0) { } } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_%d_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -73,9 +78,7 @@ void replay_workshop_example(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/PRODUCTION/replay_production_shms.C b/SCRIPTS/SHMS/PRODUCTION/replay_production_shms.C index 2b3330050185fe1a3b26f379509ffb14dde288c3..0f853bb225bb4a3116199ae5b9e34741c8f3cc10 100644 --- a/SCRIPTS/SHMS/PRODUCTION/replay_production_shms.C +++ b/SCRIPTS/SHMS/PRODUCTION/replay_production_shms.C @@ -16,7 +16,12 @@ void replay_production_shms (Int_t RunNumber = 0, Int_t MaxEvent = 0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_production_%d_%d.root"; // Load global parameters @@ -106,9 +111,7 @@ void replay_production_shms (Int_t RunNumber = 0, Int_t MaxEvent = 0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Set to read in Hall C run database parameters run->SetRunParamClass("THcRunParameters"); diff --git a/SCRIPTS/SHMS/RASTER/replay_shms_raster_simple.C b/SCRIPTS/SHMS/RASTER/replay_shms_raster_simple.C index 1c417ab6705cab4b5d80ad55feef58f5aedbb782..3aadc1c5cdd175f7a5b3e4587deb2a72d2ea501f 100644 --- a/SCRIPTS/SHMS/RASTER/replay_shms_raster_simple.C +++ b/SCRIPTS/SHMS/RASTER/replay_shms_raster_simple.C @@ -16,7 +16,12 @@ void replay_shms_raster_simple (Int_t RunNumber = 0, Int_t MaxEvent = 0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_raster_simple_%d_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -56,9 +61,7 @@ void replay_shms_raster_simple (Int_t RunNumber = 0, Int_t MaxEvent = 0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/SCALERS/replay_shms_scalers.C b/SCRIPTS/SHMS/SCALERS/replay_shms_scalers.C index 0a74c103c90db9969869e560aa067d86c0c8c58e..407f695fdfd048b9f39d41d8cd38be07e629e6a4 100644 --- a/SCRIPTS/SHMS/SCALERS/replay_shms_scalers.C +++ b/SCRIPTS/SHMS/SCALERS/replay_shms_scalers.C @@ -16,7 +16,12 @@ void replay_shms_scalers (Int_t RunNumber = 0, Int_t MaxEvent = 0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_scalers_%d_%d.root"; // Load global parameters @@ -66,9 +71,7 @@ void replay_shms_scalers (Int_t RunNumber = 0, Int_t MaxEvent = 0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/STACK/replay_shms.C b/SCRIPTS/SHMS/STACK/replay_shms.C index 8dbff29a73f3489531b100bfc3eaee9d557ea23b..82fb86848acb0a564bc567a3e6e28952c1587335 100644 --- a/SCRIPTS/SHMS/STACK/replay_shms.C +++ b/SCRIPTS/SHMS/STACK/replay_shms.C @@ -16,7 +16,12 @@ void replay_shms (Int_t RunNumber = 0, Int_t MaxEvent = 0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/shms_replay_%d_%d.root"; // Load global parameters @@ -87,9 +92,7 @@ void replay_shms (Int_t RunNumber = 0, Int_t MaxEvent = 0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/TEST_STANDS/replay_paero_test_stand.C b/SCRIPTS/SHMS/TEST_STANDS/replay_paero_test_stand.C index aa6c978846007864465e1cdb6e1f3be7a6cb5f8e..5fda63bd483202de3ca18897d8ca5bb012142ec1 100644 --- a/SCRIPTS/SHMS/TEST_STANDS/replay_paero_test_stand.C +++ b/SCRIPTS/SHMS/TEST_STANDS/replay_paero_test_stand.C @@ -16,7 +16,12 @@ void replay_paero_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/paero_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -69,9 +74,7 @@ void replay_paero_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/TEST_STANDS/replay_pcal_test_stand.C b/SCRIPTS/SHMS/TEST_STANDS/replay_pcal_test_stand.C index 2922eb38a59d7a61924dedd942dfe443414f0520..ccd2012afc14947f2af197b6b3cdfbe455bbd332 100644 --- a/SCRIPTS/SHMS/TEST_STANDS/replay_pcal_test_stand.C +++ b/SCRIPTS/SHMS/TEST_STANDS/replay_pcal_test_stand.C @@ -16,7 +16,12 @@ void replay_pcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/pcal_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -59,9 +64,7 @@ void replay_pcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/TEST_STANDS/replay_pdc_test_stand.C b/SCRIPTS/SHMS/TEST_STANDS/replay_pdc_test_stand.C index 89a43b02536614bf49b85d849f04076741cdb6cf..e6db706e67c9765cdd583110cfa2649f5f6d7a86 100644 --- a/SCRIPTS/SHMS/TEST_STANDS/replay_pdc_test_stand.C +++ b/SCRIPTS/SHMS/TEST_STANDS/replay_pdc_test_stand.C @@ -16,7 +16,12 @@ void replay_pdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/pdc_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -63,9 +68,7 @@ void replay_pdc_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/TEST_STANDS/replay_phgcer_test_stand.C b/SCRIPTS/SHMS/TEST_STANDS/replay_phgcer_test_stand.C index d7f00f642b8ed6409e7e0af4a4d447870284ac59..fcb943a4e3a7b31745d46f723bc1e80ecf66adf5 100644 --- a/SCRIPTS/SHMS/TEST_STANDS/replay_phgcer_test_stand.C +++ b/SCRIPTS/SHMS/TEST_STANDS/replay_phgcer_test_stand.C @@ -16,7 +16,12 @@ void replay_phgcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/phgcer_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -68,9 +73,7 @@ void replay_phgcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/TEST_STANDS/replay_phodo_test_stand.C b/SCRIPTS/SHMS/TEST_STANDS/replay_phodo_test_stand.C index 9e32b3304d454d807df81b6ee45f52e61b602c1e..c005cd16aae90cefdc92dbd54da9bcc568af25a6 100644 --- a/SCRIPTS/SHMS/TEST_STANDS/replay_phodo_test_stand.C +++ b/SCRIPTS/SHMS/TEST_STANDS/replay_phodo_test_stand.C @@ -16,7 +16,12 @@ void replay_phodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/phodo_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -67,9 +72,7 @@ void replay_phodo_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/TEST_STANDS/replay_pngcer_test_stand.C b/SCRIPTS/SHMS/TEST_STANDS/replay_pngcer_test_stand.C index 4c2d23341dd141e993c911809069ba30811d2567..19b3c10cc815060cb4d6f66cb70ca99231aedd97 100644 --- a/SCRIPTS/SHMS/TEST_STANDS/replay_pngcer_test_stand.C +++ b/SCRIPTS/SHMS/TEST_STANDS/replay_pngcer_test_stand.C @@ -16,7 +16,12 @@ void replay_pngcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/pngcer_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -68,9 +73,7 @@ void replay_pngcer_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/SHMS/TEST_STANDS/replay_ptrig_test_stand.C b/SCRIPTS/SHMS/TEST_STANDS/replay_ptrig_test_stand.C index 9df0e328616f86be92029c39510176fc88931961..eaf78bf7b6aad7453913d25f3977f7e4fbba7a22 100644 --- a/SCRIPTS/SHMS/TEST_STANDS/replay_ptrig_test_stand.C +++ b/SCRIPTS/SHMS/TEST_STANDS/replay_ptrig_test_stand.C @@ -16,7 +16,12 @@ void replay_ptrig_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { } // Create file name patterns. - const char* RunFileNamePattern = "raw/shms_all_%05d.dat"; + const char* RunFileNamePattern = "shms_all_%05d.dat"; + vector<TString> pathList; + pathList.push_back("."); + pathList.push_back("./raw"); + pathList.push_back("./cache"); + const char* ROOTFileNamePattern = "ROOTfiles/ptrig_replay_%d.root"; // Add variables to global list. gHcParms->Define("gen_run_number", "Run Number", RunNumber); @@ -61,9 +66,7 @@ void replay_ptrig_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) { // Define the run(s) that we want to analyze. // We just set up one, but this could be many. - char RunFileName[100]; - sprintf(RunFileName, RunFileNamePattern, RunNumber); - THaRun* run = new THaRun(RunFileName); + THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) ); // Eventually need to learn to skip over, or properly analyze // the pedestal events diff --git a/SCRIPTS/filter.pl b/SCRIPTS/filter.pl new file mode 100755 index 0000000000000000000000000000000000000000..2c6a4889bd31acbbae346257c8a6c5fcd6481c89 --- /dev/null +++ b/SCRIPTS/filter.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +use File::Slurp; + + +my $file = read_file($ARGV[0]); + +$file =~ s/\Qchar RunFileName[100];\E\W*\Qsprintf(RunFileName, RunFileNamePattern, RunNumber);\E\W*\QTHaRun* run = new THaRun(RunFileName);\E/THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) );/s; + +$file =~ s/\Qconst char* RunFileNamePattern = "\E.*?\/(.*?\.dat)";/const char* RunFileNamePattern = "$1";\n vector<TString> pathList;\n pathList.push_back(".");\n pathList.push_back(".\/raw");\n pathList.push_back(".\/cache");\n/s; + +#$file =~ s/\Qconst char* RunFileNamePattern = "raw\/\E(.*?%05d.dat)\Q";\E/ + + +write_file("$ARGV[0]", $file); +