CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (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
 

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.

8 {
10 }
double thePathLengthAtShower
Definition: GflashShowino.h:54
GflashTrajectory * theHelix
Definition: GflashShowino.h:65
double theStepLengthToHcal
Definition: GflashShowino.h:56
double thePathLength
Definition: GflashShowino.h:60
Gflash3Vector thePosition
Definition: GflashShowino.h:62
double theEnergy
Definition: GflashShowino.h:52
Gflash3Vector thePositionAtShower
Definition: GflashShowino.h:53
double thePathLengthOnEcal
Definition: GflashShowino.h:55
double theEnergyDeposited
Definition: GflashShowino.h:63
double theStepLengthToOut
Definition: GflashShowino.h:57
double theGlobalTime
Definition: GflashShowino.h:61
GflashShowino::~GflashShowino ( )

Definition at line 12 of file GflashShowino.cc.

References theHelix.

13 {
14  delete theHelix;
15 }
GflashTrajectory * theHelix
Definition: GflashShowino.h:65

Member Function Documentation

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

Definition at line 61 of file GflashShowino.cc.

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

61  {
62  //thePathLengthAtShower: path Length from the origin to the shower starting point in cm
63  //theStepLengthToOut: the total path length from the starting point of
64  // shower to the maximum distance inside paramerized envelopes
65  double eta = thePosition.getEta();
66 
67  if (std::fabs(eta) < Gflash::EtaMax[Gflash::kESPM]) {
72  }
73  else if (std::fabs(eta) < Gflash::EtaMax[Gflash::kENCA] ) {
74  double zsign = (eta > 0) ? 1.0 : -1.0 ;
78  theStepLengthToHcal = theHelix->getPathLengthAtZ(zsign*Gflash::Zmin[Gflash::kHE]) - thePathLengthAtShower;
79  }
80  else {
81  //@@@extend for HF later
82  theStepLengthToOut = 200.0;
83  }
84 
86 
87 }
const double ZFrontCrystalEE
double getPathLengthAtZ(double z) const
const double Zmax[kNumberCalorimeter]
double thePathLengthAtShower
Definition: GflashShowino.h:54
GflashTrajectory * theHelix
Definition: GflashShowino.h:65
#define min(a, b)
Definition: mlp_lapack.h:161
const double EtaMax[kNumberCalorimeter]
T eta() const
double theStepLengthToHcal
Definition: GflashShowino.h:56
double thePathLength
Definition: GflashShowino.h:60
Gflash3Vector thePosition
Definition: GflashShowino.h:62
const double RFrontCrystalEB
const double Zmin[kNumberCalorimeter]
double thePathLengthOnEcal
Definition: GflashShowino.h:55
double theStepLengthToOut
Definition: GflashShowino.h:57
const double Rmax[kNumberCalorimeter]
const double Rmin[kNumberCalorimeter]
double getPathLengthAtRhoEquals(double rho) const
double GflashShowino::getDepth ( void  )
inline

Definition at line 36 of file GflashShowino.h.

References thePathLength, and thePathLengthAtShower.

Referenced by GflashHadronShowerProfile::longitudinalProfile().

double thePathLengthAtShower
Definition: GflashShowino.h:54
double thePathLength
Definition: GflashShowino.h:60
double GflashShowino::getEnergy ( )
inline
double GflashShowino::getEnergyDeposited ( )
inline

Definition at line 35 of file GflashShowino.h.

References theEnergyDeposited.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

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

Definition at line 33 of file GflashShowino.h.

References thePathLength.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

33 { return thePathLength; }
double thePathLength
Definition: GflashShowino.h:60
double GflashShowino::getPathLengthAtShower ( )
inline
double GflashShowino::getPathLengthOnEcal ( )
inline

Definition at line 25 of file GflashShowino.h.

References thePathLengthOnEcal.

Referenced by CalorimetryManager::HDShowerSimulation().

25 { return thePathLengthOnEcal; }
double thePathLengthOnEcal
Definition: GflashShowino.h:55
Gflash3Vector& GflashShowino::getPosition ( )
inline
Gflash3Vector& GflashShowino::getPositionAtShower ( )
inline
int GflashShowino::getShowerType ( )
inline
double GflashShowino::getStepLengthToHcal ( )
inline

Definition at line 28 of file GflashShowino.h.

References theStepLengthToHcal.

Referenced by GflashHadronShowerProfile::longitudinalProfile().

28 { return theStepLengthToHcal; }
double theStepLengthToHcal
Definition: GflashShowino.h:56
double GflashShowino::getStepLengthToOut ( )
inline

Definition at line 29 of file GflashShowino.h.

References theStepLengthToOut.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

29 { return theStepLengthToOut; }
double theStepLengthToOut
Definition: GflashShowino.h:57
void GflashShowino::initialize ( int  showerType,
double  energy,
double  globalTime,
double  charge,
Gflash3Vector position,
Gflash3Vector momentum,
double  magneticField 
)

Definition at line 17 of file GflashShowino.cc.

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

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

19  {
20 
21  theEnergy = energy;
22  theGlobalTime = globalTime;
23  theEnergyDeposited = 0.0;
24 
25  // inside the magnetic field (tesla unit);
26  theHelix->initializeTrajectory(momentum,position,charge,magneticField);
27 
28  if(showerType<100) {
31  theShowerType = showerType;
32 
33  }
34  else {
35  //this input is from FastSimulation
36  //1. simulate the shower starting position
39 
40  //2. find shower type depending on where is the shower starting point
42 
43  }
44 
46 
47 }
GflashTrajectory * theHelix
Definition: GflashShowino.h:65
Gflash3Vector & simulateFirstInteractionPoint(int showType, Gflash3Vector &pos)
void evaluateLengths()
double charge(const std::vector< uint8_t > &Ampls)
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
int findShowerType(const Gflash3Vector position)
Gflash3Vector thePosition
Definition: GflashShowino.h:62
double theEnergy
Definition: GflashShowino.h:52
Gflash3Vector thePositionAtShower
Definition: GflashShowino.h:53
double theEnergyDeposited
Definition: GflashShowino.h:63
double theGlobalTime
Definition: GflashShowino.h:61
void initializeTrajectory(const HepGeom::Vector3D< double > &, const HepGeom::Point3D< double > &, double q, double Field)
void GflashShowino::setGlobalTime ( double  globalTime)
inline

Definition at line 38 of file GflashShowino.h.

References theGlobalTime.

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

Definition at line 39 of file GflashShowino.h.

References thePathLength.

Referenced by GflashHadronShowerProfile::hadronicParameterization().

39 { thePathLength = pathLength; }
double thePathLength
Definition: GflashShowino.h:60
void GflashShowino::setPosition ( Gflash3Vector  position)
inline

Definition at line 40 of file GflashShowino.h.

References position, and thePosition.

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

fraction before the crystal, but inside Ecal

Definition at line 90 of file GflashShowino.cc.

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

Referenced by initialize().

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

Definition at line 49 of file GflashShowino.cc.

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

Referenced by GflashHadronShowerProfile::hadronicParameterization().

50 {
51  thePathLength += deltaStep;
52  //trajectory point of showino along the shower depth at the pathLength
53  GflashTrajectoryPoint trajectoryShowino;
55 
56  thePosition = trajectoryShowino.getPosition();
57 
58  theGlobalTime += (theEnergy/100.0)*deltaStep/30.0; //@@@calculate exact time change in nsec
59 }
GflashTrajectory * theHelix
Definition: GflashShowino.h:65
double thePathLength
Definition: GflashShowino.h:60
Gflash3Vector thePosition
Definition: GflashShowino.h:62
double theEnergy
Definition: GflashShowino.h:52
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
Gflash3Vector & getPosition()
double theGlobalTime
Definition: GflashShowino.h:61

Member Data Documentation

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

Definition at line 63 of file GflashShowino.h.

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

double GflashShowino::theGlobalTime
private

Definition at line 61 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 54 of file GflashShowino.h.

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

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

Definition at line 62 of file GflashShowino.h.

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

Gflash3Vector GflashShowino::thePositionAtShower
private

Definition at line 53 of file GflashShowino.h.

Referenced by getPositionAtShower(), and initialize().

int GflashShowino::theShowerType
private

Definition at line 51 of file GflashShowino.h.

Referenced by getShowerType(), and initialize().

double GflashShowino::theStepLengthToHcal
private

Definition at line 56 of file GflashShowino.h.

Referenced by evaluateLengths(), and getStepLengthToHcal().

double GflashShowino::theStepLengthToOut
private

Definition at line 57 of file GflashShowino.h.

Referenced by evaluateLengths(), and getStepLengthToOut().