CMS 3D CMS Logo

SingleParticleEvent Class Reference

#include <GeneratorInterface/CosmicMuonGenerator/interface/SingleParticleEvent.h>

List of all members.

Public Member Functions

double absmom ()
double absVz ()
void create (int id, double px, double py, double pz, double e, double m, double vx, double vy, double vz, double t0)
double e ()
bool hitTarget ()
int id ()
double m ()
double phi ()
void propagate (double ElossScaleFac, double RadiusTarget, double Z_DistTarget, double Z_CentrTarget, bool TrackerOnly, bool MTCCHalf)
double px ()
double py ()
double pz ()
double rVxy ()
 SingleParticleEvent ()
double t0 ()
double theta ()
double vx ()
double vy ()
double vz ()
 ~SingleParticleEvent ()

Public Attributes

double PlugVx
double PlugVz

Private Member Functions

double absVzTmp ()
double rVxyTmp ()
void subtractEloss (double waterEquivalents)
void update (double stepSize)
void updateTmp (double stepSize)

Private Attributes

double dX
double dY
double dZ
double E
bool HitTarget
int ID
double M
bool MTCC
double Px
double Py
double Pz
double T0
double tmpVx
double tmpVy
double tmpVz
double Vx
double Vy
double Vz


Detailed Description

Definition at line 13 of file SingleParticleEvent.h.


Constructor & Destructor Documentation

SingleParticleEvent::SingleParticleEvent (  )  [inline]

Definition at line 16 of file SingleParticleEvent.h.

References E, HitTarget, ID, M, PlugOnShaftVx, PlugOnShaftVz, PlugVx, PlugVz, Px, Py, Pz, T0, Vx, Vy, and Vz.

00016                        {
00017     ID = 0;
00018     Px = 0.; Py = 0.; Pz = 0.; E = 0.; M = 0.;
00019     Vx = 0.; Vy = 0.; Vz = 0.; T0 = 0.;
00020     HitTarget = false;
00021     PlugVx = PlugOnShaftVx;
00022     PlugVz = PlugOnShaftVz;
00023   }

SingleParticleEvent::~SingleParticleEvent (  )  [inline]

Definition at line 25 of file SingleParticleEvent.h.

00025 {}


Member Function Documentation

double SingleParticleEvent::absmom (  ) 

Definition at line 242 of file SingleParticleEvent.cc.

References Px, Py, Pz, and funct::sqrt().

Referenced by propagate(), and subtractEloss().

00242                                   {
00243   return sqrt(Px*Px + Py*Py + Pz*Pz);
00244 }

double SingleParticleEvent::absVz (  ) 

Definition at line 246 of file SingleParticleEvent.cc.

References Vz.

00246                                  {
00247   return fabs(Vz);
00248 }

double SingleParticleEvent::absVzTmp (  )  [private]

Definition at line 198 of file SingleParticleEvent.cc.

References MTCC, and tmpVz.

Referenced by propagate().

00198                                     {
00199   if(MTCC==true){
00200     return tmpVz; //need sign to be sure muon hits half of CMS with MTCC setup
00201   }else{
00202     return fabs(tmpVz);
00203   }
00204 }

void SingleParticleEvent::create ( int  id,
double  px,
double  py,
double  pz,
double  e,
double  m,
double  vx,
double  vy,
double  vz,
double  t0 
)

Definition at line 3 of file SingleParticleEvent.cc.

References E, HitTarget, ID, M, Px, Py, Pz, T0, Vx, Vy, and Vz.

Referenced by CosmicMuonGenerator::nextEvent().

00003                                                                                                                                        {
00004     ID = id;
00005     Px = px; Py = py; Pz = pz; E = e; M = m;
00006     Vx = vx; Vy = vy; Vz = vz; T0 = t0;
00007     HitTarget = false;
00008 }

double SingleParticleEvent::e (  ) 

Definition at line 220 of file SingleParticleEvent.cc.

References E.

Referenced by CosmicMuonGenerator::displayEv(), CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00220 { return E; }

bool SingleParticleEvent::hitTarget (  ) 

Definition at line 210 of file SingleParticleEvent.cc.

References HitTarget.

Referenced by CosmicMuonGenerator::nextEvent().

00210 { return HitTarget; }

int SingleParticleEvent::id ( void   ) 

Definition at line 212 of file SingleParticleEvent.cc.

References ID.

Referenced by edm::CosMuoGenSource::produce().

00212 { return ID; }

double SingleParticleEvent::m (  ) 

Definition at line 222 of file SingleParticleEvent.cc.

References M.

Referenced by CosmicMuonGenerator::nextEvent().

00222 { return M; }

double SingleParticleEvent::phi ( void   ) 

Definition at line 232 of file SingleParticleEvent.cc.

References Px, Pz, and TwoPi.

Referenced by CosmicMuonGenerator::goodOrientation(), and CosmicMuonGenerator::nextEvent().

00232                                {
00233   double phiXZ = atan2(Px,Pz);
00234   if (phiXZ < 0.) phiXZ = phiXZ + TwoPi;
00235   return  phiXZ;
00236 }

void SingleParticleEvent::propagate ( double  ElossScaleFac,
double  RadiusTarget,
double  Z_DistTarget,
double  Z_CentrTarget,
bool  TrackerOnly,
bool  MTCCHalf 
)

Definition at line 10 of file SingleParticleEvent.cc.

References absmom(), absVzTmp(), Air, Clay, dX, dY, dZ, E, HitTarget, inMat(), MinStepSize, MTCC, MuonMass, Plug, PlugVx, PlugVz, Px, Py, Pz, RadiusCMS, RadiusTracker, RhoAir, RhoClay, RhoPlug, RhoRock, RhoWall, Rock, rVxy(), rVxyTmp(), subtractEloss(), tmpVx, tmpVy, tmpVz, update(), updateTmp(), Vx, Vy, Vz, Wall, Z_DistCMS, and Z_DistTracker.

Referenced by CosmicMuonGenerator::nextEvent().

00010                                                                                                                                                         {
00011   MTCC=MTCCHalf; //need to know this boolean in absVzTmp()
00012   // calculated propagation direction
00013   dX = Px/absmom();
00014   dY = Py/absmom(); 
00015   dZ = Pz/absmom();
00016   // propagate with decreasing step size
00017   tmpVx = Vx;
00018   tmpVy = Vy;
00019   tmpVz = Vz;
00020   double RadiusTargetEff = RadiusTarget;
00021   double Z_DistTargetEff = Z_DistTarget;
00022   double Z_CentrTargetEff = Z_CentrTarget;
00023 
00024   if(TrackerOnly==true){
00025     RadiusTargetEff = RadiusTracker;
00026     Z_DistTargetEff = Z_DistTracker;
00027   }
00028   HitTarget = true;
00029   if (HitTarget == true){
00030     HitTarget = false;
00031     double stepSize = MinStepSize*100000.;
00032     double acceptR = RadiusTargetEff + stepSize;
00033     double acceptZ = Z_DistTargetEff + stepSize;
00034 
00035     bool continuePropagation = true;
00036     while (continuePropagation){
00037       if (tmpVy < -acceptR) continuePropagation = false;
00038       //if (absVzTmp() < acceptZ && rVxyTmp() < acceptR){
00039       if (fabs(tmpVz - Z_CentrTargetEff) < acceptZ && rVxyTmp() < acceptR){
00040         HitTarget = true;
00041         continuePropagation = false;
00042       }
00043       if (continuePropagation) updateTmp(stepSize);
00044     }
00045   }
00046   if (HitTarget == true){
00047     HitTarget = false;
00048     double stepSize = MinStepSize*10000.;
00049     double acceptR = RadiusTargetEff + stepSize;
00050     double acceptZ = Z_DistTargetEff + stepSize;
00051     bool continuePropagation = true;
00052     while (continuePropagation){
00053       if (tmpVy < -acceptR) continuePropagation = false;
00054       //if (absVzTmp() < acceptZ && rVxyTmp() < acceptR){
00055       if (fabs(tmpVz - Z_CentrTargetEff) < acceptZ && rVxyTmp() < acceptR){
00056         HitTarget = true;
00057         continuePropagation = false;
00058       }
00059       if (continuePropagation) updateTmp(stepSize);
00060     }
00061   }
00062   if (HitTarget == true){
00063     HitTarget = false;
00064     double stepSize = MinStepSize*1000.;
00065     double acceptR = RadiusTargetEff + stepSize;
00066     double acceptZ = Z_DistTargetEff + stepSize;
00067     bool continuePropagation = true;
00068     while (continuePropagation){
00069       if (tmpVy < -acceptR) continuePropagation = false;
00070       //if (absVzTmp() < acceptZ && rVxyTmp() < acceptR){
00071       if (fabs(tmpVz - Z_CentrTargetEff) < acceptZ && rVxyTmp() < acceptR){
00072         HitTarget = true;
00073         continuePropagation = false;
00074       }
00075       if (continuePropagation) updateTmp(stepSize);
00076     }
00077   }
00078   if (HitTarget == true){
00079     HitTarget = false;
00080     double stepSize = MinStepSize*100.;
00081     double acceptR = RadiusTargetEff + stepSize;
00082     double acceptZ = Z_DistTargetEff + stepSize;
00083     bool continuePropagation = true;
00084     while (continuePropagation){
00085       if (tmpVy < -acceptR) continuePropagation = false;
00086       //if (absVzTmp() < acceptZ && rVxyTmp() < acceptR){
00087       if (fabs(tmpVz - Z_CentrTargetEff) < acceptZ && rVxyTmp() < acceptR){
00088         HitTarget = true;
00089         continuePropagation = false;
00090       }
00091       if (continuePropagation) updateTmp(stepSize);
00092     }
00093   }
00094   if (HitTarget == true){
00095     HitTarget = false;
00096     double stepSize = MinStepSize*10.;
00097     double acceptR = RadiusTargetEff + stepSize;
00098     double acceptZ = Z_DistTargetEff + stepSize;
00099     bool continuePropagation = true;
00100     while (continuePropagation){
00101       if (tmpVy < -acceptR) continuePropagation = false;
00102       //if (absVzTmp() < acceptZ && rVxyTmp() < acceptR){
00103       if (fabs(tmpVz - Z_CentrTargetEff) < acceptZ && rVxyTmp() < acceptR){
00104         HitTarget = true;
00105         continuePropagation = false;
00106       }
00107       if (continuePropagation) updateTmp(stepSize);
00108     }
00109   }
00110   if (HitTarget == true){
00111     HitTarget = false;
00112     double stepSize = MinStepSize*1.;
00113     double acceptR = RadiusTargetEff + stepSize;
00114     double acceptZ = Z_DistTargetEff + stepSize;
00115     bool continuePropagation = true;
00116     while (continuePropagation){
00117       if (tmpVy < -acceptR) continuePropagation = false;
00118       if (0 < absVzTmp()){ //only check for MTCC setup in last step of propagation, need fine stepSize
00119         //if (absVzTmp() < acceptZ && rVxyTmp() < acceptR){
00120         if (fabs(tmpVz - Z_CentrTargetEff) < acceptZ && rVxyTmp() < acceptR){
00121           HitTarget = true;
00122           continuePropagation = false;
00123         }
00124       }
00125       if (continuePropagation) updateTmp(stepSize);
00126     }
00127   }
00128   // actual propagation + energy loss
00129   if (HitTarget == true){
00130     HitTarget = false;
00131     //int nAir = 0; int nWall = 0; int nRock = 0; int nClay = 0; int nPlug = 0;
00132     int nMat[6] = {0, 0, 0, 0, 0, 0};
00133     double stepSize = MinStepSize*1.; // actual step size
00134     double acceptR = RadiusCMS + stepSize;
00135     double acceptZ = Z_DistCMS + stepSize;
00136     if(TrackerOnly==true){
00137       acceptR = RadiusTracker + stepSize;
00138       acceptZ = Z_DistTracker + stepSize;
00139     }
00140     bool continuePropagation = true;
00141     while (continuePropagation){
00142       if (Vy < -acceptR) continuePropagation = false;
00143       //if (absVz() < acceptZ && rVxy() < acceptR){
00144       if (fabs(Vz - Z_CentrTargetEff) < acceptZ && rVxy() < acceptR){
00145         HitTarget = true;
00146         continuePropagation = false;
00147       }
00148       if (continuePropagation) update(stepSize);
00149 
00150       int Mat = inMat(Vx,Vy,Vz, PlugVx, PlugVz);
00151 
00152       nMat[Mat]++;
00153     }
00154 
00155     if (HitTarget){
00156       double lPlug = double(nMat[Plug])*stepSize;
00157       double lWall = double(nMat[Wall])*stepSize;
00158       double lAir = double(nMat[Air])*stepSize;
00159       double lClay = double(nMat[Clay])*stepSize;
00160       double lRock = double(nMat[Rock])*stepSize;      
00161       //double lUnknown = double(nMat[Unknown])*stepSize;
00162 
00163       double waterEquivalents = (lAir*RhoAir + lWall*RhoWall + lRock*RhoRock
00164                                  + lClay*RhoClay + lPlug*RhoPlug) *ElossScaleFac/10.; // [g cm^-2]
00165       subtractEloss(waterEquivalents);
00166       if (E < MuonMass) HitTarget = false; // muon stopped in the material around the target
00167     }
00168   }
00169   // end of propagation part
00170 }

double SingleParticleEvent::px (  ) 

Definition at line 214 of file SingleParticleEvent.cc.

References Px.

Referenced by CosmicMuonGenerator::displayEv(), CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00214 { return Px; }

double SingleParticleEvent::py (  ) 

Definition at line 216 of file SingleParticleEvent.cc.

References Py.

Referenced by CosmicMuonGenerator::displayEv(), CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00216 { return Py; }

double SingleParticleEvent::pz (  ) 

Definition at line 218 of file SingleParticleEvent.cc.

References Pz.

Referenced by CosmicMuonGenerator::displayEv(), CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00218 { return Pz; }

double SingleParticleEvent::rVxy (  ) 

Definition at line 250 of file SingleParticleEvent.cc.

References funct::sqrt(), Vx, and Vy.

Referenced by propagate().

00250                                 {
00251   return sqrt(Vx*Vx + Vy*Vy);
00252 }

double SingleParticleEvent::rVxyTmp (  )  [private]

Definition at line 206 of file SingleParticleEvent.cc.

References funct::sqrt(), tmpVx, and tmpVy.

Referenced by propagate().

00206                                    {
00207   return sqrt(tmpVx*tmpVx + tmpVy*tmpVy);
00208 }

void SingleParticleEvent::subtractEloss ( double  waterEquivalents  )  [private]

Definition at line 184 of file SingleParticleEvent.cc.

References funct::A, absmom(), E, EPS, funct::exp(), MuonMass, Px, Py, Pz, and funct::sqrt().

Referenced by propagate().

00184                                                               {
00185   double L10E = log10(E);
00186   // parameters for standard rock (PDG 2004, page 230)
00187   double A = (1.91514 + 0.254957*L10E)/1000.;                         // a [GeV g^-1 cm^2]
00188   double B = (0.379763 + 1.69516*L10E - 0.175026*L10E*L10E)/1000000.; // b [g^-1 cm^2]
00189   double EPS = A/B;                                                   // epsilon [GeV]
00190   E = (E + EPS)*exp(-B*waterEquivalents) - EPS; // updated energy
00191   double oldAbsMom = absmom();
00192   double newAbsMom = sqrt(E*E - MuonMass*MuonMass);
00193   Px = Px*newAbsMom/oldAbsMom;                  // updated px
00194   Py = Py*newAbsMom/oldAbsMom;                  // updated py
00195   Pz = Pz*newAbsMom/oldAbsMom;                  // updated pz
00196 }

double SingleParticleEvent::t0 (  ) 

Definition at line 230 of file SingleParticleEvent.cc.

References T0.

Referenced by CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00230 { return T0; }

double SingleParticleEvent::theta (  ) 

Definition at line 238 of file SingleParticleEvent.cc.

References Px, Py, Pz, and funct::sqrt().

Referenced by CosmicMuonGenerator::goodOrientation(), and CosmicMuonGenerator::nextEvent().

00238                                  {
00239   return atan2(sqrt(Px*Px+Pz*Pz),-Py);
00240 }

void SingleParticleEvent::update ( double  stepSize  )  [private]

Definition at line 172 of file SingleParticleEvent.cc.

References dX, dY, dZ, Vx, Vy, and Vz.

Referenced by propagate().

00172                                                {
00173   Vx += stepSize*dX;
00174   Vy += stepSize*dY;
00175   Vz += stepSize*dZ;
00176 }

void SingleParticleEvent::updateTmp ( double  stepSize  )  [private]

Definition at line 178 of file SingleParticleEvent.cc.

References dX, dY, dZ, tmpVx, tmpVy, and tmpVz.

Referenced by propagate().

00178                                                   {
00179   tmpVx += stepSize*dX;
00180   tmpVy += stepSize*dY;
00181   tmpVz += stepSize*dZ;
00182 }

double SingleParticleEvent::vx (  ) 

Definition at line 224 of file SingleParticleEvent.cc.

References Vx.

Referenced by CosmicMuonGenerator::displayEv(), CosmicMuonGenerator::goodOrientation(), CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00224 { return Vx; }

double SingleParticleEvent::vy (  ) 

Definition at line 226 of file SingleParticleEvent.cc.

References Vy.

Referenced by CosmicMuonGenerator::displayEv(), CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00226 { return Vy; }

double SingleParticleEvent::vz (  ) 

Definition at line 228 of file SingleParticleEvent.cc.

References Vz.

Referenced by CosmicMuonGenerator::displayEv(), CosmicMuonGenerator::goodOrientation(), CosmicMuonGenerator::nextEvent(), and edm::CosMuoGenSource::produce().

00228 { return Vz; }


Member Data Documentation

double SingleParticleEvent::dX [private]

Definition at line 34 of file SingleParticleEvent.h.

Referenced by propagate(), update(), and updateTmp().

double SingleParticleEvent::dY [private]

Definition at line 34 of file SingleParticleEvent.h.

Referenced by propagate(), update(), and updateTmp().

double SingleParticleEvent::dZ [private]

Definition at line 34 of file SingleParticleEvent.h.

Referenced by propagate(), update(), and updateTmp().

double SingleParticleEvent::E [private]

Definition at line 28 of file SingleParticleEvent.h.

Referenced by create(), e(), propagate(), SingleParticleEvent(), and subtractEloss().

bool SingleParticleEvent::HitTarget [private]

Definition at line 30 of file SingleParticleEvent.h.

Referenced by create(), hitTarget(), propagate(), and SingleParticleEvent().

int SingleParticleEvent::ID [private]

Definition at line 27 of file SingleParticleEvent.h.

Referenced by create(), id(), and SingleParticleEvent().

double SingleParticleEvent::M [private]

Definition at line 28 of file SingleParticleEvent.h.

Referenced by create(), m(), and SingleParticleEvent().

bool SingleParticleEvent::MTCC [private]

Definition at line 31 of file SingleParticleEvent.h.

Referenced by absVzTmp(), and propagate().

double SingleParticleEvent::PlugVx

Definition at line 70 of file SingleParticleEvent.h.

Referenced by CosmicMuonGenerator::initialize(), propagate(), and SingleParticleEvent().

double SingleParticleEvent::PlugVz

Definition at line 71 of file SingleParticleEvent.h.

Referenced by CosmicMuonGenerator::initialize(), propagate(), and SingleParticleEvent().

double SingleParticleEvent::Px [private]

Definition at line 28 of file SingleParticleEvent.h.

Referenced by absmom(), create(), phi(), propagate(), px(), SingleParticleEvent(), subtractEloss(), and theta().

double SingleParticleEvent::Py [private]

Definition at line 28 of file SingleParticleEvent.h.

Referenced by absmom(), create(), propagate(), py(), SingleParticleEvent(), subtractEloss(), and theta().

double SingleParticleEvent::Pz [private]

Definition at line 28 of file SingleParticleEvent.h.

Referenced by absmom(), create(), phi(), propagate(), pz(), SingleParticleEvent(), subtractEloss(), and theta().

double SingleParticleEvent::T0 [private]

Definition at line 29 of file SingleParticleEvent.h.

Referenced by create(), SingleParticleEvent(), and t0().

double SingleParticleEvent::tmpVx [private]

Definition at line 35 of file SingleParticleEvent.h.

Referenced by propagate(), rVxyTmp(), and updateTmp().

double SingleParticleEvent::tmpVy [private]

Definition at line 35 of file SingleParticleEvent.h.

Referenced by propagate(), rVxyTmp(), and updateTmp().

double SingleParticleEvent::tmpVz [private]

Definition at line 35 of file SingleParticleEvent.h.

Referenced by absVzTmp(), propagate(), and updateTmp().

double SingleParticleEvent::Vx [private]

Definition at line 29 of file SingleParticleEvent.h.

Referenced by create(), propagate(), rVxy(), SingleParticleEvent(), update(), and vx().

double SingleParticleEvent::Vy [private]

Definition at line 29 of file SingleParticleEvent.h.

Referenced by create(), propagate(), rVxy(), SingleParticleEvent(), update(), and vy().

double SingleParticleEvent::Vz [private]

Definition at line 29 of file SingleParticleEvent.h.

Referenced by absVz(), create(), propagate(), SingleParticleEvent(), update(), and vz().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:48 2009 for CMSSW by  doxygen 1.5.4