-
Notifications
You must be signed in to change notification settings - Fork 0
BS parameters for MC production & upload to CondDB
The whole procedure consists of these steps:
- define the parameter values, e.g. starting from the measurement of beamspot on data;
- create a set of VtxSmearing parameters in this file;
- create and upload a BeamSpotRcd payload containing the corresponding parameter values ("TAG_v0_mc");
- fit the beamspot on the RelVal MC samples produced with the input VtxSmearing parameters + .db file created in the steps above;
- create and upload a second BeamSpotRcd payload ("TAG_v1_mc") containing the newly measured parameter values.
In the following steps 2-4 are described. Step 5 is exactly the same as step 3, starting from the new .txt file.
1. start from the (averaged over the period you’re interested in) BS x, y, z and sigma z handy;
2. you also need the position of the BPIX barycentre;
3. apply a translation of -BPIX to your BS, so that the centre of the reference frame coincides with the position of the BPIX barycentre. These are the x,y and z coordinates to be passed to the vtx smearing module.
4. beta*: you take from the LHC beam parameters during the relevant run.
5. emittance: can be computed from https://lpc.web.cern.ch/lumiCalc.html, using sigma_x, sigma_y and beta star. Basically you have to change the "Normalised transverse emittance" value until you get "Transverse beam spot" equal to the sigma_x or sigma_y value you need (not "Transverse beam size at IP").
- 5.1 in the emittance formula you’ll have to choose between sigma_x and _y, and you’ll probably see the two differ slightly in data. In pp runs this is due to a small tilt wrt the beam z direction and the sigma with the lowest value is the one closest to the actual beam transverse width.
- 5.2 the machinery takes in the non-normalised transverse emittance in cm, you’ll need to plug in a 10^2 factor to the number you get from the calculator
1. Prepare a .txt file in the usual BS format with the parameters corresponding to those of the new set of VtxSmearing parameters (i.e. the positions should be compatible with the ones added in the new VtxSmearing parameters).
2. You are now with file named, e.g., BeamFit_*.txt.
In order to create a .db file to be uploaded to DropBox, open this file and remove the first four lines (i.e. remove:
Runnumber 1
BeginTimeOfFit 1970.01.01 00:00:00 GMT 0
EndTimeOfFit 1970.01.01 00:00:00 GMT 0
LumiRange 1 - 90
3. Open the python file write2DB.py and modify the name of the output file (modify here) and the creation tag (modify here). The name of input txt file will be passed via command line.
4. Now run
cmsRun write2DB.py inputFile=BeamFit_*.txt
You will have a .db file in your directory. To check if the stored values do agree with your previous txt file, you can run the script readDB.py modifying the input file and the tag accordingly.
5. In order to upload the .db file to dropbox, follow the instructions on https://twiki.cern.ch/twiki/bin/view/CMS/ConditionUploader#Usage The final .txt file for the upload to dropbox should be something like
{
"destinationDatabase": "oracle://cms_orcon_prod/CMS_COND_31X_BEAMSPOT",
"destinationTags": {
"BeamSpotObjects_0TdNdEtaCollision2015_v0_mc": {
"dependencies": {},
"synchronizeTo": "offline"
}
},
"inputTag": "BeamSpotObjects_0TdNdEtaCollision2015_v0_mc",
"since": null,
"userText": "Beamspot as measured in data, run 247324, LS88-311, special dNdEta run, 0 Tesla"
}
6. Finally, queue your tag to the chosen queue as explained here
cmsrel CMSSW_X_X_X
cd CMSSW_X_X_X/src
cmsenv
git cms-addpkg RecoVertex/BeamSpotProducer
scram b -j 8
cd RecoVertex/BeamSpotProducer/test
cmsRun BeamFit_LumiBased_NewAlignWorkflow.py
Before running cmsRun, make sure you properly modified the input files and parameters (saveNtuples, ...).
In order to fit the BS parameters using the whole statistics, set
process.d0_phi_analyzer.BSAnalyzerParameters.fitEveryNLumi = -1
process.d0_phi_analyzer.BSAnalyzerParameters.resetEveryNLumi = -1
The location of input data can be found on https://cmsweb.cern.ch/das/.
(Input data format is something like
/RelValMinBias_13/CMSSW_7_4_6_patch5-TkAlMinBias-74X_mcRun2_startup_realisticBS_Queue-v1/ALCARECO
)
NB. The .txt output file is not re-created every time you run the cfg, but the results are appended at the end of the file. If you run twice the same cfg, make sure not to have duplicate entries in the payload.txt.
(partially old:
If you have run the BS fit per each LS, and you want to to produce the average beamspot parameters over the entire run, you can use the script RecoVertex/BeamSpotProducer/python/workflow/test/test_workflow.py.
You should change
- the run number (here): it is 1 in MC
- the input .txt file (here)
- comment from line 39 to 57, since this is needed only for data
)
- Instructions for ReReco
- BS parameters for MC production & upload to CondDB
- Talks
- Useful links
- Notes for BS fit on VdM scans
- Notes for error scale computation
- Begin of run checks
- DQM and PCL beam spot fits
- BS for FTV
- BS Trends Plots
- Payloads log 2015
- Payloads log 2016
- Payloads log 2017
- Payloads log UL2017
- Payloads log 2018
- Payloads log 2019
- Payloads log 2022
- Payloads log 2023