-
Notifications
You must be signed in to change notification settings - Fork 12
BD and QA event flag overhaul #89
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
Open
ckierans
wants to merge
6
commits into
cositools:develop/em
Choose a base branch
from
ckierans:bad_and_qa_flags
base: develop/em
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0445f37
Updated strip hit threshold logic, and now have QA flag to not filter…
ckierans a1add80
Merge branch 'develop/em' into threshold_fix
ckierans a8db144
Included better tracking for hits removed through threshold cut, and …
ckierans 3ccb3b1
Merge branch 'develop/em' into threshold_fix
ckierans a06ce65
Overhaul on BD flag from balloon days and updated variable names in M…
ckierans 5d83719
Added minor comments to MReadoutAssembly for PR
ckierans File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,19 +140,26 @@ bool MModuleDepthCalibration2024::Initialize() | |
| m_YPitches[DetID] = strip->GetPitchY(); | ||
| m_NXStrips[DetID] = strip->GetNStripsX(); | ||
| m_NYStrips[DetID] = strip->GetNStripsY(); | ||
| cout << "Found detector " << det_name << " corresponding to DetID=" << DetID << "." << endl; | ||
| cout << "Detector thickness: " << m_Thicknesses[DetID] << endl; | ||
| cout << "Number of X strips: " << m_NXStrips[DetID] << endl; | ||
| cout << "Number of Y strips: " << m_NYStrips[DetID] << endl; | ||
| cout << "X strip pitch: " << m_XPitches[DetID] << endl; | ||
| cout << "Y strip pitch: " << m_YPitches[DetID] << endl; | ||
|
|
||
| if (g_Verbosity >= c_Info) { | ||
| cout << "Found detector " << det_name << " corresponding to DetID=" << DetID << "." << endl; | ||
| cout << "Detector thickness: " << m_Thicknesses[DetID] << endl; | ||
| cout << "Number of X strips: " << m_NXStrips[DetID] << endl; | ||
| cout << "Number of Y strips: " << m_NYStrips[DetID] << endl; | ||
| cout << "X strip pitch: " << m_XPitches[DetID] << endl; | ||
| cout << "Y strip pitch: " << m_YPitches[DetID] << endl; | ||
| } | ||
| m_DetectorIDs.push_back(DetID); | ||
| m_Detectors[DetID] = det; | ||
| } else { | ||
| cout<<"ERROR in MModuleDepthCalibration2024::Initialize: Found a duplicate detector: "<<det_name<<endl; | ||
| if (g_Verbosity >= c_Error) { | ||
| cout<<"ERROR in MModuleDepthCalibration2024::Initialize: Found a duplicate detector: "<<det_name<<endl; | ||
| } | ||
| } | ||
| } else { | ||
| cout<<"ERROR in MModuleDepthCalibration2024::Initialize: Found a Strip3D detector with "<<det->GetNSensitiveVolumes()<<" Sensitive Volumes."<<endl; | ||
| if (g_Verbosity >= c_Error) { | ||
| cout<<"ERROR in MModuleDepthCalibration2024::Initialize: Found a Strip3D detector with "<<det->GetNSensitiveVolumes()<<" Sensitive Volumes."<<endl; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -207,7 +214,7 @@ bool MModuleDepthCalibration2024::AnalyzeEvent(MReadOutAssembly* Event) | |
|
|
||
| if (Event->GetGuardRingVeto()==true) { | ||
|
|
||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(true, "GR Veto"); | ||
| return false; | ||
|
|
||
| } else { | ||
|
|
@@ -224,7 +231,7 @@ bool MModuleDepthCalibration2024::AnalyzeEvent(MReadOutAssembly* Event) | |
| // GRADE=-1 is an error. Break from the loop and continue. | ||
| if ( Grade < 0 ){ | ||
| H->SetNoDepth(); | ||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(); | ||
| if (Grade == -1) { | ||
| ++m_ErrorSH; | ||
| } else if (Grade == -2) { | ||
|
|
@@ -234,7 +241,7 @@ bool MModuleDepthCalibration2024::AnalyzeEvent(MReadOutAssembly* Event) | |
| } | ||
| } else if (Grade > 4) { // GRADE=5 is some complicated geometry with multiple hits on a single strip. GRADE=6 means not all strips are adjacent. | ||
| H->SetNoDepth(); | ||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(true, "Multiple hits on single strip"); | ||
| if (Grade==5) { | ||
| ++m_Error5; | ||
| } else if (Grade==6) { | ||
|
|
@@ -285,24 +292,24 @@ bool MModuleDepthCalibration2024::AnalyzeEvent(MReadOutAssembly* Event) | |
| double LVTiming = LVSH->GetTiming(); | ||
| double HVTiming = HVSH->GetTiming(); | ||
|
|
||
| // If there aren't coefficients loaded, then calibration is incomplete. | ||
| // If there aren't coefficients loaded, then report a depth calibration error. | ||
| if( Coeffs == nullptr ){ | ||
| //set the bad flag for depth | ||
| H->SetNoDepth(); | ||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(true, "No calibration coefficients"); | ||
| ++m_Error1; | ||
| } else if (CTDVec.size() == 0) { | ||
| cout << "Empty CTD vector" << endl; | ||
| H->SetNoDepth(); | ||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(true, "No calibration coefficients"); | ||
| } else if (DepthVec.size() == 0) { | ||
| cout << "Empty Depth vector" << endl; | ||
| H->SetNoDepth(); | ||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(true, "No calibration coefficients"); | ||
| } else if ((LVTiming < 1.0E-6) || (HVTiming < 1.0E-6)) { | ||
| ++m_Error3; | ||
| H->SetNoDepth(); | ||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(true, "No timing"); | ||
| } else { | ||
|
|
||
| // If there are coefficients and timing information is loaded, try calculating the CTD and depth | ||
|
|
@@ -320,7 +327,7 @@ bool MModuleDepthCalibration2024::AnalyzeEvent(MReadOutAssembly* Event) | |
| //if the CTD is out of range, check if we should reject the event. | ||
| if( (CTD_s < (Xmin - 2.0*noise)) || (CTD_s > (Xmax + 2.0*noise)) ){ | ||
| H->SetNoDepth(); | ||
| Event->SetDepthCalibrationIncomplete(); | ||
| Event->SetDepthCalibrationError(true, "Out of Range"); | ||
| ++m_Error2; | ||
| } | ||
|
|
||
|
|
@@ -355,7 +362,7 @@ bool MModuleDepthCalibration2024::AnalyzeEvent(MReadOutAssembly* Event) | |
| Zpos = mean_depth; | ||
|
|
||
| // Add the depth to the GUI histogram. | ||
| if (Event->IsStripPairingIncomplete()==false) { | ||
| if (Event->IsStripPairingError()==false) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. White space: ..() == false |
||
| if (HasExpos() == true) { | ||
| m_ExpoDepthCalibration->AddDepth(DetID, Zpos); | ||
| } | ||
|
|
@@ -475,7 +482,9 @@ std::vector<double>* MModuleDepthCalibration2024::GetPixelCoeffs(int PixelCode) | |
| if( m_Coeffs.count(PixelCode) > 0 ){ | ||
| return &m_Coeffs[PixelCode]; | ||
| } else { | ||
| cout << "MModuleDepthCalibration2024::GetPixelCoeffs: cannot get stretch and offset; pixel code " << PixelCode << " not found." << endl; | ||
| if (g_Verbosity >= c_Warning) { | ||
| cout << "MModuleDepthCalibration2024::GetPixelCoeffs: cannot get stretch and offset; pixel code " << PixelCode << " not found." << endl; | ||
| } | ||
| return nullptr; | ||
| } | ||
| } else { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add error message