SND@LHC Software
Loading...
Searching...
No Matches
convertRawData_muTestbeam Namespace Reference

Functions

 qdc_calibration (board_id, tofpet_id, channel, tac, v_coarse, v_fine, tf)
 
 qdc_chi2 (board_id, tofpet_id, channel, tac, TDC=0)
 
 qdc_sat (board_id, tofpet_id, channel, tac, v_fine)
 
 time_calibration (board_id, tofpet_id, channel, tac, t_coarse, t_fine, TDC=0)
 
 comb_calibration (board_id, tofpet_id, channel, tac, v_coarse, v_fine, t_coarse, t_fine, GQDC=1.0, TDC=0)
 
 calibrationReport ()
 
 channel (tofpet_id, tofpet_channel, position)
 
 run (nEvent)
 
 getMapEvent2Time ()
 
 asynInfo (run)
 
 dumpMap ()
 

Variables

dict h = {}
 
int chi2Max = 2000.
 
float saturationLimit = 0.95
 
int mufi_hitThreshold = 2
 
 parser = ArgumentParser()
 
 dest
 
 help
 
 type
 
 int
 
 required
 
 False
 
 default
 
bool withGeoFile = False
 
 options = parser.parse_args()
 
 runNr = str(options.runNumber).zfill(6)
 
str path = options.path+'run_'+ runNr+'/'
 
str part = ""
 
str inFile = 'data_'+part+'.root'
 
str outFile = "sndsw_raw_"+runNr+'-'+part+'.root'
 
bool local = False
 
 fqdc_cal = open(path+'/qdc_cal.csv')
 
 Lqdc = fqdc_cal.readlines()
 
 ftdc_cal = open(path+'/tdc_cal.csv')
 
 Ltdc = ftdc_cal.readlines()
 
 server = os.environ['EOSSHIP']
 
 status
 
 L = Lqdc
 
dict SiPMmap = {}
 
dict TofpetMap = {}
 
str infile = "/eos/experiment/sndlhc/testbeam/MuFilter/SiPM_mappings/"+system+"_SiPM_mapping.csv"
 
 reader = csv.DictReader(f, delimiter=',')
 
 tmp = L[l].replace('\n','').split(',')
 
 row = x.split(',')
 
dict qdc_cal = {}
 
 board_id = int(tmp[0])
 
 fe_id = int(tmp[1])
 
 channel = int(tmp[2])
 
 tac = int(tmp[3])
 
dict X = qdc_cal[board_id][fe_id][channel][tac]
 
 tdc = int(tmp[4])
 
dict stations = {}
 
dict boardMaps = {}
 
str board = 'board_'+str(stations[station][mat])
 
dict slots = {0:'A',1:'A',2:'B',3:'B',4:'C',5:'C',6:'D',7:'D'}
 
dict MufiSystem = {}
 
int s = 0
 
dict offMap = {}
 
str dataName = 'data'+part+'.root'
 
 f0 = ROOT.TFile.Open(X+path+dataName)
 
 nEvent
 
dict boards = {}
 
 name = b.GetName()
 
 fSink = ROOT.FairRootFileSink(outFile)
 
 sTree = ROOT.TTree('rawConv','raw data converted')
 
 header = ROOT.FairEventHeader()
 
 eventSND = sTree.Branch("EventHeader",header,32000,-1)
 
 digiSciFi = ROOT.TClonesArray("sndScifiHit")
 
 digiSciFiBranch = sTree.Branch("Digi_ScifiHits",digiSciFi,32000,1)
 
 digiMuFilter = ROOT.TClonesArray("MuFilterHit")
 
 digiMuFilterHitBranch = sTree.Branch("Digi_MuFilterHits",digiMuFilter,32000,1)
 
 clusScifi = ROOT.TClonesArray("sndCluster")
 
 clusScifiBranch = sTree.Branch("Cluster_Scifi",clusScifi,32000,1)
 
 B = ROOT.TList()
 
dict theMap = {}
 
str test = 'map'+str(options.runNumber)+'.pkl'
 
 fin = open('map'+str(options.runNumber)+'.pkl','rb')
 
 asyn = asynInfo(options.runNumber)
 

Function Documentation

◆ asynInfo()

convertRawData_muTestbeam.asynInfo (   run)

Definition at line 541 of file convertRawData_muTestbeam.py.

541def asynInfo(run):
542 server = os.environ['EOSSHIP']
543 with client.File() as f:
544 location = "/eos/experiment/sndlhc/raw_data/commissioning/TB_H8_october/run_logs/log_"+str(run)+".txt"
545 f.open(server+location)
546 status, L = f.read()
547 A = L.decode().split('\n')
548 f.close()
549 info = {}
550 for x in A:
551 X = x.replace('\n','')
552 if X=='':continue
553 if X.find('2021')==0:
554 tag = X
555 info[tag]={}
556 else:
557 if X.find('disc')>0: info[tag]['summary'] = eval(X)
558 else: info[tag]['detail'] = eval(X)
559# correction procedure
560 A = {41:{},43:{},59:{},60:{}}
561 C = {}
562 prev = {41:None,43:None,59:None,60:None}
563 errorCounter = 0
564 T = list(info.keys())
565 T.sort()
566 for tag in T:
567 test = info[tag]['summary']
568 lastT = test['last_timestamp']
569 if not 'desync_info' in test: continue
570 C[tag] = {41:{},43:{},59:{},60:{}}
571 for L in test['desync_info']:
572 board = L[0]
573 t = L[1][0]
574 c = L[1][1]
575 C[tag][board][c]=t
576 # check that desync is constant over the complete run
577 for c in C[tag][41]:
578 tref = C[tag][41][c]
579 break
580 for board in C[tag]:
581 if not c in C[tag][board]:
582 #print('different trigger counts, problematic',tag,C[tag])
583 errorCounter+=1
584 else:
585 if not prev[board] == None:
586 if not C[tag][board][c]-tref == prev[board]:
587 print('desync changed, problematic',tag,prev,C[tag])
588 prev[board] = C[tag][board][c]-tref
589
590 T = list(C.keys())
591 for b in C[T[0]]:
592 for c in C[T[0]][b]:
593 A[b]= C[T[0]][b][c]
594 return A
595

◆ calibrationReport()

convertRawData_muTestbeam.calibrationReport ( )

Definition at line 182 of file convertRawData_muTestbeam.py.

182def calibrationReport():
183 ut.bookHist(h,'chi2','chi2',1000,0.,10000)
184 report = {}
185 TDC = 0
186 for b in qdc_cal:
187 for t in qdc_cal[b]:
188 for c in qdc_cal[b][t]:
189 for tac in qdc_cal[b][t][c]:
190 par = qdc_cal[b][t][c][tac]
191 if 'chi2Ndof' in par: chi2 = par['chi2Ndof']
192 else: chi2=-1
193 parT = qdc_cal[b][t][c][tac][TDC]
194 if 'chi2Ndof' in parT: chi2T = parT['chi2Ndof']
195 else: chi2T=-1
196 key = tac +10*c + t*10*100 + b*10*100*100
197 if not key in report: report[key]=[chi2,chi2T]
198 for key in report:
199 rc=h['chi2'].Fill(report[key][0])
200 rc=h['chi2'].Fill(report[key][1])
201 h['chi2'].Draw()
202 return report
203
204# station mapping for SciFi

◆ channel()

convertRawData_muTestbeam.channel (   tofpet_id,
  tofpet_channel,
  position 
)

Definition at line 261 of file convertRawData_muTestbeam.py.

261def channel(tofpet_id,tofpet_channel,position):
262 return (64 * tofpet_id + 63 - tofpet_channel + 512*position) # 512 channels per mat, 1536 channels per plane
263 # one channel covers all 6 layers of fibres
264
265# reading hits and converting to event information

◆ comb_calibration()

convertRawData_muTestbeam.comb_calibration (   board_id,
  tofpet_id,
  channel,
  tac,
  v_coarse,
  v_fine,
  t_coarse,
  t_fine,
  GQDC = 1.0,
  TDC = 0 
)

Definition at line 158 of file convertRawData_muTestbeam.py.

158def comb_calibration(board_id,tofpet_id,channel,tac,v_coarse,v_fine,t_coarse,t_fine,GQDC = 1.0, TDC=0): # max gain QDC = 3.6
159 par = qdc_cal[board_id][tofpet_id][channel][tac]
160 parT = par[TDC]
161 x = t_fine
162 ftdc = (-parT['b']-ROOT.TMath.Sqrt(parT['b']**2-4*parT['a']*(parT['c']-x)))/(2*parT['a']) # Ettore 28/01/2022 +parT['d']
163 timestamp = t_coarse + ftdc
164 tf = timestamp - t_coarse
165 x = v_coarse - tf
166 fqdc = -par['c']*ROOT.TMath.Log(1+ROOT.TMath.Exp( par['a']*(x-par['e'])**2-par['b']*(x-par['e']) )) + par['d']
167 value = (v_fine-fqdc)/GQDC
168 return timestamp,value,max(par['chi2Ndof'],parT['chi2Ndof']),v_fine/par['d']
169

◆ dumpMap()

convertRawData_muTestbeam.dumpMap ( )

Definition at line 597 of file convertRawData_muTestbeam.py.

597def dumpMap():
598 fout = open('map'+str(options.runNumber)+'.pkl','wb')
599 pickle.dump(theMap,fout)
600

◆ getMapEvent2Time()

convertRawData_muTestbeam.getMapEvent2Time ( )

Definition at line 534 of file convertRawData_muTestbeam.py.

534def getMapEvent2Time():
535 k = 0
536 for event in f0.event:
537 theMap[event.timestamp]=k
538 k+=1
539 if k%10000000==0: print('key time map: now at ',k)
540

◆ qdc_calibration()

convertRawData_muTestbeam.qdc_calibration (   board_id,
  tofpet_id,
  channel,
  tac,
  v_coarse,
  v_fine,
  tf 
)

Definition at line 134 of file convertRawData_muTestbeam.py.

134def qdc_calibration(board_id,tofpet_id,channel,tac,v_coarse,v_fine,tf):
135 GQDC = 1.0 # or 3.6
136 par = qdc_cal[board_id][tofpet_id][channel][tac]
137 x = v_coarse - tf
138 fqdc = -par['c']*ROOT.TMath.Log(1+ROOT.TMath.Exp( par['a']*(x-par['e'])**2-par['b']*(x-par['e']) )) + par['d']
139 value = (v_fine-fqdc)/GQDC
140 return value
141

◆ qdc_chi2()

convertRawData_muTestbeam.qdc_chi2 (   board_id,
  tofpet_id,
  channel,
  tac,
  TDC = 0 
)

Definition at line 142 of file convertRawData_muTestbeam.py.

142def qdc_chi2(board_id,tofpet_id,channel,tac,TDC=0):
143 par = qdc_cal[board_id][tofpet_id][channel][tac]
144 parT = qdc_cal[board_id][tofpet_id][channel][tac][TDC]
145 return max(par['chi2Ndof'],parT['chi2Ndof'])
146

◆ qdc_sat()

convertRawData_muTestbeam.qdc_sat (   board_id,
  tofpet_id,
  channel,
  tac,
  v_fine 
)

Definition at line 147 of file convertRawData_muTestbeam.py.

147def qdc_sat(board_id,tofpet_id,channel,tac,v_fine):
148 par = qdc_cal[board_id][tofpet_id][channel][tac]
149 return v_fine/par['d']
150

◆ run()

convertRawData_muTestbeam.run (   nEvent)

Definition at line 305 of file convertRawData_muTestbeam.py.

305def run(nEvent):
306 event = f0.event
307 for eventNumber in range(options.nStart,nEvent):
308 ncreated = 0
309 rc = event.GetEvent(eventNumber)
310 T = event.timestamp
311 if eventNumber%options.heartBeat==0:
312 tt = time.ctime()
313 print('run ',options.runNumber, ' event',eventNumber," ",tt)
314 # find entry numbers for all boards
315 otherEvents={}
316 maxHits = 0
317 found = False
318 for board in boards:
319 board_id = int(board.split('_')[1])
320 bt = boards[board]
321 rc = bt.GetEvent(eventNumber)
322 if bt.n_hits < 1: continue
323 if bt.n_hits > maxHits:
324 maxHits = bt.n_hits
325 maxBoard = board_id
326 t1 = asyn[board_id]
327 for boardx in boards:
328 boardx_id = int(boardx.split('_')[1])
329 t2 = asyn[boardx_id]
330 dt = t2 - t1
331 newT = T + dt
332 if newT<0 or dt==0: continue
333 if newT in theMap:
334 if options.debug: print("found",eventNumber)
335 key = theMap[newT]
336 if key < 0 : continue # event time had already been used
337 found = True
338 if not board_id in otherEvents:
339 otherEvents[board_id]={}
340 otherEvents[board_id][boardx_id]=[newT,theMap[newT]]
341# problem if more than one board has links to another event.
342 if found and options.debug: print("+++",otherEvents)
343
344 if len(otherEvents)>1:
345 print("Houston we have a problem, more than one board match with other events",eventNumber,otherEvents)
346 for b in otherEvents:
347 rc = boards["board_"+str(b)].GetEvent(eventNumber)
348 txt = "mult "+str( boards["board_"+str(b)].n_hits )
349 for bx in otherEvents[b]:
350 rc = boards["board_"+str(bx)].GetEvent(otherEvents[b][bx][1])
351 txt+= " " +str( boards["board_"+str(bx)].n_hits )
352 print(txt)
353 continue
354
355 if len(otherEvents)==0:
356 if maxHits>mufi_hitThreshold:
357 otherEvents[maxBoard]={}
358 otherEvents[maxBoard][maxBoard] = [T,eventNumber]
359 else: continue
360 else:
361 thisBoard = list(otherEvents.keys())[0]
362 otherEvents[thisBoard][thisBoard] = [T,eventNumber]
363 listOfBoards = {}
364 for x in otherEvents:
365 for b in otherEvents[x]:
366 tmp = otherEvents[x][b]
367 listOfBoards[b]=tmp[1]
368 theMap[tmp[0]] = -1 # use event only once
369
370 if options.debug: print("---",listOfBoards)
371
372 header.SetEventTime(event.timestamp)
373 header.SetRunId(options.runNumber)
374 if options.debug: print('event:',eventNumber,event.timestamp)
375 indexSciFi=0
376 digiSciFi.Delete()
377 digiSciFiStore = {}
378 indexMuFilter=0
379 digiMuFilter.Delete()
380 digiMuFilterStore = {}
381# special part for synchronizing the MuFilter testbeam data
382 for board_id in listOfBoards:
383 board = "board_"+str(board_id)
384 scifi = True
385 if board in boardMaps['Scifi']:
386 station,mat = boardMaps['Scifi'][board]
387 elif board in boardMaps['MuFilter']:
388 scifi = False
389 else:
390 print(board+' not known. Serious error, stop')
391 1/0
392 bt = boards[board]
393 rc = bt.GetEvent(listOfBoards[board_id])
394 for n in range(bt.n_hits):
395 mask = False
396 if options.debug:
397 print(scifi,board_id,bt.tofpet_id[n],bt.tofpet_channel[n],bt.tac[n],bt.t_coarse[n],bt.t_fine[n],bt.v_coarse[n],bt.v_fine[n])
398 tofpet_id = bt.tofpet_id[n]
399 tofpet_channel = bt.tofpet_channel[n]
400 tac = bt.tac[n]
401 TDC,QDC,Chi2ndof,satur = comb_calibration(board_id,tofpet_id,tofpet_channel,tac,bt.v_coarse[n],bt.v_fine[n],bt.t_coarse[n],bt.t_fine[n])
402 if Chi2ndof > chi2Max:
403 if QDC>1E20: QDC = 997. # checking for inf
404 if QDC != QDC: QDC = 998. # checking for nan
405 if QDC>0: QDC = -QDC
406 mask = True
407 elif satur > saturationLimit or QDC>1E20 or QDC != QDC:
408 if QDC>1E20: QDC = 987. # checking for inf
409 if options.debug:
410 print('inf',board_id,bt.tofpet_id[n],bt.tofpet_channel[n],bt.tac[n],bt.v_coarse[n],bt.v_fine[n],TDC-bt.t_coarse[n],eventNumber,Chi2ndof)
411 if QDC != QDC: QDC = 988. # checking for nan
412 if options.debug:
413 print('nan',board_id,bt.tofpet_id[n],bt.tofpet_channel[n],bt.tac[n],bt.v_coarse[n],bt.v_fine[n],\
414 TDC-bt.t_coarse[n],TDC,bt.t_coarse[n],eventNumber,Chi2ndof)
415 A = int(min( QDC,1000))
416 B = min(satur,999)/1000.
417 QDC = A+B
418 mask = True
419 elif Chi2ndof > chi2Max:
420 if QDC>0: QDC = -QDC
421 mask = True
422 if options.debug:
423 print('calibrated: tdc = ',TDC,' qdc = ',QDC) # TDC clock cycle = 160 MHz or 6.25ns
424
425 if not scifi:
426# mufi encoding
427 slot = bt.tofpet_id[n]
428 tmp = boardMaps['MuFilter'][board][slots[slot]]
429 system = tmp.split('_')[0]
430 key = (slot%2)*1000 + bt.tofpet_channel[n]
431 if options.debug: print(system,key,board,bt.tofpet_id[n],bt.tofpet_id[n]%2,bt.tofpet_channel[n])
432 sipmChannel = 99
433 if not key in TofpetMap[system]:
434 print('key does not exist',key)
435 print(system, key, TofpetMap[system])
436 else:
437 sipmChannel = TofpetMap[system][key]-1
438 nSiPMs = abs(offMap[tmp][1])
439 nSides = abs(offMap[tmp][2])
440 direction = int(offMap[tmp][1]/nSiPMs)
441 detID = offMap[tmp][0] + direction*(sipmChannel//(nSiPMs))
442 sipm_number = sipmChannel%(nSiPMs)
443 if tmp.find('Right')>0:
444 sipm_number += nSiPMs
445 if not detID in digiMuFilterStore:
446 digiMuFilterStore[detID] = ROOT.MuFilterHit(detID,nSiPMs,nSides)
447 test = digiMuFilterStore[detID].GetSignal(sipm_number)
448 digiMuFilterStore[detID].SetDigi(QDC,TDC,sipm_number)
449 if mask: digiMuFilterStore[detID].SetMasked(sipm_number)
450
451 if options.debug:
452 ncreated +=1
453 print('create mu hit: ',detID,tmp,system,slot,offMap[tmp],sipmChannel,nSiPMs,nSides,test,slot)
454 print(' ',detID,sipm_number,QDC,TDC)
455 if test>0 or detID%1000>200 or sipm_number>15:
456 print('what goes wrong?',detID,sipm_number,system,key,board,bt.tofpet_id[n],bt.tofpet_channel[n],test)
457 else:
458# scifi encoding
459 chan = channel(bt.tofpet_id[n],bt.tofpet_channel[n],mat)
460 orientation = 1
461 if station[2]=="Y": orientation = 0
462 sipmLocal = (chan - mat*512)
463 sipmID = 1000000*int(station[1]) + 100000*orientation + 10000*mat + 1000*(sipmLocal//128) + chan%128
464 if not sipmID in digiSciFiStore: digiSciFiStore[sipmID] = ROOT.sndScifiHit(sipmID)
465 digiSciFiStore[sipmID].SetDigi(QDC,TDC)
466 if mask: digiSciFiStore[sipmID].setInvalid()
467 if options.debug:
468 print('create scifi hit: tdc = ',board,sipmID,QDC,TDC)
469 print('tofpet:', bt.tofpet_id[n],bt.tofpet_channel[n],mat,chan)
470 print(station[1],station[2],mat,chan,int(chan/128)%4,chan%128)
471
472 for sipmID in digiSciFiStore:
473 if digiSciFi.GetSize() == indexSciFi: digiSciFi.Expand(indexSciFi+100)
474 digiSciFi[indexSciFi]=digiSciFiStore[sipmID]
475 indexSciFi+=1
476 for detID in digiMuFilterStore:
477 if digiMuFilter.GetSize() == indexMuFilter: digiMuFilter.Expand(indexMuFilter+100)
478 digiMuFilter[indexMuFilter]=digiMuFilterStore[detID]
479 indexMuFilter+=1
480# make simple clustering for scifi, only works with geometry file. Don't think it is a good idea at the moment
481 if withGeoFile:
482 index = 0
483 hitDict = {}
484 for k in range(digiSciFi.GetEntries()):
485 d = digiSciFi[k]
486 if not d.isValid(): continue
487 hitDict[d.GetDetectorID()] = k
488 hitList = list(hitDict.keys())
489 if len(hitList)>0:
490 hitList.sort()
491 tmp = [ hitList[0] ]
492 cprev = hitList[0]
493 ncl = 0
494 last = len(hitList)-1
495 hitlist = ROOT.std.vector("sndScifiHit*")()
496 for i in range(len(hitList)):
497 if i==0 and len(hitList)>1: continue
498 c=hitList[i]
499 if (c-cprev)==1:
500 tmp.append(c)
501 if (c-cprev)!=1 or c==hitList[last]:
502 first = tmp[0]
503 N = len(tmp)
504 hitlist.clear()
505 for aHit in tmp:
506 hitlist.push_back( digiSciFi[hitDict[aHit]])
507 print(aHit,hitDict[aHit],digiSciFi[hitDict[aHit]].GetDetectorID())
508 print(hitlist.size())
509 aCluster = ROOT.sndCluster(first,N,hitlist,scifiDet)
510 print("cluster created")
511 if clusScifi.GetSize() == index: clusScifi.Expand(index+10)
512 clusScifi[index]=aCluster
513 index+=1
514 if c!=hitList[last]:
515 ncl+=1
516 tmp = [c]
517 cprev = c
518# fill TTree
519 sTree.Fill()
520 if options.debug:
521 print('====> number of created hits',ncreated)
522 if options.debug:
523 print('number of events processed',sTree.GetEntries(),f0.event.GetEntries())
524 sTree.Write()
525
526# https://gitlab.cern.ch/snd-scifi/software/-/wikis/Raw-data-format
527# tac: 0-3, identifies the Time-To-Analogue converter used for this hit (each channel has four of them and they require separate calibration).
528# t_coarse: Coarse timestamp of the hit, running on a 4 times the LHC clock
529# t_fine: 0-1023, fine timestamp of the hit. It contains the raw value of the charge digitized by the TDC and requires calibration.
530# v_coarse: 0-1023, QDC mode: it represents the number of clock cycles the charge integration lasted.
531# v_fine = 0-1023, QDC mode: represents the charge measured. Requires calibration.
532

◆ time_calibration()

convertRawData_muTestbeam.time_calibration (   board_id,
  tofpet_id,
  channel,
  tac,
  t_coarse,
  t_fine,
  TDC = 0 
)

Definition at line 151 of file convertRawData_muTestbeam.py.

151def time_calibration(board_id,tofpet_id,channel,tac,t_coarse,t_fine,TDC=0): #??
152 par = qdc_cal[board_id][tofpet_id][channel][tac][TDC]
153 x = t_fine
154 ftdc = (-par['b']-ROOT.TMath.Sqrt(par['b']**2-4*par['a']*(par['c']-x)))/(2*par['a']) # Ettore 28/01/2022 +par['d']
155 timestamp = t_coarse+ftdc
156 return timestamp
157

Variable Documentation

◆ asyn

convertRawData_muTestbeam.asyn = asynInfo(options.runNumber)

Definition at line 614 of file convertRawData_muTestbeam.py.

◆ B

convertRawData_muTestbeam.B = ROOT.TList()

Definition at line 297 of file convertRawData_muTestbeam.py.

◆ board

str convertRawData_muTestbeam.board = 'board_'+str(stations[station][mat])

Definition at line 223 of file convertRawData_muTestbeam.py.

◆ board_id

convertRawData_muTestbeam.board_id = int(tmp[0])

Definition at line 94 of file convertRawData_muTestbeam.py.

◆ boardMaps

dict convertRawData_muTestbeam.boardMaps = {}

Definition at line 219 of file convertRawData_muTestbeam.py.

◆ boards

dict convertRawData_muTestbeam.boards = {}

Definition at line 276 of file convertRawData_muTestbeam.py.

◆ channel

convertRawData_muTestbeam.channel = int(tmp[2])

Definition at line 98 of file convertRawData_muTestbeam.py.

◆ chi2Max

int convertRawData_muTestbeam.chi2Max = 2000.

Definition at line 11 of file convertRawData_muTestbeam.py.

◆ clusScifi

convertRawData_muTestbeam.clusScifi = ROOT.TClonesArray("sndCluster")

Definition at line 294 of file convertRawData_muTestbeam.py.

◆ clusScifiBranch

convertRawData_muTestbeam.clusScifiBranch = sTree.Branch("Cluster_Scifi",clusScifi,32000,1)

Definition at line 295 of file convertRawData_muTestbeam.py.

◆ dataName

str convertRawData_muTestbeam.dataName = 'data'+part+'.root'

Definition at line 270 of file convertRawData_muTestbeam.py.

◆ default

convertRawData_muTestbeam.default

Definition at line 19 of file convertRawData_muTestbeam.py.

◆ dest

convertRawData_muTestbeam.dest

Definition at line 18 of file convertRawData_muTestbeam.py.

◆ digiMuFilter

convertRawData_muTestbeam.digiMuFilter = ROOT.TClonesArray("MuFilterHit")

Definition at line 290 of file convertRawData_muTestbeam.py.

◆ digiMuFilterHitBranch

convertRawData_muTestbeam.digiMuFilterHitBranch = sTree.Branch("Digi_MuFilterHits",digiMuFilter,32000,1)

Definition at line 291 of file convertRawData_muTestbeam.py.

◆ digiSciFi

convertRawData_muTestbeam.digiSciFi = ROOT.TClonesArray("sndScifiHit")

Definition at line 288 of file convertRawData_muTestbeam.py.

◆ digiSciFiBranch

convertRawData_muTestbeam.digiSciFiBranch = sTree.Branch("Digi_ScifiHits",digiSciFi,32000,1)

Definition at line 289 of file convertRawData_muTestbeam.py.

◆ eventSND

convertRawData_muTestbeam.eventSND = sTree.Branch("EventHeader",header,32000,-1)

Definition at line 286 of file convertRawData_muTestbeam.py.

◆ f0

convertRawData_muTestbeam.f0 = ROOT.TFile.Open(X+path+dataName)

Definition at line 271 of file convertRawData_muTestbeam.py.

◆ False

convertRawData_muTestbeam.False

Definition at line 19 of file convertRawData_muTestbeam.py.

◆ fe_id

convertRawData_muTestbeam.fe_id = int(tmp[1])

Definition at line 96 of file convertRawData_muTestbeam.py.

◆ fin

convertRawData_muTestbeam.fin = open('map'+str(options.runNumber)+'.pkl','rb')

Definition at line 608 of file convertRawData_muTestbeam.py.

◆ fqdc_cal

convertRawData_muTestbeam.fqdc_cal = open(path+'/qdc_cal.csv')

Definition at line 42 of file convertRawData_muTestbeam.py.

◆ fSink

convertRawData_muTestbeam.fSink = ROOT.FairRootFileSink(outFile)

Definition at line 282 of file convertRawData_muTestbeam.py.

◆ ftdc_cal

convertRawData_muTestbeam.ftdc_cal = open(path+'/tdc_cal.csv')

Definition at line 44 of file convertRawData_muTestbeam.py.

◆ h

dict convertRawData_muTestbeam.h = {}

Definition at line 6 of file convertRawData_muTestbeam.py.

◆ header

convertRawData_muTestbeam.header = ROOT.FairEventHeader()

Definition at line 285 of file convertRawData_muTestbeam.py.

◆ help

convertRawData_muTestbeam.help

Definition at line 18 of file convertRawData_muTestbeam.py.

◆ inFile

str convertRawData_muTestbeam.inFile = 'data_'+part+'.root'

Definition at line 36 of file convertRawData_muTestbeam.py.

◆ infile

str convertRawData_muTestbeam.infile = "/eos/experiment/sndlhc/testbeam/MuFilter/SiPM_mappings/"+system+"_SiPM_mapping.csv"

Definition at line 66 of file convertRawData_muTestbeam.py.

◆ int

convertRawData_muTestbeam.int

Definition at line 18 of file convertRawData_muTestbeam.py.

◆ L

convertRawData_muTestbeam.L = Lqdc

Definition at line 53 of file convertRawData_muTestbeam.py.

◆ local

bool convertRawData_muTestbeam.local = False

Definition at line 39 of file convertRawData_muTestbeam.py.

◆ Lqdc

convertRawData_muTestbeam.Lqdc = fqdc_cal.readlines()

Definition at line 43 of file convertRawData_muTestbeam.py.

◆ Ltdc

convertRawData_muTestbeam.Ltdc = ftdc_cal.readlines()

Definition at line 45 of file convertRawData_muTestbeam.py.

◆ mufi_hitThreshold

int convertRawData_muTestbeam.mufi_hitThreshold = 2

Definition at line 14 of file convertRawData_muTestbeam.py.

◆ MufiSystem

dict convertRawData_muTestbeam.MufiSystem = {}

Definition at line 234 of file convertRawData_muTestbeam.py.

◆ name

convertRawData_muTestbeam.name = b.GetName()

Definition at line 278 of file convertRawData_muTestbeam.py.

◆ nEvent

convertRawData_muTestbeam.nEvent

Definition at line 272 of file convertRawData_muTestbeam.py.

◆ offMap

dict convertRawData_muTestbeam.offMap = {}

Definition at line 246 of file convertRawData_muTestbeam.py.

◆ options

convertRawData_muTestbeam.options = parser.parse_args()

Definition at line 31 of file convertRawData_muTestbeam.py.

◆ outFile

str convertRawData_muTestbeam.outFile = "sndsw_raw_"+runNr+'-'+part+'.root'

Definition at line 37 of file convertRawData_muTestbeam.py.

◆ parser

convertRawData_muTestbeam.parser = ArgumentParser()

Definition at line 17 of file convertRawData_muTestbeam.py.

◆ part

str convertRawData_muTestbeam.part = ""

Definition at line 34 of file convertRawData_muTestbeam.py.

◆ path

str convertRawData_muTestbeam.path = options.path+'run_'+ runNr+'/'

Definition at line 33 of file convertRawData_muTestbeam.py.

◆ qdc_cal

dict convertRawData_muTestbeam.qdc_cal = {}

Definition at line 88 of file convertRawData_muTestbeam.py.

◆ reader

convertRawData_muTestbeam.reader = csv.DictReader(f, delimiter=',')

Definition at line 70 of file convertRawData_muTestbeam.py.

◆ required

convertRawData_muTestbeam.required

Definition at line 18 of file convertRawData_muTestbeam.py.

◆ row

dict convertRawData_muTestbeam.row = x.split(',')

Definition at line 81 of file convertRawData_muTestbeam.py.

◆ runNr

convertRawData_muTestbeam.runNr = str(options.runNumber).zfill(6)

Definition at line 32 of file convertRawData_muTestbeam.py.

◆ s

convertRawData_muTestbeam.s = 0

Definition at line 240 of file convertRawData_muTestbeam.py.

◆ saturationLimit

float convertRawData_muTestbeam.saturationLimit = 0.95

Definition at line 12 of file convertRawData_muTestbeam.py.

◆ server

convertRawData_muTestbeam.server = os.environ['EOSSHIP']

Definition at line 49 of file convertRawData_muTestbeam.py.

◆ SiPMmap

dict convertRawData_muTestbeam.SiPMmap = {}

Definition at line 63 of file convertRawData_muTestbeam.py.

◆ slots

dict convertRawData_muTestbeam.slots = {0:'A',1:'A',2:'B',3:'B',4:'C',5:'C',6:'D',7:'D'}

Definition at line 232 of file convertRawData_muTestbeam.py.

◆ stations

dict convertRawData_muTestbeam.stations = {}

Definition at line 205 of file convertRawData_muTestbeam.py.

◆ status

convertRawData_muTestbeam.status

Definition at line 53 of file convertRawData_muTestbeam.py.

◆ sTree

convertRawData_muTestbeam.sTree = ROOT.TTree('rawConv','raw data converted')

Definition at line 283 of file convertRawData_muTestbeam.py.

◆ tac

convertRawData_muTestbeam.tac = int(tmp[3])

Definition at line 100 of file convertRawData_muTestbeam.py.

◆ tdc

convertRawData_muTestbeam.tdc = int(tmp[4])

Definition at line 123 of file convertRawData_muTestbeam.py.

◆ test

str convertRawData_muTestbeam.test = 'map'+str(options.runNumber)+'.pkl'

Definition at line 605 of file convertRawData_muTestbeam.py.

◆ theMap

convertRawData_muTestbeam.theMap = {}

Definition at line 533 of file convertRawData_muTestbeam.py.

◆ tmp

dict convertRawData_muTestbeam.tmp = L[l].replace('\n','').split(',')

Definition at line 78 of file convertRawData_muTestbeam.py.

◆ TofpetMap

dict convertRawData_muTestbeam.TofpetMap = {}

Definition at line 64 of file convertRawData_muTestbeam.py.

◆ type

convertRawData_muTestbeam.type

Definition at line 18 of file convertRawData_muTestbeam.py.

◆ withGeoFile

bool convertRawData_muTestbeam.withGeoFile = False

Definition at line 29 of file convertRawData_muTestbeam.py.

◆ X

str convertRawData_muTestbeam.X = qdc_cal[board_id][fe_id][channel][tac]

Definition at line 102 of file convertRawData_muTestbeam.py.