diff --git a/README.md b/README.md index 8c2f02799e8ebff2c57eaffa78371bd9dc26d8aa..69d45517fda09a1dca1b53905939497b7b348db0 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 @@ -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. diff --git a/calibration/si26a/dssd.prm b/calibration/si26a/dssd.prm index b327fc4aff2cf03c8c6bcdfd4e94896604bc7c90..4b4505fabb121b3427e4cf7a7a32fd68c6828b95 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_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_Tel3_dE2Y_4 +0.0, 2.0; dssd_Tel3_dE2Y_5 +0.0, 2.0; dssd_Tel3_dE2Y_6 +0.0, 2.0; dssd_Tel3_dE2Y_7 +0.0, 2.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/calibrationfile.md b/doc/calibrationfile.md new file mode 100644 index 0000000000000000000000000000000000000000..36f949a6f1d18ff455a6bcc5ec9ef1fa7a8221e6 --- /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/develop_memo.md b/doc/develop_memo.md new file mode 100644 index 0000000000000000000000000000000000000000..9c18752024e4879927ff2b9a113750fcf9ab8df0 --- /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/doc/main.md b/doc/main.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7144cea6e33cf16ad756c605041c4470478bb371 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a46f87d61ba557d927cff9a368a4a128351ffddb 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..82008728717f86b31b6dae8bf3af93f7411120e0 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/macro/compare.C b/macro/compare.C index 2c63c0851048d8f7bff41ecf0f8cee05f52fd120..6093a3f2066fb6c063b84764f4ee384cc824c78a 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/recipe/recipe_si26a.yml b/recipe/recipe_si26a.yml index 054e6fb658ab7793cdfd8b059b5d7abbac865289..12b9c3db8f324e5c96621ae3c58d4f181ce6be2d 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" diff --git a/src/TCordferBranchManager.cpp b/src/TCordferBranchManager.cpp index 6a2d0c278e720043c855e6da6f8f3de756f0e533..d4be30029b2acef72a1291d1fa5176a8bc741789 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);