CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GEMCSCSegmentProducer.cc
Go to the documentation of this file.
1 
7 
11 
13 
17 
21 
23 
24  csc_token = consumes<CSCSegmentCollection>( pas.getParameter<edm::InputTag>("inputObjectsCSC"));
25  gem_token = consumes<GEMRecHitCollection> ( pas.getParameter<edm::InputTag>("inputObjectsGEM"));
26  segmentBuilder_ = new GEMCSCSegmentBuilder(pas); // pass on the parameterset
27 
28  // register what this produces
29  produces<GEMCSCSegmentCollection>();
30 }
31 
32 
34 
35  LogDebug("GEMCSCSegment") << "deleting GEMCSCSegmentBuilder after " << iev << " events w/ gem and csc data.";
36  delete segmentBuilder_;
37 }
38 
39 
41  LogDebug("GEMCSCSegment") << "start producing segments for " << ++iev << "th event w/ gem and csc data";
42 
43  // find the geometry (& conditions?) for this event & cache it in the builder
45  setup.get<MuonGeometryRecord>().get(cscg);
46  const CSCGeometry* cgeom = &*cscg;
47 
49  setup.get<MuonGeometryRecord>().get(gemg);
50  const GEMGeometry* ggeom = &*gemg;
51 
52  // cache the geometry in the builder
53  segmentBuilder_->setGeometry(ggeom,cgeom);
54 
55  // fill the map with matches between GEM and CSC chambers
57 
58  // get the collection of CSCSegment and GEMRecHits
60  ev.getByToken(csc_token, cscSegment);
62  ev.getByToken(gem_token, gemRecHits);
63 
64  // create empty collection of GEMCSC Segments
65  std::auto_ptr<GEMCSCSegmentCollection> oc( new GEMCSCSegmentCollection );
66 
67  // pass the empty collection of GEMCSC Segments and fill it
68  segmentBuilder_->build(gemRecHits.product(), cscSegment.product(), *oc); //@@ FILL oc
69 
70  // put the filled collection in event
71  ev.put(oc);
72 }
#define LogDebug(id)
T getParameter(std::string const &) const
GEMCSCSegmentBuilder * segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > gem_token
edm::EDGetTokenT< CSCSegmentCollection > csc_token
void LinkGEMRollsToCSCChamberIndex(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
GEMCSCSegmentProducer(const edm::ParameterSet &)
Constructor.
bool ev
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
~GEMCSCSegmentProducer()
Destructor.
void build(const GEMRecHitCollection *rechits, const CSCSegmentCollection *cscsegments, GEMCSCSegmentCollection &oc)
virtual void produce(edm::Event &, const edm::EventSetup &)
Produce the GEM-CSCSegment collection.
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
void setGeometry(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")