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

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]) {
70  double pathLengthAtHcalBack = theHelix->getPathLengthAtRhoEquals(Gflash::Rmax[Gflash::kHB]);
71  if (pathLengthAtHcalBack>0) {
72  theStepLengthToOut = std::min(300.,pathLengthAtHcalBack - thePathLengthAtShower);
73  }
74  else {
75  theStepLengthToOut = 200.;
76  }
78 
79  }
80  else if (std::fabs(eta) < Gflash::EtaMax[Gflash::kENCA] ) {
81  double zsign = (eta > 0) ? 1.0 : -1.0 ;
86  }
87  else {
88  //@@@extend for HF later
89  theStepLengthToOut = 200.0;
90  }
91 
93 
94 }
const double ZFrontCrystalEE
double getPathLengthAtZ(double z) const
const double Zmax[kNumberCalorimeter]
double thePathLengthAtShower
Definition: GflashShowino.h:54
GflashTrajectory * theHelix
Definition: GflashShowino.h:65
const double EtaMax[kNumberCalorimeter]
double theStepLengthToHcal
Definition: GflashShowino.h:56
double thePathLength
Definition: GflashShowino.h:60
Gflash3Vector thePosition
Definition: GflashShowino.h:62
T min(T a, T b)
Definition: MathUtil.h:58
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
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);
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()
Gflash3Vector thePosition
Definition: GflashShowino.h:62
double theEnergy
Definition: GflashShowino.h:52
int findShowerType(const Gflash3Vector &position)
Gflash3Vector thePositionAtShower
Definition: GflashShowino.h:53
double theEnergyDeposited
Definition: GflashShowino.h:63
static int position[264][3]
Definition: ReadPGInfo.cc:509
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 ( const Gflash3Vector position)
inline

Definition at line 40 of file GflashShowino.h.

References position, and thePosition.

40 { thePosition = position; }
Gflash3Vector thePosition
Definition: GflashShowino.h:62
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 96 of file GflashShowino.cc.

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

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

GflashTrajectoryPoint GflashShowino::theTrajectoryPoint
private

Definition at line 66 of file GflashShowino.h.

Referenced by simulateFirstInteractionPoint().