From d49cbaeddd14ef02f6a7a582dd3c55809362cc4c Mon Sep 17 00:00:00 2001 From: "guofangyi@ihep.ac.cn" <guofangyi@ihep.ac.cn> Date: Fri, 14 Mar 2025 02:41:04 +0000 Subject: [PATCH] Harmonize scripts --- .../Ecal_Crystal_Barrel_v02_02.xml | 2 +- .../CRD_common_v01/SHcalGlass_Endcaps_v01.xml | 2 +- Detector/DetCRD/scripts/TDR_o1_v01/rec.py | 3 +- Detector/DetCRD/scripts/TDR_o1_v01/sim.py | 17 + Reconstruction/ParticleID/src/FinalPIDAlg.cpp | 2 +- Reconstruction/ParticleID/src/FinalPIDAlg.h | 2 +- Reconstruction/RecPFACyber/script/ana.py | 44 --- Reconstruction/RecPFACyber/script/digi.py | 187 ---------- Reconstruction/RecPFACyber/script/rec.py | 161 --------- .../RecPFACyber/script/roofit_jets.cpp | 229 ------------ Reconstruction/RecPFACyber/script/sim.py | 131 ------- Reconstruction/RecPFACyber/script/tracking.py | 331 ------------------ 12 files changed, 23 insertions(+), 1088 deletions(-) delete mode 100644 Reconstruction/RecPFACyber/script/ana.py delete mode 100644 Reconstruction/RecPFACyber/script/digi.py delete mode 100644 Reconstruction/RecPFACyber/script/rec.py delete mode 100644 Reconstruction/RecPFACyber/script/roofit_jets.cpp delete mode 100644 Reconstruction/RecPFACyber/script/sim.py delete mode 100644 Reconstruction/RecPFACyber/script/tracking.py diff --git a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v02_02.xml b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v02_02.xml index 48f4d5d0..30c16069 100755 --- a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v02_02.xml +++ b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v02_02.xml @@ -38,7 +38,7 @@ </regions> <detectors> - <detector id="DetID_ECAL" name="CaloDetector" type="LongCrystalBarBarrelCalorimeter32Polygon_v02" readout="EcalBarrelCollection" vis="Invisible" sensitive="true" region="EcalBarrelRegion"> + <detector id="DetID_ECAL" name="EcalBarrel" type="LongCrystalBarBarrelCalorimeter32Polygon_v02" readout="EcalBarrelCollection" vis="Invisible" sensitive="true" region="EcalBarrelRegion"> <!-- Use cm as unit if you want to use Pandora for reconstruction --> </detector> </detectors> diff --git a/Detector/DetCRD/compact/CRD_common_v01/SHcalGlass_Endcaps_v01.xml b/Detector/DetCRD/compact/CRD_common_v01/SHcalGlass_Endcaps_v01.xml index 857363c2..d68479d2 100644 --- a/Detector/DetCRD/compact/CRD_common_v01/SHcalGlass_Endcaps_v01.xml +++ b/Detector/DetCRD/compact/CRD_common_v01/SHcalGlass_Endcaps_v01.xml @@ -44,7 +44,7 @@ <detectors> <detector id="DetID_HCAL_ENDCAP" - name="HcalEndcaps" + name="HcalEndcap" type="SHcalSc04_Endcaps_v02" readout="HcalEndcapsCollection" vis="Invisible" diff --git a/Detector/DetCRD/scripts/TDR_o1_v01/rec.py b/Detector/DetCRD/scripts/TDR_o1_v01/rec.py index 94e1f86f..7f8a427b 100644 --- a/Detector/DetCRD/scripts/TDR_o1_v01/rec.py +++ b/Detector/DetCRD/scripts/TDR_o1_v01/rec.py @@ -60,7 +60,7 @@ CyberPFAlg.Seed = 1024 CyberPFAlg.BField = 3. CyberPFAlg.Debug = 0 CyberPFAlg.SkipEvt = 0 -CyberPFAlg.WriteAna = 1 +CyberPFAlg.WriteAna = 0 CyberPFAlg.AnaFileName = "RecAnaTuple_TDR_o1_v01.root" CyberPFAlg.UseMCPTrack = 0 CyberPFAlg.UseTruthMatchTrack = 0 @@ -143,6 +143,7 @@ pid.OutputPFOName = "CyberPFOPID" from Configurables import GenMatch genmatch = GenMatch("GenMatch") +genmatch.InputPFOs = "CyberPFOPID" genmatch.nJets = 2 genmatch.R = 0.6 genmatch.OutputFile = "Jets_TDR_o1_v01.root" diff --git a/Detector/DetCRD/scripts/TDR_o1_v01/sim.py b/Detector/DetCRD/scripts/TDR_o1_v01/sim.py index 17dddfd3..8bcb3eeb 100644 --- a/Detector/DetCRD/scripts/TDR_o1_v01/sim.py +++ b/Detector/DetCRD/scripts/TDR_o1_v01/sim.py @@ -43,6 +43,7 @@ from Configurables import SLCIORdr from Configurables import HepMCRdr from Configurables import GenPrinter +########### Particle Gun ############## gun = GtGunTool("GtGunTool") gun.PositionXs = [0] gun.PositionYs = [0] @@ -60,6 +61,13 @@ genprinter = GenPrinter("GenPrinter") genalg = GenAlgo("GenAlgo") genalg.GenTools = ["GtGunTool"] +############ Physics generator in stdhep +#stdheprdr = StdHepRdr("StdHepRdr") +#stdheprdr.Input = "/cefs/data/stdhep/CEPC240/higgs/update_from_LiangHao_1M/data/E240.Pnnh_gg.e0.p0.whizard195/nnh_gg.e0.p0.00001.stdhep" + +#genalg = GenAlgo("GenAlgo") +#genalg.GenTools = ["StdHepRdr"] + ############################################################################## # Detector Simulation ############################################################################## @@ -101,6 +109,15 @@ dedx_simtool.max_step = 1#mm dedx_simtool.save_mc = True #dedx_simtool.OutputLevel = DEBUG + +from Configurables import CalorimeterSensDetTool +from Configurables import DriftChamberSensDetTool +cal_sensdettool = CalorimeterSensDetTool("CalorimeterSensDetTool") +cal_sensdettool.CalNamesMergeDisable = ["EcalBarrel", "EcalEndcap", "HcalBarrel", "HcalEndcap"] +cal_sensdettool.CalNamesApplyBirks = ["EcalBarrel", "EcalEndcap", "HcalBarrel","HcalEndcap"] +cal_sensdettool.CalNamesBirksConstants = [0.008415, 0.008415, 0.01, 0.01] # BGO and Glass scintillator + + from Configurables import MarlinEvtSeeder evtseeder = MarlinEvtSeeder("EventSeeder") diff --git a/Reconstruction/ParticleID/src/FinalPIDAlg.cpp b/Reconstruction/ParticleID/src/FinalPIDAlg.cpp index 8656660b..fc3f2134 100644 --- a/Reconstruction/ParticleID/src/FinalPIDAlg.cpp +++ b/Reconstruction/ParticleID/src/FinalPIDAlg.cpp @@ -19,7 +19,7 @@ FinalPIDAlg::FinalPIDAlg( const std::string& name, ISvcLocator* pSvcLocator ) // output declareProperty("OutputPFOName", m_outPFOCol, "Reconstructed particles with PID information"); // PID method - declareProperty("Method", m_method = "TPC+TOF", "PID method: TPC, TPC+TOF, TPC+TOF+CALO"); + declareProperty("PIDMethod", m_method = "TPC+TOF+CALO", "PID method: TPC, TPC+TOF, TPC+TOF+CALO"); } //------------------------------------------------------------------------------ diff --git a/Reconstruction/ParticleID/src/FinalPIDAlg.h b/Reconstruction/ParticleID/src/FinalPIDAlg.h index 8cda460e..501dd1a4 100644 --- a/Reconstruction/ParticleID/src/FinalPIDAlg.h +++ b/Reconstruction/ParticleID/src/FinalPIDAlg.h @@ -28,7 +28,7 @@ class FinalPIDAlg : public Algorithm { DataHandle<edm4hep::RecDqdxCollection> m_inDqdxCol{"DndxTracks", Gaudi::DataHandle::Reader, this}; //DataHandle<edm4hep::ParticleIDCollection> m_PIDCol{"finalPID", Gaudi::DataHandle::Writer, this}; DataHandle<edm4hep::ReconstructedParticleCollection> m_outPFOCol{"CyberPFOPID", Gaudi::DataHandle::Writer, this}; - Gaudi::Property<std::string> m_method{this, "Method", "TPC+TOF+CALO"}; + Gaudi::Property<std::string> m_method{this, "PIDMethod", "TPC+TOF+CALO"}; void FillTPCPID(const edm4hep::RecDqdxCollection* dqdxcol, edm4hep::MutableReconstructedParticle& pfo, std::array<double, 5>& chi2s); diff --git a/Reconstruction/RecPFACyber/script/ana.py b/Reconstruction/RecPFACyber/script/ana.py deleted file mode 100644 index cbbde081..00000000 --- a/Reconstruction/RecPFACyber/script/ana.py +++ /dev/null @@ -1,44 +0,0 @@ -import os, sys -from Gaudi.Configuration import * - -########### k4DataSvc #################### -from Configurables import k4DataSvc -podioevent = k4DataSvc("EventDataSvc", input="Rec_TDR_o1_v01.root") -########################################## - -########## CEPCSWData ################# -cepcswdatatop ="/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/data/latest" -####################################### - - -########## Podio Input ################### -from Configurables import PodioInput -inp = PodioInput("InputReader") -inp.collections = [ "CyberPFO", "CyberPFOPID", "MCParticle" ] -########################################## - - - -from Configurables import GenMatch -genmatch = GenMatch("GenMatch") -genmatch.InputPFOs = "CyberPFOPID" -genmatch.nJets = 2 -genmatch.R = 0.6 -genmatch.OutputFile = "Jets_TDR_o1_v01.root" -#genmatch.OutputFile = "./FullSim_samples/RecJets_TDR_o1_v01_E240_nnh_gg_CalHits.root" - -############################################################################## -# POD I/O -############################################################################## - - -######################################## - -from Configurables import ApplicationMgr -ApplicationMgr( - TopAlg=[inp, genmatch ], - EvtSel="NONE", - EvtMax=10, - ExtSvc=[podioevent], - #OutputLevel=DEBUG -) diff --git a/Reconstruction/RecPFACyber/script/digi.py b/Reconstruction/RecPFACyber/script/digi.py deleted file mode 100644 index 3a7f2ae7..00000000 --- a/Reconstruction/RecPFACyber/script/digi.py +++ /dev/null @@ -1,187 +0,0 @@ -#!/usr/bin/env python -import os -from Gaudi.Configuration import * - -from Configurables import k4DataSvc -dsvc = k4DataSvc("EventDataSvc", input="Sim_TDR_o1_v01.root") - -from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_ -seed = [12340] -# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi -rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_("RndmGenSvc.Engine") # The default engine in Geant4 -rndmengine.SetSingleton = True -rndmengine.Seeds = seed - -rndmgensvc = RndmGenSvc("RndmGenSvc") -rndmgensvc.Engine = rndmengine.name() - -geometry_option = "TDR_o1_v01/TDR_o1_v01.xml" - -if not os.getenv("DETCRDROOT"): - print("Can't find the geometry. Please setup envvar DETCRDROOT." ) - sys.exit(-1) - -geometry_path = os.path.join(os.getenv("DETCRDROOT"), "compact", geometry_option) -if not os.path.exists(geometry_path): - print("Can't find the compact geometry file: %s"%geometry_path) - sys.exit(-1) - -from Configurables import DetGeomSvc -geosvc = DetGeomSvc("GeomSvc") -geosvc.compact = geometry_path - -from Configurables import MarlinEvtSeeder -evtseeder = MarlinEvtSeeder("EventSeeder") - -from Configurables import GearSvc -gearsvc = GearSvc("GearSvc") - -from Configurables import TrackSystemSvc -tracksystemsvc = TrackSystemSvc("TrackSystemSvc") - -from Configurables import SimplePIDSvc -pidsvc = SimplePIDSvc("SimplePIDSvc") -cepcswdatatop = "/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/data/latest" -pidsvc.ParFile = os.path.join(cepcswdatatop, "CEPCSWData/offline-data/Service/SimplePIDSvc/data/dNdx_TPC.root") - -from Configurables import PodioInput -podioinput = PodioInput("PodioReader", collections=[ -# "EventHeader", - "MCParticle", - "EcalBarrelCollection", - "EcalBarrelContributionCollection", - "EcalEndcapsCollection", - "EcalEndcapsContributionCollection", - "HcalBarrelCollection", - "HcalBarrelContributionCollection", - "HcalEndcapsCollection", - "HcalEndcapsContributionCollection" - ]) - -########## Digitalization ################ - -##ECAL## -from Configurables import EcalDigiAlg -EcalDigi = EcalDigiAlg("EcalDigiAlg") -EcalDigi.SimCaloHitCollection = ["EcalBarrelCollection", "EcalEndcapsCollection"] -EcalDigi.ReadOutName = ["EcalBarrelCollection", "EcalEndcapsCollection"] -EcalDigi.CaloHitCollection = ["ECALBarrel", "ECALEndcaps"] -EcalDigi.CaloAssociationCollection = ["ECALBarrelAssoCol", "ECALEndcapsAssoCol"] -EcalDigi.CaloMCPAssociationCollection = ["ECALBarrelParticleAssoCol", "ECALEndcapsParticleAssoCol"] -EcalDigi.SkipEvt = 0 -EcalDigi.Seed = 2079 -#Digitalization parameters -EcalDigi.TimeResolution = 0.7 # 0.7 ns -EcalDigi.EcalMIPEnergy = 13.35 # MIP energy 13.35 MeV for 1.5 cm BGO -EcalDigi.EcalMIP_Thre = 0.05 # 0.05 mip at each side, 0.1 mip for one bar -EcalDigi.UseRealisticDigi = 1 -# scintillation -EcalDigi.UseDigiScint = 1 -EcalDigi.EcalCryIntLY = 8200 #intrinsic LY 8200 [p.e./MIP] -EcalDigi.EcalCryMipLY = 300 #Detected effective LY 300 [p.e./MIP] -EcalDigi.AttenuationLength = 1e8 # 8000 mm for 5% non-uniformity -# SiPM -EcalDigi.SiPMDigiVerbose = 2 # 0:w/o response, w/o correction; 1:w/ response, w/o correction; 2:w/ response, w/ simple correction; 3:w/ response, w/ full correction -EcalDigi.EcalSiPMPDE = 0.25 # NDL-EQR06, PDE 0.25 -EcalDigi.EcalSiPMDCR = 0 # NDL-EQR06, dark count rate 2500000 [Hz] -EcalDigi.EcalTimeInterval = 0. # Time interval 0.000002 [s]. DCR*TimeInterval = dark count noise -EcalDigi.EcalSiPMCT = 0. # SiPM crosstalk Probability 12% -EcalDigi.EcalSiPMGainMean = 5 # 5 [ADC/p.e.] -EcalDigi.EcalSiPMGainSigma = 0.08 # 0.08 -#EcalDigi.EcalSiPMNoiseSigma = 0 # 0 -# ADC -EcalDigi.ADC = 8192 # 13-bit, 8192 -EcalDigi.ADCSwitch = 8000 # 8000 -EcalDigi.Pedestal = 50 # Pedestal 50 ADC -EcalDigi.GainRatio_12 = 30 # Gain ratio 30 -EcalDigi.GainRatio_23 = 10 # Gain ratio 10 -EcalDigi.EcalASICNoiseSigma = 4 -EcalDigi.EcalFEENoiseSigma = 5 -EcalDigi.ADCNonLinearity = 0 # ADC non-linearity 0 -# temperature control -EcalDigi.UseCryTemp = 0 -EcalDigi.UseCryTempCor = 0 -EcalDigi.UseSiPMTemp = 0 -EcalDigi.UseSiPMTempCor = 0 -EcalDigi.EcalTempGrad = 3./27 # 3./27 = 3K from 0 to 27 layer -EcalDigi.EcalBGOTempCoef = -0.0138 # -0.0138 [%/K] -EcalDigi.EcalSiPMGainTempCoef = -0.03 # -0.03 [%/K] -EcalDigi.EcalSiPMDCRTempCoef = 3.34/80 # 3.34/80 [10^{k*deltaT}] -######################################### -EcalDigi.WriteNtuple = 0 - -##HCAL## -from Configurables import HcalDigiAlg -HcalDigi = HcalDigiAlg("HcalDigiAlg") -HcalDigi.SimCaloHitCollection = ["HcalBarrelCollection", "HcalEndcapsCollection"] -HcalDigi.ReadOutName = ["HcalBarrelCollection", "HcalEndcapsCollection"] -HcalDigi.CaloHitCollection = ["HCALBarrel", "HCALEndcaps"] -HcalDigi.CaloAssociationCollection = ["HCALBarrelAssoCol", "HCALEndcapsAssoCol"] -HcalDigi.CaloMCPAssociationCollection = ["HCALBarrelParticleAssoCol", "HCALEndcapsParticleAssoCol"] -HcalDigi.SkipEvt = 0 -HcalDigi.Seed = 2079 -HcalDigi.CalibrHCAL = 1. -#Digitalization parameters -HcalDigi.UseRealisticDigi = 0 #---------Flag to use digitization model. -HcalDigi.MIPResponse = 0.007126 # 0.007.126 GeV / MIP -HcalDigi.MIPThreshold = 0.1 # ----------Unit: MIP -HcalDigi.TemperatureVariation = 0 # Temperature variation 1K -# Scintillation -HcalDigi.UseTileLYMap = 0 -HcalDigi.MIPLY = 80 # Glass LY -HcalDigi.LYTempCoef = 0 # Glass LY with temperature -HcalDigi.TileNonUniformity = 0.0 -# SiPM -HcalDigi.SiPMPixel = 57600 #---------57600 for 6025PE (6*6 mm, 25 um pixel pitch) -HcalDigi.SiPMDCR = 1600 #---------1600 for 6025PE (6*6 mm, 25 um pixel pitch), 3200 for 6015PS () -HcalDigi.SiPMCT = 0.0 #---------SiPM crosstalk Probability 0.12 -HcalDigi.TimeInterval = 0. #---------Shaping time 2 us -HcalDigi.SiPMGainTempCoef = 0 #---------Temperature dependence of SiPM gain (-3%/K) -HcalDigi.SiPMDCRTempCoef = 0 #---------Temperature dependence of SiPM DCR (10^{k*deltaT}, k=3.34/80) -# ADC -HcalDigi.ADC = 8192 -HcalDigi.ADCSwitch = 1e7 # Switch at 8000 -HcalDigi.GainRatio_12 = 50 -HcalDigi.GainRatio_23 = 60 -HcalDigi.SiPMGainMean = 20 # SiPM gain: 2 ADC / p.e. -HcalDigi.SiPMGainSigma = 0.08 # Fluctuation of ADC / p.e. -HcalDigi.SiPMNoiseSigma = 0 # SiPM noise sigma -HcalDigi.Pedestal = 50 # Pedestal 50 ADC -HcalDigi.PedestalSigma = 4 # Sigma of electronic noise (4 ADC) -HcalDigi.WriteNtuple = 0 - - -# output -from Configurables import PodioOutput -out = PodioOutput("outputalg") -out.filename = "CaloDigi_TDR_o1_v01.root" -out.outputCommands = ["drop *", - "keep MCParticle", - "keep VXDCollection", - "keep ITKBarrelCollection", - "keep ITKEndcapCollection", - "keep TPCCollection", - "keep OTKBarrelCollection", - "keep OTKEndcapCollection", - "keep MuonBarrelCollection", - "keep MuonEndcapCollection", - "keep ECALBarrel", - "keep HCALBarrel", - "keep ECALBarrelParticleAssoCol", - "keep HCALBarrelParticleAssoCol", - "keep ECALEndcaps", - "keep HCALEndcaps", - "keep ECALEndcapsParticleAssoCol", - "keep HCALEndcapsParticleAssoCol" ] - - -# ApplicationMgr -from Configurables import ApplicationMgr -mgr = ApplicationMgr( - TopAlg = [podioinput, EcalDigi, HcalDigi, out], - EvtSel = 'NONE', - EvtMax = 10, - ExtSvc = [dsvc, rndmengine, rndmgensvc, geosvc], - HistogramPersistency = 'ROOT', - OutputLevel = ERROR -) diff --git a/Reconstruction/RecPFACyber/script/rec.py b/Reconstruction/RecPFACyber/script/rec.py deleted file mode 100644 index e28309ee..00000000 --- a/Reconstruction/RecPFACyber/script/rec.py +++ /dev/null @@ -1,161 +0,0 @@ -import os, sys -from Gaudi.Configuration import * - -############## GeomSvc ################# -geometry_option = "TDR_o1_v01/TDR_o1_v01.xml" - -if not os.getenv("DETCRDROOT"): - print("Can't find the geometry. Please setup envvar DETCRDROOT." ) - sys.exit(-1) - -geometry_path = os.path.join(os.getenv("DETCRDROOT"), "compact", geometry_option) -if not os.path.exists(geometry_path): - print("Can't find the compact geometry file: %s"%geometry_path) - sys.exit(-1) - -from Configurables import DetGeomSvc -geomsvc = DetGeomSvc("GeomSvc") -geomsvc.compact = geometry_path -####################################### - -########### k4DataSvc #################### -from Configurables import k4DataSvc -podioevent = k4DataSvc("EventDataSvc", input="Tracking_TDR_o1_v01.root") -########################################## - -########## CEPCSWData ################# -cepcswdatatop ="/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/data/latest" -####################################### - -########## CrystalEcalEnergyCorrectionSvc ######## -from Configurables import CrystalEcalEnergyCorrectionSvc -crystalecalcorr = CrystalEcalEnergyCorrectionSvc("CrystalEcalEnergyCorrectionSvc") -crystalecalcorr.CorrectionFile = os.path.join(cepcswdatatop, "CEPCSWData/offline-data/Service/CrystalEcalSvc/data/CrackRegionEnergyCorrection.root") -################################################## - -########## Podio Input ################### -from Configurables import PodioInput -inp = PodioInput("InputReader") -inp.collections = [ - "ECALBarrel", - "ECALBarrelParticleAssoCol", - "ECALEndcaps", - "ECALEndcapsParticleAssoCol", - "HCALBarrel", - "HCALBarrelParticleAssoCol", - "HCALEndcaps", - "HCALEndcapsParticleAssoCol", - "MCParticle", - "CompleteTracks", - "CompleteTracksParticleAssociation", - "RecTofCollection", - "DndxTracks"] -########################################## - -######### Reconstruction ################ -from Configurables import CyberPFAlg -CyberPFAlg = CyberPFAlg("CyberPFAlg") -##----Global parameters---- -CyberPFAlg.Seed = 1024 -CyberPFAlg.BField = 3. -CyberPFAlg.Debug = 0 -CyberPFAlg.SkipEvt = 0 -CyberPFAlg.WriteAna = 0 -CyberPFAlg.AnaFileName = "RecAnaTuple_TDR_o1_v01.root" -CyberPFAlg.UseMCPTrack = 0 -CyberPFAlg.UseTruthMatchTrack = 0 -CyberPFAlg.DoCleanTrack = 1 -CyberPFAlg.TrackIDFile = "/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/data/latest/CEPCSWData/offline-data/Reconstruction/CyberPFA_trackID/TrkID_BDT_BDTG.weights.xml" -CyberPFAlg.TrackIDMethod = "BDTG" -CyberPFAlg.EcalChargedCalib = 1.26 -CyberPFAlg.HcalChargedCalib = 4.0 -CyberPFAlg.EcalNeutralCalib = 1.0 -CyberPFAlg.HcalNeutralCalib = 4.0 -##----Readin collections---- -CyberPFAlg.MCParticleCollection = "MCParticle" -CyberPFAlg.TrackCollections = ["CompleteTracks"] -CyberPFAlg.MCRecoTrackParticleAssociationCollection = "CompleteTracksParticleAssociation" -CyberPFAlg.ECalCaloHitCollections = ["ECALBarrel","ECALEndcaps"] -CyberPFAlg.ECalReadOutNames = ["EcalBarrelCollection","EcalEndcapsCollection"] -CyberPFAlg.ECalMCPAssociationName = ["ECALBarrelParticleAssoCol", "ECALEndcapsParticleAssoCol"] -CyberPFAlg.HCalCaloHitCollections = ["HCALBarrel", "HCALEndcaps"] -CyberPFAlg.HCalReadOutNames = ["HcalBarrelCollection", "HcalEndcapsCollection"] -CyberPFAlg.HCalMCPAssociationName = ["HCALBarrelParticleAssoCol", "HCALEndcapsParticleAssoCol"] - -##--- Output collections --- -CyberPFAlg.OutputPFO = "outputPFO"; -CyberPFAlg.RecoPFOCollection = "CyberPFO" - -#----Algorithms---- -CyberPFAlg.AlgList = ["GlobalClusteringAlg", #1 - "LocalMaxFindingAlg", #2 - "TrackMatchingAlg", #3 - "HoughClusteringAlg", #4 - "ConeClustering2DAlg", #5 - "AxisMergingAlg", #6 - "EnergySplittingAlg", #9 - "EnergyTimeMatchingAlg", #11 - "HcalClusteringAlg", #12 - "TruthClusteringAlg", #15 - "TrackClusterConnectingAlg", #16 - "PFOReclusteringAlg" ] #17 -CyberPFAlg.AlgParNames = [ ["InputECALBars","OutputECAL1DClusters","OutputECALHalfClusters"],#1 - ["OutputLocalMaxName"],#2 - ["ReadinLocalMaxName","OutputLongiClusName"],#3 - ["ReadinLocalMaxName","LeftLocalMaxName","OutputLongiClusName"],#4 - ["ReadinLocalMaxName", "OutputLongiClusName"], #5 - ["OutputAxisName"], #6 - ["ReadinAxisName", "OutputClusName", "OutputTowerName"], #9 - ["ReadinHFClusterName", "ReadinTowerName","OutputClusterName"], #11 - ["OutputHCALClusters"], #12 - ["DoECALClustering","DoHCALClustering","OutputHCALClusters"], #15 - ["ReadinECALClusterName", "ReadinHCALClusterName", "OutputCombPFO"], #16 - ["ECALChargedCalib", "HCALChargedCalib", "ECALNeutralCalib", "HCALNeutralCalib"] ]#17 -CyberPFAlg.AlgParTypes = [ ["string","string","string"],#1 - ["string"],#2 - ["string","string"],#3 - ["string","string","string"],#4 - ["string","string"], #5 - ["string"], #6 - ["string","string","string"], #9 - ["string","string","string"], #11 - ["string"], #12 - ["bool","bool","string"], #15 - ["string","string","string"], #16 - ["double","double", "double","double"] ]#17 -CyberPFAlg.AlgParValues = [ ["BarCol","Cluster1DCol","HalfClusterCol"],#1 - ["AllLocalMax"],#2 - ["AllLocalMax","TrackAxis"],#3 - ["AllLocalMax","LeftLocalMax","HoughAxis"],#4 - ["LeftLocalMax","ConeAxis"], #5 - ["MergedAxis"], #6 - ["MergedAxis","ESHalfCluster","ESTower"], #9 - ["ESHalfCluster","ESTower","EcalCluster"], #11 - ["SimpleHCALCluster"], #12 - ["0","1","HCALCluster"], #15 - ["EcalCluster", "SimpleHCALCluster", "outputPFO"], #16 - ["1.26","4.", "1.", "4."] ]#17 - -from Configurables import FinalPIDAlg -pid = FinalPIDAlg("FinalPIDAlg") -pid.OutputPFOName = "CyberPFOPID" - -############################################################################## -# POD I/O -############################################################################## -from Configurables import PodioOutput -out = PodioOutput("outputalg") -out.filename = "Rec_TDR_o1_v01.root" -out.outputCommands = ["keep *"] - - -######################################## - -from Configurables import ApplicationMgr -ApplicationMgr( - TopAlg=[inp, CyberPFAlg, pid, out ], - EvtSel="NONE", - EvtMax=10, - ExtSvc=[podioevent, geomsvc], - #OutputLevel=DEBUG -) diff --git a/Reconstruction/RecPFACyber/script/roofit_jets.cpp b/Reconstruction/RecPFACyber/script/roofit_jets.cpp deleted file mode 100644 index 43d53ffc..00000000 --- a/Reconstruction/RecPFACyber/script/roofit_jets.cpp +++ /dev/null @@ -1,229 +0,0 @@ -#include <algorithm> -#include <iomanip> -#include <iostream> -#include <TFile.h> -#include <TCanvas.h> -#include <TH1F.h> -#include <TF1.h> -#include <TRandom3.h> -#include <RooRealVar.h> -#include <RooGaussian.h> -#include <RooDataHist.h> -#include <RooFitResult.h> -#include <RooPlot.h> -#include "/afs/ihep.ac.cn/users/g/guofy/RootUtils/AtlasStyle.C" -#include "/afs/ihep.ac.cn/users/g/guofy/RootUtils/AtlasUtils.C" -#include "/afs/ihep.ac.cn/users/g/guofy/RootUtils/AtlasLabels.C" -#include "/afs/ihep.ac.cn/users/g/guofy/HggTwoSidedCBPdf.cxx" -#include "/afs/ihep.ac.cn/users/g/guofy/HggTwoSidedCBPdf.h" - -using namespace std; -using namespace RooFit; - -vector<double> get_rms90(vector<double> data); - -vector<double> roofit_jets(){ - SetAtlasStyle(); - //gStyle->SetLegendTextSize(0.04); - gStyle->SetLegendFont(42); - gStyle->SetErrorX(0.5); - gStyle->SetOptStat(0); - gStyle->SetLabelSize(0.05); - - - // Read data from txt file - double m_jj, jet1_costheta, jet2_costheta, invPt, barrelRatio; - std::vector<double> event; - std::vector<double> inv_mass; - std::vector<double> mc_chargeE; - std::vector<double> mc_neuhadE; - std::vector<double> rec_trackE; - - // std::ifstream file("out/invmass_fullrec_ecal1.1_hcal70.txt"); - // std::ifstream file("out/invmass_MCtrk_recHCAL_ecal1.1_hcal70.txt"); - // std::ifstream file("scan_calibration/out/invmass_ECALCali1.100_HCALCali70.0.txt"); - -/* std::ifstream file("output.txt"); - if(file.is_open()) - { - // double ll_event, ll_invmass, ll_chargeE, ll_neuhadE, ll_rectrack, ll_EECAL, ll_EHCAL; - // while (file >> ll_event >> ll_invmass ) - // { // é€è¡Œè¯»å–文件ä¸çš„æ•°æ® - // // double dE = ll_chargeE - ll_rectrack; - // // if( (dE<-5) || (dE>5) ) continue; - // event.push_back(ll_event); - // inv_mass.push_back(ll_invmass); // å°†æ¯ä¸ªæ•°æ·»åŠ åˆ°vectorä¸ - // // mc_chargeE.push_back(ll_chargeE); - // // mc_neuhadE.push_back(ll_neuhadE); - // // rec_trackE.push_back(ll_rectrack); - // } - // file.close(); // 关闿–‡ä»¶ - double ll_invmass; - while (file >> ll_invmass ) - { // é€è¡Œè¯»å–文件ä¸çš„æ•°æ® - inv_mass.push_back(ll_invmass); // å°†æ¯ä¸ªæ•°æ·»åŠ åˆ°vectorä¸ - } - file.close(); // 关闿–‡ä»¶ - } -*/ - TFile* rfile = new TFile("jet_all.root","read"); - TTree* rtree = (TTree*)rfile->Get("jets"); - rtree->SetBranchAddress("mass_allParticles", &m_jj); - rtree->SetBranchAddress("GEN_jet1_costheta", &jet1_costheta); - rtree->SetBranchAddress("GEN_jet2_costheta", &jet2_costheta); - rtree->SetBranchAddress("GEN_inv_pt", &invPt); - rtree->SetBranchAddress("barrelRatio", &barrelRatio); - - for(int ievt=0; ievt<rtree->GetEntries(); ievt++){ - //if(ievt>10000) continue; - rtree->GetEntry(ievt); - //if(fabs(jet1_costheta)>0.6 || fabs(jet2_costheta)>0.6 || invPt>1) continue; - if(barrelRatio<0.95) continue; - inv_mass.push_back(m_jj); - } - - // 创建RooFitå˜é‡ - // RooRealVar x("x", "Invariant mass / GeV", 90, 150); - RooRealVar x("x", "Invariant mass / GeV", 80, 180); - // 创建空的RooDataSet - RooDataSet data("data", "data", RooArgSet(x)); - for(int i=0; i<inv_mass.size();i++){ - if(inv_mass[i]<80) continue; - x.setVal(inv_mass[i]); - data.add(RooArgSet(x)); - } - data.Print(); - - // RooRealVar rf_x("x", "x", 90, 150); - RooRealVar rf_mean("mean", "mean of gaussian", 123, 115, 135); - RooRealVar rf_sigma("sigma", "width of gaussian", 5, 3, 12); - - TCanvas *c2 = new TCanvas("c2", "c2", 800, 600); - c2->cd(); - //RooGaussian rf_gauss("gauss", "gaussian PDF", x, rf_mean, rf_sigma); - //vector<double> rms90_range = get_rms90(inv_mass); - //cout << "yyy: " << rms90_range[0] << " " << rms90_range[1] << endl; - //x.setRange("rms90", rms90_range[0], rms90_range[1]); - ////x.setRange(110, 140); - //rf_gauss.fitTo(data, Range("rms90")); - - - - RooRealVar alphaLo("alphaLo","alphaLo",0,5); - RooRealVar nLo("nLo","nLo",0,200); - RooRealVar alphaHi("alphaHi","alphaHi",0,5); - RooRealVar nHi("nHi","nHi",0,150); - - RooAbsPdf* rf_dscb = new HggTwoSidedCBPdf("rf_dscb", "rf_dscb", x, rf_mean, rf_sigma, alphaLo, nLo, alphaHi, nHi); - rf_dscb->fitTo(data); - RooPlot* xframe = x.frame(); - data.plotOn(xframe, Name("gr_data"), DataError(RooAbsData::SumW2), Binning(50), Invisible()); - //rf_gauss.plotOn(xframe, Name("rf_gauss"), LineColor(2), LineWidth(2)); - rf_dscb->plotOn(xframe, Name("rf_dscb"), LineColor(2), LineWidth(2)); - //rf_dscb->paramOn(xframe); - - - //xframe->GetYaxis()->SetRangeUser(0, 390); - xframe->GetYaxis()->SetTitle("Events / GeV"); - xframe->GetXaxis()->SetTitleSize(0.06); - xframe->GetYaxis()->SetTitleSize(0.06); - xframe->GetXaxis()->CenterTitle(); - xframe->GetYaxis()->CenterTitle(); - xframe->GetXaxis()->SetLabelSize(0.05); - xframe->GetYaxis()->SetLabelSize(0.05); - xframe->Draw(); - - - TGraphAsymmErrors* gr1 = (TGraphAsymmErrors*)(xframe->getObject(0)); - TGraphAsymmErrors* gr2 = new TGraphAsymmErrors(); - gr2->SetName("gr_data"); - for(int i=0; i<gr1->GetN(); i++){ - if(gr1->GetPointY(i)==0) continue; - else{ - gr2->SetPoint(i, gr1->GetPointX(i), gr1->GetPointY(i)); - gr2->SetPointError(i, 0, 0, sqrt(gr1->GetPointY(i)), sqrt(gr1->GetPointY(i))); - } - } - - gr2->GetXaxis()->SetRangeUser(100, 160); - gr2->GetYaxis()->SetRangeUser(0, 260); - gr2->GetXaxis()->SetTitle("m_{jj} [GeV]"); - gr2->GetYaxis()->SetTitle("Events / GeV"); - gr2->Draw("P same"); - - //xframe->getObject(1)->Print(); - - //TF1* func = (TF1*)xframe->getObject(1); - //func->Print(); - //func->SetName("rf_dscb"); - //func->SetLineStyle(1); - //func->SetLineWidth(2); - //func->GetXaxis()->SetRangeUser(105,160); - //func->GetYaxis()->SetRangeUser(0, 4400); - //func->Draw("C same"); - - TLegend* l1 = new TLegend(0.23, 0.65, 0.50, 0.9); - l1->SetBorderSize(0); - l1->AddEntry("gr_data", "Rec. events", "PE" ); - l1->AddEntry("rf_dscb", "H #rightarrow jj, DSCB fit", "L"); - //l1->AddEntry("rf_gauss", "H #rightarrow jj, DSCB fit", "L"); - l1->Draw(); - - //TLatex text_CEPC; - //text_CEPC.SetNDC(); - //text_CEPC.SetTextSize(0.050); - //text_CEPC.SetTextFont(22); - //text_CEPC.DrawLatex(0.2, 0.8, "CEPC Simulation"); - - //text_CEPC.SetTextFont(62); - //text_CEPC.SetTextSize(0.04); - //text_CEPC.DrawLatex(0.2, 0.75, "e^{+}e^{-} #rightarrow ZH, H #rightarrow #gamma#gamma"); - //text_CEPC.DrawLatex(0.2, 0.7, "#sqrt{s} = 240 GeV"); - - // èŽ·å–æ‹Ÿåˆå‚数的值和误差 - double fittedMean = rf_mean.getVal(); - double fittedMeanError = rf_mean.getError(); - double fittedSigma = rf_sigma.getVal(); - double fittedSigmaError = rf_sigma.getError(); - double BMR_fit = fittedSigma / fittedMean; - double BMR_error = BMR_error = BMR_fit * - sqrt( (fittedMeanError / fittedMean)*(fittedMeanError / fittedMean) + - (fittedSigmaError / fittedSigma)*(fittedSigmaError / fittedSigma) ); - - // æ‰“å°æ‹Ÿåˆç»“æžœ - // data.Print(); - std::cout << "Fitted mean: " << fittedMean << " +/- " << fittedMeanError << std::endl; - std::cout << "Fitted sigma: " << fittedSigma << " +/- " << fittedSigmaError << std::endl; - cout << "BMR = " << BMR_fit*100. << " +/- " << BMR_error*100. << " %" << endl; - - vector<double> output; - output.push_back(BMR_fit*100.); - output.push_back(BMR_error*100.); - - return output; -} - - -vector<double> get_rms90(vector<double> data){ - std::sort(data.begin(), data.end()); - int num_data = data.size(); - int num_data90 = num_data*0.90; - int num_data10 = num_data*0.10; - - double lower_range = 0; - double upper_range = 0; - double range = 10000.0; - for(int i=0; i<num_data10-3; i++){ - double temp_lower_range = data[i]; - double temp_upper_range = data[i+num_data90]; - double temp_range = temp_upper_range - temp_lower_range; - if (temp_range < range){ - range = temp_range; - lower_range = temp_lower_range; - upper_range = temp_upper_range; - } - } - - vector<double> aa{lower_range, upper_range}; - return aa; -} diff --git a/Reconstruction/RecPFACyber/script/sim.py b/Reconstruction/RecPFACyber/script/sim.py deleted file mode 100644 index 2182e266..00000000 --- a/Reconstruction/RecPFACyber/script/sim.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python -import os,sys -from Gaudi.Configuration import * - -from Configurables import k4DataSvc -dsvc = k4DataSvc("EventDataSvc") - -from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_ -seed = [1024] -# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi -rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_("RndmGenSvc.Engine") # The default engine in Geant4 -rndmengine.SetSingleton = True -rndmengine.Seeds = seed - -rndmgensvc = RndmGenSvc("RndmGenSvc") -rndmgensvc.Engine = rndmengine.name() - -# option for standalone tracker study -geometry_option = "TDR_o1_v01/TDR_o1_v01.xml" - -if not os.getenv("DETCRDROOT"): - print("Can't find the geometry. Please setup envvar DETCRDROOT." ) - sys.exit(-1) - -geometry_path = os.path.join(os.getenv("DETCRDROOT"), "compact", geometry_option) -if not os.path.exists(geometry_path): - print("Can't find the compact geometry file: %s"%geometry_path) - sys.exit(-1) - -from Configurables import DetGeomSvc -geosvc = DetGeomSvc("GeomSvc") -geosvc.compact = geometry_path - -############################################################################## -# Physics Generator -############################################################################## -from Configurables import GenAlgo -from Configurables import GtGunTool -from Configurables import StdHepRdr -from Configurables import SLCIORdr -from Configurables import HepMCRdr -from Configurables import GenPrinter - -#gun = GtGunTool("GtGunTool") -#gun.PositionXs = [0, 0] -#gun.PositionYs = [0, 0] -#gun.PositionZs = [0, 0] -#gun.Particles = ["mu-", "mu+"] -#gun.EnergyMins = [5, 10] -#gun.EnergyMaxs = [5, 10] -#gun.ThetaMins = [60, 60] -#gun.ThetaMaxs = [120, 120] -#gun.PhiMins = [0, 0] -#gun.PhiMaxs = [360, 360] -#genprinter = GenPrinter("GenPrinter") - -stdheprdr = StdHepRdr("StdHepRdr") -stdheprdr.Input = "/cefs/data/stdhep/CEPC240/higgs/update_from_LiangHao_1M/data/E240.Pnnh_gg.e0.p0.whizard195/nnh_gg.e0.p0.00001.stdhep" - -genalg = GenAlgo("GenAlgo") -#genalg.GenTools = ["GtGunTool"] -genalg.GenTools = ["StdHepRdr"] - -############################################################################## -# Detector Simulation -############################################################################## -from Configurables import DetSimSvc -detsimsvc = DetSimSvc("DetSimSvc") - -from Configurables import Edm4hepWriterAnaElemTool -edm4hep_writer = Edm4hepWriterAnaElemTool("Edm4hepWriterAnaElemTool") -edm4hep_writer.TrackerCollections = ["VXD", "ITKBarrel", "ITKEndcap", "TPC", "TPCLowPt", "TPCSpacePoint", - "OTKBarrel", "OTKEndcap", "COIL", "MuonBarrel", "MuonEndcap"] - -from Configurables import DetSimAlg -detsimalg = DetSimAlg("DetSimAlg") -detsimalg.RandomSeeds = seed -# detsimalg.VisMacs = ["vis.mac"] -detsimalg.RunCmds = [ -# "/tracking/verbose 1", -] -detsimalg.AnaElems = [ - # example_anatool.name() - # "ExampleAnaElemTool" - "Edm4hepWriterAnaElemTool" -] -detsimalg.RootDetElem = "WorldDetElemTool" - -from Configurables import TimeProjectionChamberSensDetTool -tpc_sensdettool = TimeProjectionChamberSensDetTool("TimeProjectionChamberSensDetTool") -tpc_sensdettool.TypeOption = 1 -tpc_sensdettool.DoHeedSim = False #True -dedxoption = "TrackHeedSimTool" -tpc_sensdettool.DedxSimTool = dedxoption - -from Configurables import TrackHeedSimTool -dedx_simtool = TrackHeedSimTool("TrackHeedSimTool") -dedx_simtool.detector = "TPC" -dedx_simtool.only_primary = False#True -dedx_simtool.use_max_step = False#True -dedx_simtool.max_step = 1#mm -dedx_simtool.save_mc = True -#dedx_simtool.OutputLevel = DEBUG - - -from Configurables import CalorimeterSensDetTool -from Configurables import DriftChamberSensDetTool -cal_sensdettool = CalorimeterSensDetTool("CalorimeterSensDetTool") -cal_sensdettool.CalNamesMergeDisable = ["EcalBarrel", "EcalEndcap", "HcalBarrel", "HcalEndcaps"] -cal_sensdettool.CalNamesApplyBirks = ["EcalBarrel", "EcalEndcap", "HcalBarrel","HcalEndcaps"] -cal_sensdettool.CalNamesBirksConstants = [0.008415, 0.008415, 0.01, 0.01] # BGO and Glass scintillator - -from Configurables import MarlinEvtSeeder -evtseeder = MarlinEvtSeeder("EventSeeder") - -# output -from Configurables import PodioOutput -out = PodioOutput("outputalg") -out.filename = "Sim_TDR_o1_v01.root" -out.outputCommands = ["keep *"] - -# ApplicationMgr -from Configurables import ApplicationMgr -mgr = ApplicationMgr( - TopAlg = [genalg, detsimalg, out], - EvtSel = 'NONE', - EvtMax = 10, - ExtSvc = [rndmengine, rndmgensvc, dsvc, geosvc], - HistogramPersistency = 'ROOT', - OutputLevel = INFO -) diff --git a/Reconstruction/RecPFACyber/script/tracking.py b/Reconstruction/RecPFACyber/script/tracking.py deleted file mode 100644 index c39aca46..00000000 --- a/Reconstruction/RecPFACyber/script/tracking.py +++ /dev/null @@ -1,331 +0,0 @@ -#!/usr/bin/env python -import os -from Gaudi.Configuration import * - -from Configurables import k4DataSvc -dsvc = k4DataSvc("EventDataSvc", input="CaloDigi_TDR_o1_v01.root") - -from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_ -seed = [12340] -# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi -rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_("RndmGenSvc.Engine") # The default engine in Geant4 -rndmengine.SetSingleton = True -rndmengine.Seeds = seed - -rndmgensvc = RndmGenSvc("RndmGenSvc") -rndmgensvc.Engine = rndmengine.name() - -geometry_option = "TDR_o1_v01/TDR_o1_v01.xml" - -if not os.getenv("DETCRDROOT"): - print("Can't find the geometry. Please setup envvar DETCRDROOT." ) - sys.exit(-1) - -geometry_path = os.path.join(os.getenv("DETCRDROOT"), "compact", geometry_option) -if not os.path.exists(geometry_path): - print("Can't find the compact geometry file: %s"%geometry_path) - sys.exit(-1) - -from Configurables import DetGeomSvc -geosvc = DetGeomSvc("GeomSvc") -geosvc.compact = geometry_path - -from Configurables import MarlinEvtSeeder -evtseeder = MarlinEvtSeeder("EventSeeder") - -from Configurables import GearSvc -gearsvc = GearSvc("GearSvc") - -from Configurables import TrackSystemSvc -tracksystemsvc = TrackSystemSvc("TrackSystemSvc") - -from Configurables import SimplePIDSvc -pidsvc = SimplePIDSvc("SimplePIDSvc") -cepcswdatatop = "/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/data/latest" -pidsvc.ParFile = os.path.join(cepcswdatatop, "CEPCSWData/offline-data/Service/SimplePIDSvc/data/tdr25.1.1/dNdx_TPC.root") - -from Configurables import PodioInput -podioinput = PodioInput("PodioReader", collections=[ -# "EventHeader", - "MCParticle", - "VXDCollection", - "ITKBarrelCollection", - "ITKEndcapCollection", - "TPCCollection", - "OTKBarrelCollection", - "OTKEndcapCollection", - "MuonBarrelCollection", - "MuonEndcapCollection" - ]) - - -################## -# Digitization -################## - -## Config ## -vxdhitname = "VXDTrackerHits" -sithitname = "ITKBarrelTrackerHits" -ftdhitname = "ITKEndcapTrackerHits" -gashitname = "TPCTrackerHits" -sethitname = "OTKBarrelTrackerHits" -etdhitname = "OTKEndcapTrackerHits" -from Configurables import SmearDigiTool,SiTrackerDigiAlg - -## VXD ## -vxdtool = SmearDigiTool("VXD") -vxdtool.ResolutionU = [0.005] -vxdtool.ResolutionV = [0.005] -vxdtool.EnergyThreshold = 0.00001 #GeV -#vxdtool.OutputLevel = DEBUG - -digiVXD = SiTrackerDigiAlg("VXDDigi") -digiVXD.SimTrackHitCollection = "VXDCollection" -digiVXD.TrackerHitCollection = vxdhitname -digiVXD.TrackerHitAssociationCollection = "VXDTrackerHitAssociation" -digiVXD.DigiTool = "SmearDigiTool/VXD" -#digiVXD.OutputLevel = DEBUG - -## ITKBarrel ## -itkbtool = SmearDigiTool("ITKBarrel") -itkbtool.ResolutionU = [0.008] -itkbtool.ResolutionV = [0.040] -itkbtool.EnergyThreshold = 0.00005 #GeV -#itkbtool.OutputLevel = DEBUG - -digiITKB = SiTrackerDigiAlg("ITKBarrelDigi") -digiITKB.SimTrackHitCollection = "ITKBarrelCollection" -digiITKB.TrackerHitCollection = sithitname -digiITKB.TrackerHitAssociationCollection = "ITKBarrelTrackerHitAssociation" -digiITKB.DigiTool = "SmearDigiTool/ITKBarrel" -#digiITKB.OutputLevel = DEBUG - -## ITKEndcap ## -itketool = SmearDigiTool("ITKEndcap") -itketool.ResolutionU = [0.008] -itketool.ResolutionV = [0.040] -itketool.EnergyThreshold = 0.00005 #GeV -#itketool.OutputLevel = DEBUG - -digiITKE = SiTrackerDigiAlg("ITKEndcapDigi") -digiITKE.SimTrackHitCollection = "ITKEndcapCollection" -digiITKE.TrackerHitCollection = ftdhitname -digiITKE.TrackerHitAssociationCollection = "ITKEndcapTrackerHitAssociation" -digiITKE.DigiTool = "SmearDigiTool/ITKEndcap" -#digiITKE.OutputLevel = DEBUG - -## OTKBarrel ## -otkbtool = SmearDigiTool("OTKBarrel") -otkbtool.ResolutionU = [0.010] -otkbtool.ResolutionV = [1.000] -otkbtool.EnergyThreshold = 0.00005 #GeV -#otkbtool.OutputLevel = DEBUG - -digiOTKB = SiTrackerDigiAlg("OTKBarrelDigi") -digiOTKB.SimTrackHitCollection = "OTKBarrelCollection" -digiOTKB.TrackerHitCollection = sethitname -digiOTKB.TrackerHitAssociationCollection = "OTKBarrelTrackerHitAssociation" -digiOTKB.DigiTool = "SmearDigiTool/OTKBarrel" -#digiOTKB.OutputLevel = DEBUG - -## OTKEndcap ## -otketool = SmearDigiTool("OTKEndcap") -otketool.ResolutionU = [0.010] -otketool.ResolutionV = [1.000] -otketool.EnergyThreshold = 0.00005 #GeV -#otketool.OutputLevel = DEBUG - -digiOTKE = SiTrackerDigiAlg("OTKEndcapDigi") -digiOTKE.SimTrackHitCollection = "OTKEndcapCollection" -digiOTKE.TrackerHitCollection = etdhitname -digiOTKE.TrackerHitAssociationCollection = "OTKEndcapTrackerHitAssociation" -digiOTKE.DigiTool = "SmearDigiTool/OTKEndcap" -#digiOTKE.OutputLevel = DEBUG - -## TPC ## -from Configurables import TPCDigiAlg -digiTPC = TPCDigiAlg("TPCDigi") -digiTPC.TPCCollection = "TPCCollection" -digiTPC.TPCLowPtCollection = "TPCLowPtCollection" -digiTPC.TPCTrackerHitsCol = gashitname -#default value, modify them according to future Garfield simulation results -#digiTPC.PixelClustering = True -#digiTPC.PointResolutionRPhi = 0.144 -#digiTPC.DiffusionCoeffRPhi = 0.0323 -#digiTPC.PointResolutionZ = 0.4 -#digiTPC.DiffusionCoeffZ = 0.23 -#digiTPC.N_eff = 30 -#digiTPC.OutputLevel = DEBUG - - -## Muon Detector ## -from Configurables import MuonDigiAlg -digiMuon = MuonDigiAlg("MuonDigiAlg") -digiMuon.MuonBarrelHitsCollection = "MuonBarrelCollection" -digiMuon.MuonEndcapHitsCollection = "MuonEndcapCollection" -digiMuon.MuonBarrelTrackerHits = "MuonBarrelTrackerHits" -digiMuon.MuonEndcapTrackerHits = "MuonEndcapTrackerHits" -digiMuon.WriteNtuple = 0 -digiMuon.OutFileName = "Digi_MUON.root" -digiMuon.SiPMEff = 1 -digiMuon.EdepMin = 0.0 # no cut on GeV energy deposition -digiMuon.HitEdepMin = 6.0 # ADC counts -digiMuon.HitEdepMax = -1 # ADC counts, -1 means no upper cut -#digiMuon.OutputLevel = DEBUG -######################################### - -################ -# Tracking -################ -from Configurables import KalTestTool -# Close multiple scattering and smooth, used by clupatra -kt010 = KalTestTool("KalTest010") -kt010.MSOn = False -kt010.Smooth = False -#kt010.OutputLevel = DEBUG - -# Open multiple scattering, energy loss and smooth (default) -kt111 = KalTestTool("KalTest111") -#kt111.OutputLevel = DEBUG - -# Close smooth -kt110 = KalTestTool("KalTest110") -kt110.Smooth = False -#kt110.OutputLevel = DEBUG - -# Close energy loss -kt101 = KalTestTool("KalTest101") -kt101.EnergyLossOn = False -#kt101.OutputLevel = DEBUG - -from Configurables import SiliconTrackingAlg -tracking = SiliconTrackingAlg("SiliconTracking") -tracking.LayerCombinations = [8,7,6, 8,7,5, 8,7,4, 8,7,3, 8,7,2, 8,7,1, 8,7,0, - 8,6,5, 8,6,4, 8,6,3, 8,6,2, 8,6,1, 8,6,0, - 7,6,5, 7,6,4, 7,6,3, 7,6,2, 7,6,1, 7,6,0, - 7,5,3, 7,5,2, 7,5,1, 7,5,0, 7,4,3, 7,4,2, 7,4,1, 7,4,0, - 6,5,3, 6,5,2, 6,5,1, 6,5,0, 6,4,3, 6,4,2, 6,4,1, 6,4,0, - 6,3,2, 6,3,1, 6,3,0, 6,2,1, 6,2,0, 6,1,0, - 5,3,2, 5,3,1, 5,3,0, 5,2,1, 5,2,0, 5,1,0, - 4,3,2, 4,3,1, 4,3,0, 4,2,1, 4,2,0, 4,1,0, - 3,2,1, 3,2,0, 3,1,0, 2,1,0] -tracking.LayerCombinationsFTD = [] -tracking.HeaderCol = "EventHeader" -tracking.VTXHitCollection = vxdhitname -tracking.SITHitCollection = sithitname -tracking.FTDPixelHitCollection = ftdhitname -tracking.SITRawHitCollection = "NotNeedForPixelSIT" -tracking.FTDRawHitCollection = ftdhitname -tracking.UseSIT = True -tracking.SmoothOn = False -tracking.NDivisionsInTheta = 10 -tracking.NDivisionsInPhi = 60 -tracking.NDivisionsInPhiFTD = 16 -tracking.MinDistCutAttach = 50 -# for p=1GeV, theta=10degree, Chi2FitCut = 1500, HelixMaxChi2 = 1000000, Chi2WZ = 0.02 -tracking.Chi2FitCut = 200 -tracking.MaxChi2PerHit = 200 -tracking.HelixMaxChi2 = 50000 -tracking.Chi2WZTriplet = 0.1 -tracking.Chi2WZQuartet = 0.1 -tracking.Chi2WZSeptet = 0.1 -#tracking.FitterTool = "KalTestTool/KalTest111" -#tracking.OutputLevel = DEBUG - -from Configurables import ForwardTrackingAlg -forward = ForwardTrackingAlg("ForwardTracking") -forward.FTDPixelHitCollection = ftdhitname -#forward.FTDSpacePointCollection = ftdspname -forward.FTDRawHitCollection = ftdhitname -forward.Chi2ProbCut = 0.0 -forward.HitsPerTrackMin = 3 -forward.BestSubsetFinder = "SubsetSimple" -forward.Criteria = ["Crit2_DeltaPhi","Crit2_StraightTrackRatio","Crit3_3DAngle","Crit3_ChangeRZRatio","Crit3_IPCircleDist","Crit4_3DAngleChange","Crit4_DistToExtrapolation", - "Crit2_DeltaRho","Crit2_RZRatio","Crit3_PT"] -forward.CriteriaMin = [0, 0.9, 0, 0.995, 0, 0.8, 0, 20, 1.002, 0.1, 0, 0.99, 0, 0.999, 0, 0.99, 0] -forward.CriteriaMax = [30, 1.02, 10, 1.015, 20, 1.3, 1.0, 150, 1.08, 99999999, 0.8, 1.01, 0.35, 1.001, 1.5, 1.01, 0.05] -#forward.FitterTool = "KalTestTool/KalTest110" -#forward.OutputLevel = DEBUG - -from Configurables import TrackSubsetAlg -subset = TrackSubsetAlg("TrackSubset") -subset.TrackInputCollections = ["ForwardTracks", "SiTracks"] -subset.RawTrackerHitCollections = [vxdhitname, sithitname, ftdhitname] -subset.TrackSubsetCollection = "SubsetTracks" -#subset.FitterTool = "KalTestTool/KalTest111" -#subset.OutputLevel = DEBUG - -from Configurables import ClupatraAlg -clupatra = ClupatraAlg("Clupatra") -clupatra.TPCHitCollection = gashitname -#clupatra.OutputLevel = DEBUG - -from Configurables import FullLDCTrackingAlg -full = FullLDCTrackingAlg("FullTracking") -full.VTXTrackerHits = vxdhitname -full.SITTrackerHits = sithitname -full.TPCTrackerHits = gashitname -full.SETTrackerHits = sethitname -full.FTDPixelTrackerHits = ftdhitname -#full.FTDSpacePoints = ftdspname -full.ETDTrackerHits = etdhitname -full.SITRawHits = "NotNeedForPixelSIT" -full.SETRawHits = "NotNeedForPixelSET" -full.FTDRawHits = ftdhitname -full.TPCTracks = "ClupatraTracks" # add standalone TPC track -full.SiTracks = "SiTracks" -full.OutputTracks = "CompleteTracks" # default name -full.FTDHitToTrackDistance = 5. -full.SITHitToTrackDistance = 3. -full.SETHitToTrackDistance = 5. -#according to particle gun -full.ETDHitToTrackDistance = 40. -full.MinChi2ProbForSiliconTracks = 0 -full.MaxChi2PerHit = 200 -full.ForceSiTPCMerging = True -full.ForceTPCSegmentsMerging = True -#full.OutputLevel = DEBUG - -from Configurables import TPCDndxAlg -tpc_dndx = TPCDndxAlg("TPCDndxAlg") -tpc_dndx.Method = "Simple" - -from Configurables import TofRecAlg -tof = TofRecAlg("TofRecAlg") -#tof.OutputLevel = DEBUG - -from Configurables import TrackParticleRelationAlg -tpr = TrackParticleRelationAlg("Track2Particle") -tpr.MCParticleCollection = "MCParticle" -tpr.TrackList = ["CompleteTracks"] -tpr.TrackerAssociationList = ["VXDTrackerHitAssociation", "ITKBarrelTrackerHitAssociation", "ITKEndcapTrackerHitAssociation", - "OTKBarrelTrackerHitAssociation", "OTKEndcapTrackerHitAssociation", "TPCTrackerHitAss"] -#tpr.OutputLevel = DEBUG - - -from Configurables import TrueMuonTagAlg -tmt = TrueMuonTagAlg("TrueMuonTag") -tmt.MCParticleCollection = "MCParticle" -tmt.TrackList = ["CompleteTracks"] -tmt.TrackerAssociationList = ["VXDTrackerHitAssociation", "ITKBarrelTrackerHitAssociation", "ITKEndcapTrackerHitAssociation", - "OTKBarrelTrackerHitAssociation", "OTKEndcapTrackerHitAssociation", "TPCTrackerHitAss"] -tmt.MuonTagEfficiency = 0.95 # muon true tag efficiency, default is 1.0 (100%) -tmt.MuonDetTanTheta = 1.2 # muon det barrel/endcap separation tan(theta) -#tmt.OutputLevel = DEBUG - -# output -from Configurables import PodioOutput -out = PodioOutput("outputalg") -out.filename = "Tracking_TDR_o1_v01.root" -out.outputCommands = ["keep *"] - -# ApplicationMgr -from Configurables import ApplicationMgr -mgr = ApplicationMgr( - TopAlg = [podioinput, digiVXD, digiITKB, digiITKE, digiOTKB, digiOTKE, digiTPC, digiMuon, tracking, clupatra, full, tpr, tpc_dndx, tof, tmt, out], - EvtSel = 'NONE', - EvtMax = 10, - ExtSvc = [rndmengine, rndmgensvc, dsvc, evtseeder, geosvc, gearsvc, tracksystemsvc, pidsvc], - HistogramPersistency = 'ROOT', - OutputLevel = ERROR -) -- GitLab