test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Phase2TrackerRecHits.cc
Go to the documentation of this file.
12 
17 
23 
26 
27 #include <vector>
28 #include <string>
29 
31 
32  public:
33 
34  explicit Phase2TrackerRecHits(const edm::ParameterSet& conf);
35  virtual ~Phase2TrackerRecHits() {};
36  void produce(edm::StreamID sid, edm::Event& event, const edm::EventSetup& eventSetup) const override final;
37 
38  private:
39 
42 
43 };
44 
46  token_(consumes< Phase2TrackerCluster1DCollectionNew >(conf.getParameter<edm::InputTag>("src"))),
47  cpeTag_(conf.getParameter<edm::ESInputTag>("Phase2StripCPE")) {
48  produces<Phase2TrackerRecHit1DCollectionNew>();
49 }
50 
52 
53  // Get the Clusters
55  event.getByToken(token_, clusters);
56 
57  // load the cpe via the eventsetup
59  eventSetup.get<TkStripCPERecord>().get(cpeTag_, cpe);
60 
61  // Get the geometry
63  eventSetup.get< TrackerDigiGeometryRecord >().get(geomHandle);
64  const TrackerGeometry* tkGeom(&(*geomHandle));
65 
67  eventSetup.get< IdealGeometryRecord >().get(tTopoHandle);
68  //const TrackerTopology* tTopo(tTopoHandle.product());
69 
70  // Global container for the RecHits of each module
71  std::auto_ptr< Phase2TrackerRecHit1DCollectionNew > outputRecHits(new Phase2TrackerRecHit1DCollectionNew());
72 
73  // Loop over clusters
74  for (auto DSViter : *clusters) {
75 
76  DetId detId(DSViter.detId());
77 
78  // Geometry
79  const GeomDetUnit * geomDetUnit(tkGeom->idToDetUnit(detId));
80 
81  // Container for the clusters that will be produced for this modules
82  Phase2TrackerRecHit1DCollectionNew::FastFiller rechits(*outputRecHits, DSViter.detId());
83 
84  for (auto clustIt : DSViter) {
85  ClusterParameterEstimator< Phase2TrackerCluster1D >::LocalValues lv = cpe->localParameters(clustIt, *geomDetUnit);
86 
87  // Create a persistent edm::Ref to the cluster
89 
90  // Make a RecHit and add it to the DetSet
91  Phase2TrackerRecHit1D hit(lv.first, lv.second, cluster);
92 
93  rechits.push_back(hit);
94  }
95  }
96 
97  outputRecHits->shrink_to_fit();
98  event.put(outputRecHits);
99 
100 }
101 
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edmNew::DetSetVector< Phase2TrackerRecHit1D > Phase2TrackerRecHit1DCollectionNew
void produce(edm::StreamID sid, edm::Event &event, const edm::EventSetup &eventSetup) const overridefinal
Phase2TrackerRecHits(const edm::ParameterSet &conf)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNew > token_