CMS 3D CMS Logo

Public Member Functions | Private Attributes

MSLayersKeeperX0DetLayer Class Reference

#include <MSLayersKeeperX0DetLayer.h>

Inheritance diagram for MSLayersKeeperX0DetLayer:
MSLayersKeeper

List of all members.

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 ()

Private Attributes

bool isInitialised
MSLayersAtAngle theLayersData

Detailed Description

Definition at line 7 of file MSLayersKeeperX0DetLayer.h.


Constructor & Destructor Documentation

MSLayersKeeperX0DetLayer::MSLayersKeeperX0DetLayer ( ) [inline]

Definition at line 9 of file MSLayersKeeperX0DetLayer.h.

: isInitialised(false) { }
virtual MSLayersKeeperX0DetLayer::~MSLayersKeeperX0DetLayer ( ) [inline, virtual]

Definition at line 10 of file MSLayersKeeperX0DetLayer.h.

{ }

Member Function Documentation

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

Reimplemented from MSLayersKeeper.

Definition at line 13 of file MSLayersKeeperX0DetLayer.cc.

References Reference_intrackfit_cff::barrel, GeomDetEnumerators::barrel, PixelRecoLineRZ::cotLine(), gather_cfg::cout, if(), slope, and zero.

{
  if (isInitialised) return;
  isInitialised = true;
  //  vector<MSLayer> allLayers = MSLayersKeeperX0DetLayerGeom().detLayers();
  //MP
  vector<MSLayer> allLayers;
  theLayersData = MSLayersAtAngle(allLayers);
  
  vector<MSLayer>::iterator it;
  PixelRecoPointRZ zero(0.,0.); 
  for (it = allLayers.begin(); it != allLayers.end(); it++) {
    PixelRecoPointRZ middle = it->face()== GeomDetEnumerators::barrel ?
        PixelRecoPointRZ(it->position(), it->range().mean())
      : PixelRecoPointRZ(it->range().mean(), it->position());

    float cotTheta = PixelRecoLineRZ(zero,middle).cotLine();
    float x0 =  getDataX0(*it).x0;

    DataX0 dataX0;
    if (it->face()== GeomDetEnumerators::barrel) {
      float sumX0D = theLayersData.sumX0D(zero, middle);
      dataX0 = DataX0(x0, sumX0D, cotTheta);      
    } else {
      float hrange= (it->range().max()-it->range().min())/2.;
      float cot1 = it->position()/(it->range().mean()-hrange/2);
      float cot2 = it->position()/(it->range().mean()+hrange/2);
      PixelRecoLineRZ line1(zero,cot1);
      PixelRecoLineRZ line2(zero,cot2);
      float sum1 = theLayersData.sumX0D(zero,it->crossing(line1).first);
      float sum2 = theLayersData.sumX0D(zero,it->crossing(line2).first);
      float slope = (sum2-sum1)/(1/cot2-1/cot1);
      float sumX0D = sum1 + slope*(1/cotTheta-1/cot1);
      dataX0 = DataX0(x0, sumX0D, cotTheta);
      dataX0.setForwardSumX0DSlope(slope);
    }
    setDataX0(*it, dataX0);
    theLayersData.update(*it);
  }
  cout << "MSLayersKeeperX0DetLayer LAYERS: "<<endl;
  theLayersData.print();
}
virtual MSLayer MSLayersKeeperX0DetLayer::layer ( const DetLayer layer) const [inline, virtual]

Reimplemented from MSLayersKeeper.

Definition at line 12 of file MSLayersKeeperX0DetLayer.h.

References MSLayersAtAngle::findLayer(), and theLayersData.

    {return *theLayersData.findLayer(MSLayer(layer)); }
virtual const MSLayersAtAngle& MSLayersKeeperX0DetLayer::layers ( float  cotTheta) const [inline, virtual]

Implements MSLayersKeeper.

Definition at line 14 of file MSLayersKeeperX0DetLayer.h.

References theLayersData.

    {return theLayersData;}

Member Data Documentation

Definition at line 18 of file MSLayersKeeperX0DetLayer.h.

Definition at line 19 of file MSLayersKeeperX0DetLayer.h.

Referenced by layer(), and layers().