CMS 3D CMS Logo

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

#include <GflashShowino.h>

Public Member Functions

void addEnergyDeposited (double energy)
 
double getDepth ()
 
double getEnergy ()
 
double getEnergyDeposited ()
 
double getGlobalTime ()
 
GflashTrajectorygetHelix ()
 
double getPathLength ()
 
double getPathLengthAtShower ()
 
double getPathLengthOnEcal ()
 
Gflash3VectorgetPosition ()
 
Gflash3VectorgetPositionAtShower ()
 
int getShowerType ()
 
double getStepLengthToHcal ()
 
double getStepLengthToOut ()
 
 GflashShowino ()
 
void initialize (int showerType, double energy, double globalTime, double charge, Gflash3Vector &position, Gflash3Vector &momentum, double magneticField)
 
void setGlobalTime (double globalTime)
 
void setPathLength (double pathLength)
 
void setPosition (const Gflash3Vector &position)
 
void updateShowino (double deltaStep)
 
 ~GflashShowino ()
 

Private Member Functions

int convertShowerType (int fastSimShowerType, const Gflash3Vector &pos)
 
void evaluateLengths ()
 
Gflash3VectorsimulateFirstInteractionPoint (int showType, Gflash3Vector &pos)
 

Private Attributes

double theEnergy
 
double theEnergyDeposited
 
double theGlobalTime
 
GflashTrajectorytheHelix
 
double thePathLength
 
double thePathLengthAtShower
 
double thePathLengthOnEcal
 
Gflash3Vector thePosition
 
Gflash3Vector thePositionAtShower
 
int theShowerType
 
double theStepLengthToHcal
 
double theStepLengthToOut
 
GflashTrajectoryPoint theTrajectoryPoint
 

Detailed Description

Definition at line 8 of file GflashShowino.h.

Constructor & Destructor Documentation

◆ GflashShowino()

GflashShowino::GflashShowino ( )

Definition at line 4 of file GflashShowino.cc.

5  : theShowerType(-1),
6  theEnergy(0),
7  thePositionAtShower(0, 0, 0),
12  thePathLength(0),
13  theGlobalTime(0),
14  thePosition(0, 0, 0),
17 }

References theHelix.

◆ ~GflashShowino()

GflashShowino::~GflashShowino ( )

Definition at line 19 of file GflashShowino.cc.

19 { delete theHelix; }

References theHelix.

Member Function Documentation

◆ addEnergyDeposited()

void GflashShowino::addEnergyDeposited ( double  energy)
inline

◆ convertShowerType()

int GflashShowino::convertShowerType ( int  fastSimShowerType,
const Gflash3Vector pos 
)
private

◆ evaluateLengths()

void GflashShowino::evaluateLengths ( )
private

Definition at line 64 of file GflashShowino.cc.

64  {
65  // thePathLengthAtShower: path Length from the origin to the shower starting
66  // point in cm theStepLengthToOut: the total path length from the starting
67  // point of
68  // shower to the maximum distance inside paramerized
69  // envelopes
70  double eta = thePosition.getEta();
71 
72  if (std::fabs(eta) < Gflash::EtaMax[Gflash::kESPM]) {
75  double pathLengthAtHcalBack = theHelix->getPathLengthAtRhoEquals(Gflash::Rmax[Gflash::kHB]);
76  if (pathLengthAtHcalBack > 0) {
77  theStepLengthToOut = std::min(300., pathLengthAtHcalBack - thePathLengthAtShower);
78  } else {
79  theStepLengthToOut = 200.;
80  }
82 
83  } else if (std::fabs(eta) < Gflash::EtaMax[Gflash::kENCA]) {
84  double zsign = (eta > 0) ? 1.0 : -1.0;
90  } else {
91  //@@@extend for HF later
92  theStepLengthToOut = 200.0;
93  }
94 
96 }

References PVValHelper::eta, Gflash::EtaMax, GflashTrajectory::getPathLengthAtRhoEquals(), GflashTrajectory::getPathLengthAtZ(), Gflash::kENCA, Gflash::kESPM, Gflash::kHB, Gflash::kHE, min(), Gflash::RFrontCrystalEB, Gflash::Rmax, Gflash::Rmin, theHelix, thePathLength, thePathLengthAtShower, thePathLengthOnEcal, thePosition, theStepLengthToHcal, theStepLengthToOut, Gflash::ZFrontCrystalEE, Gflash::Zmax, and Gflash::Zmin.

Referenced by initialize().

◆ getDepth()

double GflashShowino::getDepth ( void  )
inline

◆ getEnergy()

double GflashShowino::getEnergy ( )
inline

◆ getEnergyDeposited()

double GflashShowino::getEnergyDeposited ( )
inline

Definition at line 38 of file GflashShowino.h.

38 { return theEnergyDeposited; }

References theEnergyDeposited.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

◆ getGlobalTime()

double GflashShowino::getGlobalTime ( )
inline

◆ getHelix()

GflashTrajectory* GflashShowino::getHelix ( )
inline

◆ getPathLength()

double GflashShowino::getPathLength ( )
inline

Definition at line 36 of file GflashShowino.h.

36 { return thePathLength; }

References thePathLength.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

◆ getPathLengthAtShower()

double GflashShowino::getPathLengthAtShower ( )
inline

◆ getPathLengthOnEcal()

double GflashShowino::getPathLengthOnEcal ( )
inline

◆ getPosition()

Gflash3Vector& GflashShowino::getPosition ( )
inline

◆ getPositionAtShower()

Gflash3Vector& GflashShowino::getPositionAtShower ( )
inline

◆ getShowerType()

int GflashShowino::getShowerType ( )
inline

◆ getStepLengthToHcal()

double GflashShowino::getStepLengthToHcal ( )
inline

Definition at line 31 of file GflashShowino.h.

31 { return theStepLengthToHcal; }

References theStepLengthToHcal.

Referenced by GflashHadronShowerProfile::longitudinalProfile().

◆ getStepLengthToOut()

double GflashShowino::getStepLengthToOut ( )
inline

Definition at line 32 of file GflashShowino.h.

32 { return theStepLengthToOut; }

References theStepLengthToOut.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

◆ initialize()

void GflashShowino::initialize ( int  showerType,
double  energy,
double  globalTime,
double  charge,
Gflash3Vector position,
Gflash3Vector momentum,
double  magneticField 
)

Definition at line 21 of file GflashShowino.cc.

27  {
28  theEnergy = energy;
29  theGlobalTime = globalTime;
30  theEnergyDeposited = 0.0;
31 
32  // inside the magnetic field (tesla unit);
34 
35  if (showerType < 100) {
38  theShowerType = showerType;
39 
40  } else {
41  // this input is from FastSimulation
42  // 1. simulate the shower starting position
45 
46  // 2. find shower type depending on where is the shower starting point
48  }
49 
51 }

References ALCARECOTkAlJpsiMuMu_cff::charge, HCALHighEnergyHPDFilter_cfi::energy, evaluateLengths(), Gflash::findShowerType(), GflashTrajectory::initializeTrajectory(), HLT_FULL_cff::magneticField, position, simulateFirstInteractionPoint(), theEnergy, theEnergyDeposited, theGlobalTime, theHelix, thePosition, thePositionAtShower, and theShowerType.

Referenced by GflashEMShowerProfile::initialize(), and GflashHadronShowerProfile::initialize().

◆ setGlobalTime()

void GflashShowino::setGlobalTime ( double  globalTime)
inline

Definition at line 41 of file GflashShowino.h.

41 { theGlobalTime = globalTime; }

References theGlobalTime.

◆ setPathLength()

void GflashShowino::setPathLength ( double  pathLength)
inline

Definition at line 42 of file GflashShowino.h.

42 { thePathLength = pathLength; }

References thePathLength.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

◆ setPosition()

void GflashShowino::setPosition ( const Gflash3Vector position)
inline

Definition at line 43 of file GflashShowino.h.

43 { thePosition = position; }

References position, and thePosition.

◆ simulateFirstInteractionPoint()

Gflash3Vector & GflashShowino::simulateFirstInteractionPoint ( int  showType,
Gflash3Vector pos 
)
private

fraction before the crystal, but inside Ecal

Definition at line 98 of file GflashShowino.cc.

98  {
99  // determine the shower starting point (ssp):
100  // the position at the entrance + the mean free path till the inelastic
101  // interaction inside calo
102 
103  double depthAtShower = 0.0;
104 
105  // set thePathLengthOnEcal, the pathLength at the reference (r=123.8 for
106  // barrel and z=304.5 for endcap)
107 
108  // effective interaction length fitter to ssp from Geant4
109  double effectiveLambda = 0.0;
110  if (theEnergy > 0.0 && theEnergy < 15) {
111  effectiveLambda = 24.6 + 2.6 * std::tanh(3.0 * (std::log(theEnergy) - 1.43));
112  } else {
113  effectiveLambda = 28.4 + 1.20 * std::tanh(1.5 * (std::log(theEnergy) - 4.3));
114  }
115  // fraction before the crystal, but inside Ecal
116  // double frac_ssp1
117  // = 1.5196e-01+1.3300e-01*tanh(-4.6971e-01*(std::log(theEnergy)+2.4162e+00));
118  // fraction after the crystal, but before Hcal
119  double frac_ssp2 = 2.8310e+00 + 2.6766e+00 * tanh(-4.8068e-01 * (std::log(theEnergy) + 3.4857e+00));
120 
121  if (fastSimShowerType == 100) { // fastTrack.onEcal() == 1
122 
123  // double rhoTemp = Gflash::ROffCrystalEB +
124  // Gflash::LengthCrystalEB*std::sin(position.getTheta());
125  double rhoTemp = Gflash::LengthCrystalEB * std::sin(position.getTheta());
127  double pathLengthAt2 = theHelix->getPathLengthAtRhoEquals(Gflash::RFrontCrystalEB + rhoTemp);
128  double pathLengthAt3 = theHelix->getPathLengthAtRhoEquals(Gflash::Rmin[Gflash::kHB]);
129 
131  /*
132  if(CLHEP::HepUniformRand() < frac_ssp1 ) {
133  depthAtShower =
134  (pathLengthAt1-thePathLengthOnEcal)*CLHEP::HepUniformRand();
135  }
136  else {
137  */
138  // inside the crystal
139  // depthAtShower = (pathLengthAt1-thePathLengthOnEcal) -
140  // effectiveLambda*log(CLHEP::HepUniformRand());
141  depthAtShower = -effectiveLambda * log(CLHEP::HepUniformRand());
142  // after the crystal
143  if (depthAtShower > (pathLengthAt2 - thePathLengthOnEcal)) {
144  // before Hcal
145  if (CLHEP::HepUniformRand() < frac_ssp2) {
146  depthAtShower =
147  (pathLengthAt2 - thePathLengthOnEcal) + (pathLengthAt3 - pathLengthAt2) * CLHEP::HepUniformRand();
148  }
149  // inside Hcal
150  else {
151  depthAtShower = (pathLengthAt3 - thePathLengthOnEcal) - effectiveLambda * log(CLHEP::HepUniformRand());
152  // check whether the shower starts beyond HB
153  double pathLengthAt4 = theHelix->getPathLengthAtRhoEquals(Gflash::Rmax[Gflash::kHB]);
154  if (depthAtShower > (pathLengthAt4 - thePathLengthOnEcal)) {
155  depthAtShower = (pathLengthAt4 - pathLengthAt3) * CLHEP::HepUniformRand();
156  }
157  }
158  }
159  // }
160  } else if (fastSimShowerType == 101) { // fastTrack.onEcal() == 2
161 
162  double zTemp = Gflash::LengthCrystalEE;
163  double zsign = (position.getEta() > 0) ? 1.0 : -1.0;
164 
166  double pathLengthAt2 = theHelix->getPathLengthAtZ(zsign * (Gflash::ZFrontCrystalEE + zTemp));
167  double pathLengthAt3 = theHelix->getPathLengthAtZ(zsign * Gflash::Zmin[Gflash::kHE]);
168 
169  /*
170  if(CLHEP::HepUniformRand() < frac_ssp1 ) {
171  depthAtShower =
172  (pathLengthAt1-thePathLengthOnEcal)*CLHEP::HepUniformRand();
173  }
174  else {
175  */
176  // depthAtShower =
177  // (pathLengthAt1-thePathLengthOnEcal)-effectiveLambda*std::log(CLHEP::HepUniformRand());
178  depthAtShower = -effectiveLambda * std::log(CLHEP::HepUniformRand());
179 
180  if (depthAtShower > (pathLengthAt2 - thePathLengthOnEcal)) {
181  if (CLHEP::HepUniformRand() < frac_ssp2) {
182  depthAtShower =
183  (pathLengthAt2 - thePathLengthOnEcal) + (pathLengthAt3 - pathLengthAt2) * CLHEP::HepUniformRand();
184  } else {
185  depthAtShower = (pathLengthAt3 - thePathLengthOnEcal) - effectiveLambda * std::log(CLHEP::HepUniformRand());
186  // shower starts beyond HE
187  double pathLengthAt4 = theHelix->getPathLengthAtZ(zsign * Gflash::Zmax[Gflash::kHE]);
188  if (depthAtShower > (pathLengthAt4 - thePathLengthOnEcal)) {
189  depthAtShower = (pathLengthAt4 - pathLengthAt3) * CLHEP::HepUniformRand();
190  }
191  }
192  }
193  // }
194  } else {
195  depthAtShower = 0.0;
196  }
197 
198  double pathLength = thePathLengthOnEcal + depthAtShower;
199 
201 
202  // return the initial showino position at the shower starting position
204 }

References MillePedeFileConverter_cfg::e, GflashTrajectory::getGflashTrajectoryPoint(), GflashTrajectory::getPathLengthAtRhoEquals(), GflashTrajectory::getPathLengthAtZ(), GflashTrajectoryPoint::getPosition(), Gflash::kHB, Gflash::kHE, Gflash::LengthCrystalEB, Gflash::LengthCrystalEE, dqm-mbProfile::log, position, Gflash::RFrontCrystalEB, Gflash::Rmax, Gflash::Rmin, funct::sin(), theEnergy, theHelix, thePathLengthOnEcal, theTrajectoryPoint, Gflash::ZFrontCrystalEE, Gflash::Zmax, and Gflash::Zmin.

Referenced by initialize().

◆ updateShowino()

void GflashShowino::updateShowino ( double  deltaStep)

Definition at line 53 of file GflashShowino.cc.

53  {
54  thePathLength += deltaStep;
55  // trajectory point of showino along the shower depth at the pathLength
56  GflashTrajectoryPoint trajectoryShowino;
57  theHelix->getGflashTrajectoryPoint(trajectoryShowino, thePathLength);
58 
59  thePosition = trajectoryShowino.getPosition();
60 
61  theGlobalTime += (theEnergy / 100.0) * deltaStep / 30.0; //@@@calculate exact time change in nsec
62 }

References GflashTrajectory::getGflashTrajectoryPoint(), GflashTrajectoryPoint::getPosition(), theEnergy, theGlobalTime, theHelix, thePathLength, and thePosition.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

Member Data Documentation

◆ theEnergy

double GflashShowino::theEnergy
private

◆ theEnergyDeposited

double GflashShowino::theEnergyDeposited
private

Definition at line 65 of file GflashShowino.h.

Referenced by addEnergyDeposited(), getEnergyDeposited(), and initialize().

◆ theGlobalTime

double GflashShowino::theGlobalTime
private

Definition at line 63 of file GflashShowino.h.

Referenced by getGlobalTime(), initialize(), setGlobalTime(), and updateShowino().

◆ theHelix

GflashTrajectory* GflashShowino::theHelix
private

◆ thePathLength

double GflashShowino::thePathLength
private

◆ thePathLengthAtShower

double GflashShowino::thePathLengthAtShower
private

Definition at line 56 of file GflashShowino.h.

Referenced by evaluateLengths(), getDepth(), and getPathLengthAtShower().

◆ thePathLengthOnEcal

double GflashShowino::thePathLengthOnEcal
private

◆ thePosition

Gflash3Vector GflashShowino::thePosition
private

Definition at line 64 of file GflashShowino.h.

Referenced by evaluateLengths(), getPosition(), initialize(), setPosition(), and updateShowino().

◆ thePositionAtShower

Gflash3Vector GflashShowino::thePositionAtShower
private

Definition at line 55 of file GflashShowino.h.

Referenced by getPositionAtShower(), and initialize().

◆ theShowerType

int GflashShowino::theShowerType
private

Definition at line 53 of file GflashShowino.h.

Referenced by getShowerType(), and initialize().

◆ theStepLengthToHcal

double GflashShowino::theStepLengthToHcal
private

Definition at line 58 of file GflashShowino.h.

Referenced by evaluateLengths(), and getStepLengthToHcal().

◆ theStepLengthToOut

double GflashShowino::theStepLengthToOut
private

Definition at line 59 of file GflashShowino.h.

Referenced by evaluateLengths(), and getStepLengthToOut().

◆ theTrajectoryPoint

GflashTrajectoryPoint GflashShowino::theTrajectoryPoint
private

Definition at line 68 of file GflashShowino.h.

Referenced by simulateFirstInteractionPoint().

GflashShowino::thePositionAtShower
Gflash3Vector thePositionAtShower
Definition: GflashShowino.h:55
GflashTrajectory::getPathLengthAtRhoEquals
double getPathLengthAtRhoEquals(double rho) const
Definition: GflashTrajectory.cc:175
Gflash::LengthCrystalEE
const double LengthCrystalEE
Definition: GflashNameSpace.h:41
Gflash::ZFrontCrystalEE
const double ZFrontCrystalEE
Definition: GflashNameSpace.h:37
min
T min(T a, T b)
Definition: MathUtil.h:58
Gflash::Rmax
const double Rmax[kNumberCalorimeter]
Definition: GflashNameSpace.h:31
Gflash::EtaMax
const double EtaMax[kNumberCalorimeter]
Definition: GflashNameSpace.h:34
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
GflashTrajectory::initializeTrajectory
void initializeTrajectory(const HepGeom::Vector3D< double > &, const HepGeom::Point3D< double > &, double q, double Field)
Definition: GflashTrajectory.cc:27
Gflash::findShowerType
int findShowerType(const Gflash3Vector &position)
Definition: GflashNameSpace.cc:41
GflashShowino::thePosition
Gflash3Vector thePosition
Definition: GflashShowino.h:64
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
GflashTrajectory
Definition: GflashTrajectory.h:6
GflashShowino::thePathLength
double thePathLength
Definition: GflashShowino.h:62
Gflash::kHB
Definition: GflashNameSpace.h:13
Gflash::kHE
Definition: GflashNameSpace.h:15
Gflash::kENCA
Definition: GflashNameSpace.h:14
Gflash::Zmax
const double Zmax[kNumberCalorimeter]
Definition: GflashNameSpace.h:29
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
GflashTrajectoryPoint::getPosition
Gflash3Vector & getPosition()
Definition: GflashTrajectoryPoint.h:20
Gflash::LengthCrystalEB
const double LengthCrystalEB
Definition: GflashNameSpace.h:40
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
GflashShowino::simulateFirstInteractionPoint
Gflash3Vector & simulateFirstInteractionPoint(int showType, Gflash3Vector &pos)
Definition: GflashShowino.cc:98
GflashShowino::evaluateLengths
void evaluateLengths()
Definition: GflashShowino.cc:64
Gflash::Zmin
const double Zmin[kNumberCalorimeter]
Definition: GflashNameSpace.h:28
Gflash::RFrontCrystalEB
const double RFrontCrystalEB
Definition: GflashNameSpace.h:36
GflashShowino::thePathLengthOnEcal
double thePathLengthOnEcal
Definition: GflashShowino.h:57
GflashShowino::theEnergyDeposited
double theEnergyDeposited
Definition: GflashShowino.h:65
GflashShowino::thePathLengthAtShower
double thePathLengthAtShower
Definition: GflashShowino.h:56
GflashShowino::theStepLengthToHcal
double theStepLengthToHcal
Definition: GflashShowino.h:58
GflashShowino::theHelix
GflashTrajectory * theHelix
Definition: GflashShowino.h:67
GflashTrajectory::getPathLengthAtZ
double getPathLengthAtZ(double z) const
Definition: GflashTrajectory.cc:179
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
Gflash::Rmin
const double Rmin[kNumberCalorimeter]
Definition: GflashNameSpace.h:30
GflashShowino::theShowerType
int theShowerType
Definition: GflashShowino.h:53
GflashShowino::theEnergy
double theEnergy
Definition: GflashShowino.h:54
GflashShowino::theGlobalTime
double theGlobalTime
Definition: GflashShowino.h:63
GflashShowino::theStepLengthToOut
double theStepLengthToOut
Definition: GflashShowino.h:59
GflashTrajectoryPoint
Definition: GflashTrajectoryPoint.h:8
GflashShowino::theTrajectoryPoint
GflashTrajectoryPoint theTrajectoryPoint
Definition: GflashShowino.h:68
Gflash::kESPM
Definition: GflashNameSpace.h:12
GflashTrajectory::getGflashTrajectoryPoint
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
Definition: GflashTrajectory.cc:155
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37