CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
OpticalFunctionsTransport Class Reference

#include <OpticalFunctionsTransport.h>

Inheritance diagram for OpticalFunctionsTransport:
BaseProtonTransport

Public Member Functions

 OpticalFunctionsTransport (const edm::ParameterSet &ps)
 
void process (const HepMC::GenEvent *ev, const edm::EventSetup &es, CLHEP::HepRandomEngine *engine) override
 
 ~OpticalFunctionsTransport () override
 
- Public Member Functions inherited from BaseProtonTransport
void addPartToHepMC (HepMC::GenEvent *)
 
void ApplyBeamCorrection (HepMC::GenParticle *p)
 
void ApplyBeamCorrection (TLorentzVector &p)
 
 BaseProtonTransport (const edm::ParameterSet &iConfig)
 
double beamEnergy ()
 
double beamMomentum ()
 
void clear ()
 
std::vector< LHCTransportLink > & getCorrespondenceMap ()
 
void setBeamEnergy (double e)
 
virtual ~BaseProtonTransport ()
 

Private Member Functions

bool transportProton (const HepMC::GenParticle *)
 

Private Attributes

edm::ESHandle< CTPPSBeamParametersbeamParameters_
 
double empiricalAperture45_a_int_
 
double empiricalAperture45_a_slp_
 
double empiricalAperture45_xi0_int_
 
double empiricalAperture45_xi0_slp_
 
double empiricalAperture56_a_int_
 
double empiricalAperture56_a_slp_
 
double empiricalAperture56_xi0_int_
 
double empiricalAperture56_xi0_slp_
 
edm::ESHandle< LHCInfolhcInfo_
 
std::string lhcInfoLabel_
 
edm::ESHandle< LHCInterpolatedOpticalFunctionsSetCollectionopticalFunctions_
 
std::string opticsLabel_
 
bool produceHitsRelativeToBeam_
 
bool useEmpiricalApertures_
 

Additional Inherited Members

- Protected Types inherited from BaseProtonTransport
enum  TransportMode { TransportMode::HECTOR, TransportMode::TOTEM, TransportMode::OPTICALFUNCTIONS }
 
- Protected Attributes inherited from BaseProtonTransport
bool bApplyZShift
 
std::string beam1Filename_
 
std::string beam2Filename_
 
double beamEnergy_
 
double beamMomentum_
 
CLHEP::HepRandomEngine * engine_
 
double etaCut_
 
double fBeamXatIP
 
double fBeamYatIP
 
double fCrossingAngle_45
 
double fCrossingAngle_56
 
double fPPSRegionStart_45
 
double fPPSRegionStart_56
 
double fVtxMeanX
 
double fVtxMeanY
 
double fVtxMeanZ
 
std::map< unsigned int, TLorentzVector > m_beamPart
 
std::vector< LHCTransportLinkm_CorrespondenceMap
 
double m_sig_E
 
double m_sigmaSTX
 
double m_sigmaSTY
 
double m_sigmaSX
 
double m_sigmaSY
 
std::map< unsigned int, double > m_xAtTrPoint
 
std::map< unsigned int, double > m_yAtTrPoint
 
TransportMode MODE
 
double momentumCut_
 
int NEvent
 
bool verbosity_
 

Detailed Description

Definition at line 22 of file OpticalFunctionsTransport.h.

Constructor & Destructor Documentation

◆ OpticalFunctionsTransport()

OpticalFunctionsTransport::OpticalFunctionsTransport ( const edm::ParameterSet ps)

Definition at line 4 of file OpticalFunctionsTransport.cc.

5  : BaseProtonTransport(iConfig),
6  lhcInfoLabel_(iConfig.getParameter<std::string>("lhcInfoLabel")),
7  opticsLabel_(iConfig.getParameter<std::string>("opticsLabel")),
8  useEmpiricalApertures_(iConfig.getParameter<bool>("useEmpiricalApertures")),
9  empiricalAperture45_xi0_int_(iConfig.getParameter<double>("empiricalAperture45_xi0_int")),
10  empiricalAperture45_xi0_slp_(iConfig.getParameter<double>("empiricalAperture45_xi0_slp")),
11  empiricalAperture45_a_int_(iConfig.getParameter<double>("empiricalAperture45_a_int")),
12  empiricalAperture45_a_slp_(iConfig.getParameter<double>("empiricalAperture45_a_slp")),
13  empiricalAperture56_xi0_int_(iConfig.getParameter<double>("empiricalAperture56_xi0_int")),
14  empiricalAperture56_xi0_slp_(iConfig.getParameter<double>("empiricalAperture56_xi0_slp")),
15  empiricalAperture56_a_int_(iConfig.getParameter<double>("empiricalAperture56_a_int")),
16  empiricalAperture56_a_slp_(iConfig.getParameter<double>("empiricalAperture56_a_slp")),
17  produceHitsRelativeToBeam_(iConfig.getParameter<bool>("produceHitsRelativeToBeam")) {
19 }

References BaseProtonTransport::MODE, and BaseProtonTransport::OPTICALFUNCTIONS.

◆ ~OpticalFunctionsTransport()

OpticalFunctionsTransport::~OpticalFunctionsTransport ( )
inlineoverride

Definition at line 25 of file OpticalFunctionsTransport.h.

25 {};

Member Function Documentation

◆ process()

void OpticalFunctionsTransport::process ( const HepMC::GenEvent ev,
const edm::EventSetup es,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements BaseProtonTransport.

Definition at line 20 of file OpticalFunctionsTransport.cc.

22  {
23  this->clear();
24 
25  iSetup.get<LHCInfoRcd>().get(lhcInfoLabel_, lhcInfo_);
28 
29  engine_ = _engine; // the engine needs to be updated for each event
30 
31  for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
32  eventParticle != evt->particles_end();
33  ++eventParticle) {
34  if (!((*eventParticle)->status() == 1 && (*eventParticle)->pdg_id() == 2212))
35  continue;
36 
37  if (!(fabs((*eventParticle)->momentum().eta()) > etaCut_ && fabs((*eventParticle)->momentum().pz()) > momentumCut_))
38  continue; // discard protons outside kinematic acceptance
39 
40  unsigned int line = (*eventParticle)->barcode();
41  HepMC::GenParticle* gpart = (*eventParticle);
42  if (gpart->pdg_id() != 2212)
43  continue; // only transport stable protons
44  if (gpart->status() != 1)
45  continue;
46  if (m_beamPart.find(line) != m_beamPart.end()) // assures this protons has not been already propagated
47  continue;
48 
49  transportProton(gpart);
50  }
51 }

References beamParameters_, BaseProtonTransport::clear(), BaseProtonTransport::engine_, BaseProtonTransport::etaCut_, GenParticle::GenParticle, edm::EventSetup::get(), get, lhcInfo_, lhcInfoLabel_, mps_splice::line, BaseProtonTransport::m_beamPart, BaseProtonTransport::momentumCut_, opticalFunctions_, opticsLabel_, and transportProton().

◆ transportProton()

bool OpticalFunctionsTransport::transportProton ( const HepMC::GenParticle *  in_trk)
private

Definition at line 53 of file OpticalFunctionsTransport.cc.

53  {
54  const HepMC::FourVector& vtx_cms = in_trk->production_vertex()->position(); // in mm
55  const HepMC::FourVector& mom_cms = in_trk->momentum();
56 
57  // transformation to LHC/TOTEM convention
58  HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
59  HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
60 
61  // determine the LHC arm and related parameters
62  unsigned int arm = 3;
63  double beamMomentum = 0.;
64  double xangle = 0.;
65  double empiricalAperture_xi0_int, empiricalAperture_xi0_slp;
66  double empiricalAperture_a_int, empiricalAperture_a_slp;
67 
68  if (mom_lhc.z() < 0) // sector 45
69  {
70  arm = 0;
73  empiricalAperture_xi0_int = empiricalAperture45_xi0_int_;
74  empiricalAperture_xi0_slp = empiricalAperture45_xi0_slp_;
75  empiricalAperture_a_int = empiricalAperture45_a_int_;
76  empiricalAperture_a_slp = empiricalAperture45_a_slp_;
77  } else { // sector 56
78  arm = 1;
81  empiricalAperture_xi0_int = empiricalAperture56_xi0_int_;
82  empiricalAperture_xi0_slp = empiricalAperture56_xi0_slp_;
83  empiricalAperture_a_int = empiricalAperture56_a_int_;
84  empiricalAperture_a_slp = empiricalAperture56_a_slp_;
85  }
86 
87  // calculate kinematics for optics parametrisation
88  const double p = mom_lhc.rho();
89  const double xi = 1. - p / beamMomentum;
90  const double th_x_phys = mom_lhc.x() / p;
91  const double th_y_phys = mom_lhc.y() / p;
92  const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() + xangle);
93  const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z());
94 
95  if (verbosity_) {
96  LogDebug("OpticalFunctionsTransport")
97  << "simu: xi = " << xi << ", th_x_phys = " << th_x_phys << ", th_y_phys = " << th_y_phys
98  << ", vtx_lhc_eff_x = " << vtx_lhc_eff_x << ", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl;
99  }
100 
101  // check empirical aperture
103  const auto& xangle = lhcInfo_->crossingAngle();
104  const double xi_th = (empiricalAperture_xi0_int + xangle * empiricalAperture_xi0_slp) +
105  (empiricalAperture_a_int + xangle * empiricalAperture_a_slp) * th_x_phys;
106 
107  if (xi > xi_th) {
108  if (verbosity_) {
109  LogDebug("OpticalFunctionsTransport") << "stop because of empirical appertures";
110  }
111  return false;
112  }
113  }
114 
115  // transport the proton into each pot/scoring plane
116  for (const auto& ofp : (*opticalFunctions_)) {
117  CTPPSDetId rpId(ofp.first);
118  const unsigned int rpDecId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
119 
120  // first check the arm
121  if (rpId.arm() != arm)
122  continue;
123 
124  if (verbosity_)
125  LogDebug("OpticalFunctionsTransport") << " RP " << rpDecId << std::endl;
126 
127  // transport proton
129  vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys, xi}; // conversions: mm -> cm
130 
132  ofp.second.transport(k_in, k_out, true);
133 
134  double b_x = k_out.x * 1E1, b_y = k_out.y * 1E1; // conversions: cm -> mm
135  double a_x = k_out.th_x, a_y = k_out.th_y;
136 
137  // if needed, subtract beam position and angle
139  // determine beam position
140  LHCInterpolatedOpticalFunctionsSet::Kinematics k_be_in = {0., 0., 0., 0., 0.};
142  ofp.second.transport(k_be_in, k_be_out, true);
143 
144  a_x -= k_be_out.th_x;
145  a_y -= k_be_out.th_y;
146  b_x -= k_be_out.x * 1E1;
147  b_y -= k_be_out.y * 1E1; // conversions: cm -> mm
148  }
149 
150  const double z_scoringPlane = ofp.second.getScoringPlaneZ() * 1E1; // conversion: cm --> mm
151 
152  if (verbosity_) {
153  LogDebug("OpticalFunctionsTransport")
154  << " proton transported: a_x = " << a_x << " rad, a_y = " << a_y << " rad, b_x = " << b_x
155  << " mm, b_y = " << b_y << " mm, z = " << z_scoringPlane << " mm" << std::endl;
156  }
157  unsigned int line = in_trk->barcode();
158  double px = -p * a_x;
159  double py = p * a_y;
160  double pz = std::copysign(sqrt(p * p - px * px - py * py), mom_cms.z());
161  double e = sqrt(px * px + py * py + pz * pz + ProtonMassSQ);
162  TLorentzVector p_out(px, py, pz, e);
163  m_beamPart[line] = p_out;
164  m_xAtTrPoint[line] = -b_x;
165  m_yAtTrPoint[line] = b_y;
166  return true;
167  }
168  return false;
169 }

References BaseProtonTransport::beamMomentum(), beamParameters_, LHCInfo::crossingAngle(), MillePedeFileConverter_cfg::e, empiricalAperture45_a_int_, empiricalAperture45_a_slp_, empiricalAperture45_xi0_int_, empiricalAperture45_xi0_slp_, empiricalAperture56_a_int_, empiricalAperture56_a_slp_, empiricalAperture56_xi0_int_, empiricalAperture56_xi0_slp_, CTPPSBeamParameters::getBeamMom45(), CTPPSBeamParameters::getBeamMom56(), CTPPSBeamParameters::getHalfXangleX45(), CTPPSBeamParameters::getHalfXangleX56(), lhcInfo_, mps_splice::line, LogDebug, BaseProtonTransport::m_beamPart, BaseProtonTransport::m_xAtTrPoint, BaseProtonTransport::m_yAtTrPoint, opticalFunctions_, AlCaHLTBitMon_ParallelJobs::p, produceHitsRelativeToBeam_, ProtonMassSQ, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, year_2016_postTS2_cff::rpId, mathSSE::sqrt(), LHCInterpolatedOpticalFunctionsSet::Kinematics::th_x, LHCInterpolatedOpticalFunctionsSet::Kinematics::th_y, useEmpiricalApertures_, BaseProtonTransport::verbosity_, LHCInterpolatedOpticalFunctionsSet::Kinematics::x, OpticalFunctionsConfig_cfi::xangle, hybridSuperClusters_cfi::xi, and LHCInterpolatedOpticalFunctionsSet::Kinematics::y.

Referenced by process().

Member Data Documentation

◆ beamParameters_

edm::ESHandle<CTPPSBeamParameters> OpticalFunctionsTransport::beamParameters_
private

Definition at line 36 of file OpticalFunctionsTransport.h.

Referenced by process(), and transportProton().

◆ empiricalAperture45_a_int_

double OpticalFunctionsTransport::empiricalAperture45_a_int_
private

Definition at line 40 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ empiricalAperture45_a_slp_

double OpticalFunctionsTransport::empiricalAperture45_a_slp_
private

Definition at line 40 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ empiricalAperture45_xi0_int_

double OpticalFunctionsTransport::empiricalAperture45_xi0_int_
private

Definition at line 40 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ empiricalAperture45_xi0_slp_

double OpticalFunctionsTransport::empiricalAperture45_xi0_slp_
private

Definition at line 40 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ empiricalAperture56_a_int_

double OpticalFunctionsTransport::empiricalAperture56_a_int_
private

Definition at line 42 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ empiricalAperture56_a_slp_

double OpticalFunctionsTransport::empiricalAperture56_a_slp_
private

Definition at line 42 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ empiricalAperture56_xi0_int_

double OpticalFunctionsTransport::empiricalAperture56_xi0_int_
private

Definition at line 42 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ empiricalAperture56_xi0_slp_

double OpticalFunctionsTransport::empiricalAperture56_xi0_slp_
private

Definition at line 42 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ lhcInfo_

edm::ESHandle<LHCInfo> OpticalFunctionsTransport::lhcInfo_
private

Definition at line 35 of file OpticalFunctionsTransport.h.

Referenced by process(), and transportProton().

◆ lhcInfoLabel_

std::string OpticalFunctionsTransport::lhcInfoLabel_
private

Definition at line 32 of file OpticalFunctionsTransport.h.

Referenced by process().

◆ opticalFunctions_

edm::ESHandle<LHCInterpolatedOpticalFunctionsSetCollection> OpticalFunctionsTransport::opticalFunctions_
private

Definition at line 37 of file OpticalFunctionsTransport.h.

Referenced by process(), and transportProton().

◆ opticsLabel_

std::string OpticalFunctionsTransport::opticsLabel_
private

Definition at line 33 of file OpticalFunctionsTransport.h.

Referenced by process().

◆ produceHitsRelativeToBeam_

bool OpticalFunctionsTransport::produceHitsRelativeToBeam_
private

Definition at line 45 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

◆ useEmpiricalApertures_

bool OpticalFunctionsTransport::useEmpiricalApertures_
private

Definition at line 39 of file OpticalFunctionsTransport.h.

Referenced by transportProton().

BaseProtonTransport::TransportMode::OPTICALFUNCTIONS
OpticalFunctionsTransport::opticsLabel_
std::string opticsLabel_
Definition: OpticalFunctionsTransport.h:33
LHCInterpolatedOpticalFunctionsSet::Kinematics
proton kinematics description
Definition: LHCInterpolatedOpticalFunctionsSet.h:28
OpticalFunctionsTransport::empiricalAperture45_a_int_
double empiricalAperture45_a_int_
Definition: OpticalFunctionsTransport.h:40
OpticalFunctionsTransport::empiricalAperture45_xi0_int_
double empiricalAperture45_xi0_int_
Definition: OpticalFunctionsTransport.h:40
OpticalFunctionsTransport::lhcInfoLabel_
std::string lhcInfoLabel_
Definition: OpticalFunctionsTransport.h:32
BaseProtonTransport::clear
void clear()
Definition: BaseProtonTransport.cc:111
BaseProtonTransport::MODE
TransportMode MODE
Definition: BaseProtonTransport.h:42
OpticalFunctionsTransport::empiricalAperture45_a_slp_
double empiricalAperture45_a_slp_
Definition: OpticalFunctionsTransport.h:40
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
OpticalFunctionsTransport::transportProton
bool transportProton(const HepMC::GenParticle *)
Definition: OpticalFunctionsTransport.cc:53
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CTPPSBeamParameters::getHalfXangleX56
double getHalfXangleX56() const
Definition: CTPPSBeamParameters.cc:67
BaseProtonTransport::verbosity_
bool verbosity_
Definition: BaseProtonTransport.h:51
hybridSuperClusters_cfi.xi
xi
Definition: hybridSuperClusters_cfi.py:10
CTPPSBeamParameters::getBeamMom56
double getBeamMom56() const
Definition: CTPPSBeamParameters.cc:53
CTPPSBeamParameters::getHalfXangleX45
double getHalfXangleX45() const
Definition: CTPPSBeamParameters.cc:65
year_2016_postTS2_cff.rpId
rpId
Definition: year_2016_postTS2_cff.py:23
BaseProtonTransport::momentumCut_
double momentumCut_
Definition: BaseProtonTransport.h:65
OpticalFunctionsTransport::lhcInfo_
edm::ESHandle< LHCInfo > lhcInfo_
Definition: OpticalFunctionsTransport.h:35
OpticalFunctionsTransport::empiricalAperture56_a_slp_
double empiricalAperture56_a_slp_
Definition: OpticalFunctionsTransport.h:42
LHCInfo::crossingAngle
const float crossingAngle() const
Definition: LHCInfo.cc:182
LHCInterpolatedOpticalFunctionsSet::Kinematics::y
double y
Definition: LHCInterpolatedOpticalFunctionsSet.h:31
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
OpticalFunctionsTransport::empiricalAperture56_a_int_
double empiricalAperture56_a_int_
Definition: OpticalFunctionsTransport.h:42
OpticalFunctionsTransport::empiricalAperture56_xi0_int_
double empiricalAperture56_xi0_int_
Definition: OpticalFunctionsTransport.h:42
LHCInterpolatedOpticalFunctionsSet::Kinematics::x
double x
Definition: LHCInterpolatedOpticalFunctionsSet.h:29
OpticalFunctionsTransport::produceHitsRelativeToBeam_
bool produceHitsRelativeToBeam_
Definition: OpticalFunctionsTransport.h:45
LHCInfoRcd
Definition: LHCInfoRcd.h:24
OpticalFunctionsTransport::beamParameters_
edm::ESHandle< CTPPSBeamParameters > beamParameters_
Definition: OpticalFunctionsTransport.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
OpticalFunctionsConfig_cfi.xangle
xangle
Definition: OpticalFunctionsConfig_cfi.py:17
LHCInterpolatedOpticalFunctionsSet::Kinematics::th_y
double th_y
Definition: LHCInterpolatedOpticalFunctionsSet.h:32
ProtonMassSQ
static const double ProtonMassSQ
Definition: PPSUnitConversion.h:6
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
BaseProtonTransport::etaCut_
double etaCut_
Definition: BaseProtonTransport.h:64
BaseProtonTransport::m_beamPart
std::map< unsigned int, TLorentzVector > m_beamPart
Definition: BaseProtonTransport.h:47
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
OpticalFunctionsTransport::opticalFunctions_
edm::ESHandle< LHCInterpolatedOpticalFunctionsSetCollection > opticalFunctions_
Definition: OpticalFunctionsTransport.h:37
CTPPSBeamParameters::getBeamMom45
double getBeamMom45() const
Definition: CTPPSBeamParameters.cc:52
BaseProtonTransport::engine_
CLHEP::HepRandomEngine * engine_
Definition: BaseProtonTransport.h:45
get
#define get
CTPPSBeamParametersRcd
Definition: CTPPSBeamParametersRcd.h:14
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
OpticalFunctionsTransport::empiricalAperture56_xi0_slp_
double empiricalAperture56_xi0_slp_
Definition: OpticalFunctionsTransport.h:42
BaseProtonTransport::m_yAtTrPoint
std::map< unsigned int, double > m_yAtTrPoint
Definition: BaseProtonTransport.h:49
OpticalFunctionsTransport::empiricalAperture45_xi0_slp_
double empiricalAperture45_xi0_slp_
Definition: OpticalFunctionsTransport.h:40
BaseProtonTransport::m_xAtTrPoint
std::map< unsigned int, double > m_xAtTrPoint
Definition: BaseProtonTransport.h:48
BaseProtonTransport::beamMomentum
double beamMomentum()
Definition: BaseProtonTransport.h:38
BaseProtonTransport::BaseProtonTransport
BaseProtonTransport(const edm::ParameterSet &iConfig)
Definition: BaseProtonTransport.cc:8
LHCInterpolatedOpticalFunctionsSet::Kinematics::th_x
double th_x
Definition: LHCInterpolatedOpticalFunctionsSet.h:30
OpticalFunctionsTransport::useEmpiricalApertures_
bool useEmpiricalApertures_
Definition: OpticalFunctionsTransport.h:39
mps_splice.line
line
Definition: mps_splice.py:76
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CTPPSInterpolatedOpticsRcd
Definition: CTPPSInterpolatedOpticsRcd.h:13