====================================
This code produces (1D and 2D) pixel template and generr sqlite db files by uploading template files and associating each detID with a template.
Currently not yet integrated into CMSSW, so this is very kludge-y and does not retain a working clone of this repo. Sorry! This code just adds a few files to CondTools in CMSSW, so until it's incorporated this will be a bit nasty.
setenv SCRAM_ARCH slc6_amd64_gcc530
cmsrel CMSSW_9_0_0_pre4
cd CMSSW_9_0_0_pre4/src/
cmsenv
git cms-addpkg CondTools
git cms-addpkg Configuration
git clone https://github.com/eminizer/pixel_templates
cp -r pixel_templates/ CondTools/* CondTools/
rmrf pixel_templates/CondTools
scram b -j 20
- Template and GenError Files
- These are produced by Prof. Morris Swartz at Johns Hopkins University
- Template files should be located by default in CondTools/SiPixel/data/, GenErr files in CondTools/SiPixel/generr_data (this can be changed via a command line option, see below). Usually when I run I leave both types of template inside the CondTools/SiPixel/data/directory and point both the template and generror code to the same place using a command line option.
- Template files should be named in the format "template_summary_zp????.out", GenErrs files as "generr_summary_zp????.out" (this is hardcoded currently so if it changes edits to the scripts will need to be made).
- Map File
- This is a .csv file that maps detector locations to templates
- You can make this from a spreadsheet if you want
- An example of the format can be found at /CondTools/SiPixel/data/template_1D_IOV12/IOV12_map.csv
- The location of this file can be changed via a command line option, but it's currently set to the example above
Example commands The output of these commands prints some useful information, including the location and template assignments for each detID, so it could be good to pipe it to a file if you want to double check.
- Producing Template SQLite files
cd CondTools/SiPixel/test
cmsRun SiPixelTemplateDBObjectUploader_cfg.py MagField=3.8 Year=2017 Version=1 Append=bugfix Map=../data/template1D_phase1_2017_IOV1/phase1_2017_IOV1_map.csv TemplateFilePath=CondTools/SiPixel/data/template1D_phase1_2017_IOV1
This will produce an SQLLite file called "SiPixelTemplateDBObject_phase1_38T_2017_v1_bugfix.db"
- Producing GenError SQLite files
cd CondTools/SiPixel/test
cmsRun SiPixelGenErrorDBObjectUploader_cfg.py MagField=3.8 Year=2017 Version=1 Append=bugfix Map=../data/template1D_phase1_2017_IOV1/phase1_2017_IOV1_map.csv GenErrFilePath=CondTools/SiPixel/data/template1D_phase1_2017_IOV1
This will produce an SQLLite file called "SiPixelGenErrorDBObject_phase1_38T_2017_v1_bugfix.db"
-
MagField: Magnetic field value in Tesla (not deciTesla, so "3.8" NOT "38")
-
Year: Current year for versioning
-
Version: Version number
-
Append: Anything to add to the end of the SQLite filenames, like "bugfix"
-
Fullname: In case the options above are insufficient to title the files as desired, use this flag to name them anything you like.
-
Map: Full path to the Map file mentioned above (this one does have a default, so if you've changed something, use this option)
-
GlobalTag: GlobalTag for data run (default is set for this one too, so change it if necessary)
-
Delimiter: The delimiter used in the .csv map file (default is a comma, ",")
-
Quotechar: The quotechar used in the .csv map file (default is double quotes, """)
-
(Template/GenErr)FilePath: The path to the directory holding the template/generr files (these are currently set to the defaults mentioned above)
-
useVectorIndices: Set to true if the input file is indexed [0,(N-1)] instead of [1,N]; ([1,N] is the default and corresponds to the pixel offline conventions)
-
Submit a pull request to CMSSW
-
Incorporate some sort of visualization of template/detID assignments
This work has been maintained to this point by Maggie Eminizer at Johns Hopkins University (margaret.eminizer@gmail.com) and represents a service work contribution to the CMS Collaboration.