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  edm::ConsumesCollector iC = consumesCollector();
39  TheMatcher = new MuonSegmentMatcher(matchParameters, TheService,iC);
40 
41  // Cosmic track selection parameters
42  CSCAlgo.SetDetaThreshold( (float) iConfig.getParameter<double>("DetaParam"));
43  CSCAlgo.SetDphiThreshold( (float) iConfig.getParameter<double>("DphiParam"));
44  CSCAlgo.SetMinMaxInnerRadius( (float) iConfig.getParameter<double>("InnerRMinParam") , (float) iConfig.getParameter<double>("InnerRMaxParam") );
45  CSCAlgo.SetMinMaxOuterRadius( (float) iConfig.getParameter<double>("OuterRMinParam"), (float) iConfig.getParameter<double>("OuterRMaxParam"));
46  CSCAlgo.SetNormChi2Threshold( (float) iConfig.getParameter<double>("NormChi2Param") );
47 
48  // MLR
49  CSCAlgo.SetMaxSegmentRDiff( (float) iConfig.getParameter<double>("MaxSegmentRDiff") );
50  CSCAlgo.SetMaxSegmentPhiDiff( (float) iConfig.getParameter<double>("MaxSegmentPhiDiff") );
51  CSCAlgo.SetMaxSegmentTheta( (float) iConfig.getParameter<double>("MaxSegmentTheta") );
52  // End MLR
53 
54  CSCAlgo.SetMaxDtMuonSegment( (float) iConfig.getParameter<double>("MaxDtMuonSegment") );
55  CSCAlgo.SetMaxFreeInverseBeta( (float) iConfig.getParameter<double>("MaxFreeInverseBeta") );
56  CSCAlgo.SetExpectedBX( (short int) iConfig.getParameter<int>("ExpectedBX") );
57  CSCAlgo.SetRecHitTime0( (float) iConfig.getParameter<double>("RecHitTime0") );
58  CSCAlgo.SetRecHitTimeWindow( (float) iConfig.getParameter<double>("RecHitTimeWindow") );
59  CSCAlgo.SetMinMaxOuterMomentumTheta( (float)iConfig.getParameter<double>("MinOuterMomentumTheta"), (float)iConfig.getParameter<double>("MaxOuterMomentumTheta") );
60  CSCAlgo.SetMatchingDPhiThreshold( (float)iConfig.getParameter<double>("MatchingDPhiThreshold") );
61  CSCAlgo.SetMatchingDEtaThreshold( (float)iConfig.getParameter<double>("MatchingDEtaThreshold") );
62  CSCAlgo.SetMatchingDWireThreshold(iConfig.getParameter<int>("MatchingDWireThreshold") );
63 
64  produces<CSCHaloData>();
65 }
66 
67 void CSCHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup)
68 {
69  //Get CSC Geometry
70  edm::ESHandle<CSCGeometry> TheCSCGeometry;
71  iSetup.get<MuonGeometryRecord>().get(TheCSCGeometry);
72 
73  //Get Muons Collection from Cosmic Reconstruction
75  iEvent.getByLabel(IT_CosmicMuon, TheCosmics);
76 
77  //Get Muon Time Information from Cosmic Reconstruction
79  iEvent.getByLabel(IT_CosmicMuon.label(),"csc",TheCSCTimeMap);
80 
81  //Collision Muon Collection
83  iEvent.getByLabel(IT_Muon, TheMuons);
84 
85  //Get CSC Segments
86  edm::Handle<CSCSegmentCollection> TheCSCSegments;
87  iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
88 
89  //Get CSC RecHits
90  Handle<CSCRecHit2DCollection> TheCSCRecHits;
91  iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits);
92 
93  //Get L1MuGMT
95  iEvent.getByLabel (IT_L1MuGMTReadout, TheL1GMTReadout);
96 
97  //Get Chamber Anode Trigger Information
99  iEvent.getByLabel (IT_ALCT, TheALCTs);
100 
101  //Get HLT Results
102  edm::Handle<edm::TriggerResults> TheHLTResults;
103  iEvent.getByLabel( IT_HLTResult , TheHLTResults);
104 
105  const edm::TriggerNames * triggerNames = 0;
106  if (TheHLTResults.isValid()) {
107  triggerNames = &iEvent.triggerNames(*TheHLTResults);
108  }
109 
110  std::auto_ptr<CSCHaloData> TheCSCData(new CSCHaloData( CSCAlgo.Calculate(*TheCSCGeometry, TheCosmics, TheCSCTimeMap, TheMuons, TheCSCSegments, TheCSCRecHits, TheL1GMTReadout, TheHLTResults, triggerNames, TheALCTs, TheMatcher, iEvent) ) );
111  // Put it in the event
112  iEvent.put(TheCSCData);
113  return;
114 }
115 
116 CSCHaloDataProducer::~CSCHaloDataProducer(){}
T getParameter(std::string const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:204
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
const T & get() const
Definition: EventSetup.h:55