Skip to content

Instantly share code, notes, and snippets.

View giorgiopizz's full-sized avatar

Giorgio Pizzati giorgiopizz

View GitHub Profile
@giorgiopizz
giorgiopizz / script.py
Created December 20, 2019 07:58
python scrypt for micro serial acquisition adc
import serial
ser=serial.Serial()
ser.baudrate=9600
ser.port='COM10'
with open("dati_seriale.txt","w") as file:
r=ser.read()
while(r):
file.write(r)
r=ser.read()
import os
import sys
import subprocess
from shutil import copyfile, copytree
if __name__ == "__main__":
#switchOn = ['2','4','5','7','9','21','22','24','25','29','30','31','32','33','34']
#switchOn = ['2', '4', '7', '21', '24', '25', '31', '32', '33', '34'] # production succeeded
# switchOn = [str(i) for i in range(43, 61)]
switchOn = ['6']
@giorgiopizz
giorgiopizz / .err
Created November 9, 2021 09:27
cHB errore
tar: This does not look like a tar archive
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
----- Begin Fatal Exception 06-Nov-2021 18:18:05 CET-----------------------
An exception of category 'ExternalLHEProducer' occurred while
[0] Processing global begin Run run: 1
[1] Calling method for module ExternalLHEProducer/'externalLHEProducer'
Exception Message:
Child failed with exit code 2.
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY THE UFO #####################
######################################################################
###################################
## INFORMATION FOR SMINPUTS
###################################
Block SMINPUTS
1 8.038700e+01 # MW
2 1.166379e-05 # Gf
@giorgiopizz
giorgiopizz / SMP-RunIIFall18wmLHEGS-00062_EFT_1_cfg .py
Created November 17, 2021 11:35
Configurazione per LHEGS con dipole correction e randomizeSeed sostituito
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: Configuration/GenProduction/python/SMP-RunIIFall18wmLHEGS-00062-fragment.py --python_filename SMP-RunIIFall18wmLHEGS-00062_1_cfg.py --eventcontent RAWSIM,LHE --customise Configuration/DataProcessing/Utils.addMonitoring --datatier GEN-SIM,LHE --fileout file:SMP-RunIIFall18wmLHEGS-00062.root --conditions 102X_upgrade2018_realistic_v11 --beamspot Realistic25ns13TeVEarly2018Collision --step LHE,GEN,SIM --geometry DB:Extended --era Run2_2018 --no_exec --mc -n 2500 --customise Configuration/GenProduction/randomizeSeeds.randomizeSeeds
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
process = cms.Process('SIM',eras.Run2_2018)
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
import model SMEFTsim_U35_MwScheme_UFO-cHG_massless
define p = g u c d s u~ c~ d~ s~
define j = p
define l+ = e+ mu+ ta+
define l- = e- mu- ta-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
generate p p > l+ l- j j QCD=0 SMHLOOP=0 QED=99 NP=1 NP^2==1
output Zjj_cHG_LI
import FWCore.ParameterSet.Config as cms
from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import offlinePrimaryVertices
#from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVerticesPhase2_cfi import offlinePrimaryVertices, offlinePrimaryVerticesCUDA, offlinePrimaryVerticesDumbFitter
#from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVerticesCUDA_cfi import offlinePrimaryVertices as offlinePrimaryVerticesCUDA
#from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVerticesCUDA_cfi import offlinePrimaryVertices as offlinePrimaryVerticesDumpFitter
import FWCore.ParameterSet.VarParsing as VarParsing
from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
process = cms.Process("Vertexing")
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/NanoAOD/interface/FlatTable.h"
#include "DataFormats/NanoAOD/interface/MergeableCounterTable.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Utilities/interface/transform.h"
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
@giorgiopizz
giorgiopizz / LatinosUtils.py
Created May 11, 2023 14:35
mkPlot.py and mkDatacards.py port to mkShapesRDF
def flatten_samples(samples):
## flatten the subsamples (create full samples named sample_subsample)
subsamplesmap = []
for sname in list(samples.keys()):
sample = samples[sname]
if 'subsamples' not in sample:
continue
subsamplesmap.append((sname, []))
for sub in sample['subsamples']: