CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MSLayersKeeperX0DetLayer Class Referencefinal

#include <MSLayersKeeperX0DetLayer.h>

Inheritance diagram for MSLayersKeeperX0DetLayer:
MSLayersKeeper

Public Member Functions

virtual void init (const edm::EventSetup &iSetup)
 
virtual MSLayer layer (const DetLayer *layer) const
 
virtual const MSLayersAtAnglelayers (float cotTheta) const
 
 MSLayersKeeperX0DetLayer ()
 
virtual ~MSLayersKeeperX0DetLayer ()
 
- 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 7 of file MSLayersKeeperX0DetLayer.h.

Constructor & Destructor Documentation

MSLayersKeeperX0DetLayer::MSLayersKeeperX0DetLayer ( )
inline

Definition at line 9 of file MSLayersKeeperX0DetLayer.h.

virtual MSLayersKeeperX0DetLayer::~MSLayersKeeperX0DetLayer ( )
inlinevirtual

Definition at line 10 of file MSLayersKeeperX0DetLayer.h.

10 { }

Member Function Documentation

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

Reimplemented from MSLayersKeeper.

Definition at line 13 of file MSLayersKeeperX0DetLayer.cc.

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

14 {
15  if (isInitialised) 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 }
static const double slope[3]
MSLayer::DataX0 DataX0
void update(const MSLayer &layer)
static void setDataX0(MSLayer &l, const DataX0 &x0Data)
float cotLine() const
static const DataX0 & getDataX0(const MSLayer &l)
float sumX0D(const PixelRecoPointRZ &pointI, const PixelRecoPointRZ &pointO) const
if(dp >Float(M_PI)) dp-
virtual MSLayer MSLayersKeeperX0DetLayer::layer ( const DetLayer layer) const
inlinevirtual

Reimplemented from MSLayersKeeper.

Definition at line 12 of file MSLayersKeeperX0DetLayer.h.

Referenced by geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

13  {return *theLayersData.findLayer(MSLayer(layer)); }
const MSLayer * findLayer(const MSLayer &layer) const
virtual const MSLayersAtAngle& MSLayersKeeperX0DetLayer::layers ( float  cotTheta) const
inlinevirtual

Implements MSLayersKeeper.

Definition at line 14 of file MSLayersKeeperX0DetLayer.h.

15  {return theLayersData;}

Member Data Documentation

bool MSLayersKeeperX0DetLayer::isInitialised
private

Definition at line 18 of file MSLayersKeeperX0DetLayer.h.

MSLayersAtAngle MSLayersKeeperX0DetLayer::theLayersData
private

Definition at line 19 of file MSLayersKeeperX0DetLayer.h.