CMS 3D CMS Logo

CSCHaloDataProducer.cc
Go to the documentation of this file.
4 
5 /*
6  [class]: CSCHaloDataProducer
7  [authors]: R. Remington, The University of Florida
8  [description]: See CSCHaloDataProducer.h
9  [date]: October 15, 2009
10 */
11 
12 using namespace edm;
13 using namespace std;
14 using namespace reco;
15 
16 CSCHaloDataProducer::CSCHaloDataProducer(const edm::ParameterSet& iConfig) : CSCAlgo(consumesCollector()) {
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  //Calo RecHit
28  IT_HBHErh = iConfig.getParameter<edm::InputTag>("HBHErhLabel");
29  IT_ECALBrh = iConfig.getParameter<edm::InputTag>("ECALBrhLabel");
30  IT_ECALErh = iConfig.getParameter<edm::InputTag>("ECALErhLabel");
31  //Higher Level Reco
32  IT_CSCSegment = iConfig.getParameter<edm::InputTag>("CSCSegmentLabel");
33  IT_CosmicMuon = iConfig.getParameter<edm::InputTag>("CosmicMuonLabel");
34  IT_Muon = iConfig.getParameter<edm::InputTag>("MuonLabel");
35  IT_SA = iConfig.getParameter<edm::InputTag>("SALabel");
36  IT_ALCT = iConfig.getParameter<edm::InputTag>("ALCTDigiLabel");
37 
38  //Muon to Segment Matching
39  edm::ParameterSet matchParameters = iConfig.getParameter<edm::ParameterSet>("MatchParameters");
40  edm::ConsumesCollector iC = consumesCollector();
41  TheMatcher = new MuonSegmentMatcher(matchParameters, iC);
42 
43  // Cosmic track selection parameters
44  CSCAlgo.SetDetaThreshold((float)iConfig.getParameter<double>("DetaParam"));
45  CSCAlgo.SetDphiThreshold((float)iConfig.getParameter<double>("DphiParam"));
46  CSCAlgo.SetMinMaxInnerRadius((float)iConfig.getParameter<double>("InnerRMinParam"),
47  (float)iConfig.getParameter<double>("InnerRMaxParam"));
48  CSCAlgo.SetMinMaxOuterRadius((float)iConfig.getParameter<double>("OuterRMinParam"),
49  (float)iConfig.getParameter<double>("OuterRMaxParam"));
50  CSCAlgo.SetNormChi2Threshold((float)iConfig.getParameter<double>("NormChi2Param"));
51 
52  // MLR
53  CSCAlgo.SetMaxSegmentRDiff((float)iConfig.getParameter<double>("MaxSegmentRDiff"));
54  CSCAlgo.SetMaxSegmentPhiDiff((float)iConfig.getParameter<double>("MaxSegmentPhiDiff"));
55  CSCAlgo.SetMaxSegmentTheta((float)iConfig.getParameter<double>("MaxSegmentTheta"));
56  // End MLR
57 
58  CSCAlgo.SetMaxDtMuonSegment((float)iConfig.getParameter<double>("MaxDtMuonSegment"));
59  CSCAlgo.SetMaxFreeInverseBeta((float)iConfig.getParameter<double>("MaxFreeInverseBeta"));
60  CSCAlgo.SetExpectedBX((short int)iConfig.getParameter<int>("ExpectedBX"));
61  CSCAlgo.SetRecHitTime0((float)iConfig.getParameter<double>("RecHitTime0"));
62  CSCAlgo.SetRecHitTimeWindow((float)iConfig.getParameter<double>("RecHitTimeWindow"));
63  CSCAlgo.SetMinMaxOuterMomentumTheta((float)iConfig.getParameter<double>("MinOuterMomentumTheta"),
64  (float)iConfig.getParameter<double>("MaxOuterMomentumTheta"));
65  CSCAlgo.SetMatchingDPhiThreshold((float)iConfig.getParameter<double>("MatchingDPhiThreshold"));
66  CSCAlgo.SetMatchingDEtaThreshold((float)iConfig.getParameter<double>("MatchingDEtaThreshold"));
67  CSCAlgo.SetMatchingDWireThreshold(iConfig.getParameter<int>("MatchingDWireThreshold"));
68 
69  cscGeometry_token = esConsumes<CSCGeometry, MuonGeometryRecord>();
70  cosmicmuon_token_ = consumes<reco::MuonCollection>(IT_CosmicMuon);
71  csctimemap_token_ = consumes<reco::MuonTimeExtraMap>(edm::InputTag(IT_CosmicMuon.label(), "csc"));
72  muon_token_ = consumes<reco::MuonCollection>(IT_Muon);
73  cscsegment_token_ = consumes<CSCSegmentCollection>(IT_CSCSegment);
74  cscrechit_token_ = consumes<CSCRecHit2DCollection>(IT_CSCRecHit);
75  cscalct_token_ = consumes<CSCALCTDigiCollection>(IT_ALCT);
76  l1mugmtro_token_ = consumes<L1MuGMTReadoutCollection>(IT_L1MuGMTReadout);
77  hbhereco_token_ = consumes<HBHERecHitCollection>(IT_HBHErh);
78  EcalRecHitsEB_token_ = consumes<EcalRecHitCollection>(IT_ECALBrh);
79  EcalRecHitsEE_token_ = consumes<EcalRecHitCollection>(IT_ECALErh);
80  hltresult_token_ = consumes<edm::TriggerResults>(IT_HLTResult);
81 
82  produces<CSCHaloData>();
83 }
84 
86  //Get CSC Geometry
88 
89  //Get Muons Collection from Cosmic Reconstruction
91  // iEvent.getByLabel(IT_CosmicMuon, TheCosmics);
92  iEvent.getByToken(cosmicmuon_token_, TheCosmics);
93 
94  //Get Muon Time Information from Cosmic Reconstruction
96  // iEvent.getByLabel(IT_CosmicMuon.label(),"csc",TheCSCTimeMap);
97  iEvent.getByToken(csctimemap_token_, TheCSCTimeMap);
98 
99  //Collision Muon Collection
101  // iEvent.getByLabel(IT_Muon, TheMuons);
102  iEvent.getByToken(muon_token_, TheMuons);
103 
104  //Get CSC Segments
105  edm::Handle<CSCSegmentCollection> TheCSCSegments;
106  // iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
107  iEvent.getByToken(cscsegment_token_, TheCSCSegments);
108 
109  //Get CSC RecHits
110  Handle<CSCRecHit2DCollection> TheCSCRecHits;
111  // iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits);
112  iEvent.getByToken(cscrechit_token_, TheCSCRecHits);
113 
114  //Get L1MuGMT
116  // iEvent.getByLabel (IT_L1MuGMTReadout, TheL1GMTReadout);
117  iEvent.getByToken(l1mugmtro_token_, TheL1GMTReadout);
118 
119  //Get Chamber Anode Trigger Information
121  // iEvent.getByLabel (IT_ALCT, TheALCTs);
122  iEvent.getByToken(cscalct_token_, TheALCTs);
123 
124  //Calo rec hits
126  iEvent.getByToken(hbhereco_token_, hbhehits);
127  Handle<EcalRecHitCollection> ecalebhits;
128  iEvent.getByToken(EcalRecHitsEB_token_, ecalebhits);
129  Handle<EcalRecHitCollection> ecaleehits;
130  iEvent.getByToken(EcalRecHitsEE_token_, ecaleehits);
131 
132  //Get HLT Results
133  edm::Handle<edm::TriggerResults> TheHLTResults;
134  // iEvent.getByLabel( IT_HLTResult , TheHLTResults);
135  iEvent.getByToken(hltresult_token_, TheHLTResults);
136 
137  const edm::TriggerNames* triggerNames = nullptr;
138  if (TheHLTResults.isValid()) {
139  triggerNames = &iEvent.triggerNames(*TheHLTResults);
140  }
141 
142  // Put it in the event
143  iEvent.put(std::make_unique<CSCHaloData>(CSCAlgo.Calculate(*TheCSCGeometry,
144  TheCosmics,
145  TheCSCTimeMap,
146  TheMuons,
147  TheCSCSegments,
148  TheCSCRecHits,
149  TheL1GMTReadout,
150  hbhehits,
151  ecalebhits,
152  ecaleehits,
153  TheHLTResults,
154  triggerNames,
155  TheALCTs,
156  TheMatcher,
157  iEvent,
158  iSetup)));
159  return;
160 }
161 
void SetMaxSegmentTheta(float x)
Definition: CSCHaloAlgo.h:140
MuonSegmentMatcher * TheMatcher
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void SetMatchingDEtaThreshold(float x)
Definition: CSCHaloAlgo.h:132
void SetMaxDtMuonSegment(float x)
Definition: CSCHaloAlgo.h:134
reco::CSCHaloData Calculate(const CSCGeometry &TheCSCGeometry, edm::Handle< reco::MuonCollection > &TheCosmicMuons, const edm::Handle< reco::MuonTimeExtraMap > TheCSCTimeMap, edm::Handle< reco::MuonCollection > &TheMuons, edm::Handle< CSCSegmentCollection > &TheCSCSegments, edm::Handle< CSCRecHit2DCollection > &TheCSCRecHits, edm::Handle< L1MuGMTReadoutCollection > &TheL1GMTReadout, edm::Handle< HBHERecHitCollection > &hbhehits, edm::Handle< EcalRecHitCollection > &ecalebhits, edm::Handle< EcalRecHitCollection > &ecaleehits, edm::Handle< edm::TriggerResults > &TheHLTResults, const edm::TriggerNames *triggerNames, const edm::Handle< CSCALCTDigiCollection > &TheALCTs, MuonSegmentMatcher *TheMatcher, const edm::Event &TheEvent, const edm::EventSetup &TheEventSetup)
Definition: CSCHaloAlgo.cc:63
void SetRecHitTimeWindow(float x)
Definition: CSCHaloAlgo.h:125
std::string const & label() const
Definition: InputTag.h:36
void SetMatchingDWireThreshold(int x)
Definition: CSCHaloAlgo.h:133
void SetMaxSegmentRDiff(float x)
Definition: CSCHaloAlgo.h:138
void SetMinMaxOuterRadius(float min, float max)
Definition: CSCHaloAlgo.h:118
edm::EDGetTokenT< reco::MuonTimeExtraMap > csctimemap_token_
void SetDetaThreshold(float x)
Definition: CSCHaloAlgo.h:113
edm::EDGetTokenT< CSCALCTDigiCollection > cscalct_token_
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitsEE_token_
std::vector< edm::InputTag > vIT_HLTBit
Definition: CSCHaloAlgo.h:111
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< CSCRecHit2DCollection > cscrechit_token_
edm::EDGetTokenT< CSCSegmentCollection > cscsegment_token_
edm::EDGetTokenT< HBHERecHitCollection > hbhereco_token_
void SetExpectedBX(int x)
Definition: CSCHaloAlgo.h:126
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeometry_token
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
void SetMaxSegmentPhiDiff(float x)
Definition: CSCHaloAlgo.h:139
edm::EDGetTokenT< L1MuGMTReadoutCollection > l1mugmtro_token_
void SetMinMaxInnerRadius(float min, float max)
Definition: CSCHaloAlgo.h:114
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitsEB_token_
void SetRecHitTime0(float x)
Definition: CSCHaloAlgo.h:124
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::MuonCollection > cosmicmuon_token_
edm::EDGetTokenT< edm::TriggerResults > hltresult_token_
bool isValid() const
Definition: HandleBase.h:70
fixed size matrix
HLT enums.
void SetMaxFreeInverseBeta(float x)
Definition: CSCHaloAlgo.h:135
void SetMatchingDPhiThreshold(float x)
Definition: CSCHaloAlgo.h:131
void SetMinMaxOuterMomentumTheta(float min, float max)
Definition: CSCHaloAlgo.h:127
edm::EDGetTokenT< reco::MuonCollection > muon_token_
void SetNormChi2Threshold(float x)
Definition: CSCHaloAlgo.h:123
void SetDphiThreshold(float x)
Definition: CSCHaloAlgo.h:122