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 ( )

Definition at line 4 of file GflashShowino.cc.

References theHelix.

5  : theShowerType(-1),
6  theEnergy(0),
7  thePositionAtShower(0, 0, 0),
12  thePathLength(0),
13  theGlobalTime(0),
14  thePosition(0, 0, 0),
17 }
double thePathLengthAtShower
Definition: GflashShowino.h:56
GflashTrajectory * theHelix
Definition: GflashShowino.h:67
double theStepLengthToHcal
Definition: GflashShowino.h:58
double thePathLength
Definition: GflashShowino.h:62
Gflash3Vector thePosition
Definition: GflashShowino.h:64
double theEnergy
Definition: GflashShowino.h:54
Gflash3Vector thePositionAtShower
Definition: GflashShowino.h:55
double thePathLengthOnEcal
Definition: GflashShowino.h:57
double theEnergyDeposited
Definition: GflashShowino.h:65
double theStepLengthToOut
Definition: GflashShowino.h:59
double theGlobalTime
Definition: GflashShowino.h:63
GflashShowino::~GflashShowino ( )

Definition at line 19 of file GflashShowino.cc.

References theHelix.

19 { delete theHelix; }
GflashTrajectory * theHelix
Definition: GflashShowino.h:67

Member Function Documentation

void GflashShowino::addEnergyDeposited ( double  energy)
inline
int GflashShowino::convertShowerType ( int  fastSimShowerType,
const Gflash3Vector pos 
)
private

Referenced by addEnergyDeposited().

void GflashShowino::evaluateLengths ( )
private

Definition at line 64 of file GflashShowino.cc.

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 addEnergyDeposited(), and initialize().

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 }
const double ZFrontCrystalEE
double getPathLengthAtZ(double z) const
const double Zmax[kNumberCalorimeter]
double thePathLengthAtShower
Definition: GflashShowino.h:56
GflashTrajectory * theHelix
Definition: GflashShowino.h:67
const double EtaMax[kNumberCalorimeter]
double theStepLengthToHcal
Definition: GflashShowino.h:58
double thePathLength
Definition: GflashShowino.h:62
Gflash3Vector thePosition
Definition: GflashShowino.h:64
T min(T a, T b)
Definition: MathUtil.h:58
const double RFrontCrystalEB
const double Zmin[kNumberCalorimeter]
double thePathLengthOnEcal
Definition: GflashShowino.h:57
double theStepLengthToOut
Definition: GflashShowino.h:59
const double Rmax[kNumberCalorimeter]
const double Rmin[kNumberCalorimeter]
double getPathLengthAtRhoEquals(double rho) const
double GflashShowino::getDepth ( void  )
inline

Definition at line 39 of file GflashShowino.h.

References thePathLength, and thePathLengthAtShower.

Referenced by GflashHadronShowerProfile::longitudinalProfile().

double thePathLengthAtShower
Definition: GflashShowino.h:56
double thePathLength
Definition: GflashShowino.h:62
double GflashShowino::getEnergy ( )
inline
double GflashShowino::getEnergyDeposited ( )
inline

Definition at line 38 of file GflashShowino.h.

References theEnergyDeposited.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

38 { return theEnergyDeposited; }
double theEnergyDeposited
Definition: GflashShowino.h:65
double GflashShowino::getGlobalTime ( )
inline
GflashTrajectory* GflashShowino::getHelix ( )
inline
double GflashShowino::getPathLength ( )
inline

Definition at line 36 of file GflashShowino.h.

References thePathLength.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

36 { return thePathLength; }
double thePathLength
Definition: GflashShowino.h:62
double GflashShowino::getPathLengthAtShower ( )
inline
double GflashShowino::getPathLengthOnEcal ( )
inline
Gflash3Vector& GflashShowino::getPosition ( )
inline
Gflash3Vector& GflashShowino::getPositionAtShower ( )
inline
int GflashShowino::getShowerType ( )
inline
double GflashShowino::getStepLengthToHcal ( )
inline

Definition at line 31 of file GflashShowino.h.

References theStepLengthToHcal.

Referenced by GflashHadronShowerProfile::longitudinalProfile().

31 { return theStepLengthToHcal; }
double theStepLengthToHcal
Definition: GflashShowino.h:58
double GflashShowino::getStepLengthToOut ( )
inline

Definition at line 32 of file GflashShowino.h.

References theStepLengthToOut.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

32 { return theStepLengthToOut; }
double theStepLengthToOut
Definition: GflashShowino.h:59
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.

References randomXiThetaGunProducer_cfi::energy, evaluateLengths(), Gflash::findShowerType(), GflashTrajectory::initializeTrajectory(), position, simulateFirstInteractionPoint(), theEnergy, theEnergyDeposited, theGlobalTime, theHelix, thePosition, thePositionAtShower, and theShowerType.

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

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 }
GflashTrajectory * theHelix
Definition: GflashShowino.h:67
Gflash3Vector & simulateFirstInteractionPoint(int showType, Gflash3Vector &pos)
void evaluateLengths()
Gflash3Vector thePosition
Definition: GflashShowino.h:64
double theEnergy
Definition: GflashShowino.h:54
int findShowerType(const Gflash3Vector &position)
Gflash3Vector thePositionAtShower
Definition: GflashShowino.h:55
double theEnergyDeposited
Definition: GflashShowino.h:65
static int position[264][3]
Definition: ReadPGInfo.cc:509
double theGlobalTime
Definition: GflashShowino.h:63
void initializeTrajectory(const HepGeom::Vector3D< double > &, const HepGeom::Point3D< double > &, double q, double Field)
void GflashShowino::setGlobalTime ( double  globalTime)
inline

Definition at line 41 of file GflashShowino.h.

References theGlobalTime.

41 { theGlobalTime = globalTime; }
double theGlobalTime
Definition: GflashShowino.h:63
void GflashShowino::setPathLength ( double  pathLength)
inline

Definition at line 42 of file GflashShowino.h.

References thePathLength.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

42 { thePathLength = pathLength; }
double thePathLength
Definition: GflashShowino.h:62
void GflashShowino::setPosition ( const Gflash3Vector position)
inline

Definition at line 43 of file GflashShowino.h.

References position, and thePosition.

43 { thePosition = position; }
Gflash3Vector thePosition
Definition: GflashShowino.h:64
static int position[264][3]
Definition: ReadPGInfo.cc:509
Gflash3Vector & GflashShowino::simulateFirstInteractionPoint ( int  showType,
Gflash3Vector pos 
)
private

fraction before the crystal, but inside Ecal

Definition at line 98 of file GflashShowino.cc.

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

Referenced by addEnergyDeposited(), and initialize().

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 
165  thePathLengthOnEcal = theHelix->getPathLengthAtZ(zsign * Gflash::ZFrontCrystalEE);
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 }
const double ZFrontCrystalEE
double getPathLengthAtZ(double z) const
const double Zmax[kNumberCalorimeter]
GflashTrajectory * theHelix
Definition: GflashShowino.h:67
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const double LengthCrystalEE
const double LengthCrystalEB
double theEnergy
Definition: GflashShowino.h:54
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
const double RFrontCrystalEB
const double Zmin[kNumberCalorimeter]
double thePathLengthOnEcal
Definition: GflashShowino.h:57
Gflash3Vector & getPosition()
static int position[264][3]
Definition: ReadPGInfo.cc:509
const double Rmax[kNumberCalorimeter]
GflashTrajectoryPoint theTrajectoryPoint
Definition: GflashShowino.h:68
const double Rmin[kNumberCalorimeter]
double getPathLengthAtRhoEquals(double rho) const
void GflashShowino::updateShowino ( double  deltaStep)

Definition at line 53 of file GflashShowino.cc.

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

Referenced by GflashHadronShowerProfile::hadronicParameterization().

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 }
GflashTrajectory * theHelix
Definition: GflashShowino.h:67
double thePathLength
Definition: GflashShowino.h:62
Gflash3Vector thePosition
Definition: GflashShowino.h:64
double theEnergy
Definition: GflashShowino.h:54
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
Gflash3Vector & getPosition()
double theGlobalTime
Definition: GflashShowino.h:63

Member Data Documentation

double GflashShowino::theEnergy
private
double GflashShowino::theEnergyDeposited
private

Definition at line 65 of file GflashShowino.h.

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

double GflashShowino::theGlobalTime
private

Definition at line 63 of file GflashShowino.h.

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

GflashTrajectory* GflashShowino::theHelix
private
double GflashShowino::thePathLength
private
double GflashShowino::thePathLengthAtShower
private

Definition at line 56 of file GflashShowino.h.

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

double GflashShowino::thePathLengthOnEcal
private
Gflash3Vector GflashShowino::thePosition
private

Definition at line 64 of file GflashShowino.h.

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

Gflash3Vector GflashShowino::thePositionAtShower
private

Definition at line 55 of file GflashShowino.h.

Referenced by getPositionAtShower(), and initialize().

int GflashShowino::theShowerType
private

Definition at line 53 of file GflashShowino.h.

Referenced by getShowerType(), and initialize().

double GflashShowino::theStepLengthToHcal
private

Definition at line 58 of file GflashShowino.h.

Referenced by evaluateLengths(), and getStepLengthToHcal().

double GflashShowino::theStepLengthToOut
private

Definition at line 59 of file GflashShowino.h.

Referenced by evaluateLengths(), and getStepLengthToOut().

GflashTrajectoryPoint GflashShowino::theTrajectoryPoint
private

Definition at line 68 of file GflashShowino.h.

Referenced by simulateFirstInteractionPoint().