-
Notifications
You must be signed in to change notification settings - Fork 0
Modify calculations for the Lorentz angle #17
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
Changes from 1 commit
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 | ||
|---|---|---|---|---|
|
|
@@ -214,7 +214,8 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS | |||
| << "p4" << "\t" << "e4" << "\t" | ||||
| << "p5" << "\t" << "e5" << "\t" | ||||
| << "chi2" << "\t" << "prob" << "\t" | ||||
| << "newDetId" << std::endl; | ||||
| << "newDetId" << "\t" << "tan(LA)" << "\t" | ||||
| << "Error(LA)" << std::endl; | ||||
| // clang-format on | ||||
|
|
||||
| std::unique_ptr<SiPixelLorentzAngle> LorentzAngle = std::make_unique<SiPixelLorentzAngle>(); | ||||
|
|
@@ -228,6 +229,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS | |||
| f1->SetParName(5, "quintic term"); | ||||
|
|
||||
| double p1_simul_newmodule = 0.294044; | ||||
| double half_width = 0.0285 / 2 * 10000; // pixel width in units of micro meter | ||||
|
|
||||
| for (int j = 0; j < (int)hists.BPixnewDetIds_.size(); j++) { | ||||
| int new_index = j + 1 + hists.nModules_[hists.nlay - 1] + (hists.nlay - 1) * hists.nModules_[hists.nlay - 1]; | ||||
|
|
@@ -268,12 +270,25 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS | |||
| double chi2 = f1->GetChisquare(); | ||||
| double prob = f1->GetProb(); | ||||
|
|
||||
| double f1_halfwidth = p0 + p1 * half_width + p2 * pow(half_width, 2) + p3 * pow(half_width, 3) + | ||||
| p4 * pow(half_width, 4) + p5 * pow(half_width, 5); | ||||
|
|
||||
| double f1_zerowidth = p0; | ||||
|
|
||||
| double tan_LA = | ||||
| (f1_halfwidth - f1_zerowidth) / half_width; // tan_LA = (f1(x = half_width) - f1(x = 0)) / (half_width - 0) | ||||
| double errsq_LA = (pow(e1, 2) + pow((half_width * e2), 2) + pow((half_width * half_width * e3), 2) + | ||||
| pow((half_width * half_width * half_width * e4), 2) + | ||||
| pow((half_width * half_width * half_width * half_width * e5), 2)) * | ||||
| pow(tan_LA, 2); // Propagation of uncertainty | ||||
| double error_LA = sqrt(errsq_LA); | ||||
|
|
||||
| edm::LogPrint("LorentzAngle") << std::setprecision(4) << hists.BPixnewModule_[j] << "\t" << hists.BPixnewLayer_[j] | ||||
| << "\t" << p0 << "\t" << e0 << "\t" << p1 << std::setprecision(3) << "\t" << e1 | ||||
| << "\t" << e1 / p1 * 100. << "\t" << (p1 - p1_simul_newmodule) / e1 << "\t" << p2 | ||||
| << "\t" << e2 << "\t" << p3 << "\t" << e3 << "\t" << p4 << "\t" << e4 << "\t" << p5 | ||||
| << "\t" << e5 << "\t" << chi2 << "\t" << prob << "\t" << hists.BPixnewDetIds_[j] | ||||
| << std::endl; | ||||
| << "\t" << tan_LA << "\t" << error_LA << std::endl; | ||||
| } | ||||
|
|
||||
| double p1_simul[hists.nlay][hists.nModules_[hists.nlay - 1]]; | ||||
|
|
@@ -335,12 +350,26 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS | |||
| double chi2 = f1->GetChisquare(); | ||||
| double prob = f1->GetProb(); | ||||
|
|
||||
| double f1_halfwidth = p0 + p1 * half_width + p2 * pow(half_width, 2) + p3 * pow(half_width, 3) + | ||||
| p4 * pow(half_width, 4) + p5 * pow(half_width, 5); | ||||
|
|
||||
| double f1_zerowidth = p0; | ||||
|
|
||||
| double tan_LA = | ||||
| (f1_halfwidth - f1_zerowidth) / half_width; // tan_LA = (f1(x = half_width) - f1(x = 0)) / (half_width - 0) | ||||
| double errsq_LA = (pow(e1, 2) + pow((half_width * e2), 2) + pow((half_width * half_width * e3), 2) + | ||||
| pow((half_width * half_width * half_width * e4), 2) + | ||||
| pow((half_width * half_width * half_width * half_width * e5), 2)) * | ||||
| pow(tan_LA, 2); // Propagation of uncertainty | ||||
| double error_LA = sqrt(errsq_LA); | ||||
|
|
||||
| edm::LogPrint("LorentzAngle") << std::setprecision(4) << i_module << "\t" << i_layer << "\t" << p0 << "\t" << e0 | ||||
| << "\t" << p1 << std::setprecision(3) << "\t" << e1 << "\t" << e1 / p1 * 100. | ||||
| << "\t" << (p1 - p1_simul[i_layer - 1][i_module - 1]) / e1 << "\t" << p2 << "\t" | ||||
| << e2 << "\t" << p3 << "\t" << e3 << "\t" << p4 << "\t" << e4 << "\t" << p5 << "\t" | ||||
| << e5 << "\t" << chi2 << "\t" << prob << "\t" | ||||
| << "null" << std::endl; | ||||
| << "null" | ||||
| << "\t" << tan_LA << "\t" << error_LA << std::endl; | ||||
|
|
||||
| const auto& detIdsToFill = hists.detIdsList.at(i_index); | ||||
|
|
||||
|
|
@@ -351,7 +380,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS | |||
| // if the fit quality is OK | ||||
| if (prob > fitProbCut_) { | ||||
|
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. I just want to draw your attention to the fact that right now
which is not tuned at all, it's just a random value I picked. thinking in the long run for the multi-run harvesting applications, a part from the minimum number of events in the MRH configuration, I think it would be good to have some sort of internal logic from within the SiPixel LA harvester to veto the creation of the payload (as it is done for all the other Tracker PCL workflows)
Member
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. We have a similar issue with the SiPixelQuality payloads where the old payloads gets appended when the occupancy threshold is not passed. So it looks like we need a similar fix for both types of payloads. Concerning the 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.
the logic better be implemented on the cmssw side, where you have full control and NOT in the MRH backend. |
||||
| for (const auto& id : detIdsToFill) { | ||||
| bPixLorentzAnglePerTesla_ = p1 / theMagField; | ||||
| bPixLorentzAnglePerTesla_ = tan_LA / theMagField; | ||||
| if (!LorentzAngle->putLorentzAngle(id, bPixLorentzAnglePerTesla_)) { | ||||
| edm::LogError("SiPixelLorentzAnglePCLHarvester") | ||||
| << "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] detid already exists" << std::endl; | ||||
|
|
||||
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.
No magic numbers, please fetch from geometry
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.
@wweiphy can you please do this?