21 L_EcalPhiWedgeEnergy = (
float)iConfig.
getParameter<
double>(
"l_EcalPhiWedgeEnergy");
22 L_EcalPhiWedgeConstituents = iConfig.
getParameter<
int>(
"l_EcalPhiWedgeConstituents");
24 L_EcalPhiWedgeConfidence = (
float)iConfig.
getParameter<
double>(
"l_EcalPhiWedgeConfidence");
25 L_EcalShowerShapesRoundness = (
float)iConfig.
getParameter<
double>(
"l_EcalShowerShapesRoundness");
26 L_EcalShowerShapesAngle = (
float)iConfig.
getParameter<
double>(
"l_EcalShowerShapesAngle");
27 L_EcalSuperClusterSize = (
int)iConfig.
getParameter<
int>(
"l_EcalSuperClusterSize");
28 L_EcalSuperClusterEnergy = (
float)iConfig.
getParameter<
double>(
"l_EcalSuperClusterEnergy");
30 T_EcalPhiWedgeEnergy = (
float)iConfig.
getParameter<
double>(
"t_EcalPhiWedgeEnergy");
31 T_EcalPhiWedgeConstituents = iConfig.
getParameter<
int>(
"t_EcalPhiWedgeConstituents");
33 T_EcalPhiWedgeConfidence = (
float)iConfig.
getParameter<
double>(
"t_EcalPhiWedgeConfidence");
34 T_EcalShowerShapesRoundness = (
float)iConfig.
getParameter<
double>(
"t_EcalShowerShapesRoundness");
35 T_EcalShowerShapesAngle = (
float)iConfig.
getParameter<
double>(
"t_EcalShowerShapesAngle");
36 T_EcalSuperClusterSize = (
int)iConfig.
getParameter<
int>(
"t_EcalSuperClusterSize");
37 T_EcalSuperClusterEnergy = (
float)iConfig.
getParameter<
double>(
"t_EcalSuperClusterEnergy");
39 L_HcalPhiWedgeEnergy = (
float)iConfig.
getParameter<
double>(
"l_HcalPhiWedgeEnergy");
40 L_HcalPhiWedgeConstituents = iConfig.
getParameter<
int>(
"l_HcalPhiWedgeConstituents");
42 L_HcalPhiWedgeConfidence = (
float)iConfig.
getParameter<
double>(
"l_HcalPhiWedgeConfidence");
44 T_HcalPhiWedgeEnergy = (
float)iConfig.
getParameter<
double>(
"t_HcalPhiWedgeEnergy");
45 T_HcalPhiWedgeConstituents = iConfig.
getParameter<
int>(
"t_HcalPhiWedgeConstituents");
47 T_HcalPhiWedgeConfidence = (
float)iConfig.
getParameter<
double>(
"t_HcalPhiWedgeConfidence");
51 cschalodata_token_ = consumes<CSCHaloData>(IT_CSCHaloData);
52 ecalhalodata_token_ = consumes<EcalHaloData>(IT_EcalHaloData);
53 hcalhalodata_token_ = consumes<HcalHaloData>(IT_HcalHaloData);
54 globalhalodata_token_ = consumes<GlobalHaloData>(IT_GlobalHaloData);
56 produces<BeamHaloSummary>();
61 auto TheBeamHaloSummary = std::make_unique<BeamHaloSummary>();
66 iEvent.getByToken(cschalodata_token_, TheCSCHaloData);
71 if (
CSCData.NumberOfHaloTriggers() ||
CSCData.NumberOfHaloTracks() ||
72 (
CSCData.NOutOfTimeHits() > 10 &&
CSCData.NFlatHaloSegments() > 2) ||
CSCData.GetSegmentsInBothEndcaps() ||
74 TheBeamHaloSummary->GetCSCHaloReport()[0] = 1;
77 if ((
CSCData.NumberOfHaloTriggers() &&
CSCData.NumberOfHaloTracks()) ||
78 (
CSCData.NOutOfTimeHits() > 10 &&
CSCData.NumberOfHaloTriggers()) ||
79 (
CSCData.NOutOfTimeHits() > 10 &&
CSCData.NumberOfHaloTracks()) ||
CSCData.GetSegmentsInBothEndcaps() ||
81 (
CSCData.NFlatHaloSegments() > 3 && (
CSCData.NumberOfHaloTriggers() ||
CSCData.NumberOfHaloTracks())))
82 TheBeamHaloSummary->GetCSCHaloReport()[1] = 1;
85 if (
CSCData.NumberOfHaloTriggers() ||
CSCData.NumberOfHaloTracks() ||
CSCData.NumberOfOutOfTimeTriggers())
86 TheBeamHaloSummary->GetCSCHaloReport()[2] = 1;
89 if ((
CSCData.NumberOfHaloTriggers() &&
CSCData.NumberOfHaloTracks()) ||
90 (
CSCData.NumberOfHaloTriggers() &&
CSCData.NumberOfOutOfTimeTriggers()) ||
91 (
CSCData.NumberOfHaloTracks() &&
CSCData.NumberOfOutOfTimeTriggers()))
92 TheBeamHaloSummary->GetCSCHaloReport()[3] = 1;
95 if ((
CSCData.NumberOfHaloTriggers_TrkMuUnVeto() &&
CSCData.NumberOfHaloTracks()) ||
96 (
CSCData.NOutOfTimeHits() > 10 &&
CSCData.NumberOfHaloTriggers_TrkMuUnVeto()) ||
98 CSCData.GetSegmentsInBothEndcaps_Loose_TrkMuUnVeto() ||
100 (
CSCData.NFlatHaloSegments() > 3 && (
CSCData.NumberOfHaloTriggers_TrkMuUnVeto() ||
CSCData.NumberOfHaloTracks())))
101 TheBeamHaloSummary->GetCSCHaloReport()[4] = 1;
104 if ((
CSCData.NumberOfHaloTriggers_TrkMuUnVeto() &&
CSCData.NFlatHaloSegments_TrkMuUnVeto()) ||
105 CSCData.GetSegmentsInBothEndcaps_Loose_dTcut_TrkMuUnVeto() ||
CSCData.GetSegmentIsCaloMatched())
106 TheBeamHaloSummary->GetCSCHaloReport()[5] = 1;
111 iEvent.getByToken(ecalhalodata_token_, TheEcalHaloData);
115 bool EcalLooseId =
false, EcalTightId =
false;
157 float angle = vm_Angle[cluster];
158 float roundness = vm_Roundness[cluster];
161 if ((
angle > 0. &&
angle < L_EcalShowerShapesAngle) &&
162 (roundness > 0. && roundness < L_EcalShowerShapesRoundness)) {
163 if (cluster->energy() > L_EcalSuperClusterEnergy && cluster->size() > (
unsigned int)L_EcalSuperClusterSize)
168 if ((
angle > 0. &&
angle < T_EcalShowerShapesAngle) &&
169 (roundness > 0. && roundness < T_EcalShowerShapesRoundness)) {
170 if (cluster->energy() > T_EcalSuperClusterEnergy && cluster->size() > (
unsigned int)T_EcalSuperClusterSize)
176 TheBeamHaloSummary->GetEcalHaloReport()[0] = 1;
178 TheBeamHaloSummary->GetEcalHaloReport()[1] = 1;
183 iEvent.getByToken(hcalhalodata_token_, TheHcalHaloData);
186 const std::vector<PhiWedge>& HcalWedges = HcalData.
GetPhiWedges();
187 bool HcalLooseId =
false, HcalTightId =
false;
188 for (std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin(); iWedge != HcalWedges.end(); iWedge++) {
189 bool HcaliPhi =
false;
191 if (iWedge->Energy() > L_HcalPhiWedgeEnergy && iWedge->NumberOfConstituents() > L_HcalPhiWedgeConstituents &&
192 std::abs(iWedge->ZDirectionConfidence()) > L_HcalPhiWedgeConfidence) {
198 if (iWedge->Energy() > T_HcalPhiWedgeEnergy && iWedge->NumberOfConstituents() > T_HcalPhiWedgeConstituents &&
199 std::abs(iWedge->ZDirectionConfidence()) > T_HcalPhiWedgeConfidence) {
204 for (
unsigned int i = 0;
i < TheBeamHaloSummary->GetHcaliPhiSuspects().size();
i++) {
205 if (iWedge->iPhi() == TheBeamHaloSummary->GetHcaliPhiSuspects()[
i]) {
211 TheBeamHaloSummary->GetHcaliPhiSuspects().push_back(iWedge->iPhi());
215 TheBeamHaloSummary->GetHcalHaloReport()[0] = 1;
217 TheBeamHaloSummary->GetHcalHaloReport()[1] = 1;
224 TheBeamHaloSummary->getProblematicStrips().push_back(problematicStrip);
230 iEvent.getByToken(globalhalodata_token_, TheGlobalHaloData);
232 bool GlobalLooseId =
false;
233 bool GlobalTightId =
false;
239 if (!MatchedEcalWedges.empty() || !MatchedHcalWedges.empty())
240 GlobalLooseId =
true;
243 for (std::vector<PhiWedge>::const_iterator iWedge = MatchedEcalWedges.begin(); iWedge != MatchedEcalWedges.end();
245 if (iWedge->NumberOfConstituents() > T_EcalPhiWedgeConstituents)
246 GlobalTightId =
true;
247 if (
std::abs(iWedge->ZDirectionConfidence()) > T_EcalPhiWedgeConfidence)
248 GlobalTightId =
true;
251 for (std::vector<PhiWedge>::const_iterator iWedge = MatchedHcalWedges.begin(); iWedge != MatchedHcalWedges.end();
253 if (iWedge->NumberOfConstituents() > T_HcalPhiWedgeConstituents)
254 GlobalTightId =
true;
255 if (
std::abs(iWedge->ZDirectionConfidence()) > T_HcalPhiWedgeConfidence)
256 GlobalTightId =
true;
260 TheBeamHaloSummary->GetGlobalHaloReport()[0] = 1;
262 TheBeamHaloSummary->GetGlobalHaloReport()[1] = 1;
269 TheBeamHaloSummary->GetGlobalHaloReport()[2] = 1;
276 TheBeamHaloSummary->GetGlobalHaloReport()[3] = 1;
282 BeamHaloSummaryProducer::~BeamHaloSummaryProducer() {}