test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TkPhase2OTMeasurementDet.cc
Go to the documentation of this file.
9 
10 //FIXME:just temporary solution for phase2!
11 /*
12 namespace {
13  const float theRocWidth = 8.1;
14  const float theRocHeight = 8.1;
15 }
16 */
17 
19  Phase2OTMeasurementConditionSet & conditions ) :
20  MeasurementDet (gdet),
21  theDetConditions(&conditions)
22  {
23  if ( dynamic_cast<const PixelGeomDetUnit*>(gdet) == 0) {
24  throw MeasurementDetException( "TkPhase2OTMeasurementDet constructed with a GeomDet which is not a PixelGeomDetUnit");
25  }
26  }
27 
30  TempMeasurements & result) const {
31 
32 
33  if (!isActive(data)) {
34  result.add(theInactiveHit, 0.F);
35  return true;
36  }
37 
38  auto oldSize = result.size();
39  MeasurementDet::RecHitContainer && allHits = recHits(stateOnThisDet, data);
40  for (auto && hit : allHits) {
41  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, *hit);
42  if ( diffEst.first)
43  result.add(std::move(hit), diffEst.second);
44  }
45 
46  if (result.size()>oldSize) return true;
47 
48  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
49  bool inac = hasBadComponents(stateOnThisDet, data);
50  result.add(inac ? theInactiveHit : theMissingHit, 0.F);
51  return inac;
52 
53 }
54 
57  const LocalTrajectoryParameters & ltp) const
58 {
59 
60  const PixelGeomDetUnit& gdu( specificGeomDet() );
61  auto && params = cpe()->localParameters( *cluster, gdu );
62 
63  return std::make_shared<Phase2TrackerRecHit1D>( params.first, params.second, fastGeomDet(), cluster);
64 
65 }
66 
69 {
71  if (isEmpty(data.phase2OTData())== true ) return result;
72  if (isActive(data) == false) return result;
74  if (0 != data.phase2OTData().handle()->data().size()) {
75  begin = &(data.phase2OTData().handle()->data().front());
76  }
77  const detset & detSet = data.phase2OTData().detSet(index());
78  result.reserve(detSet.size());
79  for ( const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
80 
81  if (ci < begin){
82  edm::LogError("IndexMisMatch")<<"TkPhase2OTMeasurementDet cannot create hit because of index mismatch.";
83  return result;
84  }
85  unsigned int index = ci-begin;
86  if (!data.phase2OTClustersToSkip().empty() && index>=data.phase2OTClustersToSkip().size()){
87  edm::LogError("IndexMisMatch")<<"TkPhase2OTMeasurementDet cannot create hit because of index mismatch. i.e "<<index<<" >= "<<data.phase2OTClustersToSkip().size();
88  return result;
89  }
90  if(data.phase2OTClustersToSkip().empty() or (not data.phase2OTClustersToSkip()[index]) ) {
91  Phase2TrackerCluster1DRef cluster = detSet.makeRefTo( data.phase2OTData().handle(), ci );
92  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
93  }else{
94  LogDebug("TkPhase2OTMeasurementDet")<<"skipping this cluster from last iteration on "<<fastGeomDet().geographicalId().rawId()<<" key: "<<index;
95  }
96  }
97  return result;
98 }
99 
100 //FIXME:just temporary solution for phase2!
101 bool
103 /*
104  if (badRocPositions_.empty()) return false;
105  LocalPoint lp = tsos.localPosition();
106  LocalError le = tsos.localError().positionError();
107  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
108  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
109  if ( (std::abs(it->x() - lp.x()) < dx) &&
110  (std::abs(it->y() - lp.y()) < dy) ) return true;
111  }
112 */
113  return false;
114 }
#define LogDebug(id)
const std::vector< bool > & phase2OTClustersToSkip() const
bool isEmpty(const Phase2OTMeasurementDetSet &data) const
std::size_t size() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
TkPhase2OTMeasurementDet(const GeomDet *gdet, Phase2OTMeasurementConditionSet &conditionSet)
const LocalTrajectoryParameters & localParameters() const
const Phase2OTMeasurementDetSet & phase2OTData() const
const Phase2DetSet & detSet(int i) const
const PixelGeomDetUnit & specificGeomDet() const
tuple result
Definition: mps_fire.py:84
TrackingRecHit::ConstRecHitPointer theMissingHit
const GeomDet & fastGeomDet() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int index() const
Sets the list of bad ROCs, identified by the positions of their centers in the local coordinate frame...
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
const edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle() const
void add(ConstRecHitPointer const &h, float d)
def move
Definition: eostools.py:510
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &dat) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
const ClusterParameterEstimator< Phase2TrackerCluster1D > * cpe() const
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
std::shared_ptr< TrackingRecHit const > RecHitPointer
TrackingRecHit::ConstRecHitPointer theInactiveHit
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &dat) const
TrackingRecHit::ConstRecHitContainer RecHitContainer
#define begin
Definition: vmac.h:30
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
iterator end()
Definition: DetSetNew.h:70
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &dat, TempMeasurements &result) const
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(HandleT const &handle, const_iterator ci) const
Definition: DetSetNew.h:95
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
size_type size() const
Definition: DetSetNew.h:87
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
detset::const_iterator const_iterator
TrackingRecHit::RecHitPointer buildRecHit(const Phase2TrackerCluster1DRef &cluster, const LocalTrajectoryParameters &ltp) const
iterator begin()
Definition: DetSetNew.h:67