CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
MTDRingForwardDoubleLayer Class Reference

#include <MTDRingForwardDoubleLayer.h>

Inheritance diagram for MTDRingForwardDoubleLayer:
RingedForwardLayer

Public Member Functions

const MTDRingForwardLayerbackLayer () const
 
const std::vector< const GeomDet * > & basicComponents () const override
 
std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
 
std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
const std::vector< const GeometricSearchDet * > & components () const override
 
const MTDRingForwardLayerfrontLayer () const
 
std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
bool isCrack (const GlobalPoint &gp) const
 
bool isInsideOut (const TrajectoryStateOnSurface &tsos) const
 
 MTDRingForwardDoubleLayer (const std::vector< const ForwardDetRing * > &frontRings, const std::vector< const ForwardDetRing * > &backRings)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector< const ForwardDetRing * > & rings () const
 Return the vector of rings. More...
 
void selfTest () const
 
SubDetector subDetector () const override
 
 ~MTDRingForwardDoubleLayer () override
 

Protected Member Functions

BoundDiskcomputeSurface () override
 

Private Attributes

MTDRingForwardLayer theBackLayer
 
std::vector< const GeomDet * > theBasicComponents
 
std::vector< const GeometricSearchDet * > theComponents
 
MTDRingForwardLayer theFrontLayer
 
std::vector< const ForwardDetRing * > theRings
 

Detailed Description

A plane composed two layers of disks. The Endcap Timing Layer.

Author
L. Gray

Definition at line 19 of file MTDRingForwardDoubleLayer.h.

Constructor & Destructor Documentation

MTDRingForwardDoubleLayer::MTDRingForwardDoubleLayer ( const std::vector< const ForwardDetRing * > &  frontRings,
const std::vector< const ForwardDetRing * > &  backRings 
)

Constructor, takes ownership of pointers.

Definition at line 21 of file MTDRingForwardDoubleLayer.cc.

References basicComponents(), computeSurface(), LogTrace, metname, selfTest(), AlCaHLTBitMon_QueryRunRegistry::string, theBasicComponents, theComponents, and theRings.

22  :
23  RingedForwardLayer(true),
24  theFrontLayer(frontRings),
25  theBackLayer(backRings),
26  theRings(frontRings), // add back later
27  theComponents(),
29 {
30 
31  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDRingForwardDoubleLayer";
32 
33  theRings.insert(theRings.end(), backRings.begin(), backRings.end());
34  theComponents = std::vector <const GeometricSearchDet*>(theRings.begin(), theRings.end());
35 
36  // Cache chamber pointers (the basic components_)
37  // and find extension in R and Z
38  for (vector<const ForwardDetRing*>::const_iterator it=theRings.begin();
39  it!=theRings.end(); it++) {
40  vector<const GeomDet*> tmp2 = (*it)->basicComponents();
41  theBasicComponents.insert(theBasicComponents.end(),tmp2.begin(),tmp2.end());
42  }
43 
44  setSurface(computeSurface());
45 
46  LogTrace(metname) << "Constructing MTDRingForwardDoubleLayer: "
47  << basicComponents().size() << " Dets "
48  << theRings.size() << " Rings "
49  << " Z: " << specificSurface().position().z()
50  << " R1: " << specificSurface().innerRadius()
51  << " R2: " << specificSurface().outerRadius();
52 
53  selfTest();
54 }
ForwardDetLayer RingedForwardLayer
const std::string metname
BoundDisk * computeSurface() override
std::vector< const ForwardDetRing * > theRings
const std::vector< const GeomDet * > & basicComponents() const override
std::vector< const GeomDet * > theBasicComponents
#define LogTrace(id)
std::vector< const GeometricSearchDet * > theComponents
MTDRingForwardDoubleLayer::~MTDRingForwardDoubleLayer ( )
inlineoverride

Definition at line 27 of file MTDRingForwardDoubleLayer.h.

27 {}

Member Function Documentation

const MTDRingForwardLayer* MTDRingForwardDoubleLayer::backLayer ( ) const
inline

Definition at line 66 of file MTDRingForwardDoubleLayer.h.

References computeSurface(), selfTest(), and theBackLayer.

66 {return &theBackLayer;}
const std::vector<const GeomDet*>& MTDRingForwardDoubleLayer::basicComponents ( ) const
inlineoverride

Definition at line 32 of file MTDRingForwardDoubleLayer.h.

References theBasicComponents.

Referenced by MTDRingForwardDoubleLayer().

32 {return theBasicComponents;}
std::vector< const GeomDet * > theBasicComponents
std::pair< bool, TrajectoryStateOnSurface > MTDRingForwardDoubleLayer::compatible ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 88 of file MTDRingForwardDoubleLayer.cc.

References deltaR(), TrajectoryStateOnSurface::hasError(), SimpleDiskBounds::inside(), insideOut, isInsideOut(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogTrace, metname, gsfElectronCkfTrackCandidateMaker_cff::nSigma, LocalTrajectoryError::positionError(), Propagator::propagate(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), theBackLayer, theFrontLayer, PV3DBase< T, PVType, FrameType >::theta(), tmp, LocalError::xx(), and LocalError::yy().

Referenced by compatibleDets(), and components().

90 {
91  // mostly copied from ForwardDetLayer, except propagates to closest surface,
92  // not to center
93  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDRingForwardDoubleLayer";
94 
95  bool insideOut = isInsideOut(startingState);
96  const MTDRingForwardLayer & closerLayer = (insideOut) ? theFrontLayer : theBackLayer;
97  LogTrace(metname)
98  << "MTDRingForwardDoubleLayer::compatible is assuming inside-out direction: "<< insideOut;
99 
100  TrajectoryStateOnSurface myState = prop.propagate( startingState, closerLayer.specificSurface());
101  if ( !myState.isValid()) return make_pair( false, myState);
102 
103  // take into account the thickness of the layer
104  float deltaR = surface().bounds().thickness()/2. *
105  fabs( tan( myState.localDirection().theta()));
106 
107  // take into account the error on the predicted state
108  const float nSigma = 3.;
109  if (myState.hasError()) {
110  LocalError err = myState.localError().positionError();
111  // ignore correlation for the moment...
112  deltaR += nSigma * sqrt(err.xx() + err.yy());
113  }
114 
115  float zPos = (zmax()+zmin())/2.;
116  SimpleDiskBounds tmp( rmin()-deltaR, rmax()+deltaR,
117  zmin()-zPos, zmax()-zPos);
118 
119  return make_pair( tmp.inside(myState.localPosition()), myState);
120 }
float xx() const
Definition: LocalError.h:24
const std::string metname
LocalVector localDirection() const
LocalError positionError() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const LocalTrajectoryError & localError() const
#define LogTrace(id)
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
bool isInsideOut(const TrajectoryStateOnSurface &tsos) const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
vector< GeometricSearchDet::DetWithState > MTDRingForwardDoubleLayer::compatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 124 of file MTDRingForwardDoubleLayer.cc.

References compatible(), groupedCompatibleDets(), LogTrace, metname, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by components().

126  {
127  vector<DetWithState> result;
128  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDRingForwardDoubleLayer";
129  pair<bool, TrajectoryStateOnSurface> compat =
130  compatible(startingState, prop, est);
131 
132  if (!compat.first) {
133 
134  LogTrace(metname) << " MTDRingForwardDoubleLayer::compatibleDets: not compatible"
135  << " (should not have been selected!)";
136  return result;
137  }
138 
139 
140  TrajectoryStateOnSurface& tsos = compat.second;
141 
142  // standard implementation of compatibleDets() for class which have
143  // groupedCompatibleDets implemented.
144  // This code should be moved in a common place intead of being
145  // copied many times.
146  vector<DetGroup> vectorGroups = groupedCompatibleDets(tsos,prop,est);
147  for(vector<DetGroup>::const_iterator itDG=vectorGroups.begin();
148  itDG!=vectorGroups.end();itDG++){
149  for(vector<DetGroupElement>::const_iterator itDGE=itDG->begin();
150  itDGE!=itDG->end();itDGE++){
151  result.push_back(DetWithState(itDGE->det(),itDGE->trajectoryState()));
152  }
153  }
154  return result;
155 }
const std::string metname
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
#define LogTrace(id)
std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
const std::vector<const GeometricSearchDet*>& MTDRingForwardDoubleLayer::components ( ) const
inlineoverride

Definition at line 34 of file MTDRingForwardDoubleLayer.h.

References compatible(), compatibleDets(), groupedCompatibleDets(), isInsideOut(), and theComponents.

34 {return theComponents;}
std::vector< const GeometricSearchDet * > theComponents
BoundDisk * MTDRingForwardDoubleLayer::computeSurface ( )
overrideprotected

Definition at line 57 of file MTDRingForwardDoubleLayer.cc.

References SiStripPI::max, min(), makeMuonMisalignmentScenario::rot, theBackLayer, and theFrontLayer.

Referenced by backLayer(), and MTDRingForwardDoubleLayer().

58 {
59  const BoundDisk & frontDisk = theFrontLayer.specificSurface();
60  const BoundDisk & backDisk = theBackLayer.specificSurface();
61 
62  float rmin = min( frontDisk.innerRadius(), backDisk.innerRadius() );
63  float rmax = max( frontDisk.outerRadius(), backDisk.outerRadius() );
64  float zmin = frontDisk.position().z();
65  float halfThickness = frontDisk.bounds().thickness()/2.;
66  zmin = (zmin > 0) ? zmin-halfThickness : zmin+halfThickness;
67  float zmax = backDisk.position().z();
68  halfThickness = backDisk.bounds().thickness()/2.;
69  zmax = (zmax > 0) ? zmax+halfThickness : zmax-halfThickness;
70  float zPos = (zmax+zmin)/2.;
71  PositionType pos(0.,0.,zPos);
73 
74  return new BoundDisk( pos, rot,
75  new SimpleDiskBounds( rmin, rmax,
76  zmin-zPos, zmax-zPos));
77 }
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
T min(T a, T b)
Definition: MathUtil.h:58
Disk BoundDisk
Definition: BoundDisk.h:62
const MTDRingForwardLayer* MTDRingForwardDoubleLayer::frontLayer ( ) const
inline

Definition at line 65 of file MTDRingForwardDoubleLayer.h.

References theFrontLayer.

65 {return &theFrontLayer;}
vector< DetGroup > MTDRingForwardDoubleLayer::groupedCompatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 159 of file MTDRingForwardDoubleLayer.cc.

References MTDRingForwardLayer::compatibleDets(), LogTrace, metname, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, theBackLayer, and theFrontLayer.

Referenced by compatibleDets(), and components().

161  {
162 
163  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDRingForwardDoubleLayer";
164  vector<GeometricSearchDet::DetWithState> detWithStates1, detWithStates2;
165 
166  LogTrace(metname) << "groupedCompatibleDets are currently given always in inside-out order";
167  // this should be fixed either in RecoMTD/MeasurementDet/MTDDetLayerMeasurements or
168  // RecoMTD/DetLayers/MTDRingForwardDoubleLayer
169 
170  detWithStates1 = theFrontLayer.compatibleDets(startingState, prop, est);
171  detWithStates2 = theBackLayer.compatibleDets(startingState, prop, est);
172 
173  vector<DetGroup> result;
174  if(!detWithStates1.empty()) result.push_back( DetGroup(detWithStates1) );
175  if(!detWithStates2.empty()) result.push_back( DetGroup(detWithStates2) );
176  LogTrace(metname) << "DoubleLayer Compatible dets: " << result.size();
177  return result;
178 }
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
const std::string metname
#define LogTrace(id)
bool MTDRingForwardDoubleLayer::isCrack ( const GlobalPoint gp) const

Definition at line 181 of file MTDRingForwardDoubleLayer.cc.

References LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), alignCSCRings::r, mps_fire::result, MTDRingForwardLayer::rings(), ForwardDetRing::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, and theBackLayer.

Referenced by rings().

182 {
183  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDRingForwardDoubleLayer";
184  // approximate
185  bool result = false;
186  double r = gp.perp();
187  const std::vector<const ForwardDetRing*>& backRings = theBackLayer.rings();
188  if(backRings.size() > 1)
189  {
190  const MTDDetRing * innerRing = dynamic_cast<const MTDDetRing *>(backRings[0]);
191  const MTDDetRing * outerRing = dynamic_cast<const MTDDetRing *>(backRings[1]);
192  assert(innerRing && outerRing);
193  float crackInner = innerRing->specificSurface().outerRadius();
194  float crackOuter = outerRing->specificSurface().innerRadius();
195  LogTrace(metname) << "In a crack:" << crackInner << " " << r << " " << crackOuter;
196  if(r > crackInner && r < crackOuter) return true;
197  }
198  // non-overlapping rings
199  return result;
200 }
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
T perp() const
Definition: PV3DBase.h:72
const std::string metname
#define LogTrace(id)
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
bool MTDRingForwardDoubleLayer::isInsideOut ( const TrajectoryStateOnSurface tsos) const

Definition at line 80 of file MTDRingForwardDoubleLayer.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), Basic3DVector< T >::dot(), TrajectoryStateOnSurface::globalMomentum(), and TrajectoryStateOnSurface::globalPosition().

Referenced by compatible(), and components().

81 {
82  return tsos.globalPosition().basicVector().dot(tsos.globalMomentum().basicVector()) > 0;
83 }
GlobalPoint globalPosition() const
GlobalVector globalMomentum() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
virtual const std::vector<const ForwardDetRing*>& MTDRingForwardDoubleLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 61 of file MTDRingForwardDoubleLayer.h.

References runTauDisplay::gp, isCrack(), and theRings.

61 {return theRings;}
std::vector< const ForwardDetRing * > theRings
void MTDRingForwardDoubleLayer::selfTest ( ) const

Definition at line 203 of file MTDRingForwardDoubleLayer.cc.

References MTDRingForwardLayer::basicComponents(), theBackLayer, and theFrontLayer.

Referenced by backLayer(), and MTDRingForwardDoubleLayer().

204 {
205  const std::vector<const GeomDet*>& frontDets = theFrontLayer.basicComponents();
206  const std::vector<const GeomDet*>& backDets = theBackLayer.basicComponents();
207 
208  std::vector<const GeomDet*>::const_iterator frontItr = frontDets.begin(),
209  lastFront = frontDets.end(),
210  backItr = backDets.begin(),
211  lastBack = backDets.end();
212 
213  // test that each front z is less than each back z
214  for( ; frontItr != lastFront; ++frontItr)
215  {
216  float frontz = fabs( (**frontItr).surface().position().z() );
217  for( ; backItr != lastBack; ++backItr)
218  {
219  float backz = fabs( (**backItr).surface().position().z() );
220  assert(frontz < backz);
221  }
222  }
223 }
const std::vector< const GeomDet * > & basicComponents() const override
SubDetector MTDRingForwardDoubleLayer::subDetector ( ) const
inlineoverride

Definition at line 55 of file MTDRingForwardDoubleLayer.h.

References MTDRingForwardLayer::subDetector(), and theBackLayer.

55 {return theBackLayer.subDetector();}
SubDetector subDetector() const override

Member Data Documentation

MTDRingForwardLayer MTDRingForwardDoubleLayer::theBackLayer
private
std::vector<const GeomDet*> MTDRingForwardDoubleLayer::theBasicComponents
private

Definition at line 76 of file MTDRingForwardDoubleLayer.h.

Referenced by basicComponents(), and MTDRingForwardDoubleLayer().

std::vector<const GeometricSearchDet*> MTDRingForwardDoubleLayer::theComponents
private

Definition at line 75 of file MTDRingForwardDoubleLayer.h.

Referenced by components(), and MTDRingForwardDoubleLayer().

MTDRingForwardLayer MTDRingForwardDoubleLayer::theFrontLayer
private
std::vector<const ForwardDetRing*> MTDRingForwardDoubleLayer::theRings
private

Definition at line 74 of file MTDRingForwardDoubleLayer.h.

Referenced by MTDRingForwardDoubleLayer(), and rings().