diff --git a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx index 7fc371479fba5adee99cc327970f5226186a48e2..995578e5b9b29a96674f8323353297c6b66ebe75 100644 --- a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx +++ b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx @@ -25,6 +25,15 @@ StatusCode SimHitAlg::initialize() ATH_CHECK(histSvc()->regHist("/HIST/plate_trigger", m_plate_trigger)); ATH_CHECK(histSvc()->regHist("/HIST/plate_veto", m_plate_veto)); + m_veto_hitTime = new TH1D("vetoTime", "Veto hit time", 120, -30, 30); + m_preshower_hitTime = new TH1D("preshowerTime", "Preshower hit time", 120, -30, 30); + m_trigger_hitTime = new TH1D("triggerTime", "Trigger hit time", 120, -30, 30); + m_ecal_hitTime = new TH1D("ecalTime", "Ecal hit time", 120, -30, 30); + ATH_CHECK(histSvc()->regHist("/HIST/vetoTime", m_veto_hitTime)); + ATH_CHECK(histSvc()->regHist("/HIST/triggerTime", m_trigger_hitTime)); + ATH_CHECK(histSvc()->regHist("/HIST/preshowerTime", m_preshower_hitTime)); + ATH_CHECK(histSvc()->regHist("/HIST/ecalTime", m_ecal_hitTime)); + m_ecalEnergy = new TH1D("ecalEnergy", "Ecal Energy Fraction", 100, 0.0, 0.20); ATH_CHECK(histSvc()->regHist("/HIST/ecal_energy", m_ecalEnergy)); @@ -140,7 +149,7 @@ StatusCode SimHitAlg::execute() if (m_printScintillator) hit.print(); m_hist->Fill(hit.energyLoss()); m_plate_preshower->Fill(hit.getStation(),hit.getPlate(),hit.energyLoss()); - + m_preshower_hitTime->Fill(hit.meanTime(), hit.energyLoss()); } } @@ -150,7 +159,7 @@ StatusCode SimHitAlg::execute() if (m_printScintillator) hit.print(); m_hist->Fill(hit.energyLoss()); m_plate_trigger->Fill(hit.getStation(),hit.getPlate(),hit.energyLoss()); - + m_trigger_hitTime->Fill(hit.meanTime(), hit.energyLoss()); } } @@ -160,7 +169,7 @@ StatusCode SimHitAlg::execute() if (m_printScintillator) hit.print(); m_hist->Fill(hit.energyLoss()); m_plate_veto->Fill(hit.getStation(),hit.getPlate(),hit.energyLoss()); - + m_veto_hitTime->Fill(hit.meanTime(), hit.energyLoss()); } } @@ -171,6 +180,7 @@ StatusCode SimHitAlg::execute() { if (m_printCalorimeter) hit.print(); ecalTotal += hit.energyLoss(); + m_ecal_hitTime->Fill(hit.meanTime(), hit.energyLoss()); } if (ePrimary > 0) m_ecalEnergy->Fill(ecalTotal/ePrimary); } diff --git a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h index b385c87ed8f193dc0c1b90df941de6cfbaa441a8..881365dedd2cdd996166babdade3d8c3cf8a4b68 100644 --- a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h +++ b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h @@ -30,9 +30,13 @@ class SimHitAlg : public AthHistogramAlgorithm TH2* m_plate_preshower; TH2* m_plate_trigger; TH2* m_plate_veto; + TH1* m_veto_hitTime; + TH1* m_preshower_hitTime; + TH1* m_trigger_hitTime; // Ecal histogram TH1* m_ecalEnergy; + TH1* m_ecal_hitTime; // Emulsion PDG_ID TH1* m_emulsionPDG; diff --git a/Generators/DIFGenerator/python/DIFSampler.py b/Generators/DIFGenerator/python/DIFSampler.py index 740fff10a80816485aa6b40e68e81aeb39326e96..1f82f60d704e6d3a36707bfb48d47e2e2e2bed12 100644 --- a/Generators/DIFGenerator/python/DIFSampler.py +++ b/Generators/DIFGenerator/python/DIFSampler.py @@ -6,7 +6,7 @@ import ParticleGun as PG from math import sqrt, sin, cos, acos from random import uniform from AthenaCommon.SystemOfUnits import TeV, GeV, MeV -from AthenaCommon.PhysicalConstants import pi, c_light +from AthenaCommon.PhysicalConstants import pi from ROOT import TLorentzVector class CylinderSampler(PG.Sampler): @@ -59,7 +59,7 @@ class CylinderSampler(PG.Sampler): z = self.z() t = self.t() if self.axialTiming: - t += z/c_light + t += z #print "POS =", x, y, z, t return TLorentzVector(r * cos(phi), r * sin(phi), z, t) diff --git a/Generators/FaserCosmicGenerator/python/cosmicSampler.py b/Generators/FaserCosmicGenerator/python/cosmicSampler.py index dd0c841f0c739733b7e05a952f7802a07b56738f..5642de80dc8f520d73668a3f3210ed3c8889e29f 100644 --- a/Generators/FaserCosmicGenerator/python/cosmicSampler.py +++ b/Generators/FaserCosmicGenerator/python/cosmicSampler.py @@ -5,7 +5,6 @@ from random import random from math import pi,sin,cos,acos,asin,sqrt import FaserCosmicGenerator.Range as r from numpy import array,add -from AthenaCommon.PhysicalConstants import c_light import numpy as np @@ -56,7 +55,7 @@ class CosmicSampler(Sampler): px, py, pz = CR.mom # impose vertical timing constraint - self.genPosition.SetXYZT(x + self.x0, y + self.y0, z + self.z0, -(y + self.y0)/(c_light * math.fabs(CR.costh))) + self.genPosition.SetXYZT(x + self.x0, y + self.y0, z + self.z0, -(y + self.y0)/math.fabs(CR.costh)) self.genMomentum.SetPxPyPzE(px,py,pz,CR.Efinal) particles = [] diff --git a/Generators/FaserParticleGun/python/RadialPosSampler.py b/Generators/FaserParticleGun/python/RadialPosSampler.py index 8e1efdfd6437e83bf2e04490a1ed478340f833fd..8f2fe2f0f7f45c138b775ca7c0e713f36b938564 100644 --- a/Generators/FaserParticleGun/python/RadialPosSampler.py +++ b/Generators/FaserParticleGun/python/RadialPosSampler.py @@ -1,7 +1,6 @@ import random from math import pi, sin, cos, sqrt, log from ParticleGun.samplers import Sampler, mksampler -from AthenaCommon.PhysicalConstants import c_light import ROOT class RadialPosSampler(Sampler): @@ -65,7 +64,7 @@ class RadialPosSampler(Sampler): z = self.z() t = self.t() if self.axialTiming: - t += z/c_light + t += z return ROOT.TLorentzVector(x, y, z, t) diff --git a/Generators/FlukaReader/python/FlukaReaderAlg.py b/Generators/FlukaReader/python/FlukaReaderAlg.py index ba4837c14ad0796ef7f357c94b59fa8ab7d7f9a8..5349e2226d636020eebfba846477f33af774eae6 100644 --- a/Generators/FlukaReader/python/FlukaReaderAlg.py +++ b/Generators/FlukaReader/python/FlukaReaderAlg.py @@ -2,7 +2,6 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr from GeneratorModules.EvgenAlg import EvgenAlg from AthenaPython.PyAthena import StatusCode, EventInfo, EventID, EventType from AthenaCommon.SystemOfUnits import GeV, MeV, cm -from AthenaCommon.PhysicalConstants import c_light from AthenaCommon.Constants import DEBUG from FaserCosmicGenerator import Range @@ -268,7 +267,7 @@ class FlukaReader(EvgenAlg): # Create HepMC Vertex # Impose axial timing constraint - pos = HepMC.FourVector(newentry["x"] * cm, newentry["y"] * cm, self.z, self.z/c_light) + pos = HepMC.FourVector(newentry["x"] * cm, newentry["y"] * cm, self.z, self.z) gv = HepMC.GenVertex(pos) ROOT.SetOwnership(gv, False) diff --git a/Generators/GenieReader/python/GenieReaderAlg.py b/Generators/GenieReader/python/GenieReaderAlg.py index 373fa709c036b0f6ba28574f5768bcdef93d3de8..432d792cf9391ebedfb4e750c09f738ab5f51f45 100644 --- a/Generators/GenieReader/python/GenieReaderAlg.py +++ b/Generators/GenieReader/python/GenieReaderAlg.py @@ -4,7 +4,6 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr from GeneratorModules.EvgenAlg import EvgenAlg from AthenaPython.PyAthena import StatusCode, EventInfo, EventID, EventType from AthenaCommon.SystemOfUnits import GeV, m, nanosecond -from AthenaCommon.PhysicalConstants import c_light import ROOT __author__ = "Dave Caser <dcasper@uci.edu>" @@ -38,8 +37,8 @@ class GenieReader(EvgenAlg): ROOT.SetOwnership(mcEventId, False) ROOT.SetOwnership(mcEventInfo, False) - # impose axial timing constraint - pos = HepMC.FourVector(self.evtStore["vx"]*m, self.evtStore["vy"]*m, self.evtStore["vz"]*m, (self.evtStore["vz"]*m/c_light)) + # impose axial timing constraint - time is expected in units of length, so just use z position + pos = HepMC.FourVector(self.evtStore["vx"]*m, self.evtStore["vy"]*m, self.evtStore["vz"]*m, self.evtStore["vz"]*m) gv = HepMC.GenVertex(pos) ROOT.SetOwnership(gv, False) evt.add_vertex(gv) diff --git a/Generators/ParticleGun/python/samplers.py b/Generators/ParticleGun/python/samplers.py index b53848c0027a2fb832298e03a6e17a9d39a2773f..b9edbd6c8ec5a18324412d5cf4c4da9d80b84e2e 100644 --- a/Generators/ParticleGun/python/samplers.py +++ b/Generators/ParticleGun/python/samplers.py @@ -2,7 +2,6 @@ import ROOT, math, random from ParticleGun.histsampling import TH1,TH2 -from AthenaCommon.PhysicalConstants import c_light ## For convenience PI = math.pi @@ -355,7 +354,7 @@ class PosSampler(Sampler): z = self.z() t = self.t() if self.axialTiming: - t += z/c_light + t += z #print "POS =", x, y, z, t return ROOT.TLorentzVector(x, y, z, t)