From 46cd7491f7e96f544f9758daee0cf78ac663b83a Mon Sep 17 00:00:00 2001 From: kodaiokawa Date: Wed, 2 Mar 2022 21:33:30 +0900 Subject: [PATCH 1/4] [mod] README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8c2f027..db746f9 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,16 @@ This is a tool to convert ridffile to rootfile using ANAROOT decoder. (https://r ANAROOT is automatically installed by "cmake" in the project directory in order to make it easier to edit decoder file. The part of install of ANAROOT is written in ./CMakeLists.txt. ## Note -* Multihit TDC records all hit in one trigger, but this tool include only one hit event. - * Now, this stores the data of the last hit, but do we need to stores all hit or first hit? - * -> if first hit is more important, simply we can change in "main.cpp", but if all hits are needed, source files are needed to edit. (in preparation (okawa) ) +* Multihit TDC records all hit in one trigger, but map tree include only one hit event. (last hit) + * raw data tree store all hit and calibration tree also contain all hit + * the format of timing branch of calibration tree are array (like branch[12]) in order to match the format of mhtdc -* The structure of the branches of rootfile depends on the map file, so now a single branch contains both ADC and TDC data and it is distinguished by channel. +* The structure of map tree branches depends on the map file, so now a single branch contains both ADC and TDC data and it is distinguished by channel. * ex. "name[0]": ADC, "name[1]": TDC * When the name contains "-", "/" or " " in mapfile and we use it as branch name, sometimes it is recognized as an operator, so this tool change them to "\_". -* The format of +* Calibration tree depends on the map tree. And the name of parameter file is important (cannot name arbitrary) * Assume that calibration parameters of two energy output are the same -- GitLab From 98b77533f99e4730fc83113509861b82248fa057 Mon Sep 17 00:00:00 2001 From: Kodai Okawa Date: Wed, 2 Mar 2022 22:54:47 +0900 Subject: [PATCH 2/4] [add] doc --- doc/calibrationfile.md | 3 +++ doc/main.md | 30 ++++++++++++++++++++++++++++++ doc/mapfile.md | 2 ++ doc/yamlfile.md | 10 ++++++++++ recipe/recipe_si26a.yml | 2 +- 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 doc/calibrationfile.md diff --git a/doc/calibrationfile.md b/doc/calibrationfile.md new file mode 100644 index 0000000..36f949a --- /dev/null +++ b/doc/calibrationfile.md @@ -0,0 +1,3 @@ +# parameter file setting + +calibration tree will be created based on map tree. Since the correspondence between branches and maps is based on name matches, names in parameter file should write carefully. diff --git a/doc/main.md b/doc/main.md index e69de29..7144cea 100644 --- a/doc/main.md +++ b/doc/main.md @@ -0,0 +1,30 @@ +# main.cpp + +## setting parameter +* bool rawdata + * "true" -> raw data tree will be created +* bool mapdata + * "true" -> map tree will be created +* bool calibration + * "true" -> calibrated tree will be created + * **NOTE**: calibrated tree require map tree, so mapdata = true; and calibration = true; is needed +* bool print_progress + * "true" -> display the process of data conversion in stdout +* TString yamlfile + * Set the path to the yaml file in which the settings are written + +## content +1. **CheckCommandLine** -> read information written on the command line +2. **Readyaml** -> read specified yaml file +3. **CreateRootFile** -> prepare rootfile +4. **Create__Tree** -> create trees (Raw->tree, Map->mtree, Calib->ctree) +5. **Create__branch** -> create each branches from config file ***(should be improved)*** +6. **Create__Mapping** -> mapping each branch to the id on the DAQ ***(should be improved)*** +7. **TArtEventStore** + * Read and decode ridf file using ANAROOT library +8. **Clear__All** -> initialize value +9. **Give__Value** -> Store decoded values in mapped branches ***(should be improved)*** + * geo: detector, ch: channel, val: recorded value +10. **__Fill** -> store values in the branches in one event +11. **__DataWrite** -> write the created trees to the rootfile +12. **FileClose** -> close the rootfile diff --git a/doc/mapfile.md b/doc/mapfile.md index e69de29..a46f87d 100644 --- a/doc/mapfile.md +++ b/doc/mapfile.md @@ -0,0 +1,2 @@ +# mapfile setting +these mapfile was created for the ANAPAW. I copied from ANAPAW source. diff --git a/doc/yamlfile.md b/doc/yamlfile.md index e69de29..8200872 100644 --- a/doc/yamlfile.md +++ b/doc/yamlfile.md @@ -0,0 +1,10 @@ +# yamlfile setting + +## tree information +probably no need to change default values + +## mapfile and calibration file information +Write the paths of mapfile and calibration file. "mssd" must be specified in name if MUX is used. + +## for rawdata tree +The "segment_no." must be filled in with the value set in the DAQ (babirl) diff --git a/recipe/recipe_si26a.yml b/recipe/recipe_si26a.yml index 054e6fb..12b9c3d 100644 --- a/recipe/recipe_si26a.yml +++ b/recipe/recipe_si26a.yml @@ -9,7 +9,7 @@ calib_tree: name: "ctree" description: "calibrate data tree" -#mapfile information +#mapfile and calibration file information map_setup: - name: coin mapfile: "../map/si26a/coin.map" -- GitLab From e887661100c6f97b615e3f85767a5c44005bf07c Mon Sep 17 00:00:00 2001 From: Kodai Okawa Date: Wed, 2 Mar 2022 14:00:33 +0000 Subject: [PATCH 3/4] Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index db746f9..69d4551 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,13 @@ ANAROOT is automatically installed by "cmake" in the project directory in order * calibration/(expname)/**.prm * main.cpp -#### YAML file +[yaml file setting](doc/yamlfile.md) +[map file setting](doc/mapfile.md) -#### Map file - - -#### Calibration parameter file +[calibration parameter file setting](doc/calibrationfile.md) +[main.cpp setting](doc/main.md) ### Install This is cmake based project, so make build directory and compile in it. -- GitLab From d0874a618b4eb9d378d3bdacda2793460628de70 Mon Sep 17 00:00:00 2001 From: Kodai Okawa Date: Wed, 2 Mar 2022 23:45:32 +0900 Subject: [PATCH 4/4] [mod] add comment --- calibration/si26a/dssd.prm | 128 +++++++++++++++++----------------- doc/develop_memo.md | 33 +++++++++ macro/compare.C | 18 +++++ src/TCordferBranchManager.cpp | 1 + 4 files changed, 116 insertions(+), 64 deletions(-) create mode 100644 doc/develop_memo.md diff --git a/calibration/si26a/dssd.prm b/calibration/si26a/dssd.prm index b327fc4..4b4505f 100644 --- a/calibration/si26a/dssd.prm +++ b/calibration/si26a/dssd.prm @@ -4,67 +4,67 @@ 1 # c0, c1, c2, ... , cn; name -0.0, 1.0; dssd_Tel1_dE1X_1 -0.0, 1.0; dssd_Tel1_dE1X_2 -0.0, 1.0; dssd_Tel1_dE1X_3 -0.0, 1.0; dssd_Tel1_dE1X_4 -0.0, 1.0; dssd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0; dssd_Tel3_dE2Y_8 +0.0, 2.0; dssd_Tel3_dE2Y_9 +0.0, 2.0; dssd_Tel3_dE2Y_10 +0.0, 2.0; dssd_Tel3_dE2Y_11 +0.0, 2.0; dssd_Tel3_dE2Y_12 +0.0, 2.0; dssd_Tel3_dE2Y_13 +0.0, 2.0; dssd_Tel3_dE2Y_14 +0.0, 2.0; dssd_Tel3_dE2Y_15 +0.0, 2.0; dssd_Tel3_dE2Y_16 diff --git a/doc/develop_memo.md b/doc/develop_memo.md new file mode 100644 index 0000000..9c18752 --- /dev/null +++ b/doc/develop_memo.md @@ -0,0 +1,33 @@ +# develop_memo +PPAC is not developed yet!! + +## in create branch + +#### rawdata +* Separate cases when the name is "mhtdc" and when it is not. + +-> if there are multiple mhtdc, it will be error!! + +-> Should I change the conditional statement? (TCordferBranchManager->CreateRawBranch, ClearRawAll) + +#### mapdata +I think it is OK + +#### calibdata +* Separate cases according to specific name in yamlfile. + +-> I should make rule to name + + +## mapping +unordered_map map[key] = value + +#### rawdata +key = segment_id (=geo) <- "mhtdc_nhit" is set to -1 + +value = branch_index + +#### mapdata + + +#### calibdata diff --git a/macro/compare.C b/macro/compare.C index 2c63c08..6093a3f 100644 --- a/macro/compare.C +++ b/macro/compare.C @@ -1,2 +1,20 @@ { + gStyle->SetOptLogy(1); + + TCanvas *c1 = new TCanvas("c1", "c1"); + + c1->Divide(2, 2); + + c1->cd(1); + tree->Draw("madc1[2]"); + + c1->cd(2); + ctree->Draw("dssd_Tel1_dE1X_3"); + + c1->cd(3); + tree->Draw("madc1[3]"); + + c1->cd(4); + ctree->Draw("dssd_Tel1_dE1X_4"); + } diff --git a/src/TCordferBranchManager.cpp b/src/TCordferBranchManager.cpp index 6a2d0c2..d4be300 100644 --- a/src/TCordferBranchManager.cpp +++ b/src/TCordferBranchManager.cpp @@ -61,6 +61,7 @@ void TCordferBranchManager::CreateRawBranch(){ Int_t seg_id = setup[i]["segment_no."].as(); TString bname = setup[i]["name"].as(); if(bname != "mhtdc"){ + //if(string(bname.Data()).find("mhtdc") == string::npos){ Int_t nch = setup[i]["channel"].as(); TCordferRawBranch *raw_branch = new TCordferRawBranch(bname, nch); raw_branch->Setgeo(seg_id); -- GitLab