Warning, /DQM/TrackerRemapper/README.md is written in an unsupported language. File is not indexed.
0001 # Tracker Remapper Tool
0002
0003 The tool to either remap existing DQM histograms onto Strip Detector layout or to analyze event files and put events into the right detector parts.
0004
0005 ## Running basics
0006
0007 Should you need to run this tool use: `cmsRun ConfFile_cfg.py [option=value]`
0008
0009 Options can be either adjusted in the configuration file (`ConfFile_cfg.py`) or passed as a list of `key=value` pairs. In the latter case unspecified options are taken directly from `ConfFile_cfg.py`.
0010
0011 ## Options
0012
0013 1. `opMode` - mode of operation, allowed values:
0014 1. `0` or `MODE_ANALYZE` (in configuration)
0015 2. `1` or `MODE_REMAP` (in configuration)
0016 2. `analyzeMode` - option used to choose what do you want to put inside the map if `MODE_ANALYZE` was chosen:
0017 1. `1` or `RECHITS` (in configuration) for TRACKS
0018 2. `2` or `DIGIS` (in configuration) for DIGIS
0019 3. `3` or `CLUSTERS` (in configuration) for CLUSTERS
0020 3. `eventLimit` - only relevant for `MODE_ANALYZE` controls how many events from the input should be processed; default value is `100`, put `-1` to process all events from the input
0021 4. `inputRootFile` - relative path to the file to process, it should be different type of file depending on the `opMode` set:
0022 1. `MODE_ANALYZE` - DQM root file containing regular SiStrip plots
0023 2. `MODE_REMAP` - root file with events to process
0024 4. `stripHistogram` - histogram name to look for when `opMode=MODE_REMAP` is set, default is `TkHMap_NumberValidHits`
0025 5. `src` - automaticly set based on your settings, change at your own risk
0026 6. `globalTag` - global tag (GT) to use, default is `auto:run2_data`
0027
0028 ## The output
0029
0030 Your output will be saved by default as `outputStrip.root` in your current working directory. This can be tuned in the `ConfFile_cfg.py` file.
0031
0032 SiPixelPhase1Analyzer package
0033 =============================
0034
0035 The aim of this package is to provide a convinient way to present standard Pixel Detector histograms in a way that mimics the layout of real detector.
0036
0037 Imagine a standard histogram of Pixel Forward Detector where bins are simple squares with assigned fixed coordinates (x - disk, y - blade number) - it is not easy to visualize, how exactly bin entries are represented in the detector layout.
0038
0039 Here comes this package - it creates histograms with bins which are laid out in space in a very similar way to the real detector. In case of Forward Detector bins create fans in XY-plane.
0040
0041 Two modes of operation
0042 ----------------------
0043
0044 This package can operate in two modes:
0045 1. *MODE_REMAP* - it requires file with Oline histograms that will be remapped to Offline histograms
0046 2. *MODE_ANALYZE* - takes file to analyze collections contained in events
0047
0048 How are bins booked and what kind of histograms may be produced
0049 ---------------------------------------------------------------
0050
0051 To obtain global position of each module of the Pixel Detector GeomDet::surface() is used. It returns the reference to the object that approximates real detector - position and dimensions (width, lenght, thickness). Moreover, so that to create more complicated layouts (like in forward detector) also orientation in space is required (GeomDet::rotation()). Based on this data transformation matrix is built (only in Forward case). As vertices for a given geometry unit are ready new bin in the appropriate TH2Poly histogram is created with an ID that is equal to the module rawId.
0052
0053 Types of booked histograms:
0054
0055 - `barrel_layer_n`, [1,...,4],
0056 - `barrel_summary` (keeps all 4 layers in one histogram),
0057 - `forward_disk_n`, [-3,...,3],
0058 - `forward_summary` (keeps all 6 disks in one histogram like here, disks on the negative side of x-axis correspond to disks on the negative side of the barrel, the higher the center of the disk the higher is also disk number).
0059
0060 Barrel histograms do not differ much from Online barrel histograms. Here is just Offline naming convention used. X axis represents global z-coordinate when y axis is a simple offline ladder number.
0061
0062 Concentric shape of Forward Disks and the existence of two panels on each of them forces another treatment. First of all each geometry unit (nth offline blade) is of trapezoidal shape in XY-plane which is split by the diagonal into two triangles:
0063
0064 - smaller one represents the data of panel 1,
0065 - bigger one represents the data of panel 2.
0066
0067 Secondly, vertices are multiplied by the transformation matrix which is a mean of two transformation matrices to obtain final layout.
0068
0069 How to configure the package
0070 ----------------------------
0071
0072 1. *MODE_REMAP*
0073 * it is required to provide a dummy file with at least one event to make the analyze() method fire (`fileNames = cms.untracked.vstring("file:RECO_file.root")`)
0074 * set `opMode = cms.untracked.uint32(MODE_REMAP)`
0075 * give a file in which histograms to remap will be searched for `remapRootFileName = cms.untracked.vstring("dqmFile.root")`
0076 * `baseHistogramName`, `pathToHistograms` and `isBarrelSource` are closely related to each other because every nth element describes one histogram set that will be remapped.
0077 The plugin will be looking for all histograms which names are provided in `baseHistogramName` in a corresponding directory `pathToHistograms` in file `remapRootFileName` and assumes it is of type (Barrel/Forward : 1/0) as specified in `isBarrelSource`. If everything goes fine there will be produced output file with histograms contained in directories which are named exactly the same as entries in `baseHistogramName`. Besides of booking new histograms each directory contains also source histograms from the original file. If there is a problem with opening source histogram it will be skipped.
0078 2. *MODE_ANALYZE"
0079 * set your input file (`fileNames = cms.untracked.vstring("file:RECO_file.root")`)
0080 * set `opMode = cms.untracked.uint32(MODE_ANALYZE)`
0081 * set the source collection of your inputs `src = cms.InputTag("generalTracks")`, at this point of development only `recHits` are allowed - these are extracted from collection of tracks
0082 After running the code in this mode user should get a root file which contains the distribution of __something__ in Barrel and Forward Detector.
0083
0084 DEBUG mode
0085 ---------
0086
0087 There is another mode of operation that alters default contentents of REMAP/ANALYZE histograms and creates additional files in the working directory that are used for debugging purposes. You can see the results if you uncomment '#define DEBUG_MODE' and recompile the package.
0088
0089 This mode helps to understand mapping from Online to Offline DQM, produces files with bins' vertices to use by external tools, as well as helps to check if hits positions are properly represented in contents of the bins.