-
Notifications
You must be signed in to change notification settings - Fork 12
Including Metrology Mask Rotation #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop/em
Are you sure you want to change the base?
Changes from 4 commits
6d926ee
1f2163f
5577c2e
d05aa6a
6ba6e6b
beb5c32
c138b17
9410061
f858369
108275f
e0861b2
7c3d1d6
3d3e0e3
3eeacff
5038c55
2fb1580
230f190
649f74c
f5c13f0
22f3214
a5a5de2
1d90cc8
92ed5b7
3e6d188
573f895
7a20d99
ab024e5
1912f7b
59a25a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| /* | ||
| /*:q | ||
|
||
| * MModuleDepthCalibration2024.h | ||
| * | ||
| * Copyright (C) 2008-2008 by Andreas Zoglauer. | ||
|
|
@@ -72,6 +72,16 @@ class MModuleDepthCalibration2024 : public MModule | |
| //! Get filename for CTD->Depth splines | ||
| MString GetSplinesFileName() const {return m_SplinesFile;} | ||
|
|
||
| //! Enable/Disable Preamp Temp Correction | ||
| void EnableMaskMetrologyCorrection(bool X) {m_MaskMetrologyEnabled = X;} | ||
| //! Get coincidence merging true/false | ||
| bool GetMaskMetrologyCorrection() const { return m_MaskMetrologyEnabled; } | ||
|
|
||
| //! Set filename for mask metrology | ||
| void SetMaskMetrologyFileName( const MString& FileName) {m_MaskMetrologyFile = FileName;} | ||
| //! Get filename for CTD->Depth splines | ||
| MString GetMaskMetrologyFileName() const {return m_MaskMetrologyFile;} | ||
|
|
||
| //! Set whether the data came from the card cage at UCSD | ||
| void SetUCSDOverride( bool Override ) {m_UCSDOverride = Override;} | ||
| //! Get whether the data came from the card cage at UCSD | ||
|
|
@@ -91,22 +101,40 @@ class MModuleDepthCalibration2024 : public MModule | |
| protected: | ||
| //! Returns the strip with most energy from vector Strips, also gives back the energy fraction | ||
| MStripHit* GetDominantStrip(std::vector<MStripHit*>& Strips, double& EnergyFraction); | ||
|
|
||
| //! Retrieve the appropriate Depth values given the DetID | ||
| vector<double> GetDepth(int DetID); | ||
| vector<double> GetDepth(int DetID); | ||
|
|
||
| //! Retrieve the appropriate CTD values given the DetID and Grade | ||
| vector<double> GetCTD(int DetID, int Grade); | ||
|
|
||
| //! Normal distribution | ||
| vector<double> norm_pdf(vector<double> x, double mu, double sigma); | ||
| //! Adds a Depth-to-CTD relation | ||
| bool AddDepthCTD(vector<double> depthvec, vector<vector<double>> ctdarr, int DetID, unordered_map<int, vector<double>>& DepthGrid, unordered_map<int,vector<vector<double>>>& CTDMap); | ||
|
|
||
| //! Adds a Depth-to-CTD relation | ||
| bool AddDepthCTD(vector<double> depthvec, vector<vector<double>> ctdarr, int DetID, unordered_map<int, vector<double>>& DepthGrid, unordered_map<int,vector<vector<double>>>& CTDMap); | ||
|
|
||
| //! Determine the Grade (geometry of charge sharing) of the Hit | ||
| int GetHitGrade(MHit* H); | ||
|
|
||
| //! Load in the specified coefficients file | ||
| bool LoadCoeffsFile(MString FName); | ||
|
|
||
| //! Return the coefficients for a pixel | ||
| vector<double>* GetPixelCoeffs(int PixelCode); | ||
|
|
||
| //! Load the splines file | ||
| bool LoadSplinesFile(MString FName); | ||
|
|
||
| //! Mask Metrology Correction | ||
| bool m_MaskMetrologyEnabled; | ||
|
|
||
| //! Load the metrology mask file | ||
| bool LoadMaskMetrologyFile(MString FName); | ||
|
|
||
| //! Get the x, y position of the intersection of two strips based on the Metrology Mask | ||
| vector<double> GetStripIntersection(MReadOutElementDoubleStrip LVStrip, MReadOutElementDoubleStrip HVStrip); | ||
|
|
||
| //! Get the timing FWHM noise for the specified pixel and Energy | ||
| double GetTimingNoiseFWHM(int PixelCode, double Energy); | ||
|
|
||
|
|
@@ -147,6 +175,12 @@ class MModuleDepthCalibration2024 : public MModule | |
| unordered_map<int, vector<double>> m_DepthGrid; | ||
| bool m_SplinesFileIsLoaded; | ||
| bool m_CoeffsFileIsLoaded; | ||
| bool m_MaskMetrologyFileIsLoaded; | ||
|
|
||
| // The Mask Metrology | ||
| MString m_MaskMetrologyFile; | ||
| map<MReadOutElementDoubleStrip, vector<double>> m_MaskMetrology; | ||
|
|
||
|
|
||
| // boolean for use with the card cage at UCSD since it tags all events as detector 11 | ||
zoglauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| bool m_UCSDOverride; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,8 +75,30 @@ void MGUIOptionsDepthCalibration2024::Create() | |
| m_SplinesFileSelector = new MGUIEFileSelector(m_OptionsFrame, "Select a splines file:", | ||
| dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->GetSplinesFileName()); | ||
| m_SplinesFileSelector->SetFileType("splines", "*.csv"); | ||
| TGLayoutHints* Label2Layout = new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 10, 10, 10, 10); | ||
| m_OptionsFrame->AddFrame(m_SplinesFileSelector, Label2Layout); | ||
| // TGLayoutHints* Label2Layout = new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 10, 10, 10, 10); | ||
| m_OptionsFrame->AddFrame(m_SplinesFileSelector, LabelLayout); | ||
|
|
||
| m_MaskMetModeCB = new TGCheckButton(m_OptionsFrame, "Enable mask metrology correction and read calibration from file:", c_MetFile); | ||
| m_MaskMetModeCB->SetState((dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->GetMaskMetrologyCorrection() == 1) ? kButtonDown : kButtonUp); | ||
| m_MaskMetModeCB->Associate(this); | ||
| m_OptionsFrame->AddFrame(m_MaskMetModeCB, LabelLayout); | ||
|
|
||
| m_UseMaskMetCorr = dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->GetMaskMetrologyCorrection(); | ||
|
|
||
| // TGLayoutHints* FileLabelLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX, m_FontScaler*65 + 21*m_FontScaler, m_FontScaler*65, 0, 2*m_FontScaler); | ||
|
|
||
| m_MaskMetrologyFileSelector = new MGUIEFileSelector(m_OptionsFrame, "", dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->GetMaskMetrologyFileName()); | ||
| m_MaskMetrologyFileSelector->SetFileType("metrology", "*.csv"); | ||
|
||
| m_OptionsFrame->AddFrame(m_MaskMetrologyFileSelector, LabelLayout); | ||
|
|
||
|
|
||
| if (m_UseMaskMetCorr) { | ||
| m_MaskMetrologyFileSelector->SetEnabled(true); | ||
| } else { | ||
| m_MaskMetrologyFileSelector->SetEnabled(false); | ||
| } | ||
|
|
||
|
|
||
|
|
||
| m_UCSDOverride = new TGCheckButton(m_OptionsFrame, "Check this box if you're using the card cage at UCSD", 1); | ||
| m_UCSDOverride->SetOn(dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->GetUCSDOverride()); | ||
|
|
@@ -97,16 +119,28 @@ bool MGUIOptionsDepthCalibration2024::ProcessMessage(long Message, long Paramete | |
| bool Status = true; | ||
|
|
||
| switch (GET_MSG(Message)) { | ||
| case kC_COMMAND: | ||
| switch (GET_SUBMSG(Message)) { | ||
| case kCM_BUTTON: | ||
| break; | ||
| default: | ||
| case kC_COMMAND: | ||
| switch (GET_SUBMSG(Message)) { | ||
| case kCM_BUTTON: | ||
| break; | ||
| case kCM_CHECKBUTTON: | ||
| switch (Parameter1) { | ||
| case c_MetFile: | ||
| if (m_MaskMetModeCB->GetState() == kButtonDown) { | ||
| m_UseMaskMetCorr = 1; | ||
|
||
| m_MaskMetrologyFileSelector->SetEnabled(true); | ||
| } else if (m_MaskMetModeCB->GetState() == kButtonUp) { | ||
| m_UseMaskMetCorr = 0; | ||
| m_MaskMetrologyFileSelector->SetEnabled(false); | ||
| } | ||
| break; | ||
| } | ||
| break; | ||
| default: | ||
| break; | ||
| } | ||
| break; | ||
| default: | ||
| break; | ||
| } | ||
|
|
||
| if (Status == false) { | ||
|
|
@@ -127,6 +161,10 @@ bool MGUIOptionsDepthCalibration2024::OnApply() | |
|
|
||
| dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->SetCoeffsFileName(m_CoeffsFileSelector->GetFileName()); | ||
| dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->SetSplinesFileName(m_SplinesFileSelector->GetFileName()); | ||
|
|
||
| if (dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->GetMaskMetrologyCorrection() != m_UseMaskMetCorr) dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->EnableMaskMetrologyCorrection(m_UseMaskMetCorr); | ||
|
|
||
| dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->SetMaskMetrologyFileName(m_MaskMetrologyFileSelector->GetFileName()); | ||
| dynamic_cast<MModuleDepthCalibration2024*>(m_Module)->SetUCSDOverride(m_UCSDOverride->IsOn()); | ||
|
|
||
| return true; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use bool