CMS 3D CMS Logo

Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes

StripCPE Class Reference

#include <StripCPE.h>

Inheritance diagram for StripCPE:
StripClusterParameterEstimator ClusterParameterEstimator< SiStripCluster > StripCPEfromTrackAngle StripCPEgeometric

List of all members.

Classes

struct  Param

Public Member Functions

void clearCache ()
LocalVector driftDirection (const StripGeomDetUnit *det) const
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, const GeomDetUnit &) const
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &) const
 StripCPE (edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &, const SiStripLorentzAngle &, const SiStripConfObject &, const SiStripLatency &)

Protected Member Functions

Param const & param (const uint32_t detid) const

Protected Attributes

const TrackerGeometrygeom_
const SiStripLorentzAngleLorentzAngleMap_
const MagneticFieldmagfield_
const bool peakMode_
std::vector< double > shift
std::vector< double > xtalk1
std::vector< double > xtalk2

Private Types

typedef __gnu_cxx::hash_map
< unsigned int, Param
Params

Private Member Functions

ParamfillParam (Param &p, const GeomDetUnit *det)

Private Attributes

Params m_Params

Detailed Description

Definition at line 15 of file StripCPE.h.


Member Typedef Documentation

typedef __gnu_cxx::hash_map< unsigned int, Param> StripCPE::Params [private]

Definition at line 55 of file StripCPE.h.


Constructor & Destructor Documentation

StripCPE::StripCPE ( edm::ParameterSet conf,
const MagneticField mag,
const TrackerGeometry geom,
const SiStripLorentzAngle LorentzAngle,
const SiStripConfObject confObj,
const SiStripLatency latency 
)

Definition at line 10 of file StripCPE.cc.

References SiStripConfObject::get(), SiStripDetId::IB1, SiStripDetId::IB2, SiStripConfObject::isParameter(), SiStripDetId::OB1, SiStripDetId::OB2, peakMode_, edm::second(), shift, findQualityFiles::size, SiStripDetId::W1A, SiStripDetId::W1B, SiStripDetId::W2A, SiStripDetId::W2B, SiStripDetId::W3A, SiStripDetId::W3B, SiStripDetId::W4, SiStripDetId::W5, SiStripDetId::W6, SiStripDetId::W7, xtalk1, and xtalk2.

  : peakMode_(latency.singleReadOutMode() == 1),
    geom_(geom),
    magfield_(mag),
    LorentzAngleMap_(LorentzAngle)
{
  typedef std::map<std::string,SiStripDetId::ModuleGeometry> map_t;
  map_t modules;
  modules["IB1"]=SiStripDetId::IB1;  
  modules["IB2"]=SiStripDetId::IB2;
  modules["OB1"]=SiStripDetId::OB1;  
  modules["OB2"]=SiStripDetId::OB2;
  modules["W1A"]=SiStripDetId::W1A;    
  modules["W2A"]=SiStripDetId::W2A;  
  modules["W3A"]=SiStripDetId::W3A;  
  modules["W1B"]=SiStripDetId::W1B;
  modules["W2B"]=SiStripDetId::W2B;
  modules["W3B"]=SiStripDetId::W3B;
  modules["W4"] =SiStripDetId::W4;
  modules["W5"] =SiStripDetId::W5;
  modules["W6"] =SiStripDetId::W6;
  modules["W7"] =SiStripDetId::W7;
  
  const unsigned size = max_element( modules.begin(),modules.end(),
                                     boost::bind(&map_t::value_type::second,boost::lambda::_1) < 
                                     boost::bind(&map_t::value_type::second,boost::lambda::_2) )->second + 1;
  shift.resize(size);
  xtalk1.resize(size);
  xtalk2.resize(size);

  for(map_t::const_iterator it=modules.begin(); it!=modules.end(); it++) {
    const std::string 
      modeS(peakMode_?"Peak":"Deco"),
      shiftS( "shift_"  + it->first + modeS ),
      xtalk1S("xtalk1_" + it->first + modeS ),
      xtalk2S("xtalk2_" + it->first + modeS );

    if(!confObj.isParameter(shiftS)) throw cms::Exception("SiStripConfObject does not contain: ") << shiftS;
    if(!confObj.isParameter(xtalk1S)) throw cms::Exception("SiStripConfObject does not contain: ") << xtalk1S;
    if(!confObj.isParameter(xtalk2S)) throw cms::Exception("SiStripConfObject does not contain: ") << xtalk2S;

    shift[it->second] = confObj.get<double>(shiftS);
    xtalk1[it->second] = confObj.get<double>(xtalk1S);
    xtalk2[it->second] = confObj.get<double>(xtalk2S);
  }
}

Member Function Documentation

void StripCPE::clearCache ( ) [inline]

Definition at line 29 of file StripCPE.h.

References m_Params.

{m_Params.clear();}
LocalVector StripCPE::driftDirection ( const StripGeomDetUnit det) const [virtual]

Implements StripClusterParameterEstimator.

Definition at line 81 of file StripCPE.cc.

References GeomDet::geographicalId(), SiStripLorentzAngle::getLorentzAngle(), MagneticField::inTesla(), LorentzAngleMap_, magfield_, GloballyPositioned< T >::position(), DetId::rawId(), GeomDet::surface(), toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by fillParam().

                                                  { 
  LocalVector lbfield = (det->surface()).toLocal(magfield_.inTesla(det->surface().position()));  
  
  float tanLorentzAnglePerTesla = LorentzAngleMap_.getLorentzAngle(det->geographicalId().rawId());
  
  float dir_x = -tanLorentzAnglePerTesla * lbfield.y();
  float dir_y =  tanLorentzAnglePerTesla * lbfield.x();
  float dir_z =  1.f; // E field always in z direction
  
  return LocalVector(dir_x,dir_y,dir_z);
}
StripCPE::Param & StripCPE::fillParam ( StripCPE::Param p,
const GeomDetUnit det 
) [private]
StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl,
const GeomDetUnit  
) const [inline, virtual]

Implements ClusterParameterEstimator< SiStripCluster >.

Definition at line 20 of file StripCPE.h.

References localParameters().

Referenced by localParameters().

{return localParameters(cl);}
StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cluster) const

Definition at line 63 of file StripCPE.cc.

References SiStripCluster::barycenter(), StripCPE::Param::coveredStrips(), StripCPE::Param::drift, f, SiStripCluster::geographicalId(), StripTopology::localError(), StripTopology::localPosition(), StripCPE::Param::moduleGeom, L1TEmulatorMonitor_cff::p, param(), shift, strip(), StripCPE::Param::thickness, and StripCPE::Param::topology.

                                                      {
  StripCPE::Param const & p = param(cluster.geographicalId());
  const float barycenter = cluster.barycenter();
  const float fullProjection = p.coveredStrips( p.drift + LocalVector(0,0,-p.thickness), LocalPoint(barycenter,0,0));
  const float strip = barycenter - 0.5f * (1-shift[p.moduleGeom]) * fullProjection;

  return std::make_pair( p.topology->localPosition(strip),
                         p.topology->localError(strip, 1.f/12.f) );
}
StripCPE::Param const & StripCPE::param ( const uint32_t  detid) const [protected]

Definition at line 94 of file StripCPE.cc.

References fillParam(), geom_, TrackerGeometry::idToDetUnit(), m_Params, L1TEmulatorMonitor_cff::p, and StripCPE::Param::topology.

Referenced by StripCPEgeometric::localParameters(), localParameters(), and StripCPEfromTrackAngle::localParameters().

                                  {
  Param & p = const_cast<StripCPE*>(this)->m_Params[detid];
  if (p.topology) return p;
  else return const_cast<StripCPE*>(this)->fillParam(p, geom_.idToDetUnit(detid));
}

Member Data Documentation

const TrackerGeometry& StripCPE::geom_ [protected]

Definition at line 34 of file StripCPE.h.

Referenced by param().

Definition at line 36 of file StripCPE.h.

Referenced by driftDirection().

Definition at line 56 of file StripCPE.h.

Referenced by clearCache(), and param().

const MagneticField& StripCPE::magfield_ [protected]

Definition at line 35 of file StripCPE.h.

Referenced by driftDirection().

const bool StripCPE::peakMode_ [protected]

Definition at line 33 of file StripCPE.h.

Referenced by StripCPE().

std::vector<double> StripCPE::shift [protected]
std::vector<double> StripCPE::xtalk1 [protected]

Definition at line 38 of file StripCPE.h.

Referenced by StripCPEgeometric::localParameters(), and StripCPE().

std::vector<double> StripCPE::xtalk2 [protected]

Definition at line 39 of file StripCPE.h.

Referenced by StripCPE().