Skip to content
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

Sistrip calib tree devel2018 backplane #14

Open
wants to merge 4 commits into
base: sitripCalibTreeDevel2018
Choose a base branch
from

Conversation

robervalwalsh
Copy link

Additional variables for backplane correction studies
Fix reading LA values from database
Additional command line option for cosmic triggers

@@ -57,7 +57,7 @@ void LorentzAngleRunInfo::beginRun(const edm::Run & irun, const edm::EventSetup
run = irun.run();
edm::ESHandle<TrackerGeometry> theTrackerGeometry; iSetup.get<TrackerDigiGeometryRecord>().get( theTrackerGeometry );
edm::ESHandle<MagneticField> magfield; iSetup.get<IdealMagneticFieldRecord>().get(magfield);
edm::ESHandle<SiStripLorentzAngle> SiStripLorentzAngle; iSetup.get<SiStripLorentzAngleDepRcd>().get(SiStripLorentzAngle);
edm::ESHandle<SiStripLorentzAngle> SiStripLorentzAngle; iSetup.get<SiStripLorentzAngleRcd>().get("deconvolution",SiStripLorentzAngle);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @robervalwalsh Not sure why we need to hard-code "deco" here. Isn't it OK to consume the dependent record and let it deal with the latency switches?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mmusich, I thought so, but the numbers coming out were different.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, the values from the dependent record were also different from the ones in the payload inspector.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so, but the numbers coming out were different.

Because you were using some runs in peak?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, the values from the dependent record were also different from the ones in the payload inspector.

what run number did you check?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure I was using a run in deco. I have to go through my notes to find it. May take a while

@mmusich
Copy link

mmusich commented Sep 29, 2020

@robervalwalsh I am positively puzzled by your claims.
I tried to add the following code on top of this branch:

diff --git a/CalibTracker/SiStripLorentzAngle/plugins/LorentzAngleRunInfo.cc b/CalibTracker/SiStripLorentzAngle/plugins/LorentzAngleRunInfo.cc
index 49f1cae39c4..f021d66d76e 100644
--- a/CalibTracker/SiStripLorentzAngle/plugins/LorentzAngleRunInfo.cc
+++ b/CalibTracker/SiStripLorentzAngle/plugins/LorentzAngleRunInfo.cc
@@ -22,6 +22,8 @@
 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
 
 #include "CalibTracker/SiStripLorentzAngle/interface/LorentzAngleRunInfo.h"
+#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
+#include "Geometry/Records/interface/TrackerTopologyRcd.h"
 
 using namespace edm;
 using namespace reco;
@@ -58,6 +60,13 @@ void LorentzAngleRunInfo::beginRun(const edm::Run & irun, const edm::EventSetup
    edm::ESHandle<TrackerGeometry> theTrackerGeometry;         iSetup.get<TrackerDigiGeometryRecord>().get( theTrackerGeometry );  
    edm::ESHandle<MagneticField> magfield;                     iSetup.get<IdealMagneticFieldRecord>().get(magfield);                      
    edm::ESHandle<SiStripLorentzAngle> SiStripLorentzAngle;    iSetup.get<SiStripLorentzAngleDepRcd>().get(SiStripLorentzAngle);      
+   edm::ESHandle<TrackerTopology> tTopoHandle;                iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
+   const TrackerTopology* const tTopo = tTopoHandle.product();
+
+   std::stringstream ss;
+   SiStripLorentzAngle->printSummary(ss,tTopo);
+
+   std::cout << ss.str() << std::endl;
 
    auto dets = theTrackerGeometry -> detsTIB();
    dets.insert(dets.end(),(theTrackerGeometry -> detsTOB()).begin(),(theTrackerGeometry -> detsTOB()).end());
diff --git a/CondCore/SiStripPlugins/plugins/SiStripLorentzAngle_PayloadInspector.cc b/CondCore/SiStripPlugins/plugins/SiStripLorentzAngle_PayloadInspector.cc
index 14d2fa6f7bd..883080f49ea 100644
--- a/CondCore/SiStripPlugins/plugins/SiStripLorentzAngle_PayloadInspector.cc
+++ b/CondCore/SiStripPlugins/plugins/SiStripLorentzAngle_PayloadInspector.cc
@@ -42,7 +42,9 @@ namespace {
     
   public:
     SiStripLorentzAngleValue() : cond::payloadInspector::Histogram1D<SiStripLorentzAngle>("SiStrip LorentzAngle values",
-                                                                                         "SiStrip LorentzAngle values", 100,0.0,0.05){
+                                                                                         "SiStrip LorentzAngle values", 100,0.0,0.05),
+                                m_trackerTopo{StandaloneTrackerTopology::fromTrackerParametersXMLFile(edm::FileInPath("Geometry/TrackerCommonData/data/trackerParameters.xml").fullPath())}
+    {
       Base::setSingleIov( true );
     }
     
@@ -51,6 +53,11 @@ namespace {
        std::shared_ptr<SiStripLorentzAngle> payload = Base::fetchPayload( std::get<1>(iov) );
        if( payload.get() ){
          
+         std::stringstream ss;
+         payload->printSummary(ss,&m_trackerTopo);
+
+         std::cout << ss.str() << std::endl;
+
          std::map<uint32_t,float> LAMap_ = payload->getLorentzAngles();
       
          for(const auto &element : LAMap_){
@@ -60,6 +67,8 @@ namespace {
       }// iovs
       return true;
     }// fill
+  private:
+    TrackerTopology m_trackerTopo;
   };
   
   /************************************************

and then tried to:

  1. to run the calibtree producer with:
cd CalibTracker/SiStripCommon/test/
cmsRun testProduceCalibrationTree_cfg.py

and I get:

conditionGT       :  auto:phase1_2017_realistic
conditionOverwrite:  
inputCollection   :  generalTracks
maxEvents         :  -1
outputFile        :  calibTreeTest.root
inputFiles        :  [cms.untracked.vstring('/store/relval/CMSSW_9_2_2/RelValTTbar_13/GEN-SIM-RECO/PU25ns_92X_upgrade2017_realistic_v1-v1/10000/ECFEA1BD-BF4D-E711-A404-0CC47A7C345C.root')]
Summary of lorentz angles:
subDet          layer     mono/stereo         mean +- rms

TIB               1            0           0.01814 +- 0.00340413
                  1            1         0.0177894 +- 0.00347124
                  2            0         0.0175381 +- 0.00357623
                  2            1         0.0178439 +- 0.00362067
                  3            0         0.0178429 +- 0.00372877
                  4            0         0.0178784 +- 0.00351718

TOB               1            0         0.0233531 +- 0.00479858
                  1            1         0.0230756 +- 0.00484058
                  2            0         0.0234101 +- 0.00473987
                  2            1         0.0229167 +- 0.00473609
                  3            0          0.022981 +- 0.00458583
                  4            0         0.0233672 +- 0.00477859
                  5            0         0.0232901 +- 0.00454766
                  6            0         0.0231234 +- 0.00440467

TEC               1            0          0.020632 +- 0.00501763
                  1            1         0.0201787 +- 0.00480681
                  2            0         0.0208623 +- 0.00514982
                  2            1         0.0204095 +- 0.004315
                  3            0         0.0204844 +- 0.00493551
                  3            1         0.0204753 +- 0.0047322
                  4            0         0.0210384 +- 0.00531939
                  4            1         0.0212988 +- 0.00425544
                  5            0         0.0210037 +- 0.00505769
                  5            1         0.0211675 +- 0.00499643
                  6            0         0.0209067 +- 0.00485742
                  6            1         0.0214403 +- 0.00524339
                  7            0         0.0210741 +- 0.00513076
                  7            1         0.0239123 +- 0.00489914
                  8            0         0.0212957 +- 0.00512479
                  8            1         0.0235158 +- 0.0045499
                  9            0         0.0218557 +- 0.0048702
                  9            1         0.0236434 +- 0.00479556

TID               1            0         0.0173791 +- 0.0035801
                  1            1           0.01793 +- 0.00363026
                  2            0         0.0176957 +- 0.00349743
                  2            1         0.0179966 +- 0.00373594
                  3            0         0.0180476 +- 0.00343843
                  3            1         0.0178313 +- 0.00344809

  1. run the payload inspector against the deconvolution tag in the Global Tag: SiStripLorentzAngleDeco_StartUp_31X_v2
getPayloadData.py --plugin pluginSiStripLorentzAngle_PayloadInspector --plot plot_SiStripLorentzAngleValue --tag SiStripLorentzAngleDeco_StartUp_31X_v2 --time_type Run --iovs '{"start_iov": "1", "end_iov": "1"}' --db Prod --test ;

and I get:

Summary of lorentz angles:
subDet          layer     mono/stereo         mean +- rms

TIB               1            0           0.01814 +- 0.00340413
                  1            1         0.0177894 +- 0.00347124
                  2            0         0.0175381 +- 0.00357623
                  2            1         0.0178439 +- 0.00362067
                  3            0         0.0178429 +- 0.00372877
                  4            0         0.0178784 +- 0.00351718

TOB               1            0         0.0233531 +- 0.00479858
                  1            1         0.0230756 +- 0.00484058
                  2            0         0.0234101 +- 0.00473987
                  2            1         0.0229167 +- 0.00473609
                  3            0          0.022981 +- 0.00458583
                  4            0         0.0233672 +- 0.00477859
                  5            0         0.0232901 +- 0.00454766
                  6            0         0.0231234 +- 0.00440467

TEC               1            0          0.020632 +- 0.00501763
                  1            1         0.0201787 +- 0.00480681
                  2            0         0.0208623 +- 0.00514982
                  2            1         0.0204095 +- 0.004315
                  3            0         0.0204844 +- 0.00493551
                  3            1         0.0204753 +- 0.0047322
                  4            0         0.0210384 +- 0.00531939
                  4            1         0.0212988 +- 0.00425544
                  5            0         0.0210037 +- 0.00505769
                  5            1         0.0211675 +- 0.00499643
                  6            0         0.0209067 +- 0.00485742
                  6            1         0.0214403 +- 0.00524339
                  7            0         0.0210741 +- 0.00513076
                  7            1         0.0239123 +- 0.00489914
                  8            0         0.0212957 +- 0.00512479
                  8            1         0.0235158 +- 0.0045499
                  9            0         0.0218557 +- 0.0048702
                  9            1         0.0236434 +- 0.00479556

TID               1            0         0.0173791 +- 0.0035801
                  1            1           0.01793 +- 0.00363026
                  2            0         0.0176957 +- 0.00349743
                  2            1         0.0179966 +- 0.00373594
                  3            0         0.0180476 +- 0.00343843
                  3            1         0.0178313 +- 0.00344809

I am not able to reproduce the issue, at least in MC.

@mmusich
Copy link

mmusich commented Sep 29, 2020

For the record, I also forced the calibTree production to be run as if the MC was run was in Peak mode, by doing:

conddb_import -c sqlite_file:LatencyPeak.db -f frontier://FrontierProd/CMS_CONDITIONS -i SiStripLatency_GR10_v1_hlt -t SiStripLatency_MC_peak -b 108449 -e 108449    #this is a peak mode run

cmsRun testProduceCalibrationTree_cfg.py conditionOverwrite="SiStripLatency_MC_peak,SiStripLatencyRcd,sqlite_file:LatencyPeak.db,,2020-09-29 12:42:42"

and as expected this fails with:

----- Begin Fatal Exception 29-Sep-2020 14:51:17 CEST-----------------------
An exception of category 'NoProxyException' occurred while
   [0] Processing global begin Run run: 1
   [1] Calling method for module LorentzAngleRunInfo/'lorentzAngleRunInfo'
   [2] Using EventSetup component SiStripLorentzAngleDepESProducer/'siStripLorentzAngleDepESProducer' to make data SiStripLorentzAngle/'' in record SiStripLorentzAngleDepRcd
Exception Message:
No data of type "SiStripLorentzAngle" with label "peak" in record "SiStripLorentzAngleRcd"
 Please add an ESSource or ESProducer to your job which can deliver this data.
----- End Fatal Exception -------------------------------------------------

as there is no peak-labeled tag in the MC Global Tag

@robervalwalsh
Copy link
Author

Hi @mmusich,

Thanks a lot for the checks!

I think I found the source of my mistake. On data, when reading the payload with a private EDAnlayzer that reads out such information, I may have used IOV = 1 when calling EmptyIOVSource. The result for IOV = 1 is below.

When using a meaningful IOV, the results for both columns are exactly the same as you also obtained.

I will bring back the line

iSetup.get<SiStripLorentzAngleDepRcd>().get(SiStripLorentzAngle);

Test results for IOV=1 on data GT

           SiStripLorentzAngleRcd,  SiStripLorentzAngleDepRcd
TEC_L0a :   0.019122 ,               0.0222
TEC_L0s :   0.019122 ,               0.0222
TEC_L1a :   0.019122 ,               0.0222
TEC_L1s :   0.019122 ,               0.0222
TEC_L2a :   0.019122 ,               0.0222
TEC_L2s :   0.019122 ,               0.0222
TEC_L3a :   0.019122 ,               0.0222
TEC_L3s :   0.019122 ,               0.0222
TEC_L4a :   0.019122 ,               0.0222
TEC_L4s :   0.019122 ,               0.0222
TEC_L5a :   0.019122 ,               0.0222
TEC_L5s :   0.019122 ,               0.0222
TEC_L6a :   0.019122 ,               0.0222
TEC_L6s :   0.019122 ,               0.0222
TEC_L7a :   0.019122 ,               0.0222
TEC_L7s :   0.019122 ,               0.0222
TIB_L1a :   0.018948 ,               0.0174
TIB_L1s :   0.018948 ,               0.0174
TIB_L2a :   0.017135 ,               0.0174
TIB_L2s :   0.017135 ,               0.0174
TIB_L3a :   0.018786 ,               0.0174
TIB_L4a :   0.019161 ,               0.0174
TID_L0a :   0.0185075 ,              0.0174
TID_L0s :   0.0185075 ,              0.0174
TID_L1a :   0.0185075 ,              0.0174
TID_L1s :   0.0185075 ,              0.0174
TOB_L1a :   0.017375 ,               0.0222
TOB_L1s :   0.017375 ,               0.0222
TOB_L2a :   0.018994 ,               0.0222
TOB_L2s :   0.018994 ,               0.0222
TOB_L3a :   0.018621 ,               0.0222
TOB_L4a :   0.01979 ,                0.0222
TOB_L5a :   0.01991 ,                0.0222
TOB_L6a :   0.020042 ,               0.0222

@mmusich
Copy link

mmusich commented Oct 1, 2020

So, I checked this branch for changes in size of the calibTree, by running the following command:

cmsRun testProduceCalibrationTree_cfg.py inputFiles="/store/express/Run2018D/StreamExpress/ALCARECO/SiStripCalMinBias-Express-v1/000/323/492/00000/ED5EFF5C-1B7B-564D-974B-15499A1B7D4E.root" inputCollection="ALCARECOSiStripCalMinBias" conditionGT="101X_dataRun2_Express_v8"

(665 input events)

And I observe the following increase of the gainCalibration tree:

image

That's an almost 25% increase of the tree size, which is not negligible.
@robervalwalsh do you plan to have the need to access those variables also in collision runs? perhaps can be customized to be used only for cosmics?
@pieterdavid FYI

@pieterdavid
Copy link
Collaborator

Thanks @robervalwalsh !
For the size: I think the Lorentz angle and backplane correction measurements only need a few of the variables, so we could also put them in a separate tree (and then optimise the selection for LA and gain calibration separately - for the latter we don't need as much statistics for every run in calibtrees as before since the calibration is done, and can be redone, from ALCAPROMPT).

@robervalwalsh
Copy link
Author

Hi @mmusich, thanks! The original idea is to have the code to produce those variables when running on cosmics only. How exactly this will be implemented is to be discussed with the calibtree expert.

mmusich pushed a commit that referenced this pull request Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants