#include <GflashShowino.h>
Definition at line 8 of file GflashShowino.h.
GflashShowino::GflashShowino | ( | ) |
Definition at line 4 of file GflashShowino.cc.
References theHelix.
: theShowerType(-1), theEnergy(0), thePositionAtShower(0,0,0), thePathLengthAtShower(0), thePathLengthOnEcal(0), theStepLengthToHcal(0), theStepLengthToOut(0), thePathLength(0), theGlobalTime(0), thePosition(0,0,0), theEnergyDeposited(0) { theHelix = new GflashTrajectory;; }
GflashShowino::~GflashShowino | ( | ) |
void GflashShowino::addEnergyDeposited | ( | double | energy | ) | [inline] |
Definition at line 41 of file GflashShowino.h.
References relval_parameters_module::energy, and theEnergyDeposited.
Referenced by GflashHadronShowerProfile::hadronicParameterization().
{ theEnergyDeposited += energy; }
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().
{ //thePathLengthAtShower: path Length from the origin to the shower starting point in cm //theStepLengthToOut: the total path length from the starting point of // shower to the maximum distance inside paramerized envelopes double eta = thePosition.getEta(); if (std::fabs(eta) < Gflash::EtaMax[Gflash::kESPM]) { thePathLengthOnEcal = theHelix->getPathLengthAtRhoEquals(Gflash::RFrontCrystalEB); thePathLengthAtShower = theHelix->getPathLengthAtRhoEquals(thePosition.getRho()); double pathLengthAtHcalBack = theHelix->getPathLengthAtRhoEquals(Gflash::Rmax[Gflash::kHB]); if (pathLengthAtHcalBack>0) { theStepLengthToOut = std::min(300.,pathLengthAtHcalBack - thePathLengthAtShower); } else { theStepLengthToOut = 200.; } theStepLengthToHcal = theHelix->getPathLengthAtRhoEquals(Gflash::Rmin[Gflash::kHB]) - thePathLengthAtShower; } else if (std::fabs(eta) < Gflash::EtaMax[Gflash::kENCA] ) { double zsign = (eta > 0) ? 1.0 : -1.0 ; thePathLengthOnEcal = theHelix->getPathLengthAtZ(zsign*Gflash::ZFrontCrystalEE); thePathLengthAtShower = theHelix->getPathLengthAtZ(thePosition.getZ()); theStepLengthToOut = std::min(300.,theHelix->getPathLengthAtZ(zsign*Gflash::Zmax[Gflash::kHE]) - thePathLengthAtShower); theStepLengthToHcal = theHelix->getPathLengthAtZ(zsign*Gflash::Zmin[Gflash::kHE]) - thePathLengthAtShower; } else { //@@@extend for HF later theStepLengthToOut = 200.0; } thePathLength = thePathLengthAtShower; }
double GflashShowino::getDepth | ( | void | ) | [inline] |
Definition at line 36 of file GflashShowino.h.
References thePathLength, and thePathLengthAtShower.
Referenced by GflashHadronShowerProfile::longitudinalProfile().
{ return (thePathLength-thePathLengthAtShower); }
double GflashShowino::getEnergy | ( | ) | [inline] |
Definition at line 24 of file GflashShowino.h.
References theEnergy.
Referenced by GflashHadronShowerProfile::getNumberOfSpots(), GflashHadronShowerProfile::hadronicParameterization(), GflashAntiProtonShowerProfile::loadParameters(), GflashProtonShowerProfile::loadParameters(), GflashKaonPlusShowerProfile::loadParameters(), GflashPiKShowerProfile::loadParameters(), GflashKaonMinusShowerProfile::loadParameters(), and GflashEMShowerProfile::parameterization().
{ return theEnergy; }
double GflashShowino::getEnergyDeposited | ( | ) | [inline] |
Definition at line 35 of file GflashShowino.h.
References theEnergyDeposited.
Referenced by GflashHadronShowerProfile::hadronicParameterization().
{ return theEnergyDeposited ; }
double GflashShowino::getGlobalTime | ( | ) | [inline] |
Definition at line 32 of file GflashShowino.h.
References theGlobalTime.
Referenced by GflashHadronShowerProfile::hadronicParameterization(), and GflashEMShowerProfile::parameterization().
{ return theGlobalTime; }
GflashTrajectory* GflashShowino::getHelix | ( | ) | [inline] |
Definition at line 30 of file GflashShowino.h.
References theHelix.
Referenced by GflashEMShowerProfile::getDistanceToOut(), GflashHadronShowerProfile::hadronicParameterization(), CalorimetryManager::HDShowerSimulation(), GflashHadronShowerProfile::hoProfile(), and GflashEMShowerProfile::parameterization().
{ return theHelix; }
double GflashShowino::getPathLength | ( | ) | [inline] |
Definition at line 33 of file GflashShowino.h.
References thePathLength.
Referenced by GflashHadronShowerProfile::hadronicParameterization().
{ return thePathLength; }
double GflashShowino::getPathLengthAtShower | ( | ) | [inline] |
Definition at line 26 of file GflashShowino.h.
References thePathLengthAtShower.
Referenced by GflashEMShowerProfile::getDistanceToOut(), GflashHadronShowerProfile::hadronicParameterization(), CalorimetryManager::HDShowerSimulation(), GflashHadronShowerProfile::longitudinalProfile(), and GflashEMShowerProfile::parameterization().
{ return thePathLengthAtShower; }
double GflashShowino::getPathLengthOnEcal | ( | ) | [inline] |
Definition at line 25 of file GflashShowino.h.
References thePathLengthOnEcal.
Referenced by CalorimetryManager::HDShowerSimulation(), and GflashHadronShowerProfile::longitudinalProfile().
{ return thePathLengthOnEcal; }
Gflash3Vector& GflashShowino::getPosition | ( | ) | [inline] |
Definition at line 34 of file GflashShowino.h.
References thePosition.
Referenced by GflashEMShowerProfile::getDistanceToOut(), GflashHadronShowerProfile::hadronicParameterization(), and GflashHadronShowerProfile::longitudinalProfile().
{ return thePosition; }
Gflash3Vector& GflashShowino::getPositionAtShower | ( | ) | [inline] |
Definition at line 27 of file GflashShowino.h.
References thePositionAtShower.
Referenced by GflashHadronShowerProfile::hadronicParameterization(), GflashAntiProtonShowerProfile::loadParameters(), GflashProtonShowerProfile::loadParameters(), GflashKaonPlusShowerProfile::loadParameters(), GflashPiKShowerProfile::loadParameters(), GflashKaonMinusShowerProfile::loadParameters(), and GflashEMShowerProfile::parameterization().
{ return thePositionAtShower; }
int GflashShowino::getShowerType | ( | ) | [inline] |
Definition at line 23 of file GflashShowino.h.
References theShowerType.
Referenced by GflashHadronShowerProfile::getNumberOfSpots(), GflashAntiProtonShowerProfile::loadParameters(), GflashProtonShowerProfile::loadParameters(), GflashKaonPlusShowerProfile::loadParameters(), GflashPiKShowerProfile::loadParameters(), GflashKaonMinusShowerProfile::loadParameters(), and GflashHadronShowerProfile::longitudinalProfile().
{ return theShowerType; }
double GflashShowino::getStepLengthToHcal | ( | ) | [inline] |
Definition at line 28 of file GflashShowino.h.
References theStepLengthToHcal.
Referenced by GflashHadronShowerProfile::longitudinalProfile().
{ return theStepLengthToHcal; }
double GflashShowino::getStepLengthToOut | ( | ) | [inline] |
Definition at line 29 of file GflashShowino.h.
References theStepLengthToOut.
Referenced by GflashHadronShowerProfile::hadronicParameterization().
{ return theStepLengthToOut; }
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().
{ theEnergy = energy; theGlobalTime = globalTime; theEnergyDeposited = 0.0; // inside the magnetic field (tesla unit); theHelix->initializeTrajectory(momentum,position,charge,magneticField); if(showerType<100) { thePositionAtShower = position; thePosition = thePositionAtShower; theShowerType = showerType; } else { //this input is from FastSimulation //1. simulate the shower starting position thePositionAtShower = simulateFirstInteractionPoint(showerType,position); thePosition = thePositionAtShower; //2. find shower type depending on where is the shower starting point theShowerType = Gflash::findShowerType(thePositionAtShower); } evaluateLengths(); }
void GflashShowino::setGlobalTime | ( | double | globalTime | ) | [inline] |
Definition at line 38 of file GflashShowino.h.
References theGlobalTime.
{ theGlobalTime = globalTime; }
void GflashShowino::setPathLength | ( | double | pathLength | ) | [inline] |
Definition at line 39 of file GflashShowino.h.
References thePathLength.
Referenced by GflashHadronShowerProfile::hadronicParameterization().
{ thePathLength = pathLength; }
void GflashShowino::setPosition | ( | Gflash3Vector | position | ) | [inline] |
Definition at line 40 of file GflashShowino.h.
References position, and thePosition.
{ thePosition = position; }
Gflash3Vector & GflashShowino::simulateFirstInteractionPoint | ( | int | showType, |
Gflash3Vector & | pos | ||
) | [private] |
fraction before the crystal, but inside Ecal
Definition at line 96 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().
{ //determine the shower starting point (ssp): //the position at the entrance + the mean free path till the inelastic interaction inside calo double depthAtShower = 0.0; //set thePathLengthOnEcal, the pathLength at the reference (r=123.8 for barrel and z=304.5 for endcap) //effective interaction length fitter to ssp from Geant4 double effectiveLambda = 0.0; if(theEnergy > 0.0 && theEnergy < 15) { effectiveLambda = 24.6+2.6*std::tanh(3.0*(std::log(theEnergy)-1.43)); } else { effectiveLambda = 28.4+1.20*std::tanh(1.5*(std::log(theEnergy)-4.3)); } //fraction before the crystal, but inside Ecal // double frac_ssp1 = 1.5196e-01+1.3300e-01*tanh(-4.6971e-01*(std::log(theEnergy)+2.4162e+00)); //fraction after the crystal, but before Hcal double frac_ssp2 = 2.8310e+00+2.6766e+00*tanh(-4.8068e-01*(std::log(theEnergy)+3.4857e+00)); if(fastSimShowerType == 100 ) { //fastTrack.onEcal() == 1 // double rhoTemp = Gflash::ROffCrystalEB + Gflash::LengthCrystalEB*std::sin(position.getTheta()); double rhoTemp = Gflash::LengthCrystalEB*std::sin(position.getTheta()); thePathLengthOnEcal = theHelix->getPathLengthAtRhoEquals(Gflash::RFrontCrystalEB); double pathLengthAt2 = theHelix->getPathLengthAtRhoEquals(Gflash::RFrontCrystalEB + rhoTemp ); double pathLengthAt3 = theHelix->getPathLengthAtRhoEquals(Gflash::Rmin[Gflash::kHB]); /* if(CLHEP::HepUniformRand() < frac_ssp1 ) { depthAtShower = (pathLengthAt1-thePathLengthOnEcal)*CLHEP::HepUniformRand(); } else { */ //inside the crystal // depthAtShower = (pathLengthAt1-thePathLengthOnEcal) - effectiveLambda*log(CLHEP::HepUniformRand()); depthAtShower = - effectiveLambda*log(CLHEP::HepUniformRand()); //after the crystal if(depthAtShower > (pathLengthAt2 - thePathLengthOnEcal) ) { //before Hcal if(CLHEP::HepUniformRand() < frac_ssp2 ) { depthAtShower = (pathLengthAt2 - thePathLengthOnEcal) + (pathLengthAt3-pathLengthAt2)*CLHEP::HepUniformRand(); } //inside Hcal else { depthAtShower = (pathLengthAt3 - thePathLengthOnEcal) - effectiveLambda*log(CLHEP::HepUniformRand()); //check whether the shower starts beyond HB double pathLengthAt4 = theHelix->getPathLengthAtRhoEquals(Gflash::Rmax[Gflash::kHB]); if(depthAtShower > (pathLengthAt4 - thePathLengthOnEcal)) { depthAtShower = (pathLengthAt4 - pathLengthAt3)*CLHEP::HepUniformRand(); } } } // } } else if(fastSimShowerType == 101 ) { //fastTrack.onEcal() == 2 double zTemp = Gflash::LengthCrystalEE; double zsign = (position.getEta() > 0) ? 1.0 : -1.0 ; thePathLengthOnEcal = theHelix->getPathLengthAtZ(zsign*Gflash::ZFrontCrystalEE); double pathLengthAt2 = theHelix->getPathLengthAtZ(zsign*(Gflash::ZFrontCrystalEE + zTemp)); double pathLengthAt3 = theHelix->getPathLengthAtZ(zsign*Gflash::Zmin[Gflash::kHE]); /* if(CLHEP::HepUniformRand() < frac_ssp1 ) { depthAtShower = (pathLengthAt1-thePathLengthOnEcal)*CLHEP::HepUniformRand(); } else { */ // depthAtShower = (pathLengthAt1-thePathLengthOnEcal)-effectiveLambda*std::log(CLHEP::HepUniformRand()); depthAtShower = -effectiveLambda*std::log(CLHEP::HepUniformRand()); if(depthAtShower > (pathLengthAt2 - thePathLengthOnEcal) ) { if(CLHEP::HepUniformRand() < frac_ssp2 ) { depthAtShower = (pathLengthAt2 - thePathLengthOnEcal) +(pathLengthAt3 - pathLengthAt2)*CLHEP::HepUniformRand(); } else { depthAtShower = (pathLengthAt3 - thePathLengthOnEcal)-effectiveLambda*std::log(CLHEP::HepUniformRand()); //shower starts beyond HE double pathLengthAt4 = theHelix->getPathLengthAtZ(zsign*Gflash::Zmax[Gflash::kHE]); if(depthAtShower > (pathLengthAt4 - thePathLengthOnEcal)) { depthAtShower = (pathLengthAt4 - pathLengthAt3)*CLHEP::HepUniformRand(); } } } // } } else { depthAtShower = 0.0; } double pathLength = thePathLengthOnEcal + depthAtShower; GflashTrajectoryPoint trajectoryPoint; theHelix->getGflashTrajectoryPoint(trajectoryPoint,pathLength); //return the initial showino position at the shower starting position return trajectoryPoint.getPosition(); }
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().
{ thePathLength += deltaStep; //trajectory point of showino along the shower depth at the pathLength GflashTrajectoryPoint trajectoryShowino; theHelix->getGflashTrajectoryPoint(trajectoryShowino,thePathLength); thePosition = trajectoryShowino.getPosition(); theGlobalTime += (theEnergy/100.0)*deltaStep/30.0; //@@@calculate exact time change in nsec }
double GflashShowino::theEnergy [private] |
Definition at line 52 of file GflashShowino.h.
Referenced by getEnergy(), initialize(), simulateFirstInteractionPoint(), and updateShowino().
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] |
Definition at line 65 of file GflashShowino.h.
Referenced by evaluateLengths(), getHelix(), GflashShowino(), initialize(), simulateFirstInteractionPoint(), updateShowino(), and ~GflashShowino().
double GflashShowino::thePathLength [private] |
Definition at line 60 of file GflashShowino.h.
Referenced by evaluateLengths(), getDepth(), getPathLength(), setPathLength(), and updateShowino().
double GflashShowino::thePathLengthAtShower [private] |
Definition at line 54 of file GflashShowino.h.
Referenced by evaluateLengths(), getDepth(), and getPathLengthAtShower().
double GflashShowino::thePathLengthOnEcal [private] |
Definition at line 55 of file GflashShowino.h.
Referenced by evaluateLengths(), getPathLengthOnEcal(), and simulateFirstInteractionPoint().
Gflash3Vector GflashShowino::thePosition [private] |
Definition at line 62 of file GflashShowino.h.
Referenced by evaluateLengths(), getPosition(), initialize(), setPosition(), and updateShowino().
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().