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  // Cosmic track selection parameters
35  CSCAlgo.SetDetaThreshold( (float) iConfig.getParameter<double>("DetaParam"));
36  CSCAlgo.SetDphiThreshold( (float) iConfig.getParameter<double>("DphiParam"));
37  CSCAlgo.SetMinMaxInnerRadius( (float) iConfig.getParameter<double>("InnerRMinParam") , (float) iConfig.getParameter<double>("InnerRMaxParam") );
38  CSCAlgo.SetMinMaxOuterRadius( (float) iConfig.getParameter<double>("OuterRMinParam"), (float) iConfig.getParameter<double>("OuterRMaxParam"));
39  CSCAlgo.SetNormChi2Threshold( (float) iConfig.getParameter<double>("NormChi2Param") );
40 
41  CSCAlgo.SetExpectedBX( (short int) iConfig.getParameter<int>("ExpectedBX") );
42  CSCAlgo.SetRecHitTime0( (float) iConfig.getParameter<double>("RecHitTime0") );
43  CSCAlgo.SetRecHitTimeWindow( (float) iConfig.getParameter<double>("RecHitTimeWindow") );
44  CSCAlgo.SetMinMaxOuterMomentumTheta( (float)iConfig.getParameter<double>("MinOuterMomentumTheta"), (float)iConfig.getParameter<double>("MaxOuterMomentumTheta") );
45  CSCAlgo.SetMatchingDPhiThreshold( (float)iConfig.getParameter<double>("MatchingDPhiThreshold") );
46  CSCAlgo.SetMatchingDEtaThreshold( (float)iConfig.getParameter<double>("MatchingDEtaThreshold") );
47  CSCAlgo.SetMatchingDWireThreshold(iConfig.getParameter<int>("MatchingDWireThreshold") );
48  produces<CSCHaloData>();
49 }
50 
51 void CSCHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup)
52 {
53  //Get CSC Geometry
54  edm::ESHandle<CSCGeometry> TheCSCGeometry;
55  iSetup.get<MuonGeometryRecord>().get(TheCSCGeometry);
56 
57  //Get CSC Stand-Alone Muons from Cosmic Reconstruction
59  iEvent.getByLabel(IT_CosmicMuon, TheCosmics);
60 
61  //Collision Muon Collection
63  iEvent.getByLabel(IT_Muon, TheMuons);
64 
65  //Get CSC Segments
66  edm::Handle<CSCSegmentCollection> TheCSCSegments;
67  iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
68 
69  //Get CSC RecHits
70  Handle<CSCRecHit2DCollection> TheCSCRecHits;
71  iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits);
72 
73  //Get L1MuGMT
75  iEvent.getByLabel (IT_L1MuGMTReadout, TheL1GMTReadout);
76 
77  //Get Chamber Anode Trigger Information
79  iEvent.getByLabel (IT_ALCT, TheALCTs);
80 
81  //Get HLT Results
83  iEvent.getByLabel( IT_HLTResult , TheHLTResults);
84 
85  const edm::TriggerNames * triggerNames = 0;
86  if (TheHLTResults.isValid()) {
87  triggerNames = &iEvent.triggerNames(*TheHLTResults);
88  }
89 
90  std::auto_ptr<CSCHaloData> TheCSCData(new CSCHaloData( CSCAlgo.Calculate(*TheCSCGeometry, TheCosmics, TheMuons, TheCSCSegments, TheCSCRecHits, TheL1GMTReadout, TheHLTResults, triggerNames, TheALCTs) ) );
91  // Put it in the event
92  iEvent.put(TheCSCData);
93  return;
94 }
95 
97 void CSCHaloDataProducer::endJob(){return;}
98 void CSCHaloDataProducer::beginRun(edm::Run&, const edm::EventSetup&){return;}
99 void CSCHaloDataProducer::endRun(edm::Run&, const edm::EventSetup&){return;}
100 CSCHaloDataProducer::~CSCHaloDataProducer(){}
T getParameter(std::string const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:208
void beginJob()
Definition: Breakpoints.cc:15
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
const T & get() const
Definition: EventSetup.h:55
Definition: Run.h:32