CMS 3D CMS Logo

CaloSegment Class Reference

#include <FastSimulation/CaloGeometryTools/interface/CaloSegment.h>

List of all members.

Public Types

enum  Material {
  PbWO4 = 0, CRACK = 1, GAP = 2, PS = 3,
  HCAL = 4, ECALHCALGAP = 5
}
typedef math::XYZVector XYZPoint
typedef math::XYZVector XYZVector

Public Member Functions

 CaloSegment (const CaloPoint &in, const CaloPoint &out, double si, double siX0, double liX0, Material mat, const CaloGeometryHelper *)
const CaloPoint & entrance () const
 first point of the segment
const CaloPoint & exit () const
 last point of the segment (there are only two)
double L0length () const
 length of the segment (in L9)
double length () const
 length of the segment (in cm)
Material material () const
 material
bool operator< (const CaloSegment &s) const
 ordering operator wrt to the particle direction
XYZPoint positionAtDepthincm (double depth) const
 space point corresponding to this depth (in cm)
XYZPoint positionAtDepthinL0 (double depth) const
 space point corresponding to this depth (in L0)
XYZPoint positionAtDepthinX0 (double depth) const
 space point corresponding to this depth (in X0)
double sEntrance () const
 absciss of the entrance (in cm)
double sExit () const
 absciss of the exit (in cm)
double sL0Entrance () const
 absciss of the entrance (in L0)
double sL0Exit () const
 absciss of the exit (in L0)
double sX0Entrance () const
 absciss of the entrance (in X0)
double sX0Exit () const
 absciss of the exit (in X0)
DetId::Detector whichDetector () const
 In which detector.
double x0FromCm (double cm) const
 cm to X0 conversion
double X0length () const
 length of the segment (in X0)
 ~CaloSegment ()

Private Attributes

DetId::Detector detector_
CaloPoint entrance_
CaloPoint exit_
double L0length_
double length_
Material material_
double sentrance_
double sexit_
double sL0entrance_
double sL0exit_
double sX0entrance_
double sX0exit_
double X0length_

Classes

class  inL0Segment
class  inSegment
class  inX0Segment
 This class is used to determine if a point lies in the segment. More...


Detailed Description

Definition at line 15 of file CaloSegment.h.


Member Typedef Documentation

typedef math::XYZVector CaloSegment::XYZPoint

Definition at line 21 of file CaloSegment.h.

typedef math::XYZVector CaloSegment::XYZVector

Definition at line 20 of file CaloSegment.h.


Member Enumeration Documentation

enum CaloSegment::Material

Enumerator:
PbWO4 
CRACK 
GAP 
PS 
HCAL 
ECALHCALGAP 

Definition at line 23 of file CaloSegment.h.

00023 {PbWO4=0,CRACK=1,GAP=2,PS=3,HCAL=4,ECALHCALGAP=5};


Constructor & Destructor Documentation

CaloSegment::CaloSegment ( const CaloPoint &  in,
const CaloPoint &  out,
double  si,
double  siX0,
double  liX0,
Material  mat,
const CaloGeometryHelper myCalorimeter 
)

Definition at line 9 of file CaloSegment.cc.

References GenMuonPlsPt100GeV_cfg::cout, CRACK, detector_, ECALHCALGAP, Calorimeter::ecalProperties(), lat::endl(), entrance_, exit_, GAP, HCAL, Calorimeter::hcalProperties(), HCALProperties::interactionLength(), ECALProperties::interactionLength(), PreshowerProperties::interactionLength(), L0length_, Calorimeter::layer1Properties(), length_, PbWO4, PS, PreshowerProperties::radLenIncm(), ECALProperties::radLenIncm(), HCALProperties::radLenIncm(), sentrance_, sexit_, sL0entrance_, sL0exit_, funct::sqrt(), sX0entrance_, sX0exit_, and X0length_.

00015                                                                  :
00016   entrance_(in),
00017   exit_(out),
00018   sentrance_(si),
00019   sX0entrance_(siX0),
00020   sL0entrance_(siL0),
00021   material_(mat)
00022 
00023 {
00024 
00025   sexit_= sentrance_+std::sqrt((exit_-entrance_).mag2());
00026   // Change this. CaloProperties from FamosShower should be used instead 
00027   double radLenIncm=999999;
00028   double intLenIncm=999999;
00029   detector_=in.whichDetector();
00030   if(detector_!=out.whichDetector()&&mat!=CRACK&&mat!=GAP&&mat!=ECALHCALGAP) 
00031     {
00032       std::cout << " Problem in the segments " << detector_ << " " << out.whichDetector() <<std::endl;
00033     }
00034   switch (mat)
00035     {
00036     case PbWO4:
00037       {
00038         radLenIncm =
00039           myCalorimeter->ecalProperties(1)->radLenIncm();
00040         intLenIncm =
00041           myCalorimeter->ecalProperties(1)->interactionLength();
00042       }
00043       break;
00044     case CRACK:
00045       {
00046         radLenIncm=8.9;//cracks : Al
00047         intLenIncm=35.4;
00048       }
00049       break;
00050     case PS:
00051       {
00052         radLenIncm = 
00053           myCalorimeter->layer1Properties(1)->radLenIncm();
00054         intLenIncm = 
00055           myCalorimeter->layer1Properties(1)->interactionLength();
00056       }
00057       break;
00058     case HCAL:
00059       {
00060         radLenIncm = 
00061           myCalorimeter->hcalProperties(1)->radLenIncm();
00062         intLenIncm = 
00063           myCalorimeter->hcalProperties(1)->interactionLength();
00064       }
00065       break;
00066     case ECALHCALGAP:
00067       {
00068         // From Olga's & Patrick's talk PRS/JetMET 21 Sept 2004 
00069         radLenIncm = 22.3;
00070         intLenIncm = 140;
00071       }
00072       break;
00073     default:
00074       radLenIncm=999999;
00075     }
00076   sX0exit_ = sX0entrance_+(sexit_-sentrance_)/radLenIncm;
00077   sL0exit_ = sL0entrance_+(sexit_-sentrance_)/intLenIncm;
00078   if(mat==GAP) 
00079     {
00080       sX0exit_=sX0entrance_;
00081       sL0exit_=sL0entrance_;
00082     }
00083   length_ = sexit_-sentrance_;
00084   X0length_ = sX0exit_-sX0entrance_;
00085   L0length_ = sL0exit_-sL0entrance_;
00086 }

CaloSegment::~CaloSegment (  )  [inline]

Definition at line 27 of file CaloSegment.h.

00027 {;}


Member Function Documentation

const CaloPoint& CaloSegment::entrance (  )  const [inline]

first point of the segment

Definition at line 47 of file CaloSegment.h.

References entrance_.

Referenced by operator<<().

00047 { return entrance_;};

const CaloPoint& CaloSegment::exit (  )  const [inline]

last point of the segment (there are only two)

Definition at line 49 of file CaloSegment.h.

References exit_.

Referenced by operator<<().

00049 { return exit_;};

double CaloSegment::L0length (  )  const [inline]

length of the segment (in L9)

Definition at line 45 of file CaloSegment.h.

References L0length_.

Referenced by EcalHitMaker::buildSegments(), and operator<<().

00045 { return L0length_;};

double CaloSegment::length (  )  const [inline]

length of the segment (in cm)

Definition at line 41 of file CaloSegment.h.

References length_.

Referenced by EcalHitMaker::buildSegments(), and operator<<().

00041 { return length_;};

Material CaloSegment::material (  )  const [inline]

material

Definition at line 55 of file CaloSegment.h.

References material_.

Referenced by operator<<().

00055 { return material_; }; 

bool CaloSegment::operator< ( const CaloSegment s  )  const [inline]

ordering operator wrt to the particle direction

Definition at line 52 of file CaloSegment.h.

References sEntrance(), sentrance_, sExit(), and sexit_.

00053     { return sentrance_<s.sEntrance()&&sexit_<sExit(); }

CaloSegment::XYZPoint CaloSegment::positionAtDepthincm ( double  depth  )  const

space point corresponding to this depth (in cm)

Definition at line 89 of file CaloSegment.cc.

References entrance_, exit_, sentrance_, and sexit_.

00090 {
00091   if (depth<sentrance_||depth>sexit_) return XYZPoint();
00092   return XYZPoint(entrance_+((depth-sentrance_)/(sexit_-sentrance_)*(exit_-entrance_)));
00093 }

CaloSegment::XYZPoint CaloSegment::positionAtDepthinL0 ( double  depth  )  const

space point corresponding to this depth (in L0)

Definition at line 103 of file CaloSegment.cc.

References entrance_, exit_, sL0entrance_, and sL0exit_.

00104 {
00105   if (depth<sL0entrance_||depth>sL0exit_) return XYZPoint();
00106   return XYZPoint(entrance_+((depth-sL0entrance_)/(sL0exit_-sL0entrance_)*(exit_-entrance_)));
00107 }

CaloSegment::XYZPoint CaloSegment::positionAtDepthinX0 ( double  depth  )  const

space point corresponding to this depth (in X0)

Definition at line 96 of file CaloSegment.cc.

References entrance_, exit_, sX0entrance_, and sX0exit_.

00097 {
00098   if (depth<sX0entrance_||depth>sX0exit_) return XYZPoint();
00099   return XYZPoint(entrance_+((depth-sX0entrance_)/(sX0exit_-sX0entrance_)*(exit_-entrance_)));
00100 }

double CaloSegment::sEntrance (  )  const [inline]

absciss of the entrance (in cm)

Definition at line 29 of file CaloSegment.h.

References sentrance_.

Referenced by CaloSegment::inSegment::operator()(), and operator<().

00029 { return sentrance_;};

double CaloSegment::sExit (  )  const [inline]

absciss of the exit (in cm)

Definition at line 31 of file CaloSegment.h.

References sexit_.

Referenced by CaloSegment::inSegment::operator()(), and operator<().

00031 { return sexit_;};

double CaloSegment::sL0Entrance (  )  const [inline]

absciss of the entrance (in L0)

Definition at line 37 of file CaloSegment.h.

References sL0entrance_.

Referenced by CaloSegment::inL0Segment::operator()().

00037 { return sL0entrance_;};

double CaloSegment::sL0Exit (  )  const [inline]

absciss of the exit (in L0)

Definition at line 39 of file CaloSegment.h.

References sL0exit_.

Referenced by CaloSegment::inL0Segment::operator()().

00039 { return sL0exit_;};  

double CaloSegment::sX0Entrance (  )  const [inline]

absciss of the entrance (in X0)

Definition at line 33 of file CaloSegment.h.

References sX0entrance_.

Referenced by CaloSegment::inX0Segment::operator()().

00033 { return sX0entrance_;};

double CaloSegment::sX0Exit (  )  const [inline]

absciss of the exit (in X0)

Definition at line 35 of file CaloSegment.h.

References sX0exit_.

Referenced by CaloSegment::inX0Segment::operator()().

00035 { return sX0exit_;};

DetId::Detector CaloSegment::whichDetector (  )  const [inline]

In which detector.

Definition at line 57 of file CaloSegment.h.

References detector_.

00057 {return detector_;};

double CaloSegment::x0FromCm ( double  cm  )  const

cm to X0 conversion

Definition at line 110 of file CaloSegment.cc.

References length_, sX0entrance_, and X0length_.

00110                                     {
00111   return sX0entrance_+cm/length_*X0length_;
00112 }

double CaloSegment::X0length (  )  const [inline]

length of the segment (in X0)

Definition at line 43 of file CaloSegment.h.

References X0length_.

Referenced by EcalHitMaker::buildSegments(), and operator<<().

00043 { return X0length_;};


Member Data Documentation

DetId::Detector CaloSegment::detector_ [private]

Definition at line 82 of file CaloSegment.h.

Referenced by CaloSegment(), and whichDetector().

CaloPoint CaloSegment::entrance_ [private]

Definition at line 70 of file CaloSegment.h.

Referenced by CaloSegment(), entrance(), positionAtDepthincm(), positionAtDepthinL0(), and positionAtDepthinX0().

CaloPoint CaloSegment::exit_ [private]

Definition at line 71 of file CaloSegment.h.

Referenced by CaloSegment(), exit(), positionAtDepthincm(), positionAtDepthinL0(), and positionAtDepthinX0().

double CaloSegment::L0length_ [private]

Definition at line 80 of file CaloSegment.h.

Referenced by CaloSegment(), and L0length().

double CaloSegment::length_ [private]

Definition at line 76 of file CaloSegment.h.

Referenced by CaloSegment(), length(), and x0FromCm().

Material CaloSegment::material_ [private]

Definition at line 81 of file CaloSegment.h.

Referenced by material().

double CaloSegment::sentrance_ [private]

Definition at line 72 of file CaloSegment.h.

Referenced by CaloSegment(), operator<(), positionAtDepthincm(), and sEntrance().

double CaloSegment::sexit_ [private]

Definition at line 73 of file CaloSegment.h.

Referenced by CaloSegment(), operator<(), positionAtDepthincm(), and sExit().

double CaloSegment::sL0entrance_ [private]

Definition at line 78 of file CaloSegment.h.

Referenced by CaloSegment(), positionAtDepthinL0(), and sL0Entrance().

double CaloSegment::sL0exit_ [private]

Definition at line 79 of file CaloSegment.h.

Referenced by CaloSegment(), positionAtDepthinL0(), and sL0Exit().

double CaloSegment::sX0entrance_ [private]

Definition at line 74 of file CaloSegment.h.

Referenced by CaloSegment(), positionAtDepthinX0(), sX0Entrance(), and x0FromCm().

double CaloSegment::sX0exit_ [private]

Definition at line 75 of file CaloSegment.h.

Referenced by CaloSegment(), positionAtDepthinX0(), and sX0Exit().

double CaloSegment::X0length_ [private]

Definition at line 77 of file CaloSegment.h.

Referenced by CaloSegment(), x0FromCm(), and X0length().


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