Ejemplo n.º 1
0
#! /usr/bin/env python
import sys, math, csv, json, pprint
from array import array
import ROOT as r
import lumiTools as l

### Get Data/MC files ###
bcmData = []
bcmData.extend(l.read_csv_file('data_db/BunchByBunch/Fill2663_NoHeader1.csv'))

### Set time frame ###
timeStart = 0
timeStop  = int(len(bcmData)*1.1)
duration  = int(timeStop - timeStart)

### Declare histograms ###
outFile = r.TFile('histograms/fedHistograms.root', 'RECREATE')
outFile.mkdir('OR', 'OR')
#outFile.mkdir('XOR-', 'XOR-')
#outFile.mkdir('XOR+', 'XOR+')
#outFile.mkdir('AND', 'AND')

r.TH1.SetDefaultSumw2(r.kTRUE)
r.TProfile.SetDefaultSumw2(r.kTRUE)

h1_Intensities          = r.TH1D('h1_Intensities', 'I_{1}#times I_{2};I_{1}#times I_{2};N_{bx}', 50, 0.8, 1.8) 
h1_IntensityCorr        = r.TH1D('h1_IntensityCorr', 'I_{1}#times I_{2}/<I_{1}#times I_{2}>;BCID;I_{1}#times I_{2}/<I_{1}#times I_{2}>', 3564, 0.5, 3564.5) 
p1_IntensVsTime         = r.TProfile('p1_IntensVsTime', 'I_{1}#times I_{2};BCID;I_{1}#times I_{2}', 3564, 0.5, 3564) 

outFile.cd('OR')
h1_ProbabilityOr        = r.TH1D('h1_ProbabilityOr', 'Probability of BCM1F OR;BCID;p(hit)', 3564, 0.5, 3564.5) 
Ejemplo n.º 2
0
#! /usr/bin/env python
import sys, math, csv, json, pprint
from array import array
import ROOT as r
import lumiTools as l


#fillList = [2629, 2630, 2634, 2535, 2644, 2645, 2646, 2648, 2649, 2651, 2653, 2657, 2658]
fillList = [2520]

bcmData = []
#bcmData.extend(l.read_csv_file('data_db/Current_bcm.csv'))
bcmData.extend(l.read_csv_file('data_db/fill2520bcm.csv'))

#pixelData = []
#pixelData.extend(l.read_json_file('data/pixel_lumi_raw_2012.json'))

### Declare histograms ###

timeStart = 0
timeStop  = int(len(bcmData)*1.1)
duration  = int(timeStop - timeStart)

start     = r.TDatime('2012-05-15 12:28:44').Convert()
stop      = r.TDatime(bcmData[int(len(bcmData))-1]['DT']).Convert()
#stop      = r.TDatime(bcmData[int(len(bcmData))-1]['DT_UNTIL']).Convert()

outFile     = r.TFile('histograms/lumiHistograms.root', 'RECREATE')
outFile.mkdir('OR', 'OR')
outFile.mkdir('XOR-', 'XOR-')
outFile.mkdir('XOR+', 'XOR+')
Ejemplo n.º 3
0
scanResults = []

#-----------#
# Fill 2855 #
#-----------#

if 2855 in fills:

### Scan configuration and corrections ###

    scans = ['1', '2'] #, '3'] 

### Input data files ###

    bcmData = [
        l.read_csv_file('data/July/VDMScanXY1.csv'),
        l.read_csv_file('data/July/VDMScanXY2.csv'),
        l.read_csv_file('data/July/VDMScanXY3.csv')
        ]

    bunchData = [
        l.read_csv_file('data/July/FBCT_2855_Timber/TIMBER_DATA_Fill_2855_BCTFR_A6R4_B1.csv', bunchHeader),
        l.read_csv_file('data/July/FBCT_2855_Timber/TIMBER_DATA_Fill_2855_BCTFR_A6R4_B2.csv', bunchHeader)
        ]

    pltData = r.TFile('histograms/vdmHistograms_2011-07-19_2855.root', 'OPEN')

    ### Initialize calibrator for fill 2855 ###

    calibrator = c.VDMCalibrator(2855, bcmData, bunchData, corrections, {'PLT':1342721696 - 1798, 'intensity':1342685132}, algos, dataFormat = 'brm')
    scanResults.extend(calibrator.multi_scan(scans, bcids, pltData, False, savePath)[0])