CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MSLayersKeeperX0DetLayer Class Referencefinal

#include <MSLayersKeeperX0DetLayer.h>

Inheritance diagram for MSLayersKeeperX0DetLayer:
MSLayersKeeper

Public Member Functions

void init (const edm::EventSetup &iSetup) override
 
MSLayer layer (const DetLayer *layer) const override
 
const MSLayersAtAnglelayers (float cotTheta) const override
 
 MSLayersKeeperX0DetLayer ()
 
 ~MSLayersKeeperX0DetLayer () override
 
- Public Member Functions inherited from MSLayersKeeper
virtual ~MSLayersKeeper ()
 

Private Attributes

bool isInitialised
 
MSLayersAtAngle theLayersData
 

Additional Inherited Members

- Protected Types inherited from MSLayersKeeper
typedef MSLayer::DataX0 DataX0
 
- Static Protected Member Functions inherited from MSLayersKeeper
static const DataX0getDataX0 (const MSLayer &l)
 
static void setDataX0 (MSLayer &l, const DataX0 &x0Data)
 

Detailed Description

Definition at line 9 of file MSLayersKeeperX0DetLayer.h.

Constructor & Destructor Documentation

◆ MSLayersKeeperX0DetLayer()

MSLayersKeeperX0DetLayer::MSLayersKeeperX0DetLayer ( )
inline

Definition at line 11 of file MSLayersKeeperX0DetLayer.h.

11 : isInitialised(false) {}

◆ ~MSLayersKeeperX0DetLayer()

MSLayersKeeperX0DetLayer::~MSLayersKeeperX0DetLayer ( )
inlineoverride

Definition at line 12 of file MSLayersKeeperX0DetLayer.h.

12 {}

Member Function Documentation

◆ init()

void MSLayersKeeperX0DetLayer::init ( const edm::EventSetup iSetup)
overridevirtual

Reimplemented from MSLayersKeeper.

Definition at line 13 of file MSLayersKeeperX0DetLayer.cc.

13  {
14  if (isInitialised)
15  return;
16  isInitialised = true;
17  // vector<MSLayer> allLayers = MSLayersKeeperX0DetLayerGeom().detLayers();
18  //MP
19  vector<MSLayer> allLayers;
20  theLayersData = MSLayersAtAngle(allLayers);
21 
22  vector<MSLayer>::iterator it;
23  PixelRecoPointRZ zero(0., 0.);
24  for (it = allLayers.begin(); it != allLayers.end(); it++) {
25  PixelRecoPointRZ middle = it->face() == GeomDetEnumerators::barrel
26  ? PixelRecoPointRZ(it->position(), it->range().mean())
27  : PixelRecoPointRZ(it->range().mean(), it->position());
28 
29  float cotTheta = PixelRecoLineRZ(zero, middle).cotLine();
30  float x0 = getDataX0(*it).x0;
31 
32  DataX0 dataX0;
33  if (it->face() == GeomDetEnumerators::barrel) {
34  float sumX0D = theLayersData.sumX0D(zero, middle);
35  dataX0 = DataX0(x0, sumX0D, cotTheta);
36  } else {
37  float hrange = (it->range().max() - it->range().min()) / 2.;
38  float cot1 = it->position() / (it->range().mean() - hrange / 2);
39  float cot2 = it->position() / (it->range().mean() + hrange / 2);
40  PixelRecoLineRZ line1(zero, cot1);
41  PixelRecoLineRZ line2(zero, cot2);
42  float sum1 = theLayersData.sumX0D(zero, it->crossing(line1).first);
43  float sum2 = theLayersData.sumX0D(zero, it->crossing(line2).first);
44  float slope = (sum2 - sum1) / (1 / cot2 - 1 / cot1);
45  float sumX0D = sum1 + slope * (1 / cotTheta - 1 / cot1);
46  dataX0 = DataX0(x0, sumX0D, cotTheta);
47  dataX0.setForwardSumX0DSlope(slope);
48  }
49  setDataX0(*it, dataX0);
50  theLayersData.update(*it);
51  }
52  //cout << "MSLayersKeeperX0DetLayer LAYERS: "<<endl;
53  //theLayersData.print();
54 }

References GeomDetEnumerators::barrel, PixelRecoLineRZ::cotLine(), if(), slope, combinedConstraintHelpers::sum2(), and SiPixelPI::zero.

◆ layer()

MSLayer MSLayersKeeperX0DetLayer::layer ( const DetLayer layer) const
inlineoverridevirtual

◆ layers()

const MSLayersAtAngle& MSLayersKeeperX0DetLayer::layers ( float  cotTheta) const
inlineoverridevirtual

Implements MSLayersKeeper.

Definition at line 15 of file MSLayersKeeperX0DetLayer.h.

15 { return theLayersData; }

Member Data Documentation

◆ isInitialised

bool MSLayersKeeperX0DetLayer::isInitialised
private

Definition at line 18 of file MSLayersKeeperX0DetLayer.h.

◆ theLayersData

MSLayersAtAngle MSLayersKeeperX0DetLayer::theLayersData
private

Definition at line 19 of file MSLayersKeeperX0DetLayer.h.

MSLayersAtAngle::update
void update(const MSLayer &layer)
Definition: MSLayersAtAngle.cc:40
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:48
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
GeomDetEnumerators::barrel
Definition: GeomDetEnumerators.h:9
MSLayersAtAngle::findLayer
const MSLayer * findLayer(const MSLayer &layer) const
Definition: MSLayersAtAngle.cc:34
MSLayersKeeperX0DetLayer::isInitialised
bool isInitialised
Definition: MSLayersKeeperX0DetLayer.h:18
MSLayersKeeper::getDataX0
static const DataX0 & getDataX0(const MSLayer &l)
Definition: MSLayersKeeper.h:20
MSLayersAtAngle::sumX0D
float sumX0D(const PixelRecoPointRZ &pointI, const PixelRecoPointRZ &pointO) const
Definition: MSLayersAtAngle.cc:51
MSLayersAtAngle
Definition: MSLayersAtAngle.h:16
MSLayer
Definition: MSLayer.h:13
MSLayersKeeperX0DetLayer::layer
MSLayer layer(const DetLayer *layer) const override
Definition: MSLayersKeeperX0DetLayer.h:14
MSLayersKeeper::setDataX0
static void setDataX0(MSLayer &l, const DataX0 &x0Data)
Definition: MSLayersKeeper.h:21
MSLayer::DataX0::x0
float x0
Definition: MSLayer.h:32
PixelRecoLineRZ
Definition: PixelRecoLineRZ.h:12
combinedConstraintHelpers::sum2
void sum2(T &x, T y)
Definition: CombinedKinematicConstraintT.h:74
MSLayersKeeper::DataX0
MSLayer::DataX0 DataX0
Definition: MSLayersKeeper.h:19
PixelRecoPointRZ
Definition: PixelRecoPointRZ.h:6
PixelRecoLineRZ::cotLine
float cotLine() const
Definition: PixelRecoLineRZ.h:31
slope
static const double slope[3]
Definition: CastorTimeSlew.cc:6
MSLayersKeeperX0DetLayer::theLayersData
MSLayersAtAngle theLayersData
Definition: MSLayersKeeperX0DetLayer.h:19