CMS 3D CMS Logo

PreshowerHitMaker Class Reference

#include <FastSimulation/CaloHitMakers/interface/PreshowerHitMaker.h>

Inheritance diagram for PreshowerHitMaker:

CaloHitMaker

List of all members.

Public Types

typedef math::XYZVector XYZPoint
typedef math::XYZVector XYZVector

Public Member Functions

bool addHit (double r, double phi, unsigned layer=0)
const std::map< unsigned, float > & getHits ()
 PreshowerHitMaker (CaloGeometryHelper *calo, const XYZPoint &, const XYZVector &, const XYZPoint &, const XYZVector &, const LandauFluctuationGenerator *aGenerator)
void setSpotEnergy (double e)
 ~PreshowerHitMaker ()

Private Attributes

double invcostheta1x
double invcostheta1y
double invcostheta2x
double invcostheta2y
XYZVector psLayer1Dir_
XYZPoint psLayer1Entrance_
XYZVector psLayer2Dir_
XYZPoint psLayer2Entrance_
const LandauFluctuationGeneratortheGenerator
 The Landau Fluctuation generator.
double x1
double x2
double y1
double y2
double z1
double z2


Detailed Description

Definition at line 9 of file PreshowerHitMaker.h.


Member Typedef Documentation

typedef math::XYZVector PreshowerHitMaker::XYZPoint

Reimplemented from CaloHitMaker.

Definition at line 14 of file PreshowerHitMaker.h.

typedef math::XYZVector PreshowerHitMaker::XYZVector

Reimplemented from CaloHitMaker.

Definition at line 13 of file PreshowerHitMaker.h.


Constructor & Destructor Documentation

PreshowerHitMaker::PreshowerHitMaker ( CaloGeometryHelper calo,
const XYZPoint layer1entrance,
const XYZVector layer1dir,
const XYZPoint layer2entrance,
const XYZVector layer2dir,
const LandauFluctuationGenerator aGenerator 
)

Definition at line 17 of file PreshowerHitMaker.cc.

References CaloHitMaker::intersect(), invcostheta1x, invcostheta1y, invcostheta2x, invcostheta2y, CaloHitMaker::myCalorimeter, CaloGeometryHelper::preshowerZPosition(), psLayer1Entrance_, psLayer2Entrance_, x1, x2, y1, y2, z, z1, and z2.

00023                                                  :
00024   CaloHitMaker(calo,DetId::Ecal,EcalPreshower,2),
00025   psLayer1Entrance_(layer1entrance),
00026   psLayer1Dir_(layer1dir),
00027   psLayer2Entrance_(layer2entrance),
00028   psLayer2Dir_(layer2dir),
00029   theGenerator(aGenerator)
00030 {
00031    // Check if the entrance points are really on the wafers
00032   // Layer 1 
00033   int z=(psLayer1Entrance_.z()>0)? 1:-1;
00034   Plane3D plan1(0.,0.,1.,-z*myCalorimeter->preshowerZPosition(1));
00035   double dummyt;
00036   psLayer1Entrance_ = intersect(plan1,layer1entrance,layer1entrance+layer1dir,dummyt,false);
00037   x1=psLayer1Entrance_.x();
00038   y1=psLayer1Entrance_.y();
00039   z1=psLayer1Entrance_.z();
00040   XYZVector dirx(psLayer1Entrance_.x(),0,psLayer1Entrance_.z());
00041   XYZVector diry(0,psLayer1Entrance_.y(),psLayer1Entrance_.z());
00042   dirx=dirx.Unit();
00043   diry=diry.Unit();
00044   invcostheta1x = 1./fabs(dirx.Dot(XYZVector(0,0,1.)));
00045   invcostheta1y = 1./fabs(diry.Dot(XYZVector(0,0,1.)));      
00046 
00047   // Layer 2
00048   z=(psLayer2Entrance_.z()>0) ? 1:-1;
00049   Plane3D plan2(0.,0.,1.,-z*myCalorimeter->preshowerZPosition(2));
00050   
00051   psLayer2Entrance_ = intersect(plan2,layer2entrance,layer2entrance+layer2dir,dummyt,false);
00052   x2=psLayer2Entrance_.x();
00053   y2=psLayer2Entrance_.y();
00054   z2=psLayer2Entrance_.z();
00055   dirx = XYZVector(psLayer2Entrance_.x(),0,psLayer2Entrance_.z());
00056   diry = XYZVector(0,psLayer2Entrance_.y(),psLayer2Entrance_.z());
00057   dirx=dirx.Unit();
00058   diry=diry.Unit();
00059   invcostheta2x = 1./fabs(dirx.Dot(XYZVector(0,0,1.)));
00060   invcostheta2y = 1./fabs(diry.Dot(XYZVector(0,0,1.)));
00061 
00062   //  theGenerator=LandauFluctuationGenerator();
00063 }

PreshowerHitMaker::~PreshowerHitMaker (  )  [inline]

Definition at line 23 of file PreshowerHitMaker.h.

00023 {;}


Member Function Documentation

bool PreshowerHitMaker::addHit ( double  r,
double  phi,
unsigned  layer = 0 
) [virtual]

Implements CaloHitMaker.

Definition at line 67 of file PreshowerHitMaker.cc.

References funct::cos(), EcalPreshowerGeometry::getClosestCellInPlane(), Calorimeter::getEcalPreshowerGeometry(), CaloHitMaker::hitMap_, invcostheta1x, invcostheta1y, invcostheta2x, invcostheta2y, LandauFluctuationGenerator::landau(), CaloHitMaker::moliereRadius, CaloHitMaker::myCalorimeter, DetId::null(), DetId::rawId(), funct::sin(), CaloHitMaker::spotEnergy, strip(), theGenerator, x1, x2, y1, y2, z1, and z2.

Referenced by EMShower::compute().

00068 {
00069   r*=moliereRadius;
00070   XYZPoint point = (layer==1) ? 
00071     XYZPoint(x1+r*invcostheta1x*std::cos(phi),y1+r*invcostheta1y*std::sin(phi),z1) : 
00072     XYZPoint(x2+r*invcostheta2x*std::cos(phi),y2+r*invcostheta2y*std::sin(phi),z2);
00073   
00074   //  std::cout << " Layer " << layer << " " << point << std::endl;
00075   DetId strip = myCalorimeter->getEcalPreshowerGeometry()->getClosestCellInPlane(GlobalPoint(point.x(),point.y(),point.z()),layer);
00076 
00077   float spote=0.000095+0.000021*theGenerator->landau();
00078 
00079   if(!strip.null())
00080     {
00081       uint stripNumber=strip.rawId();
00082       std::map<uint32_t,float>::iterator cellitr;
00083       cellitr = hitMap_.find(stripNumber);
00084       if( cellitr==hitMap_.end())
00085         {
00086           hitMap_.insert(std::pair<uint32_t,float>(stripNumber,spote));
00087         }
00088       else
00089         {
00090           cellitr->second+=spotEnergy;
00091         }  
00092       return true;
00093     }
00094   return false;
00095 }

const std::map<unsigned,float>& PreshowerHitMaker::getHits (  )  [inline, virtual]

Implements CaloHitMaker.

Definition at line 27 of file PreshowerHitMaker.h.

Referenced by CalorimetryManager::EMShowerSimulation().

00027 { return hitMap_ ;} ;

void PreshowerHitMaker::setSpotEnergy ( double  e  )  [inline, virtual]

Implements CaloHitMaker.

Definition at line 25 of file PreshowerHitMaker.h.

References CaloHitMaker::spotEnergy.

Referenced by EMShower::compute().

00025 { spotEnergy=e;} 


Member Data Documentation

double PreshowerHitMaker::invcostheta1x [private]

Definition at line 36 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::invcostheta1y [private]

Definition at line 37 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::invcostheta2x [private]

Definition at line 38 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::invcostheta2y [private]

Definition at line 39 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

XYZVector PreshowerHitMaker::psLayer1Dir_ [private]

Definition at line 33 of file PreshowerHitMaker.h.

XYZPoint PreshowerHitMaker::psLayer1Entrance_ [private]

Definition at line 27 of file PreshowerHitMaker.h.

Referenced by PreshowerHitMaker().

XYZVector PreshowerHitMaker::psLayer2Dir_ [private]

Definition at line 35 of file PreshowerHitMaker.h.

XYZPoint PreshowerHitMaker::psLayer2Entrance_ [private]

Definition at line 34 of file PreshowerHitMaker.h.

Referenced by PreshowerHitMaker().

const LandauFluctuationGenerator* PreshowerHitMaker::theGenerator [private]

The Landau Fluctuation generator.

Definition at line 44 of file PreshowerHitMaker.h.

Referenced by addHit().

double PreshowerHitMaker::x1 [private]

Definition at line 40 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::x2 [private]

Definition at line 41 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::y1 [private]

Definition at line 40 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::y2 [private]

Definition at line 41 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::z1 [private]

Definition at line 40 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::z2 [private]

Definition at line 41 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().


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