CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCHaloDataProducer.cc
Go to the documentation of this file.
3 
4 /*
5  [class]: CSCHaloDataProducer
6  [authors]: R. Remington, The University of Florida
7  [description]: See CSCHaloDataProducer.h
8  [date]: October 15, 2009
9 */
10 
11 using namespace edm;
12 using namespace std;
13 using namespace reco;
14 
15 CSCHaloDataProducer::CSCHaloDataProducer(const edm::ParameterSet& iConfig)
16 {
17  //Digi Level
18  IT_L1MuGMTReadout = iConfig.getParameter<edm::InputTag>("L1MuGMTReadoutLabel");
19 
20  //HLT Level
21  IT_HLTResult = iConfig.getParameter<edm::InputTag>("HLTResultLabel");
22  CSCAlgo.vIT_HLTBit = iConfig.getParameter< std::vector< edm::InputTag> >("HLTBitLabel");
23 
24  //RecHit Level
25  IT_CSCRecHit = iConfig.getParameter<edm::InputTag>("CSCRecHitLabel");
26 
27  //Higher Level Reco
28  IT_CSCSegment = iConfig.getParameter<edm::InputTag>("CSCSegmentLabel");
29  IT_CosmicMuon = iConfig.getParameter<edm::InputTag>("CosmicMuonLabel");
30  IT_Muon = iConfig.getParameter<edm::InputTag>("MuonLabel");
31  IT_SA = iConfig.getParameter<edm::InputTag>("SALabel");
32  IT_ALCT = iConfig.getParameter<edm::InputTag>("ALCTDigiLabel");
33 
34  //Muon to Segment Matching
35  edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters");
36  TheService = new MuonServiceProxy(serviceParameters);
37  edm::ParameterSet matchParameters = iConfig.getParameter<edm::ParameterSet>("MatchParameters");
38  TheMatcher = new MuonSegmentMatcher(matchParameters, TheService);
39 
40  // Cosmic track selection parameters
41  CSCAlgo.SetDetaThreshold( (float) iConfig.getParameter<double>("DetaParam"));
42  CSCAlgo.SetDphiThreshold( (float) iConfig.getParameter<double>("DphiParam"));
43  CSCAlgo.SetMinMaxInnerRadius( (float) iConfig.getParameter<double>("InnerRMinParam") , (float) iConfig.getParameter<double>("InnerRMaxParam") );
44  CSCAlgo.SetMinMaxOuterRadius( (float) iConfig.getParameter<double>("OuterRMinParam"), (float) iConfig.getParameter<double>("OuterRMaxParam"));
45  CSCAlgo.SetNormChi2Threshold( (float) iConfig.getParameter<double>("NormChi2Param") );
46 
47  // MLR
48  CSCAlgo.SetMaxSegmentRDiff( (float) iConfig.getParameter<double>("MaxSegmentRDiff") );
49  CSCAlgo.SetMaxSegmentPhiDiff( (float) iConfig.getParameter<double>("MaxSegmentPhiDiff") );
50  CSCAlgo.SetMaxSegmentTheta( (float) iConfig.getParameter<double>("MaxSegmentTheta") );
51  // End MLR
52 
53  CSCAlgo.SetMaxDtMuonSegment( (float) iConfig.getParameter<double>("MaxDtMuonSegment") );
54  CSCAlgo.SetMaxFreeInverseBeta( (float) iConfig.getParameter<double>("MaxFreeInverseBeta") );
55  CSCAlgo.SetExpectedBX( (short int) iConfig.getParameter<int>("ExpectedBX") );
56  CSCAlgo.SetRecHitTime0( (float) iConfig.getParameter<double>("RecHitTime0") );
57  CSCAlgo.SetRecHitTimeWindow( (float) iConfig.getParameter<double>("RecHitTimeWindow") );
58  CSCAlgo.SetMinMaxOuterMomentumTheta( (float)iConfig.getParameter<double>("MinOuterMomentumTheta"), (float)iConfig.getParameter<double>("MaxOuterMomentumTheta") );
59  CSCAlgo.SetMatchingDPhiThreshold( (float)iConfig.getParameter<double>("MatchingDPhiThreshold") );
60  CSCAlgo.SetMatchingDEtaThreshold( (float)iConfig.getParameter<double>("MatchingDEtaThreshold") );
61  CSCAlgo.SetMatchingDWireThreshold(iConfig.getParameter<int>("MatchingDWireThreshold") );
62 
63  produces<CSCHaloData>();
64 }
65 
66 void CSCHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup)
67 {
68  //Get CSC Geometry
69  edm::ESHandle<CSCGeometry> TheCSCGeometry;
70  iSetup.get<MuonGeometryRecord>().get(TheCSCGeometry);
71 
72  //Get Muons Collection from Cosmic Reconstruction
74  iEvent.getByLabel(IT_CosmicMuon, TheCosmics);
75 
76  //Get Muon Time Information from Cosmic Reconstruction
78  iEvent.getByLabel(IT_CosmicMuon.label(),"csc",TheCSCTimeMap);
79 
80  //Collision Muon Collection
82  iEvent.getByLabel(IT_Muon, TheMuons);
83 
84  //Get CSC Segments
85  edm::Handle<CSCSegmentCollection> TheCSCSegments;
86  iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
87 
88  //Get CSC RecHits
89  Handle<CSCRecHit2DCollection> TheCSCRecHits;
90  iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits);
91 
92  //Get L1MuGMT
94  iEvent.getByLabel (IT_L1MuGMTReadout, TheL1GMTReadout);
95 
96  //Get Chamber Anode Trigger Information
98  iEvent.getByLabel (IT_ALCT, TheALCTs);
99 
100  //Get HLT Results
101  edm::Handle<edm::TriggerResults> TheHLTResults;
102  iEvent.getByLabel( IT_HLTResult , TheHLTResults);
103 
104  const edm::TriggerNames * triggerNames = 0;
105  if (TheHLTResults.isValid()) {
106  triggerNames = &iEvent.triggerNames(*TheHLTResults);
107  }
108 
109  std::auto_ptr<CSCHaloData> TheCSCData(new CSCHaloData( CSCAlgo.Calculate(*TheCSCGeometry, TheCosmics, TheCSCTimeMap, TheMuons, TheCSCSegments, TheCSCRecHits, TheL1GMTReadout, TheHLTResults, triggerNames, TheALCTs, TheMatcher, iEvent) ) );
110  // Put it in the event
111  iEvent.put(TheCSCData);
112  return;
113 }
114 
115 CSCHaloDataProducer::~CSCHaloDataProducer(){}
T getParameter(std::string const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:207
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
const T & get() const
Definition: EventSetup.h:55